Skip to content

Assign every TCO loop slot from its tail-call argument - #11444

Merged
briansrls merged 17 commits into
mainfrom
session/tco-identity-passthrough
Sep 16, 2026
Merged

briansrls merged 17 commits into
mainfrom
session/tco-identity-passthrough

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Emitter fix lives here, not on PREPARED-CHOICE-0: prepared choice plan, whole cutover #11422. Identity-passthrough is deleted; every tail-call slot is assigned from the evaluated argument vector. Rust loop parameters are __tco_loop_<p>, authored names are rebound each iteration (tco_loop_iteration_lets).
  • Enrolled wall (rung 1): the required build lane compiles the regenerated seed and runs it over the corpus; a hang from this class is a timeout. Floor cannot import v1.compiler.emit (source roots are dag + src/v2 only). Next-rung trigger is a CI lane that executes v1.compiler witnesses — a declared gap, not a floor row.
  • Local diligence (not merge-path): v1.tests.claim.tco_tail_call_assigns_every_loop_slot_witness under src/v1/tests/claim; Rust #[test] tco_tail_call_assigns_every_loop_slot / parse_multiline_two_param_fn_and_two_arg_call_yields_expected_module (rust_unit_tests_off_the_merge_path).
  • RFM tco_identity_passthrough_elision_after_slot_local_split states that standing. Discriminator: identity-elision mutant in the v1 claim file.
  • Stage0 mirror v1_compiler_compiler_tests_rust.rs installed from --required-regen.

Test plan

  • parse_multiline_two_param_fn_and_two_arg_call_yields_expected_module (local cargo test)
  • tco_tail_call_assigns_every_loop_slot (local cargo test)
  • CI required lanes green (parent will check before merge ask)

Land this first. Then #11401. Then merge main into #11422 (parser cutover only), srv1 A/B on that final head, CI green, then ask to merge. Lookahead stays deleted (§3c).

After the slot/local split, a same-named tail-call arg is not a no-op: skip it and the seed parser hangs on a two-arg call. Assign every TCO slot from its argument; enroll parse_two_arg_call_terminates and the RFM row.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Sep 15, 2026
…tells

