Skip to content

runtime: materialize channel resumes before P transfer - #51

Merged
cpunion merged 2 commits into
llvm-corofrom
coro/typed-resume-materialization
Jul 26, 2026
Merged

runtime: materialize channel resumes before P transfer#51
cpunion merged 2 commits into
llvm-corofrom
coro/typed-resume-materialization

Conversation

@cpunion

@cpunion cpunion commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a fixed-enum, frame-local ResumeCleanupPlan to the unified bounded runner
  • retire direct-channel and multi-case select hchan waiters, exact source generations, claim and result lease before runnable publication
  • resume from a compact P-neutral packet, including transfer to another P and prompt task cancellation after migration
  • keep the plan POD-only: no callback, interface, Future/task object, function-address lookup, or permanent G field
  • generalize the packet small-result union for poll and channel status while preserving its 52-byte align-4 cross-target layout

The runtime switch handles one logical select case per ExecutorRunStepMaterialize; common core confirmation and recycle are also one exact generation per reduction. The existing hchan buffer/closed-queue reconcile helpers can still process multiple peer waiters internally; splitting those loops into an explicit subcursor is the next strict-cost PR and is documented rather than overclaimed here.

Validation

  • runtime core: race + shuffle
  • production typed hchan adapter: native race + shuffle
  • production typed hchan adapter: actual JS/WASM execution
  • compiler coroutine analysis: race + shuffle
  • isolated program driver and native fleet tests
  • focused coroutine channel lowering tests

Based on the post-#50 llvm-coro baseline, which includes current xgo-dev/main.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cpunion
cpunion force-pushed the coro/typed-resume-materialization branch from 1a36347 to 0746f5b Compare July 26, 2026 05:59
@cpunion
cpunion merged commit 264ffe8 into llvm-coro Jul 26, 2026
15 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