Skip to content

Fix async renderer inherited view update crash#904

Merged
Kyle-Ye merged 2 commits into
mainfrom
bugfix/render_crash
Jun 10, 2026
Merged

Fix async renderer inherited view update crash#904
Kyle-Ye merged 2 commits into
mainfrom
bugfix/render_crash

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Jun 10, 2026

Copy link
Copy Markdown
Member

Agent Summary

This PR fixes an async renderer crash when inherited view updates are processed during transition rendering, and adds a focused Example view for manual verification.

Changes included:

  • Capture the display list platform before entering the async view-cache update callback so the callback does not read through the mutating cache state.
  • Rename the async rendering example file and add a transition-focused example that documents the affected rendering path.
  • Implement the AppKit NSHostingView._renderAsyncForTest(interval:) path so macOS test hosts can drive async rendering consistently.

Validation:

  • Not run locally; OpenSwiftUI build/test commands are intentionally skipped unless requested because they are slow.

@github-actions github-actions Bot added area: example Example apps, previews, sample projects, screenshots, or demo assets. area: hosting-bridge SwiftUI bridge, UIHosting/NSHosting, representables, and platform host views. area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. impact: crash Crash, assertion, or fatal runtime failure. platform: macOS macOS-specific behavior or support. type: bug Something is not working correctly. labels Jun 10, 2026
@Kyle-Ye Kyle-Ye marked this pull request as ready for review June 10, 2026 14:48
@Kyle-Ye Kyle-Ye requested a review from Mx-Iris as a code owner June 10, 2026 14:48
@Kyle-Ye Kyle-Ye merged commit f37859d into main Jun 10, 2026
7 checks passed
@Kyle-Ye Kyle-Ye deleted the bugfix/render_crash branch June 10, 2026 14:48
@augmentcode

augmentcode Bot commented Jun 10, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Fixes a crash in the async renderer when inherited-view updates occur during transition rendering, and adds manual examples/tests to exercise that path.

Changes:

  • Captures the display-list platform before entering the async inherited-layer update callback to avoid reading through mutating cache state.
  • Replaces/renames the async rendering example and adds a transition-focused example that reproduces the previously crashing rendering path.
  • Implements NSHostingView._renderAsyncForTest(interval:) on AppKit so macOS test hosts can drive async rendering deterministically.

Technical Notes: The core fix is a closure-capture change that avoids Swift exclusivity violations during inherited layer updates.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

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

} else {
result = false
}
} while !propertiesNeedingUpdate.isEmpty

@augmentcode augmentcode Bot Jun 10, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

repeat { ... } while !propertiesNeedingUpdate.isEmpty can potentially spin forever if renderAsync(targetTimestamp:) returns nil while propertiesNeedingUpdate stays non-empty (e.g., a stuck update flag), which would hang tests. Consider ensuring the loop has an exit condition when didRender is false (and that canAdvanceTimeAutomatically is always restored).

Severity: medium

Fix This in Augment

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

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.28%. Comparing base (cf9a0d4) to head (725453e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ntegration/Hosting/AppKit/View/NSHostingView.swift 0.00% 16 Missing ⚠️
...re/Render/DisplayList/DisplayListViewUpdater.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #904   +/-   ##
=======================================
  Coverage   26.28%   26.28%           
=======================================
  Files         710      710           
  Lines       49705    49719   +14     
=======================================
+ Hits        13063    13070    +7     
- Misses      36642    36649    +7     

☔ View full report in Codecov by Harness.
📢 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

area: example Example apps, previews, sample projects, screenshots, or demo assets. area: hosting-bridge SwiftUI bridge, UIHosting/NSHosting, representables, and platform host views. area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. impact: crash Crash, assertion, or fatal runtime failure. platform: macOS macOS-specific behavior or support. type: bug Something is not working correctly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant