Repository navigation
perf(lynx): #230 Order 3 — the four-build split - #240
Merged
Merged
Conversation
…ompact rung Issue #230 Order 3 read the create residual as background state that accumulates because a root which never paints a first screen never reaches the incremental-compact rung it negotiated. The reading was right about the rung and wrong about the residual. `postFirstTreeLazyPublicInstances` is one gate, set only in the first-tree adoption handoff and admitting both `incrementalCompactCandidate` and `teardownMirrorCandidate`. The split is that enabler crossed with the two consequences it admits: control, both, teardown-only, incremental-only. Control is byte-identical to the vendored shipping bundle. Fifteen readings per arm, three windows. No arm's interval clears control's on latency, btsCpu, mtsCpu or fcp, and each arm's delta changes sign between windows, so this is a null rather than an effect too small to resolve. The same bundle spans 138 ms across the three windows against within-window intervals of ±40 to ±71, which is why a number here cannot be read against one from another window. The signal is in heap, and only in the arm where the certified dense teardown runs without incremental compact: 31.64 MB more retained peak for 2.12 MB more released on the clear, reproduced to within 64 kB across the three windows. The mirror copies the whole record map per mount-template-run and retains it on `state.teardownRecords`; once incremental compact succeeds, `state.records` is no longer a `Map` and the mirror's own guard declines, so the two consequences are not independent. That divergence is also what proves the enabler executed, which confirms Order 3's root cause by measurement rather than by reading: folding a candidate to `false` cannot add a 31 MB copy, and the enabler sits on the branch taken when no first tree is adopted. Adds `stages/issue230-order3-split.mjs` so the record can be re-derived from run records already on disk, with tests for the arithmetic that could otherwise lie quietly — the runner's own ci95 convention, the refusal to pool wall clock across windows, and the heap spread that makes the delta readable. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
"Byte-identical to the vendored octane-hux rows-0 bundle" is true of the benchmark repository's working tree and false of its history: the refresh of that entry to 8938c12 is uncommitted there, and the committed entry is still the 07115d6 build. The match is also worth more than the original phrasing claimed. The reference comes from build-octane-upstream.mjs against a clean checkout and the control from build-app.mjs against the worktree, so this is two independent build paths at one commit emitting the same bytes, not a build compared with itself. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
The record cited `scratchpad/o3/arm.py::<arm>` as the provenance for three of its four bundle digests. That scratch directory did not survive the machine it was written on, so the digests had no reachable recipe: three numbers you could only take on trust, in a record whose whole purpose is that you do not have to. `stages/issue230-order3-arms.mjs` is that recipe as a repository artifact. Each of the four edits is stated as the exact text it replaces rather than as a line number, so it refuses to apply to a tree it does not describe instead of silently patching the wrong line of a moved file. `patch <arm>` emits a unified diff for `git apply`, which makes the revert `git apply -R` rather than a second code path that could disagree with the first; `audit` reports drift against whatever tree you are standing in. The hunks were extracted from 8938c12 rather than transcribed, and all three non-control arms were verified end to end: each applies with `git apply`, produces exactly the expected edit in the expected files, and reverts to a clean tree. The record's `patchFile` now names this file. That is a three-value edit and the record stays byte-identical to what `writeEvidenceJson` produces for it. Also corrects the README: the four `o3*` entries, the `octane-hux` refresh and the three runner records lived only in an uncommitted working tree and are gone too. What survives is the recipe, the digests and the pooled readings — enough to rebuild the arms, not enough to replay those three windows, and by the drift the report itself documents a fourth window could not be read against them. `unifiedDiff` split the trailing newline as a line, so a change within `context` of the end emitted a context line for a line the file does not have. Not reachable by these four hunks, but the function is exported; it now splits the newline off first and refuses a text that has none. 13 tests. Five guards red-verified by breaking each in turn: the exactly-once match refusal, a hunk that stops describing the recorded commit, the diff header's line counts, a control arm that quietly acquires a hunk, and the end-of-file context bug. The pointer test was red before the record was repointed, on the dangling path itself. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
Huxpro
marked this pull request as ready for review
August 30, 2026 12:47
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.
Summary
#230 Order 3 read the create residual as background state that accumulates because a root which never paints a first screen never reaches the incremental-compact rung it negotiated. The reading was right about the rung and wrong about the residual.
postFirstTreeLazyPublicInstancesturns out to be a single gate: set only in the first-tree adoption handoff (core/transport.ts), read per commit when the background decides whether to request an incremental compact, and on the host side the admission for bothincrementalCompactCandidateandteardownMirrorCandidate(core/host-driver.ts). So the four builds are that one enabler crossed with the two consequences it admits:o3ctl0a52f5938f43b87fo3cmpe880ffb94bdb56d2o3tear919ba7cb574975afo3gen697bea26b94b6220stages/issue230-order3-arms.mjsis the recipe those digests came from, so they can be rebuilt rather than taken on trust — see Reproducing this below.o3ctlwas byte-identical to theoctane-huxentry as rebuilt at this base, which is a stronger statement than "it is the shipping build": that entry comes fromscripts/build-octane-upstream.mjsagainst a clean checkout and this control fromscripts/build-app.mjsagainst the worktree, so two independent build paths at8938c1260emitted the same bytes. That comparison was against the working tree of the benchmark repository rather than its history, and that working tree is now gone (below), so it stands as a recorded observation rather than something you can re-check without rebuilding both sides.Wall clock: a null, and demonstrably a null
15 readings per arm, three windows. No arm's 95% interval clears control's on
latency,btsCpu,mtsCpuorfcp. The three windows say why that is a null rather than an effect too small to resolve — every arm's delta changes sign between windows:o3cmpo3tearo3genThe same bundle also reads 1735.5 / 1658.2 / 1795.6 ms across the three windows — a 138 ms spread against within-window intervals of ±40 to ±71. That is why each window is compared only with itself, and why a number here cannot be read against one from another window, including benchmark #40's.
Heap: where the signal actually is
The runner captures heap once per entry per window, so the windows are the samples — and they agree to within 64 kB on a 31.64 MB difference:
o3ctlo3cmpo3tearo3genBackground heap does not move in any arm, which is where the effect has to be: the record store lives on the main thread.
Why
Three results, and the first is the one that redirects the E-train.
o3cmpreaches everything the negotiation offered and creates 10,000 rows in the same time as the build that reaches none of it. An E-train aimed at reaching the rung faster would be aimed at nothing.o3cmpis the arm to trust here: it only adds a line, so C12's warning about a constant-folding ablation removing more than the code it deleted does not apply to it. It does apply too3tearando3gen, which fold a candidate tofalse; those two are upper bounds.new Map(state.records)permount-template-run— 70,000 records at 10,000 rows — and the copy is retained onstate.teardownRecordsuntil the next batch.o3cmpdoes not pay it: once incremental compact succeedsstate.recordsis no longer aMap, so the mirror's owninstanceof Mapguard declines. The two consequences of the one enabler are therefore not independent, and the mirror is only reachable in the arm with incremental compact switched off.falsecannot add a 31 MB copy, so the only wayo3teardiverges is that its enabler executed — and the enabler sits on the branch taken when no first tree is adopted. This app does not adopt a first screen, and so never reaches the rung it negotiates.Reproducing this
Each edit is stated as the exact text it replaces rather than as a line number, so it refuses to apply to a tree it does not describe instead of silently patching the wrong line of a moved file.
… arms.mjs auditreports that refusal ahead of time.What that gets you is the arms and the digests. It does not get you these three windows: the four
o3*entries, theoctane-huxrefresh, and the runner records lived only in an uncommitted working tree that no longer exists. A fourth window would be a new measurement, and by the drift documented above it could not be read against these three.Changes
benchmarks/lynx-table/stages/issue230-order3-split.mjs— reads the runner's window records, pools them on the two opposite rules the two metric families need, and writes the checked-in record. Split from collection the way The PaintingContext ceiling package: cross-framework confirmation, engine report, the guardrail, and a device correctness gate #234 D splits judgement from collection: the runner lives in another repository and needs a browser, so keeping the arithmetic here is what lets the claim be re-derived and re-checked from records already on disk.benchmarks/lynx-table/stages/issue230-order3-split.test.mjs— 7 tests over the arithmetic that could otherwise lie quietly.benchmarks/lynx-table/stages/issue230-order3-arms.mjs— the build recipe, added in6a14e29eb. The record previously cited a path under a scratch directory that did not survive the machine it was written on, which left three of its four digests with no reachable recipe.benchmarks/lynx-table/stages/issue230-order3-arms.test.mjs— 13 tests, including the one that pins the record's provenance pointer at a path in this repository.benchmarks/lynx-table/stages/results/issue230-order3-split-10000.json— the record, carrying the commit and all four bundle digests.benchmarks/lynx-table/README.md— the window, under §7's attribution family.Validation
pnpm format:files:checkon all changed paths — clean. The record is unchanged by Prettier, which iswriteEvidenceJsondoing its job.pnpm sync— no generated changes.pnpm format:check(repo-wide) — not run; scoped check used.pnpm typecheck— not run; no TypeScript changed.pnpm test— not run; this touches no package source.node --test stages/issue230-order3-split.test.mjs→ 7/7,… issue230-order3-arms.test.mjs→ 13/13.stages/results/issue57-clear-teardown.jsonnot matching what the evidence writer would produce; verified pre-existing by stashing these changes and reproducing it on the pristine head. It belongs todcf94cfc8(perf(lynx): streamline dense clear teardown octanejs/octane#762), not this branch.git apply, produce exactly the expected edit in the expected files, and revert to a clean tree. The hunks were extracted from8938c1260rather than transcribed.lynxsuite under each arm gives control 730/730 green,o3cmpando3genfailing exactly the 3 compact-guard tests,o3tearthose plus 8 host-driver tests.ninstead ofdf, wall clock pooled across windows, heap spread reported as zero — each breaking exactly one test.Risk / follow-ups
packages/source is changed by this PR; the recipe is data, imported by nothing.lynxsuite. The certified dense teardown is reachable only behind incremental compact today, and nothing pins it independently.8938c1260. Ifpackages/lynxmoves under it,arms.mjs auditreports the drift rather than patching the wrong line — but at that point the digests describe a tree that no longer exists, and re-measuring is the only honest repair.o3tear: the other three arms sit in positions 1, 2 and 3 and agree within 9 kB.claude/octane-issue-66-phase-a-7wz97z, butcreate-a-prmandates afeat/|fix/|docs/|test/|perf/topic branch so the label bot can read the type. I used the repo convention; flagging the conflict as in the other PRs in this stack.Provenance
agent-authored)