Operator ruling 2026-09-15: black-boxing a -> d and optimizing a measured
axis is locally sound and globally inefficient (moves cost, suppresses the
deletion signal, sets scope by target); the qualitative stance is the
obligatory one toward a process one owns. Receipts: R1 (#11401), B1 vs the
prepared choice plan (#11422), the TCO loop (#11444).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gunbc-ci-auto-heal and others added 4 commits September 15, 2026 17:12
Emitter-grain tco_tail_call_assigns_every_loop_slot checks every slot is written from a fully evaluated temp (Rust/Python/Go share shared_tco_reassign) and reds under the identity-elision mutant. The seed parse control now covers multiline parse_param_list_acc and parse_arg_list_acc and asserts the expected AST.

Co-authored-by: Cursor <cursoragent@cursor.com>
…iteration.

The fixture walk() emit now has slot-assignment count == param count with each __tco_loop_acc / __tco_loop_n dest once before continue. parse_arg_list_acc and parse_param_list_acc get the same slot writes, which is the 8a1aad substance on a PR off main.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Rust #[test] is off the merge path; compile_dag_rust_emit_check
and the identity-elision mutant now run as claim witnesses.

Co-authored-by: Cursor <cursoragent@cursor.com>
The distinguishing-facts receipt named a class that does not exist;
the parse-test concat rows had drifted from the committed projection.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

review 66621:

  1. Dead citation: tco_rewrite_assigns_into_a_shadowing_pattern_binding does not exist. Distinguishing-facts now names tco_rewrite_binds_named_arguments_positionally (writes every slot, binds by position vs this class writing no slot).

  2. Stray concat indent in compiler_tests_rust.dag ct_parse_tests reverted to the projection grain (" \"valid module...\"" and the following rows at four-space concat indent).

  3. parse_two_arg_call_terminates as enrolled discriminator was already retired: CONTROLS names test.claim.tco_tail_call_assigns_every_loop_slot_witness on the floor; the Rust parse/TCO tests are local diligence (rust_unit_tests_off_the_merge_path).

The .dag generator already emitted that slice; the installed
compiler_tests.rs dropped it and would fail E0425 on regen.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

review 66654:

  1. Generator vs installed compiler_tests.rs: on current HEAD the .dag already bound rest; the installed compiler_tests.rs did not (E0425 on regen). Restored let rest = &emitted.content[walk_at..]; to match compiler_tests_rust.dag / v1_compiler_compiler_tests_rust.rs. Floor control remains test.claim.tco_tail_call_assigns_every_loop_slot_witness; the Rust test is local diligence.

  2. tco_loop_slot_name dangling: not true after 7ab0e43dc0c. Production callers: tco_loop_iteration_lets, emit_tco_param, emit_typed_tco_reassign. emit_typed_tco_reassign_shared still dests authored names because Python/Go TCO params are not slot-renamed; putting __tco_loop_* dests there without those decls would be a third fork.

gunbc-ci-auto-heal and others added 7 commits September 15, 2026 18:12
The RED is a floor witness that calls shared_tco_reassign with the
identity dest omitted; cargo-test remains local diligence only.

Co-authored-by: Cursor <cursoragent@cursor.com>
Production 05_emit has only the real reassign path; the RED copies
the filter over the same args/slots the production fold sees.

Co-authored-by: Cursor <cursoragent@cursor.com>
…trings were dropped.

v1_rt::concat is binary; removing identity-elision pieces left five extra opens, so every CI lane failed compiling v1-stage0-v1-infer.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ed concat.

required-ci generated-artifact refused v1_compiler_compiler_tests_rust.rs: the binary concat nest written to close the mutant drop was not the emitter's bytes.

Co-authored-by: Cursor <cursoragent@cursor.com>
The floor's roots are dag + src/v2, so a dag/test/claim import of v1.compiler.emit is unresolved. Local diligence lives under src/v1/tests/claim; the enrolled wall is the build-lane timeout.

Co-authored-by: Cursor <cursoragent@cursor.com>
v2 self-compile of src/v1 does not close v2.std.logic; the leftover floor import refused generated-artifact as a hard diagnostic.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ion mutant.

concat! does not unescape {{, so the walk/add sources never compiled. The mutant omitted dests by construction and could not red production.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

review 66722:

  1. Verified. concat! fixtures in compiler_tests_rust.dag now use single braces (same walk text as the v1 claim file). compiler_tests.rs and the seed concat match. Local: compiler_tests::compiler_tests::tco_tail_call_assigns_every_loop_slot and parse_multiline_two_param_fn_and_two_arg_call_yields_expected_module both pass.

  2. Verified. Deleted tco_identity_elision_mutant_drops_same_named_slot (green by construction). RFM no longer cites it as a discriminator. Also dropped compile_dag_rust_emit_check from the v1 claim file — the seed has no v1_rt realization of that builtin.

— sent from zesty-koi-299

gunbc-ci-auto-heal and others added 2 commits September 16, 2026 02:02
Retrigger CI after #11455 scoped floor pure-producer share so this head is no longer judged on the stale main refusal.
…ration.

Slots are rewritten before continue, so a move is sound and drops the String-accumulator copy. Python/Go iteration-let arms stay empty: only Rust has __tco_loop_* dests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

review 66772:

  1. Verified. Per-iteration rebind is now a move (let mut acc = __tco_loop_acc;), not .clone(). Slots are still fully assigned before continue, so the hang class is unchanged and the String-accumulator copy is gone. Regenerated seed (e.g. parse_dotted_ident_rest) matches.

  2. Verified. Python/Go arms of tco_loop_iteration_lets no longer emit p = __tco_loop_p. Only the Rust arm produces lets; those targets keep authored slot names on the shared reassign path.

— sent from zesty-koi-299

gunbc-ci-auto-heal and others added 2 commits September 16, 2026 03:27
…d arms.

The helper is only called from the Rust TCO body emitter; keeping a target match left unreachable Python and Go production.

Co-authored-by: Cursor <cursoragent@cursor.com>
Regenerated v1_compiler_parse.rs so the seed carries both TCO slot writes and main's parser changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Sep 16, 2026
Regenerated the concurrent-divergent seed parser and sibling mirrors from the merged authorities. TCO identity-passthrough stays on #11444.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Sep 16, 2026
CI was timeout-cancel with no floor verdict: identity-passthrough skipped slot assigns after the local/slot split. The always-write emitter from #11444 is now on this branch so required lanes can finish.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls added this pull request to the merge queue Sep 16, 2026
Merged via the queue into main with commit cd5b14e Sep 16, 2026
4 checks passed
@briansrls
briansrls deleted the session/tco-identity-passthrough branch September 16, 2026 12:06
gunbai-bot Bot pushed a commit that referenced this pull request Sep 17, 2026
…d kept #11219's stale mirror, which references a helper #11444 removed)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RtujL6ZdnmmcCBMihVRZ8z
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