Skip to content

test(bench): count what the direct-emission floor touches (#103 U0 harness) - #104

Merged
Huxpro merged 3 commits into
new-lynxfrom
test/lynx-update-ceiling
Aug 20, 2026
Merged

Huxpro merged 3 commits into
new-lynxfrom
test/lynx-update-ceiling

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Harness groundwork for #103 U0 — the update-path ceiling measurement.
Stacked on #102; review the last commit only.

U0 asks for the architecture floor for updates, the way
benchmarks/lynx-table/prototype/ was the architecture floor for FCP. Most of
that cell already exists: prototype/app-service.js emits change-proportional
slot deltas for every mutation op and prototype/lepus-root.js applies them
through the real Element PAPI, and web/run-web.mjs already drives
--cells octane,octane-direct over create/update10th/select/updateStorm/
selectStorm behind a byte-identical page driver.

What was missing is the half the exit gate actually turns on. The gate is not a
wall clock: it is whether the reconcile-equivalent for select@10k returns to
the semantic floor instead of the 10,042 blueprints #66 Phase 3 measured. So the
direct cell now publishes three deterministic counters:

  • rowVisits — row regions a patch touches on the main thread.
  • writes — PAPI slot writes it performs.
  • rowScans — row entries the background program examines to service the
    update, kept separate because it measures the state lookup, not the tree walk.

web/run-web.mjs zeroes them immediately before each click and reads them when
that op's predicate resolves, so each op's counts cover that op alone. Cells that
do not define them report nothing and the section is omitted — the same rule the
harness already applies to a cell it cannot drive, which reports "not measured"
rather than a zero.

rowScans is where this cell is honestly worse than the core it models.
selectById finds its row by scanning a plain id array; a Block core holds the
row's block directly and would visit one. It is counted rather than optimised
away, so the floor is reported as measured. It is microseconds against tens of
milliseconds either way.

Counters are unconditional rather than build-flagged, so the measured bundle and
the counted bundle are the same one; a patch performs O(change) increments.
Spread across reps prints beside every count, because a non-zero spread means the
number is not the invariant it is being quoted as.

No measurement is reported here. The U0 run itself, and its GO/NO-GO verdict, go
on #103.

Validation

  • pnpm format:files:check over every changed path
  • pnpm typecheck — pending
  • pnpm test — pending; these files are benchmark harness and are not in any
    vitest.config.js project
  • targeted tests: prototype/smoke.mjs functional parity, pending

Risk / follow-ups

  • The counters add O(change) integer increments to the measured cell. Stated
    rather than hidden: the alternative is a build flag, which would mean the
    counted bundle and the measured bundle are different bundles.
  • The prior same-window session (prototype/results/web-l0-session.md,
    2026-08-18, different host) has updateStorm@10k at octane 539 ms against
    direct 572 ms — the floor losing at the flush/layout floor. U0's verdict has
    to be per-cell for that reason, and updateStorm is already excluded from the
    drain claim by Execution plan (#58): complete L2, then drive L4→L6 — full context handoff #66 Phase 2 (77.3% presentation residual).

Provenance

  • An agent produced this diff (agent-authored)

Generated by Claude Code

#103 U0 needs the architecture floor stated as a deterministic count, not only
as a wall clock: the exit gate is whether the reconcile-equivalent for
`select@10k` returns to the semantic floor rather than 10,042.

The octane-direct cell now publishes three counters, read by the web harness
from whichever realm defines them and summarised per operation:

- `rowVisits` — row regions a patch touches on the main thread.
- `writes` — PAPI slot writes it performs.
- `rowScans` — row entries the background program examines to service the
  update, counted separately because it measures the state lookup rather than
  the tree walk.

`rowScans` is where this cell is honestly worse than the core it models:
`selectById` finds a row by scanning a plain id array, where a Block core holds
the row's block directly. Counting it rather than optimising it away keeps the
floor reported as measured; it is microseconds against tens of milliseconds
either way.

Counters are unconditional rather than build-flagged, so the measured bundle and
the counted bundle are the same one. A patch performs O(change) increments.
Cells that do not define them report nothing and the report omits the section,
the same way a cell that cannot be driven reports "not measured" rather than a
zero. Spread across reps is printed beside every count, because a non-zero
spread means the number is not the invariant it is being quoted as.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
claude added 2 commits August 20, 2026 02:54
…ount

The unified web harness ran every repetition of one cell before starting the
next, so any host drift across the run landed entirely on whichever cell went
second. That is the error a same-window comparison exists to avoid, and #103 U0
reads its verdict off exactly that comparison. Repetitions now interleave
AB / BA / AB / ... and the report records one-minute/five/fifteen load at both
ends of the window, so a reader can judge how quiet it was. Unlike the stage
harness this one records rather than gates, because it also feeds the
cross-framework chart.

The direct cell's background counter conflated two different questions.
`rowScans` counts what the stub actually touched, and its `selectById` finds a
row by scanning a plain id array, so it reports up to 2n for a two-row change.
A keyed core holds the block directly: `ForSlot.items` is a `Map<key, Block>`.
`blockLookups` counts that instead and is reported beside `rowScans`, never in
place of it, so the architecture claim and the fixture measurement stay
separable.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
The direct-emission cell against the current path over the mutation ops, at
1,000 and 10,000 rows, on a quiet host with the cells interleaved AB/BA.

The count the gate is written against: `select@10k` reconciles 10,042 child
blueprints on the current path against 1 keyed block lookup on the floor, and
`update10th@10k` 11,041 against 1,000. Spread 0 in every cell, as a
deterministic count must be.

The milliseconds separate only where presentation is a minority of the wall —
`create` and `update10th@10k` have disjoint min-max ranges at 0.75x and 0.59x,
`select@1k` at 0.54x — and do not separate in the storm cells, which are 78%
presentation. `updateStorm@10k` has the floor's median on the wrong side with
5x the spread; that stays on the record as an open gate rather than being
averaged away.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
@Huxpro
Huxpro changed the base branch from perf/lynx-bg-replay-attribution to new-lynx August 20, 2026 17:56
@Huxpro
Huxpro marked this pull request as ready for review August 20, 2026 17:56
@Huxpro
Huxpro merged commit f34f620 into new-lynx Aug 20, 2026
1 of 2 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.

2 participants