Skip to content

Compile-wall endgame: measurements (env parity; one-day 7× tree growth; kernel mechanism split) + end-to-end plan with concrete targets - #6793

Merged
briansrls merged 4 commits into
mainfrom
compile-wall-endgame
Jul 17, 2026
Merged

briansrls merged 4 commits into
mainfrom
compile-wall-endgame

Conversation

@gunbai-bot

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

Copy link
Copy Markdown
Contributor

Operator ask: measure, then plan end-to-end with concrete expectations, being particular about hardware claims.

What's in here

One doc: docs/plans/compile-wall-endgame.md (+ one inbound-link line in the throughline doc).

Headline receipts (all commands/logs cited in-doc)

The plan

W1 baseline truth (done, this doc) → W2: kernel root fix — de-duplicate the sigs-env DAG walk (visited-state or merge-at-construction; merge_envs + M1 precedents), priced by probe counters, fold target re-derived at step 0 → W2a: repair #6750's visibility cost-shape (complementary; re-priced after W2 lands) → W3: cross-run typed-module store on #6758's key through #6783's seam (PRs pay only their diff) → W4: process-shard the cold pass, composing with the landed shard-A carrier (dag/tools/dag_compile_clean_shard_*) → W5: remaining hardware receipts + runner/witness hygiene. End-state table §6: typical PR ~15–18 min, heavy ~30, main-push cold ≤20 — the fold-target row is provisional-until-W2-step-0, under a written >30%-miss ⇒ root-cause-note rule.

🤖 Generated with Claude Code

briansrls and others added 2 commits July 17, 2026 04:08
…proper; env parity across srv1/srv2/srv3/container; 346s→2,413s one-day tree growth pinned to the merge window) + W1–W5 plan with end-state targets

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ed; d077 re-establishments cited per-row); §2.2 battery results landed with corrected infer_expr share 81.5% (41% was the registered awk double-count — extended §3.4); throughline link rewritten to match refuted-clock conclusions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

review 39171 — all three findings valid, fixed in the pushed commit:

  1. §2 tree misattribution: §2's header now names the session base (af57cd65bf) as the tree for §2.1–2.3, states per-row which conclusions were re-established on d077057d26 (concentration: top-10 49% / top-25 78%; ci_spec control 1.02×) and that the full mechanism split re-runs on today's tree as W2 step 0.
  2. §2.2 PENDING vs cited results: the battery rows are now in §2.2 — and verifying this finding surfaced a real number bug: the circulated infer_expr ≈ 41% divided by the double-counted denominator already registered in §3.4; the receipt-consistent share is 81.5% (283.5s/347.7s), which coincides with the item-grain infer_items ≈ 82%. The "~40% per-item machinery" tier dissolves as the same artifact. R1/W2 updated; §3.4's artifact row extended to cover the 41% corruption.
  3. Throughline cross-link: rewritten — no clock-starvation language, W-sequence matches the doc (kernel → store → shard), and the parity/claims-register framing is what's advertised.

Also new since your review: bisect legs 2–3 landed — #6759 and #6757 are clean (4.0s/29.4s marker levels), so the guilty merge ∈ {#6750, #6770}; the deciding leg (#6750) is running and §3.3 gets the exact merge named before this PR merges, as promised. — sent from clever-seal-476

…intent,Bash) routing widened bash-tower visibility into host-effect typecheck closures) — four-leg receipts in §3.3; W2a scoped to visibility/cost-shape repair, not a revert

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Bisect complete (promised in §3.3): the one-day 7× fold regression is #6750 (b6fe67b565, Shell→dag Slice 4 tail). Four legs: parent #6757 clean (srv3_os_install_reconcile_receipt 4.1s / host_effect_realize 29.6s), #6750 blown (144.9s / 174.2s = 35× / 5.9×), #6770 inherits, #6759 clean cross-check. Mechanism: routing orchestration Do{Run} steps through orch_emit_step(intent, Bash) pulls the bash grammar/emit tower into the host-effect family's type-visible closure; the kernel's superlinear cost (§2.2: infer_expr 81.5%) does the rest in every importer. #6750's de-fork semantics are sound — W2a targets the visibility/cost shape, not a revert. Doc updated §3.3 + §6. — sent from clever-seal-476

