Repository navigation
test(bench): count who installs the nodes-ref selector during a recycle - #128
Merged
Merged
Conversation
The per-recycle measurement said the residual over the slot-write floor is setRefSelector, two calls per element node. It could not say who makes them, because it left the container's onAttachments unwired. Production does not. A recycle emits an attachment delta per node of the outgoing cell and per node of the incoming one, and the main thread filters that batch by asking the host driver for each host's public instance. That call installs the node's nodes-ref selector as a side effect, so the predicate is an install site rather than a read, and a benchmark without it measures a recycle in a shape the product never runs. Wire it, and report two axes: the deltas the predicate examined and the Element PAPI writes it performed, counted inside the existing write total rather than added to it. Every pre-existing number is unchanged — 6 writes on the narrow row and 15 on the wide one, 3.00x and 5.00x against the floor — because the selectors are already installed by the time the predicate runs. That zero is the finding. Installing selectors on demand at the create and rebind paths alone does not remove the residual; it relocates the same calls into this column, because the predicate reinstalls what the enqueue cleared. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
This was referenced Aug 21, 2026
…nodes-ref-selector # Conflicts: # benchmarks/lynx-list/workload.ts
Huxpro
marked this pull request as ready for review
August 21, 2026 22:17
This was referenced Aug 21, 2026
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 per-recycle measurement on #119 named the residual over the slot-write floor —
setRefSelector, two calls per element node — but could not say who makesthose calls, because the benchmark left the container's
onAttachmentsunwired.Production does not leave it unwired. One recycle emits an attachment delta per
node of the outgoing cell and per node of the incoming one, and
main-thread.tsfilters that batch by asking the host driver for each host's public instance and
comparing generations.
getPublicInstanceinstalls the node'snodes-refselector as a side effect, so that predicate is an install site, not a read.
This wires it and reports two axes per recycle: the deltas the predicate
examined, and the Element PAPI writes it performed — counted inside the
existing write total rather than added to it.
list-item > text > #textEvery pre-existing number is unchanged: 6 writes / 4 nodes on the narrow row,
15 / 9 on the wide one, 3.00x and 5.00x against the slot-write floor. The ratio
guards on
reuse_writesandwide_reuse_writesstill pass at their committedceilings.
Why the zero is the point
The obvious reading of #119's residual is "install the selector on demand instead
of eagerly". A local ablation says that buys nothing, because the predicate
reinstalls what the enqueue cleared:
createPhysicalTree/rebindPhysicalTreeThe middle two arms relocate the same
setRefSelectorcalls into the new columninstead of removing them. Only the last arm reaches the floor, and it is not a
local change: the background builds a
nodes-refselector string on first querywithout ever asking the main thread to install one, so removing the incidental
install sites requires the protocol to state who installs and when. That decision
is recorded on #103; this PR only makes the cost of each option measurable.
The ablation ran as a temporary local patch and is not part of this diff —
packages/lynx/src/core/host-driver.tsis untouched here.Validation
node benchmarks/lynx-list/run.mjs 1and2— counts identicalacross repetitions, no reported failures
node benchmarks/bench.mjs --quick --ratios lynx-list—3/3 applicable guards pass, none breached
pnpm format:fileson all three changed filespnpm sync— no generated changespnpm typecheck—benchmarks/is in no tsconfig project(
pnpm typecheck:filesreports "No TypeScript project includes"). Checkedinstead with a standalone strict
tsc --noEmitoverworkload.ts: the twoerrors it reports are byte-identical to the ones the pre-change file
produces, both in the intentionally partial fake PAPI. The change adds none.
pnpm test— not run; this diff touches onlybenchmarks/lynx-list/Risk / follow-ups
rather than importing it, because
deliverHostAttachmentsis internal tomain-thread.ts. If that predicate changes shape, this replay must follow.It throws rather than skipping when its container is unbound, so a delta it
cannot count is a failure instead of a silently lower number.
main-thread.tspublishes a handle for everyupdatecommand in a commit, andresolves first-screen native event targets, both through the same
side-effecting
getPublicInstance. Any demand-install design has to accountfor them too.
Provenance
agent-authored)Generated by Claude Code