Skip to content

Fix inline vector storage lifetime during subgraph updates - #86

Merged
jcmosc merged 1 commit into
jcmosc:mainfrom
OpenSwiftUIProject:fix/inline-vector-lifetime-upstream
Oct 21, 2026
Merged

jcmosc merged 1 commit into
jcmosc:mainfrom
OpenSwiftUIProject:fix/inline-vector-lifetime-upstream

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Repeated subgraph updates can release child subgraphs too early when the traversal stack grows beyond its 32 inline entries. After the vector moves entries to heap storage, automatic destruction of the inline array releases the stale pointer copies again.

Use union-backed inline storage so the vector alone controls element construction and destruction. Add a regression test that keeps 64 child subgraphs alive across three invalidation and update cycles and checks their values.

The regression test was verified to crash without the fix and pass with it before this change was cherry-picked onto upstream main. Tests were not rerun after the cherry-pick.

Fixes OpenSwiftUIProject/OpenSwiftUI-Samples#2.

@jcmosc
jcmosc merged commit 487f0e5 into jcmosc:main Oct 21, 2026
2 checks passed
@Kyle-Ye
Kyle-Ye deleted the fix/inline-vector-lifetime-upstream branch October 21, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compute backend crashes during repeated dynamic view updates

2 participants