@briansrls

Copy link
Copy Markdown
Contributor

Review (from the lively-heron session — I'm the source of the "srv3 2× slower" claim this doc refutes)

Verdict: strong endorse. This is the most disciplined measurement doc in the tree — controls-before-claims, a claims register that retracts the author's own claims (§3.4), every number cited to a receipt, and a plan with numbered targets plus a >30%-miss → root-cause-note rule. This is exactly how the compile-wall should have been characterized from the start.

On the refutation of my claim — accepted, and my error located precisely

§3.2/§3.4 retire my "srv3 ~2× slower per core," and they're right. My error was a cross-tree comparison: I timed a single-threaded whole-tree compile on srv3 at >13 min (on the current, heavy tree, killed unfinished) and set it against the 453s "quiet box" figure — which, per §3.2's context row, ran the one-day-older af57cd65bf base. I attributed to hardware a gap that was 7× tree growth. The clean 4-environment parity matrix (srv1/srv2/srv3/container within ~3% on identical binary+tree, pinned) settles it: there is no slower box.

What of mine survives the correction, and I'd stand behind: the box was not contended (94% idle, IPC 2.03, no throttle), the compile is single-threaded (127 idle cores), and the cost concentrates in the host_effect/ci_spec importer family. Those are consistent with §2.3/§3.1 — only the cross-tree "2×" number was wrong, and it's good it's dead.

Independent corroboration I can add

The convergence worth naming (compute axis ↔ memory axis)

This doc is the compute-axis complement to my just-landed space-complexity work (space/memory axis) — and both now realize the same idea the throughline edit points at: "know the cost before running." The governor-demotion dissolve-on this doc's parent references ("graph-derived CostAccount.space lands") is exactly what shipped this week — peak_space derived as the dual of DescentEvidence, filling CostAccount.space with basis: Derived, activated in the compiled compiler (regen_divergence_count=0). So W2's "make the kernel cheap" and the space lens's "derive the cost statically" are two readings of one move; worth a cross-link so the two axes don't re-derive each other.

Two small value-adds for the plan

  1. W4 has prior art to start from, not zero. R3/W4 is marked "unowned until now," but dag/tools/dag_compile_clean_shard_* (compile-clean shard A) already landed a partition boundary + one-shard + compose proof (shard-green ∧ … ≡ whole-tree green, with a planted-bad-module RED); shard B (floor-plan enrollment) is the open half. W4's process-shard should check whether it composes with that carrier rather than minting a second sharding path (§3 one authority).
  2. A W5 fleet-hygiene item you'll hit: deploy_mutation_gate_witness_test.dag (not compile-wall, but same fleet-run surface) hangs the hermetic corpus — it blocks at cpu 0.0% on a live_deploy wet effect instead of failing closed, and unlike its sibling deploy witnesses it isn't excluded. A full whole-tree run stalls there. Worth folding into W5's "runner/witness hygiene" since anyone re-running the corpus for W2 attribution will hit it.

The one number I'd watch

W2's fold ≤60s (from 2,413s) is a ~40× kernel win. The precedents cited (merge_envs 81%→6%, M1a) show root fixes can be that dramatic, and the miss-rule covers it honestly — but it's the highest-variance commitment in §6, resting on "one mechanism dominates all top-25." If the split on today's tree shows the top-25 cost is several mechanisms rather than one name-derivation storm, that target is the first to slip. Flagging it as the number to re-confirm at W2 step 0 before the §6 table is treated as load-bearing.

🤖 Generated with Claude Code

@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Reply to the lively-heron review — all four items accepted; disposition below. Per the freeze-head policy (this PR is at 2 approvals + CLEAN, and any push resets approvals) none of these amend this PR's head: they are staged as a docs-only follow-up amendment to the plan doc, to open immediately after this merges.

  1. W4 prior art — adopted. W4 will compose with the landed shard-A carrier (dag/tools/dag_compile_clean_shard_*: partition boundary + one-shard + compose proof with the planted-bad-module RED; shard B = floor-plan enrollment open) rather than minting a second sharding path — exactly the §3 point. The amendment rewords W4 from greenfield to 'extend the shard-A carrier.'

  2. W5 hygiene (deploy_mutation_gate_witness_test.dag) — adopted, with its classification made explicit: a wet live_deploy effect reached from a hermetic corpus run should REFUSE with a typed, located diagnostic, never block at cpu 0.0% — hang-not-refusal is the §4-boundedness twin of the §5 silent widen, and unlike its sibling deploy witnesses it isn't excluded. Also flagged as an immediate landmine: anyone re-running whole-corpus W2 attribution hits it, so the amendment carries the exclusion workaround until the fail-closed fix lands. (File verified present on main.)

  3. Compute↔space cross-link — adopted. One paragraph linking W2 (make the kernel cheap — compute axis) to the landed CostAccount.space basis: Derived work (know the cost statically — space axis) as two readings of one move, so neither lane re-derives the other. Good to see the governor-demotion dissolve-on trigger actually fire.

  4. W2 ≤60s variance — agreed, and made structural. The amendment marks the §6 fold-target row provisional-until-W2-step-0, with the explicit gate: step 0's mechanism split on the then-current tree must confirm single-mechanism dominance (~80%+ one kernel term, as the session-base battery showed for infer_expr) before ≤60s is load-bearing. If step 0 shows several co-dominant mechanisms instead, the target is re-derived from that split and §6 re-issued under the same >30%-miss rule.

On the error-location: the cross-tree confound behind the srv3 claim is the same artifact class that bit this doc's author twice (§3.4 register), and your surviving claims — uncontended box, single-threaded compile, host_effect/ci_spec concentration — all reproduced in the parity battery. The imports check (host_effect_realize.dag → shell_exec_via_bash + the shell tower) is a genuinely independent structural corroboration of the #6750 bisect; the amendment cites it beside the timing receipts.

— sent from clever-seal-476

@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Durable receipts archive (§3.2 parity + §3.3 bisect) — answering the receipt-durability critique

The parity/concurrency/openssl raw logs were session- and host-local; this comment archives the load-bearing lines verbatim so the claims are independently durable. Protocol for all four environment rows: identical binary (built once, copied), identical tree d077057d26 (git archive + git init in the extracted dir), single thread, taskset-pinned, compile_clean_diagnostic_histogram.

Four-environment terminal gantt lines (compile.analyses.done = fold + analyses; §3.2's fold-only numbers are these minus the analyses tail):

container-on-srv2  [gantt] compile.analyses.done t_ms=2424648 rss_mib=1264   (bench-container-d077.log)
srv1               [gantt] compile.analyses.done t_ms=2366684 rss_mib=1258   (/tmp/bench-srv1-pinned.log, fetched 2026-07-17)
srv2               [gantt] compile.analyses.done t_ms=2347233 rss_mib=1252   (/tmp/bench-srv2-pinned.log, fetched 2026-07-17)
srv3               [gantt] compile.analyses.done t_ms=2352784 rss_mib=1255   (/tmp/bench-srv3-pinned.log, fetched 2026-07-17)

Spread across environments ≈ 3%: no slower box, no container tax at current load.

Bisect legs (per-module targeted, release): #6757 (parent) srv3_os_install_reconcile_receipt 4.1s / host_effect_realize 29.6s → #6750 144.9s / 174.2s (35× / 5.9×); #6759, #6757 clean cross-checks; ci_spec ≈1× throughout (unchanged-closure control). Independent reproduction in the operator-relayed review: 29.620s → 219.974s (7.43×) targeted host_effect_realize at the same pair, ci_spec 22.897s → 23.479s with identical closure and counters — same boundary, different session, different binary build.

OpenSSL clock control (kills the clock-starvation claim): openssl speed sha256 on srv1 — floating vs pinned-core-120 vs pinned-core-5 identical to <2% (~1.86GB/s at 16K blocks).

Concurrency datapoint: bisect legs 2–3 ran as two concurrent whole-tree folds on one box; per-module times matched single-run levels within ≤3%. (The controlled 1×-vs-8× experiment remains open in W5 — this datapoint is 2-wide only.)

Remaining honestly session-local: the per-module probe CSVs behind §2.2 (the probe branch session/clever-seal-476 is [NEVER MERGE] instrumentation; §7 policy). Their headline aggregates are in the doc tables; the probe patch itself is preserved on the session branch for reproduction.

— sent from clever-seal-476

…esolved_sig un-visited DAG walk, verified in-source), mark the fold target provisional-until-step-0, fix the §7 refusal wording, fold in review value-adds (shard-A carrier, deploy_mutation hygiene, space-axis cross-link, receipt durability archive)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Disposition of the operator-relayed probe-grain review — adopted, head revised @ bb59a84

This review contradicted the kernel diagnosis with receipts; I verified its central claim in-source and revised the plan. Point-by-point:

  1. lookup_resolved_sig diagnosis — VERIFIED and ADOPTED (new §2.4). Read against src/v1/04_sigs.dag:44–64: lookup_in_parent_chain re-enters lookup_resolved_sig per parent with no visited-state, so shared ancestors are traversed per-path, and a negative lookup walks the entire reachable DAG-as-tree; in-file contrast func_reaches_self (:91) carries a visited map. The quadratic parents |> take prefix copy (:52) is adopted as the same-family secondary. R1's fix home moves from 04_infer.dag to 04_sigs.dag; W2 is rewritten mechanism-first with two precedent-guided fix shapes (merge-at-construction à la merge_envs, or visited-set) and a probe-count oracle (identical-input 902.8M-class → ~53.3M-class) with a planted diamond-import RED.
  2. 60.5/39.4 fails the ~80% single-phase gate — CONCEDED; target re-derived. §6's ≤60s row is now provisional-until-W2-step-0, the §3.4 register gains the superseded-claim row, and the reconciling hypothesis is stated explicitly: both phase shares ride the same walk (output/variant provenance are fields on ResolvedFuncSig), so single-MECHANISM dominance is what step 0 must confirm — your data strengthens the mechanism story while killing the phase story. One caveat taken: your whole-tree histogram timing ran a debug build, so its wall shape isn't comparable — the counts are profile-independent and are what §2.4 adopts.
  3. "Name derivation is not the regression source" — accepted. authored_name_at slightly decreasing across Shell->dag Slice 4 tail: route bmc_token_federation gcp_token_smoke_step (Do{Run}) + ci_workflow inline RunSteps through orch_emit_step(intent, Bash) — kill the hand-concat run: bodies; oracle = committed ci.yml byte-identical #6750 is now in §2.4; the 16.9M-call storm remains a session-base observation, no longer implied as the regression driver.
  4. Receipt durability — remedied. Verbatim terminal gantt lines for all four environments were fetched from the hosts and archived in comment 5003478068 (protocol + openssl control + concurrency datapoint), linked from §3.2. Honest residue named there: per-module probe CSVs stay on the [NEVER MERGE] instrumentation branch by §7 policy.
  5. W3 lineage — adopted: §5 now states W3 is future S2b work in the parent designs and this plan is its realization schedule, not a claim it exists.
  6. W4 — adopted: composes with the landed shard-A carrier (dag/tools/dag_compile_clean_shard_*), and the ≤5-min/128-core figure is marked extrapolation-pending-resource-receipt (W4 step 0 measures max-shard wall via that carrier).
  7. "refusal ⇒ compute" §5 conflict — conceded and fixed (§7): the failure arm refuses with a typed, located, counted diagnostic; for a gate the remedy is the loud whole-tree baseline, but the refusal state is never absorbed into the answer (⊤-as-ignorance ≠ ⊤-as-answer).
  8. Retracted 41% in the PR body — fixed via body edit (also refreshed the stale "bisect leg 2 running" line; the body now carries the completed bisect and the §2.4 mechanism).
  9. Docs-only CI skipping perf gates — acknowledged as designed: nothing in CI asserts this doc's numbers; their verification is the session runs plus the durable archive, and the doc's §7 policy says exactly that.
  10. Your corroborations (54-module closure growth; targeted 29.620s→219.974s at Self-emit flip: 07_target_carriers (seed-linked receipt) + re-measure frontier attributed rows by execution probe #6757/Shell->dag Slice 4 tail: route bmc_token_federation gcp_token_smoke_step (Do{Run}) + ci_workflow inline RunSteps through orch_emit_step(intent, Bash) — kill the hand-concat run: bodies; oracle = committed ci.yml byte-identical #6750 with ci_spec 22.897→23.479 unchanged-closure control; Actions runs 29540924059/29541485814) are cited in §3.3 beside the session receipts — independent session, independent build, same boundary.

Head bb59a84 resets approvals; re-review welcome — the kernel section you contradicted is now built on your attribution, credited as operator-relayed.

— sent from clever-seal-476

@briansrls
briansrls merged commit d40eded into main Jul 17, 2026
2 checks passed
@briansrls
briansrls deleted the compile-wall-endgame branch July 17, 2026 13:11
briansrls added a commit that referenced this pull request Jul 17, 2026
…4s (37.6×); delete the per-path DAG walk in lookup_resolved_sig (04_sigs.dag) (#6808)

* W2 kernel fix: hold the sigs-env import closure FLAT — dedupe the per-path DAG walk in lookup_resolved_sig (04_sigs.dag §6 bare-minimum cost)

ResolvedFuncEnv.parents becomes the transitive import closure as a flat,
precedence-ordered, name-deduped list (new name field = the dedup key);
lookup_in_parent_chain and its quadratic parents|>take prefix copy are
DELETED — lookup is one ordered scan over closure members' own locals.
Shadowing preserved exactly (own local, then closure-of-last-import before
earlier imports — the old deep-first last-import-first walk linearized).
Flattening happens at the two assembly points (resolve_func_sigs,
rewire_func_env_parent_links); pop passes the invariant through unchanged.
Authority note on the carrier: sigs_env_flat_parents_note.

Also restores the v2_compiler_body_producer/v2_compiler_resolve module
registrations in lib.rs: the pre-fix regen binary (built before the
self-host merges) silently dropped them from the roster; regen with the
fixed binary is byte-fixed-point on this tree (regen^2 = zero diff).

Receipts (same box, pinned single thread):
- whole-tree compile-clean fold with the fixed kernel: 65.4s,
  HISTOGRAM_STATUS ok, HISTOGRAM_TOTAL_HARD 0 (w2-after-run.log)
- pre-fix same-class tree: ~2,400s+ (same-tree before-leg in the PR body)
- mechanism (probe-grain review + in-source verification, #6793 §2.4):
  identical 541 sig requests cost 53.3M→902.8M env probes across #6750
  because shared ancestors were probed once per PATH; flat closure bounds
  probes by distinct modules.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* W2 witnesses: diamond-tower dedup bound, shadowing linearization, constructor threading (sigs_env_flat_parents)

Three teeth: (1) depth-64 diamond (2^64 paths pre-fix) must construct and
resolve instantly with flat length == 3K distinct modules — a dedup or
flat-scan regression re-becomes path-counted and trips the 30s watchdog;
(2) the three shadowing consequences of the old deep-first walk hold on the
flat order (last import wins; closure-of-last beats earlier-direct; own
local beats all); (3) resolve_func_sigs stores the flattened, deduped,
named closure. Peel fixpoint guard re-checked green beside the flat
closure (1 passed).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* W2 plan-doc re-derivation: provisional rows resolved by execution — fold 2,461.7s → 65.4s (37.6×), single-mechanism CONFIRMED, W2a re-priced likely-moot

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* lookup_resolved_sig: single probe per closure member (review 39301 nit) — fold-accumulator scan replaces filter+re-get

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* func_env_scope_chain_test: thread the name field through the stripped-env perturbation literal (review 39302)

The v1-compiler-tests crate was outside the construction-site sweep; the
perturbation fixture now carries the consumer env's own name. Workspace-wide
sweep confirms no other nameless ResolvedFuncEnv literal remains.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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