Skip to content

Conversation

@Kyle-Ye
Copy link
Collaborator

@Kyle-Ye Kyle-Ye commented Feb 8, 2026

Close #775

@github-actions github-actions bot added bug Something isn't working RenderEffect test Test related issue labels Feb 8, 2026
@Kyle-Ye Kyle-Ye merged commit cf0191b into main Feb 8, 2026
6 of 8 checks passed
@Kyle-Ye Kyle-Ye deleted the k-branch-1 branch February 8, 2026 10:23
@augmentcode
Copy link

augmentcode bot commented Feb 8, 2026

🤖 Augment PR Summary

Summary: Fixes a Shape + fill color mismatch (closes #755) by aligning runtime type-casting behavior used during rendering.

Changes:

  • Add `SharedExample/interpose.c` to Mach-O interpose `kdebug_is_enabled` and `swift_dynamicCast` (retrying casts involving `Color.Resolved`).
  • Remove the older `kdebug_interpose.c` and update the Example Xcode project’s synchronized build exceptions to reference the new interposer.
  • Update `ShapeUITests` snapshots to use default `perceptualPrecision` now that rendering matches expected output.
  • Minor generic-constraint formatting tweak in `Paint.swift`.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

CFRange range = CFStringFind(target_description, CFSTR("Color.Resolved"), 0);
if (range.location != kCFNotFound) {
// First try the original cast, if it fails try with OpenSwiftUI's Color.Resolved
return swift_dynamicCast(dest, src, srcType, targetType, flags) ||
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because swift_dynamicCast is being interposed, calling swift_dynamicCast(...) from inside my_swift_dynamicCast may resolve back to the interposer and recurse. Can you confirm this call path reliably reaches the original Swift runtime implementation in all build/linking modes?

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

// Interpose kdebug_is_enabled to always return true to perform Signpost testing with Instruments
{ (const void *)my_kdebug_is_enabled, (const void *)kdebug_is_enabled },
// Interpose swift_dynamicCast to handle casts to SwiftUI's internal Color.Resolved type to fix SwiftUI.ShapeLayerHelper visit check for Shape.fill API
{ (const void *)my_swift_dynamicCast, (const void *)swift_dynamicCast },
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interposing swift_dynamicCast affects every dynamic cast in the process, so any unexpected behavior here can have a wide blast radius beyond Shape.fill. Please double-check this file is only linked into the intended debug/test host (and not shipped in normal Example/production builds).

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

membershipExceptions = (
interpose.c,
);
target = 275751E22DEE1441003E467C /* TestingHost */;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exception set marks interpose.c as a membershipException for the TestingHost target, even though OpenSwiftUIUITests uses TestingHost.app as TEST_HOST. Please verify the interposer is actually present in the host process where the shape rendering/casts occur.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@cb84f0a). Learn more about missing BASE report.
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #777   +/-   ##
=======================================
  Coverage        ?   26.22%           
=======================================
  Files           ?      649           
  Lines           ?    40204           
  Branches        ?        0           
=======================================
  Hits            ?    10542           
  Misses          ?    29662           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working RenderEffect test Test related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color mismatch for Shape.fill effect

1 participant