Skip to content

M1a union base-choice: sized dispatch walks the smaller map into the larger spine (probe 1.48→1.40 GB, fingerprints byte-identical) + inductive-field base-case guard - #6534

Merged
briansrls merged 19 commits into
mainfrom
session/sleek-deer-172
Jul 13, 2026

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

M1a — union base-choice: sized dispatch (v1 run-stability throughline, follow-on to #6528)

Closes the second construction cut of the operator-signed throughline (docs/plans/v1-run-stability-throughline.md, defect §2.1): union_parent_type_env_caches Rc-shares the accumulator spine with the first import's cache only, and first imports are typically small leaves — so nearly every module freshly path-copied ≈ its whole closure's name surface across four maps.

Mechanism (authority src/v1/04_env.dag; .rs regenerated)

  • Each of the four guarded unions (str_bindings, deps_map, variant_locals, bool_set) becomes a sized dispatcher: count on both maps is O(1) (im_rc len); walk the smaller map into the larger as the shared spine.
  • The mirrored *_into_overlay bodies preserve winner/conflict semantics exactly (same-authority → keep state; differing → keep base + conflict row with existing_site/incoming_site in their semantic roles; absent → insert). Documented in note row union_base_choice_note.
  • By-construction, no threshold/heuristic (§4/§5): the dispatch is total over map sizes; the 04_infer.dag fold init is untouched because per-step dispatch already covers a small first parent.
  • Bundled from the v1 run-stability throughline: roadmap + M0 receipt + M1b/M1b-2 + M1 dial receipt (resolve peak 5.27→1.48 GB; whole-corpus run 120m-killed → 8m green at width 9) #6528 review commitment: append_inductive_field_absent guard routed through both put_inductive_field and put_inductive_field_cross — the M1b-2 set-semantics base case is now constructed, not observed (note row put_inductive_field_guard_note).

Receipts (doc §1, "M1a receipt")

Controlled pair — isolated whole-corpus resolve probe, same tree + EX list, only the binary differs:

PRE (main binary) POST (M1a binary)
probe peak (VmHWM) 1,481,617,408 B 1,401,417,728 B (−5.4%)
corpus_fingerprint d34a91a4d8fe8845 byte-identical
emit_graph_fingerprint cfdc338c2795a035 byte-identical
modules resolved / excluded 1,101 / 903 1,101 / 903

Battery: cargo test --release -p v1-compiler --lib 214 passed / 0 failed; regen_stage0 --verify regen_divergence_count=0; memo oracles 3/3.

Whole-corpus resolve-peak arc across the milestone: 5.27 → 2.05 (M1b) → 1.48 (M1b-2) → 1.40 GB (M1a). The modest M1a delta matches M0's mass ranking (inductive fields dominated and were taken by M1b/M1b-2; the union base was second). M1c (cycle sets, 24k entries) stays demoted.

Honesty note (in the doc receipt): the M0 EX list of 22 scaffold subpaths was never baked into ci_layer_roots.dag (it carries 4); this pair re-derived it by execution. Whether to bake it is surfaced as a follow-up question, not edited here.

🤖 Generated with Claude Code

briansrls and others added 19 commits July 13, 2026 05:56
…us-OOM lane (measurement-first, construction fixes, cache-grain retention strip)

Operator-requested alignment doc before any cut lands. Grounded in today's
receipts: 11.1 MB corpus -> 5.28 GB single strict resolve (typecheck envs =
87%), floor censored-pinned at the 15 GiB memory.high clamp, per-module
retention growing with closure size (superlinear total). Locates the three
construction sites (union base-choice, merge_inductive_fields fold-from-empty,
fresh cycle sets), clears func_env, and stages M0 denominate -> M1 construction
fixes -> M2 roster-aware env strip (the tripped #5892 flip-trigger's action,
corrected to the grain that frees bytes) -> M3 reference to S2a Inc-B.
Non-goals pinned: no envelope raises, no absorbing fallbacks, no v1 investment
beyond the bridge; terminal dissolution = Wave 3+ native-artifact cutover.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…or peak (review corrections)

The routed review (sharp-bee-290) caught the doc grading the wrong axis: the
adaptive governor packs width to the memory.high line BY CONSTRUCTION
(ci_floor_measurement.dag's own text), so floor_peak_post ~15 GiB is a design
constant under queue pressure — a successful retention cut raises width and
drops wall-clock while the peak stays at the line. Amended: (1) §0 states the
failure axis precisely (retention -> forced_serial -> step-cap time death);
(2) M1/M2/exit done-bars now completion-within-step-budget at width > 1, with
the isolated probe peak as the retention measure; (3) M0 widened with the
dial-side baseline (width/wall/outcome paired with retention) so the mechanism
is tested, not assumed; (4) M2 go/no-go reworded off the peak; (5) eval-memo
(#6441/#6469) scope boundary stated: frame-exit drains it per witness
(claim_batch.rs:458/638, claim_executor.rs:623/691) — its OOM class is the
single giant witness, owned by the long/ lane.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tries) — M1b is the first cut

--ancestry-report on today's tree (1,101 modules): te.inductive_fields list
mass 409,240,584 Rc slots (~3.3 GB in Vec slots alone ≈ the whole typecheck
bloat); worst single module 22.6M entries at ~1,338 types (~17k duplicates per
type) — merge_inductive_fields concat-on-collision compounding multiplicatively
along the import DAG. All map-spine dup_factors 1.00 (zero cross-module
sharing, as diagnosed) but map entries total only ~1.07M — not the bytes.
M1 order re-derived from the receipt: M1b first, M1a second, M1c demoted
(cycle sets 24k entries, negligible). Pre-fix oracle baseline pinned:
corpus_fingerprint=82e9c68b96617067 emit_graph_fingerprint=cfdc338c2795a035.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… fingerprint-identical, battery green)

Completes the M1b cut whose .dag authority edits the session checkpoint already
pushed (04_env.dag merge_inductive_fields skip-if-equal + insert-not-concat;
04_infer.dag parents-fold init from first parent, both build_type_env paths):
the regenerated seed .rs land here so regen --verify holds on the committed
pair (verified: regen_divergence_count=0).

Receipts (all by execution, controlled pre/post on identical tree+binary
shape, recorded in the throughline doc §1):
- whole-tree strict resolve peak RSS 5,274,587,136 -> 2,045,423,616 B (-61%)
- te.inductive_fields list mass 409,240,584 -> 95,050,553 (-77%); worst module
  22.6M -> 4.1M
- corpus_fingerprint d34a91a4d8fe8845 pre == post (byte-identical); emit_graph
  fingerprint identical — the dedupe is invisible to the whole-corpus
  diagnostics+emit oracle
- v1-compiler lib battery 212/0 (incl. module-grain + import-closure
  equivalence modules); claim_executor memo oracles 3/3
Doc updated: status = executing (M0 DONE, M1b LANDED, M1a next); M0's
'measurement only' framing scoped to the instrument; M1 sign-off provenance
recorded; the throughput half of the M1 done-bar (whole-corpus floor at
width>1 within step budget) explicitly declared outstanding, not asserted.

Addresses cursor REQUEST_CHANGES (review 37480): the PR now carries the M1
scope honestly (title/body updated), the post-cut receipts are on the carrier,
and the sign-off gate is documented as discharged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-graph orphan)

