Repository navigation
test(bench): give the lynx-table stage harness a teardown pair - #266
Merged
Merged
Conversation
`evidence.test.mjs` asserts something stronger than "these files pass Prettier": every checked-in measurement record is exactly what `writeEvidenceJson` would produce for it, so a diff in a results directory is always a measurement that moved and never a formatter that did. Three records had drifted off that: `c230-retention-10000.json` was tab-indented, which the repository's own JSON override rejects too, and the two `c252-*` records differed from the writer in ways Prettier accepts. The suite was therefore red on `new-lynx` — 201 of 202 — and `pnpm format:check` was red with it. Rewritten through `formatEvidenceJson` rather than through Prettier: only the writer satisfies both gates, and reformatting the first record with Prettier alone left the test failing on the next one. Content is unchanged, verified by comparing a SHA-256 of the canonical JSON of each record before and after in one process rather than trusting the diff to be whitespace. Nothing here is an instrument rotting. Every one of the three arrived while the CI pool was stopped, so `lint_checks` never ran on the commits that introduced them. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
The stage-decomposition harness measured no clear at all. Every cell in it builds or mutates a tree; nothing asked what releasing one costs, so #230's `heapMtsAfterClear` drift and #234 Part D's retention oracle had no counterpart at this harness's resolution. Adds two cells behind `--teardown`, and they are a pair on purpose. `clear` releases only what a create built; `updateThenClear` runs one `Update every 10th row` round between the create and the clear, so it releases that plus whatever the update left behind. Same target, same closing predicate, same budget: the only thing not held constant is the state the clear has to let go of, which is what makes the difference between the two readable as one claim. Neither number reads alone. Off by default because every cell is measured in all three variants at every repetition. A run without the flag measures exactly the cells it measured before the pair existed, and a test pins that rather than leaving it to inspection — the harness's records are compared across sessions, so "opt-in" has to mean the default table did not move. The mechanism this needed is a setup *sequence*: `updateThenClear` clicks twice before the measured click, and the second click's closing predicate is only knowable from the table the first one built. So `setup` now takes an array where a cell needs more than one step and keeps the bare-object form everywhere else, and the decision of how a step closes moved into `operations.mjs` as `setupPredicateSpec` — `run.mjs` launches Chromium at import time, and a branch nothing can reach without a browser is a branch nothing tests. A setup step that declares no closing predicate, or two, is refused by name. There is no checksum fallback before the measured interval opens, so a step that cannot say when it finished would let the next click land on a table still settling and the cell would measure the tail of its own setup. Red-verified: each of eight mutations was applied, the suite run, and the intended test watched go red — the default table gaining the pair, the pair losing its update step, the pair defining its own update step instead of reusing the measured one, `setupSteps` always wrapping, the clear cells losing the storm budget, a setup step losing its predicate, the ambiguity guard removed, and the no-predicate guard defaulting instead of throwing. Not verified end to end. `stages/run.mjs` cannot run on `new-lynx` at all: its build preflight requires the marker `firstScreenPrepareMs` in the profile bundle, and the only place the instrumenter mentions that name is a TypeScript interface field, which erasure deletes. Six of the nine first-screen fields it declares are never assigned. Reproduced with this diff stashed, so it predates the change; reported separately. The data half of this change is fully covered, and `papi-run.mjs` — which does not use `analyzeFcpSample` — is unaffected. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
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
The stage-decomposition harness measured no clear at all. Every cell in it builds or mutates a tree; nothing asked what releasing one costs, so #230's
heapMtsAfterCleardrift and #234 Part D's retention oracle had no counterpart at this harness's resolution.This adds two cells behind
--teardown, and they are a pair on purpose:clear— create, then clear. Releases only what the create built.updateThenClear— create, oneUpdate every 10th rowround, then clear. Releases that plus whatever the update round left behind.Same target, same closing predicate, same budget. The only thing not held constant is the state the clear has to let go of, which is what makes the difference between the two readable as one claim. Neither number reads alone and neither compares across windows.
Off by default. Every cell is measured in all three variants at every repetition, and the campaigns that read this table are about what a frame costs to build. A run without the flag measures exactly the cells it measured before the pair existed — pinned by a test rather than left to inspection, because this harness's records are compared across sessions and "opt-in" has to mean the default table did not move.
The mechanism this needed is a setup sequence.
updateThenClearclicks twice before the measured click, and the second click's closing predicate is only knowable from the table the first one built. So:setuptakes an array where a cell needs more than one step, and keeps the bare-object form everywhere else. The established cells' shape is pinned by an existing test precisely because their published attribution is only comparable across sessions if it does not move, so the sequence form is additive rather than a rewrite.operations.mjsassetupPredicateSpec.run.mjslaunches Chromium at import time — the same reason the operation table lives inoperations.mjsat all — and a branch nothing can reach without a browser is a branch nothing tests. The runner keeps the page read.The first commit is unrelated to the pair and fixes a red gate on
new-lynx: three checked-in records had drifted offwriteEvidenceJson, leavingevidence.test.mjsat 201/202 andpnpm format:checkred. Details in the commit message and on #255.CI has since confirmed that half independently. The runner pool recovered when #260 merged its GitHub-hosted fallback, and the first full run on the base head — run 33407729769 on
33d9358— is red, 23 of 26 jobs green. All three failures are this one cause:lint checksfails atCheck formatting, naming exactly the three records below, andlintandCI provenancefail only because they report its status (LINT_RESULT: failure, every other resultsuccess).Those are the three files the first commit rewrites. That half now has its own PR — #268 rewrites the same three records and additionally repairs the write-site that produced the drift (
stages/heap-retention.mjsstill emitted a bare tab-indentedJSON.stringify), which is more than a commit riding along on a harness cell should do. The records are the same bytes in both branches, not merely the same values, so this branch merges a landed #268 without a conflict on any of those 2,030 lines. If #268 lands first, the first commit here becomes a no-op; if it stalls, this still carries the fix. Worth noting for whoever picks it up: withFULL_CI: true, that same run reportsTEST_RESULT: success,TYPECHECK_RESULT: success,LYNX_COMPAT_RESULT: successandPACKAGE_RESULT: success— the base's only defect is the formatting gate.Validation
pnpm format:check— clean on the whole repository, exit 0. This was red on the base, confirmed by CI as well as locally (run 33407729769 above); the first commit is what makes it green.pnpm typecheck— not run. The diff is.mjs,.mdand.jsonunderbenchmarks/; no TypeScript program includes any of it.pnpm test— not run. No package source changed, and the Vitest projects do not collectbenchmarks/lynx-table/stages/**, which is the gap The lynx-table stage harnesses have no CI coverage, and two instruments rotted unnoticed #255 is about.node --test benchmarks/lynx-table/stages/*.test.mjs— 209 pass, 0 fail. Base is 202 tests, 201 pass, 1 fail (the record drift above). Net +7 tests, and the pre-existing failure fixed.pnpm format:fileson every changed file;pnpm syncclean.Red-verified. Each mutation was applied, the suite run, and the intended test watched go red before restoring:
teardowndefaults totrueupdateThenCleardrops its update stepsetupStepsalways wrapsRisk / follow-ups
stages/run.mjsdies in its own build preflight before it opens a browser: it requires the markerfirstScreenPrepareMsin the profiled bundle, and the only placeinstrument-source.mjsmentions that name is a TypeScript interface field, which erasure deletes. Nine of the sixteen members that widening declares are never assigned anywhere. Reproduced with this diff stashed, so it predates the change. Reported in full on The lynx-table stage harnesses have no CI coverage, and two instruments rotted unnoticed #255, including why relaxing the preflight instead of restoring the instrumentation would make the FCP split report six of its nine stages as0 msand look well-formed doing it. The data half of this change — the table,setupSteps,setupPredicateSpec— is fully covered; the loop inrunOperationis not, and I would rather say so than imply a smoke run passed.papi-run.mjsis unaffected. It does not importanalyzeFcpSample, so the Attribute the 1.6× web-startup gap to ReactLynx before deciding whether to chase it #247/test(bench): split the FCP remainder into phases, and repair the profiler that names its functions #254 bucket numbers stand.node --test benchmarks/lynx-table/stages/*.test.mjsis in no workflow, andbench.yml— the only one touchingbenchmarks/— is manual-dispatch plus a weekly cron.scripts/ci-workflow.test.mjswould verify aci.ymledit locally, but adding a step to the shared workflow belongs to a change that owns it rather than riding along with a harness cell.claude/octane-issue-66-phase-a-7wz97z, which the repository's owncreate-a-prrules and.github/workflows/label-pr.ymlcannot read as a type. The branch istest/lynx-stage-update-then-clearso the label bot works; flagging the deviation rather than hiding it.Provenance
agent-authored)Generated by Claude Code