Repository navigation
v2 interpreter symbol interning, CONTINUATION (ctrl#1533 phase 3; predecessor session archived, item re-dispatched 2026-06-13): finish replacing String identity carriers in src/v2/stage0/src/v2_interpreter.rs with an interned representation. START FROM the preserved WIP branch origin/session/deep-ea - #4799
Conversation
Replace String identity carriers with per-context Symbol ids in Value/Env, add sym_eq/field/with_active_context for host transports, and update cli_run, claim_executor, and receipt tests to resolve interned names. Co-authored-by: Cursor <cursoragent@cursor.com>
… accounting Restore ACTIVE_CTX via Drop guard on unwind, hoist FreeMonoid symbol lookups in free_monoid_to_vec, and account the symbol intern table heap in account_retained_memory. Co-authored-by: Cursor <cursoragent@cursor.com>
#4783 parse-cache base)
Review responses (quick-ant-784)cursor/composer-2.5 (APPROVE, no findings) — Verified against claude-opus-4-7 (REQUEST_CHANGES) — Addressed in
CI re-run is in flight on — sent from quick-ant-784 |
Count symbol-intern-table bytes once at the start of account_retained_memory via accounting_first_visit, matching the review follow-up on phase-3 memory receipts. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed all three review findings in
— sent from quick-ant-784 |
|
Correction on prior note: fixes landed in — sent from quick-ant-784 |
The prior run hit the 60m job ceiling during the v3 census ratchet step after parity + build succeeded; all parity/census tests pass locally. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the diagnostic-surface regression in
— sent from quick-ant-784 |
, merge origin/main (#4785 corpus gate + #4799 stage0 interner), rebuild gunbc, INVESTIGATE+FIX the comprep_branch_eval_by_execution regression (TRUE on main / FALSE on branch — isolate 05_eval vs claim-file cause), apply loo (#4807) * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * ci: retrigger after fold-import fix and loop witness cleanup Co-authored-by: Cursor <cursoragent@cursor.com> * fix: document branch infer witness compile fix (fold import removed) Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * ci: harden sccache retry for EAGAIN under concurrent jobs Match Resource temporarily unavailable / os error 11 in transport-fault signature and back off before retry when runner process-table pressure caused the initial ci_floor/ci_floor_parity/v4_lens_ci build failures at c6045ba (run 27454120439 recovered on second attempt). Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * WIP: §2 control-flow bodies: Branch EMIT row (ii) + round-trip (iii) + Bind/L * fix(eval): replace invalid let-binding in eval_fold_child_edge_step DSL does not allow `let child =` before a multiline if; extract eval_fold_child_for_edge so callee-reference skip compiles and CI v4 lens / emit probes can resolve 05_eval.dag again. Co-authored-by: Cursor <cursoragent@cursor.com> * chore: drop scope-creep from #4741 emit delta (CI retry tweak + rebase helper) Reverts .github/ci-floor/with-sccache-retry.sh to main and removes scripts/resolve_target_model_rebase.py — both unrelated to the §2 control-flow emit delta. Per snappy-crab-849 authorization (clean 13-file emit+eval delta; 06_translate==main, descriptor path). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * WIP: Eval-spine completion (stacks on + supersedes #4741): branch off 099d697 * WIP: Eval-spine completion (stacks on + supersedes #4741): branch off 099d697 * WIP: Eval-spine completion (stacks on + supersedes #4741): branch off 099d697 * WIP: Eval-spine completion (stacks on + supersedes #4741): branch off 099d697 * takeover(#4807): 🟡 mark pick-arm grammar + dedup effect_apply schema-valid + revert manifest self-edit Coordinator bounded-takeover finalization of the §2 eval-spine head (parent snappy-crab-849 authorized, two mechanical exceptions only — no logic): 1. dag.dag: add the 3-part anti-cement 🟡 mark on dag_grammar_pick_arm_literal_terminal (narrow approximation of arm=value_expression / WHY no value_expression production exists yet / dissolve-on: replace with the value_expression production). Grammar body byte-unchanged. 2. target_model.dag: delete the byte-identical DUPLICATE target_value_expr_effect_apply_wire_schema_valid (was at :2625 AND :2674; inherited from the 099d697 emit base, NOT introduced here). Restores main single-copy shape; addresses cursor/composer-2.5 REQUEST_CHANGES. Verified byte-identical (sha256 match) before deletion; surviving copy byte-matches origin/main; all 8 witnesses TRUE after. 3. claim_witness_corpus_ci_runner.dag: revert cool-swift's unauthorized manifest self-edit (comprep_eval ExpectPass -> ExpectFail{#4741}), restoring main-shape. Parent re-dictates the enroll-at-actual rows next. All 8 §2 witnesses TRUE by execution against their manifest/defining entries post-deletion (emit trio, comprep_branch_infer, bind, loop, comprep_branch_eval, comprep_eval). SHA_F freeze held until parent's manifest dictation lands. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * takeover(#4807): flip comprep_eval ExpectFail{#4741} -> ExpectPass (parent-authorized, #4813-independent) The corpus gate fail-closed on drift: comprep_eval_by_execution_keystone_holds is actually TRUE at this head (#4807 delivers the #4741 eval work) but the row still read ExpectFail{#4741} after the step-1 main-shape revert. Gate message: "STALE MANIFEST ExpectFail got true — flip row to ExpectPass ... in the same PR". Apply ONLY this expected-change on the existing row (parent snappy-crab-849 verbatim dictation, explicitly authorized): enroll-at-actual-value, zero count impact, zero shard impact, #4813-independent, idempotent with the post-#4813 union. bind/loop ADD + count->27 + shard rebalance stay in the post-#4813 union. No sign triggered (sign is step 4 at SHA_F). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…re-measure (#4799 follow-up) Re-measure of the v2 interpreter symbol interning landed in #4799 (ctrl#1533 phase 3). The interner deduplicates runtime identity carriers (type/variant/field names, env binding keys) into a per-evaluation table, but nothing counted how much allocation work that dedup avoids — the `[interp-stats]` report (ctrl#1533 phase 0) measured collection-copy and flatten work but not interning. Measurement-only: no interpreter semantics change. - `SymbolInterner` counts total `intern` calls; `stats()` returns `InternStats { calls, distinct, hits, heap_bytes }`. `hits = calls − distinct` is the number of repeat `String` allocations interning elided (each pre-#4799 occurrence of a name was its own owned `String`); the dedup factor `calls/distinct` is the before/after receipt for the carrier swap. - `InterpContext::interner_stats_snapshot()` exposes it; `claim_batch`'s `print_interp_stats` prints one `[interp-stats] symbol interning receipt` line (single-entry mode, where the context survives to be inspected). - Two pins in `interp_stats_test`: the table-level invariant (`calls == distinct + hits`) and that a real witness evaluation produces hits. Live re-measure (GUNBC_INTERP_STATS=1 claim_batch, src/v4 witnesses): comprep_eval_by_execution: 14,427,120 calls / 777 distinct / 14,426,343 hits (18,567x dedup; 61 KB table; 591 MB RSS) loop_demand_driven_eval: 14,896 calls / 414 distinct / 14,482 hits (36x dedup; 33 KB table; 140 MB RSS) Finding for the CI-latency root-cause: interning crushed the name-allocation term, but the comprep witness still issues 14.4M `intern(&str)` calls, each hashing the full source string to probe the index map. The allocation is gone; the per-occurrence string-hash on the hot path is not. Caching the resolved `Symbol` at parse/resolve time so variable references never re-hash is the next lever (phase-4) — recorded here as the measured next step, not changed. Test plan: cargo test -p v2-compiler-tests interp_stats (3 interner pins + existing measurement pins pass); manual claim_batch runs above. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…re-measure (#4799 follow-up) (#4838) Re-measure of the v2 interpreter symbol interning landed in #4799 (ctrl#1533 phase 3). The interner deduplicates runtime identity carriers (type/variant/field names, env binding keys) into a per-evaluation table, but nothing counted how much allocation work that dedup avoids — the `[interp-stats]` report (ctrl#1533 phase 0) measured collection-copy and flatten work but not interning. Measurement-only: no interpreter semantics change. - `SymbolInterner` counts total `intern` calls; `stats()` returns `InternStats { calls, distinct, hits, heap_bytes }`. `hits = calls − distinct` is the number of repeat `String` allocations interning elided (each pre-#4799 occurrence of a name was its own owned `String`); the dedup factor `calls/distinct` is the before/after receipt for the carrier swap. - `InterpContext::interner_stats_snapshot()` exposes it; `claim_batch`'s `print_interp_stats` prints one `[interp-stats] symbol interning receipt` line (single-entry mode, where the context survives to be inspected). - Two pins in `interp_stats_test`: the table-level invariant (`calls == distinct + hits`) and that a real witness evaluation produces hits. Live re-measure (GUNBC_INTERP_STATS=1 claim_batch, src/v4 witnesses): comprep_eval_by_execution: 14,427,120 calls / 777 distinct / 14,426,343 hits (18,567x dedup; 61 KB table; 591 MB RSS) loop_demand_driven_eval: 14,896 calls / 414 distinct / 14,482 hits (36x dedup; 33 KB table; 140 MB RSS) Finding for the CI-latency root-cause: interning crushed the name-allocation term, but the comprep witness still issues 14.4M `intern(&str)` calls, each hashing the full source string to probe the index map. The allocation is gone; the per-occurrence string-hash on the hot path is not. Caching the resolved `Symbol` at parse/resolve time so variable references never re-hash is the next lever (phase-4) — recorded here as the measured next step, not changed. Test plan: cargo test -p v2-compiler-tests interp_stats (3 interner pins + existing measurement pins pass); manual claim_batch runs above. Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Auto-opened by session-dashboard for session
quick-ant-784.Pushing to
session/quick-ant-784advances this PR.Worker attestation
Before flipping this PR to ready for review, confirm each item:
npm test,cargo test) and the result.Closes #Ndirective.Summary
TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.
Test plan