Whole-corpus falsifier cold run on the M1b-2 tree: EXIT=0 green, all 1,757
witnesses / 0 skipped, ~8m wall, max_width_reached=9, forced_serial=0,
hard_backoffs=0, peak 8.83 GB VmHWM (local 33.6 GB budget; fits CI's 16 GB
envelope with headroom — CI-slot confirmation declared outstanding).
Pre-M1b baseline on the same artifact: forced_serial=1, 474 hard_backoffs,
step-cap TIME death.

The DESIGN.md open-threads row links the throughline doc, which the restored
cold sweep itself flagged as a doc-graph orphan (doc_graph_has_no_orphan_docs
red on this tree; green with the link, dangling-links witness green). Also
records the three latent corpus reds the revived sweep caught (two
pre-existing, fixed in #6530; this orphan the third).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…GB, fingerprints byte-identical), battery green

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot changed the title corpus OOM M1a union base-choice: sized dispatch walks the smaller map into the larger spine (probe 1.48→1.40 GB, fingerprints byte-identical) + inductive-field base-case guard Jul 13, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 13, 2026 15:43
@briansrls
briansrls merged commit 1a8f4f9 into main Jul 13, 2026
8 of 12 checks passed
@briansrls
briansrls deleted the session/sleek-deer-172 branch July 13, 2026 18:05
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