Skip to content

coro: retain evaluated receiver inputs through resource delivery - #295

Merged
cpunion merged 4 commits into
llvm-corofrom
coro/resource-result-state-20261018
Oct 17, 2026
Merged

cpunion merged 4 commits into
llvm-corofrom
coro/resource-result-state-20261018

Conversation

@cpunion

@cpunion cpunion commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Pointer-to-value method wrappers evaluate a receiver before resource acquisition. Their cleanup must retain those evaluated inputs when the original pointee changes while a child is pending.

The compiler retains the terminal cleanup arguments in an immutable typed allocation owned by the protected result storage. Exact forwarding chains share the binding. Caller acceptance clears it; cancellation retains it through the existing cleanup drainer's helper completion. Public result tuples, funcval, G/P and scheduler operations keep their ABI.

Library schema v22, guard ABI v5 and delivery tail v3 bind the state requirement. The real retained v21 archive is accepted by its old reader and rejected by the new reader. Reflection/FFI result handoff still rejects resource capability pending its separate implementation.

Validation on exact frozen head 6965ad3e4d5f022063683e86cd75ee2452689a6b:

  • Complete compiler/SSA coro cohort and complete internal/coro tests pass.
  • 2417/2417 native resource executions pass (2318 FD/delivery + 99 public Open). New cases mutate receivers after actual evaluation and cover nil panic, static/dynamic/interface/go/defer/promoted/noinline paths, large results, function fields with GC captures, and typed Method.Func calls.
  • 9 independent archive tests pass: 20 images, 60 executions. The opaque consumer has only exported declarations; producer-side pointer mutation occurs before cancellation.
  • Removing only snapshot state publication preserves acquisition and yields the expected unique-FD leak in 39/39 controls at P=1/2/4.
  • Full canonical source-after matches. Full test/go is running on an independent copy of this exact source/compiler; it is not yet accepted.

Exact-head CI run 39054986576 passes 19/19. The JS/WASM lane first stopped during Go dependency download with a TLS handshake timeout; the same-head job retry passes. Fresh paginated reviews, inline/issue comments and review threads are empty. Implementation-specific merge gates are satisfied; full compatibility remains a separate, incomplete campaign.

@cpunion
cpunion marked this pull request as ready for review October 17, 2026 18:30
@cpunion
cpunion merged commit 7bfe16c into llvm-coro Oct 17, 2026
37 of 38 checks passed
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.

1 participant