Skip to content

Fix inline vector storage lifetime during subgraph updates - #2

Closed
Kyle-Ye wants to merge 1 commit into
mainfrom
fix/inline-vector-lifetime
Closed

Kyle-Ye wants to merge 1 commit into
mainfrom
fix/inline-vector-lifetime

Conversation

@Kyle-Ye

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

Copy link
Copy Markdown
Member

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 crashes without the fix and passes with it. The SubgraphUpdateTests suite also passes on this branch.

Fixes OpenSwiftUIProject/Game2048#2.

@Kyle-Ye Kyle-Ye closed this Oct 21, 2026
@Kyle-Ye
Kyle-Ye deleted the fix/inline-vector-lifetime 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

1 participant