Skip to content

test(bench): give the lynx-table stage harness a teardown pair - #266

Merged
Huxpro merged 2 commits into
new-lynxfrom
test/lynx-stage-update-then-clear
Aug 31, 2026
Merged

Huxpro merged 2 commits into
new-lynxfrom
test/lynx-stage-update-then-clear

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 31, 2026 •

Copy link
Copy Markdown
Owner

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 heapMtsAfterClear drift 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, one Update every 10th row round, 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. 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 takes 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.
  • The decision of how a step closes moved into operations.mjs as setupPredicateSpec. run.mjs launches Chromium at import time — the same reason the operation table lives in operations.mjs at all — and a branch nothing can reach without a browser is a branch nothing tests. The runner keeps the page read.
  • 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.

The first commit is unrelated to the pair and fixes a red gate on new-lynx: three checked-in records had drifted off writeEvidenceJson, leaving evidence.test.mjs at 201/202 and pnpm format:check red. 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 checks fails at Check formatting, naming exactly the three records below, and lint and CI provenance fail only because they report its status (LINT_RESULT: failure, every other result success).

[warn] benchmarks/lynx-table/stages/results/c230-retention-10000.json
[warn] benchmarks/lynx-table/stages/results/c252-array-owner-10000.json
[warn] benchmarks/lynx-table/stages/results/c252-postcausea-10000.json
[warn] Code style issues found in 3 files. Run Prettier with --write to fix.

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.mjs still emitted a bare tab-indented JSON.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: with FULL_CI: true, that same run reports TEST_RESULT: success, TYPECHECK_RESULT: success, LYNX_COMPAT_RESULT: success and PACKAGE_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, .md and .json under benchmarks/; no TypeScript program includes any of it.
  • pnpm test — not run. No package source changed, and the Vitest projects do not collect benchmarks/lynx-table/stages/**, which is the gap The lynx-table stage harnesses have no CI coverage, and two instruments rotted unnoticed #255 is about.
  • targeted tests: 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:files on every changed file; pnpm sync clean.

Red-verified. Each mutation was applied, the suite run, and the intended test watched go red before restoring:

mutation went red
teardown defaults to true the default table is the one every published campaign measured, every measured cell but create is reported, in table order
updateThenClear drops its update step the teardown pair differs only in the update round…, a setup sequence reads the same whether it is one step or several
the pair defines its own update step instead of reusing the measured one the teardown pair differs only in the update round…
setupSteps always wraps every operation closes on a predicate the shared driver understands, a setup sequence reads the same…
the clear cells lose the storm budget a clear cell gets the storm budget…, the teardown pair differs only in the update round…
a setup step loses its predicate four tests, including every operation closes on a predicate…
the ambiguity guard removed a setup step that declares two closing conditions is refused by name
the no-predicate guard defaults instead of throwing a setup step that declares no closing predicate is refused by name

Risk / follow-ups

  • The runner half is not verified end to end, and cannot be on this base. stages/run.mjs dies in its own build preflight before it opens a browser: it requires the marker firstScreenPrepareMs in the profiled bundle, and the only place instrument-source.mjs mentions 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 as 0 ms and look well-formed doing it. The data half of this change — the table, setupSteps, setupPredicateSpec — is fully covered; the loop in runOperation is not, and I would rather say so than imply a smoke run passed.
  • No measurement is claimed. This adds the instrument, not a reading. What the pair costs is a separate window with its own record.
  • papi-run.mjs is unaffected. It does not import analyzeFcpSample, 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.
  • The CI step The lynx-table stage harnesses have no CI coverage, and two instruments rotted unnoticed #255 asks for is not here. node --test benchmarks/lynx-table/stages/*.test.mjs is in no workflow, and bench.yml — the only one touching benchmarks/ — is manual-dispatch plus a weekly cron. scripts/ci-workflow.test.mjs would verify a ci.yml edit locally, but adding a step to the shared workflow belongs to a change that owns it rather than riding along with a harness cell.
  • Branch name. The harness for this session assigns claude/octane-issue-66-phase-a-7wz97z, which the repository's own create-a-pr rules and .github/workflows/label-pr.yml cannot read as a type. The branch is test/lynx-stage-update-then-clear so the label bot works; flagging the deviation rather than hiding it.

Provenance

  • An agent produced this diff (agent-authored)

Generated by Claude Code

Huxpro and others added 2 commits August 31, 2026 15:56
`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
@Huxpro
Huxpro marked this pull request as ready for review August 31, 2026 19:11
@Huxpro
Huxpro merged commit 112a6a1 into new-lynx Aug 31, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant