Skip to content

perf(bench): run #246 §7's falsification ablation on the MTS descriptor walk - #263

Merged
Huxpro merged 2 commits into
new-lynxfrom
perf/e1-descriptor-walk-ablation
Aug 31, 2026
Merged

Huxpro merged 2 commits into
new-lynxfrom
perf/e1-descriptor-walk-ablation

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 31, 2026 •

Copy link
Copy Markdown
Owner

Summary

#246 §7 names the test that gets to kill E1 before it is built:

an ablation that stubs the MTS descriptor walk out of a steady-state create and shows the create cell unmoved. That is cheaper than the ABI work and should run first. If the walk is not where the time is, E1 does not deserve the byte-identity promise it spends.

This is that ablation. The create cell does not move. The verdict and its consequence for #246 are posted on the issue; this PR carries the instrument, the evidence, and the procedure.

Two arms bracket the answer. Both patch packages/lynx/src/core/host-driver.ts on disk for exactly one rspeedy build and restore it afterwards, the same build-time source-patching shape stages/instrument-source.mjs uses:

arm tag removes keeps
conservative e1abl the descriptor walk, resolved once per node ahead of the row loop applyProps for nodes the fast slots cannot describe
aggressive e1abl2 the walk and the constant creation patches, so applyProps is never reached nothing

The aggressive arm carries a fallbackProps counter and so reports its own coverage rather than asserting it. In the browser at 1,000 rows it reads denseRuns 1, denseRows 1000, denseHosts 6000, slowRuns 0, ablatedRuns 1, fallbackProps 0 — the walk is fully gone — with the paint oracle still passing (1,000 rows, both boundary labels, classCount 1000).

Two fairness constraints on the stub

Work-preserving at the host boundary. §7 is explicit that E1 does not reduce host calls; what it removes is interpretation. A stub that also removed host calls would inflate the delta and wrongly greenlight E1. Verified: 19,001 calls at 1,000 rows and 190,001 at 10,000, identical between control and ablation in both windows, with the harness's own counts agree across builds column green for every cell.

At least as generous as E1. The falsifier is decisive in only one direction, so the arm resolves the descriptor tables once per node into flat slots and issues host calls straight from them — strictly more than E1 buys, since E1 still has to address a node before acting on it.

Result

Control cell octane-mts-program, ablation cell octane-mts-program-control, un-probed control build, create window:

arm reps scale control ablation delta perm p 95% CI
1 e1abl 5 1,000 138.9 137.6 −0.90% 0.762 [−6.2%, +4.0%]
1 e1abl 5 10,000 1141.5 1130.1 −1.59% 0.516 [−5.7%, +2.4%]
2 e1abl2 11 1,000 137.2 139.4 +2.73% 0.290 [−1.6%, +7.6%]
2 e1abl2 11 10,000 1127.1 1127.3 −0.20% 0.932 [−4.4%, +4.0%]

Medians in ms; delta, p and CI on the means.

The trap this would otherwise have fallen into

The instrumented builds show a win the un-probed control build does not, and it grows with probe weight — at 10,000 rows, −0.20% (p=0.932) in control, −2.37% (p=0.084) in counts, −4.83% (p=0.002) in timed. Work the arm removes is a fixed quantity and cannot know how heavily the probe is instrumenting, so a delta that scales with the probe is coupled to the probe.

The per-stage split settles it. Of the aggressive arm's −51.9 ms median in the timed build at 10,000 rows, −18.7 ms lands inside the papi_* host buckets and −6.4 ms in start_delay — buckets that time identical calls with identical arguments, which this arm provably cannot change. Only −17.3 ms lands in off_boundary, the one bucket the walk lives in, against an off_boundary spread of 91.2 ms. At 1,000 rows the same decomposition runs the other way (+5.6 ms inside the host buckets, −2.8 ms in off_boundary).

Movement that is not localized to the bucket the removed code occupies, and that flips sign between scales, is drift. docs/measurement/e1-descriptor-walk-ablation.md records this so the next reader does not report the timed number.

Validation

  • pnpm sync — clean, no generated changes
  • pnpm format:files:check on the three authored files — all pass
  • pnpm format:check
  • pnpm typecheck
  • pnpm test
  • targeted: both patch modes plus control applied against a pristine new-lynx checkout and restored to a clean tree (git status empty after each), confirming the anchors bind to the base branch and not just to the head they were written on
  • targeted: the two arms differ by exactly one line (if (false && wantsProps) vs if (true && wantsProps)), and fallbackProps appears in the aggressive bundle only
  • targeted: browser census + paint oracle on the aggressive arm, quoted above

pnpm typecheck and pnpm test are not meaningful gates for this diff: it adds two benchmarks/ scripts, one doc, and recorded JSON, and benchmarks/ is in no vitest.config.js project, so no test project reaches these files. The measurement evidence above is the validation that matters, and every number in it comes from a same-window A/B.

Second commit, and it touches no evidence. 860a07dc5 hardens e1-ablation-build.mjs's argument parsing: --scales mapped to Number before filter(Boolean), so a typo'd entry became NaN and was dropped silently and a negative one passed, either way yielding a partial arm whose missing bundle only surfaced as a mid-campaign 404. It now parses before filtering and refuses anything that is not a positive safe integer. Build-time input validation only — every number in this PR was produced by the parser as it stood, and none of them move.

Risk / follow-ups

  • The source patch binds to textual anchors in host-driver.ts. It throws on a missed anchor rather than silently producing an unablated arm, and it is verified against new-lynx above, but a reflow of the dense apply loop will need the anchors re-fitted.
  • The harness's --control-dist <tag> routes dist-mtsprogram into the cell named octane-mts-program-control, so that cell holds the ablation and octane-mts-program is the control. Confusing, pre-existing, and now documented rather than renamed — renaming is a change to the shared harness and does not belong in a measurement PR.
  • Reproducing this needs fix(bench): read a button label from the carrier the text fold left it on #261, which repairs the lynx-table harness that perf(lynx): fold a compile-time-known text child onto its text host #250's text fold broke. Both target new-lynx; this branch is not stacked on it.
  • Resolution, stated rather than hidden: these windows bound the walk's share of the create cell at under about 4% at 95% (10,000 rows, 11 reps), with a point estimate of 0.2%. They do not resolve a 1% effect, and the write-up does not claim to.
  • CI is no longer wedged, and this line previously said it was. The runner pool recovered when ci: fall back to GitHub-hosted runners while the Blacksmith pool is stalled #260 merged its GitHub-hosted fallback at 14:12Z. On this head the draft-skipped set is green (typecheck, lint, apply labels); every heavy job reports skipped, which is what ci.yml does for a draft, not a failure. Nothing has yet run the heavy suite against this diff.

Provenance

  • An agent produced this diff (agent-authored)

Generated by Claude Code

…or walk

#246 §7 names the test that gets to kill E1 before it is built: stub the MTS
descriptor walk out of a steady-state create, and if the create cell does not
move, E1 does not deserve the byte-identity promise it spends.

This is that ablation, in two arms that bracket the answer. Both patch
host-driver.ts on disk for one rspeedy build and restore it afterwards, the
same shape stages/instrument-source.mjs uses. The conservative arm resolves the
per-node descriptor tables once ahead of the row loop; the aggressive arm also
hoists the constant creation patches so applyProps is never reached, and
carries a fallbackProps counter so it reports its own coverage instead of
asserting it.

The stub is work-preserving at the host boundary, because §7 is explicit that
E1 does not reduce host calls: 19,001 at 1,000 rows and 190,001 at 10,000,
identical between control and ablation in both windows, with the harness's own
counts-agree column green for every cell.

The create cell does not move. In the un-probed control build the aggressive
arm reads -0.20% at 10,000 rows (p=0.932) and +2.73% at 1,000 (p=0.290); the
conservative arm reads -1.59% and -0.90%. The instrumented builds show a delta
that grows with probe weight and lands mostly inside host buckets this arm
cannot causally change, which the doc records as the trap that would otherwise
hand you a false positive.

docs/measurement/e1-descriptor-walk-ablation.md carries the procedure, the two
fairness constraints on the stub, the cell-naming trap in --control-dist, and
the recorded result.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
A typo'd scale was dropped by filter(Boolean) and a negative one passed
it, so the build produced a partial arm whose missing bundle surfaced
only as a mid-campaign 404 — the exact failure this file's own header
warns about. Parses before filtering so a NaN entry is seen and refused
rather than silently dropped (--scales 1000,10k now throws instead of
building only the 1000-row bundle).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YHfFsy9CLaRovTFH8pTGyY
@Huxpro
Huxpro force-pushed the perf/e1-descriptor-walk-ablation branch from fdb7fb4 to 860a07d Compare August 31, 2026 19:05
@Huxpro
Huxpro marked this pull request as ready for review August 31, 2026 19:10
@Huxpro
Huxpro merged commit 51e4a47 into new-lynx Aug 31, 2026
19 of 20 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