Repository navigation
MIR: a scope's cleanup calls yield their status into an i32 temp; validate-all accepts scope programs (#1411) - #1522
Merged
Conversation
This was referenced Sep 23, 2026
Contributor
Author
|
Stack #1528 battery (seed-driven, new seed, cold c_import cache, with :drop-audit/:move-audit) on main + #1522 → … → #1527 (head 33e6ba5; every PR head is a tested commit): build ok, :fixpoint ok, :drop-audit ok, :move-audit ok, :test ok (no reds), :test-green ok, :last-green ok. Merges cleanly into main. Merge the stack: |
ehartford
marked this pull request as ready for review
September 23, 2026 16:45
…idate-all accepts scope programs (#1411) validate-all stopped every thread- and async-scope program (20 corpus files) at "ownership terminator place has no concrete MIR type". The call was the scope's own cleanup: emit_drop_entry lowered DK_THREAD_SCOPE to THREAD_SCOPE_JOIN_ALL + THREAD_SCOPE_DESTROY and DK_ASYNC_SCOPE to SCOPE_AWAIT_ALL + SCOPE_DESTROY, each with `self.new_temp(0)` as the call's destination (MirLower.w:1142/1153/1168/1179 on ba2d5d1). --dump-mir of spec_ss14_9_scope_no_runtime.w shows it: `_8: <inferred>`, `call const ()(copy _2) -> [return: _8, next: bb4]`, and mir_validate_place_type returns 0 for it in validate_ownership_body. Codegen yields each of these four intrinsics as an i32 0 (CodegenDispatch, the with_thread_scope_* / with_scope_* arms), exactly like the task cancel/detach intrinsics, whose destinations the lowering already typed i32 (emit_task_cancel_call). The four scope calls now go through that one helper, renamed emit_handle_call; nothing else about the calls changes. Not #1305: the async-call-result typing is a separate defect; none of the 20 files reached it. Matrix (check --validate-all, base stage1 vs this stage1): every scope program listed in #1411 goes from the error to `validate-all: ok` — behav_async_scope{,_panic_cancels_siblings,_panic_propagates,d_task}, behav_scope_{block_forms,join_vec_join,spawn,spawn_mut_capture}, spec_ss14_{6_async_blocks,7_task_was_cancelled,8_scoped_task_tracking, 9_scope_no_runtime,16_scopedsend,22_task_ephemerality}, spec_ss14_async_await, examples/{async-auction,async-collection-await,channels/pipeline, ephemerality-and-lowering/*}; the seven spec_ss14 files that were already ok stay ok. Fixture: test/phase/validate_all_scope_cleanup_calls.w (a thread scope and an async scope under --validate-all). Sweep: `check --validate-all` over test/, examples/ and lib/std (3188 files), base stage2 (main f1e3bd2) vs this stack's stage2: the 20 files above, err_async_scope_no_runtime.w and the new fixture go from this error to ok. The two nebula files it masked (examples/nebula/src/{main,session}.w) now reach #1412's older finding, a generator resume that drops a str it never initialized — wrong code at run time, repro added there.
ehartford
force-pushed
the
fix-1411-scope-cleanup-types
branch
from
September 23, 2026 19:40
9089c9e to
66d9860
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
validate-all stopped every thread- and async-scope program (20 corpus files)
at "ownership terminator place has no concrete MIR type". The call was the
scope's own cleanup: emit_drop_entry lowered DK_THREAD_SCOPE to
THREAD_SCOPE_JOIN_ALL + THREAD_SCOPE_DESTROY and DK_ASYNC_SCOPE to
SCOPE_AWAIT_ALL + SCOPE_DESTROY, each with
self.new_temp(0)as the call'sdestination (MirLower.w:1142/1153/1168/1179 on ba2d5d1). --dump-mir of
spec_ss14_9_scope_no_runtime.w shows it:
_8: <inferred>,call const ()(copy _2) -> [return: _8, next: bb4], andmir_validate_place_type returns 0 for it in validate_ownership_body.
Codegen yields each of these four intrinsics as an i32 0 (CodegenDispatch,
the with_thread_scope_* / with_scope_* arms), exactly like the task
cancel/detach intrinsics, whose destinations the lowering already typed
i32 (emit_task_cancel_call). The four scope calls now go through that one
helper, renamed emit_handle_call; nothing else about the calls changes.
Not #1305: the async-call-result typing is a separate defect; none of the
20 files reached it.
Matrix (check --validate-all, base stage1 vs this stage1): every scope
program listed in #1411 goes from the error to
validate-all: ok—behav_async_scope{,panic_cancels_siblings,panic_propagates,d_task},
behav_scope{block_forms,join_vec_join,spawn,spawn_mut_capture},
spec_ss14{6_async_blocks,7_task_was_cancelled,8_scoped_task_tracking,
9_scope_no_runtime,16_scopedsend,22_task_ephemerality},
spec_ss14_async_await, examples/{async-auction,async-collection-await,channels/pipeline,
ephemerality-and-lowering/*}; the seven spec_ss14 files that were already ok
stay ok.
Fixture: test/phase/validate_all_scope_cleanup_calls.w (a thread scope and
an async scope under --validate-all).
Sweep:
check --validate-allover test/, examples/ and lib/std (3188files), base stage2 (main f1e3bd2) vs this stack's stage2: the 20 files
above, err_async_scope_no_runtime.w and the new fixture go from this error
to ok. The two nebula files it masked (examples/nebula/src/{main,session}.w)
now reach #1412's older finding, a generator resume that drops a str it
never initialized — wrong code at run time, repro added there.
Closes #1411
Stack #1528, bottom to top: #1522 (#1411) → #1523 (#1413) → #1524 (#1429) → #1525 (#1414) → #1526 (#1372) → #1527 (#1417). Each layer holds only its own commit.
Verification (iterate tier; no battery yet — draft until the seed-driven battery is green): stage1 and stage2 built from the stack top on darwin-aarch64 (SDKROOT CLT 15.4) and on native Windows 10 x64; fixtures below pass on both;
check --validate-allswept over test/, examples/, lib/std (3188 files) with base stage2 (main f1e3bd2) vs the stack's stage2.