Repository navigation
test(lynx): paint native lists and main-thread worklets at the lynx target - #134
Merged
Merged
Conversation
`applyLynxFirstScreenDirect` learned to build native lists in #66 C3, and every test of that work hands it a hand-authored plan object. None compiles a `.tsrx`, so the `<list>` the `target: 'lynx'` encoding produces had never been painted — the residual #87 left behind once its plain-view differential landed. It is reachable: with no `ref` in the tree the whole root plan lowers and the list element is built by `env.h("list")` inside the create function; one `ref` anywhere disqualifies the root while the rows keep lowering, which is the shape the gallery example ships. Both run through the same 2x2 of target by applier, comparing the painted tree, the adoption snapshot, the first-tree journal, the published row metadata, and a cell materialized through the platform's own `componentAtIndex`. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
`lynxTemplateEligible` refuses a bare `ref` binding and says nothing about a namespaced one, so `main-thread:ref` and a main-thread event lower into the create function — `p:main-thread:ref` is verbatim one of the slot kinds #87 read out of the real Rspeedy bundle's string table. Every committed test of that wiring hands the driver a hand-written `{_wvid}`/`{_wkltId}` descriptor, so the worklet the compiler emits had never been painted. The import rewrite in the harness now covers every `@octanejs/lynx` entry rather than the renderer alone, because a worklet module imports from three of them and the previous rule dropped the two it needed. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
The four-cell list differential read the capture journal through its private symbol and compared Map iteration order, so a behavior-preserving refactor of journal bookkeeping could fail cells that agree on everything a consumer can see. Row-level agreement is already carried by the published update-list-info, the adoption snapshot, and the cell the platform materializes — the axes the reuse-identifier ablation turned red. The worklet premise guard now pins the two slot-kind strings without pinning serializer layout. Co-Authored-By: Claude <[email protected]>
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
Closes the residual #87 left
behind. Its own differential —
packages/octane/tests/lynx-target-first-screen.test.ts,added when the issue was first worked — covers a
view/textfixture. Thenative
<list>path thatapplyLynxFirstScreenDirectgrew in #66 C3, and that#119–#126 extended, is not in it: every native-list test hands the applier a
hand-authored plan object, so the
<list>that thetarget: 'lynx'create-function encoding produces had never been painted.
That is #87's own thesis one layer further in — L1 and L3 each covered alone,
the pair production ships covered by nothing — on the newest and most intricate
first-screen code in the package.
A second commit closes the other encoding this pairing ships and nothing drives:
a
main-thread:prop.lynxTemplateEligiblerefuses a barerefbinding andsays nothing about a namespaced one, so
main-thread:refand a main-threadevent lower into the create function — and
p:main-thread:refis verbatim oneof the slot kinds #87 read out of the real Rspeedy
main.lynx.bundlestringtable. Every committed test of that wiring hands the driver a hand-written
{_wvid}/{_wkltId}descriptor, so the worklet the compiler actually emits hadnever been painted either.
Why the pairing is reachable, and how the fixtures were chosen
Checked against the compiler rather than assumed.
lynxTemplateEligiblelowersa whole plan root or none of it, and refuses any tree carrying a
ref:env.htypes in the lynx output<list>under a<view>, norefanywhereview,list,text,list-itemrefon the<list>list-item,textThe first is the case that has never run: the
<list>element is constructed byenv.h("list")inside a create function. The second is the shapeexamples/galleryships — onerefcosts the root its lowering while the rowskeep theirs — so one module runs both encodings over the same list. Both are
covered.
The
<text class="feed-footer">sibling after the<list>is deliberate, andmatches the reasoning already recorded in
first-screen-direct.test.ts: it isthe node that would expose a creation order the staged path does not produce,
because a list whose element were created after its subtree would hand this
sibling the lower unique ID.
Changes
packages/octane/tests/lynx-target-first-screen.test.ts: generalizes the twoexisting compile helpers to take a source and an export name, then adds a
describerunning each fixture through the 2×2 of target × applier. Each cellcompares the painted tree, the adoption snapshot, the first-tree journal
(
logicalNodesandlists), the publishedupdate-list-info, and a cellmaterialized by calling the platform's own
componentAtIndex. Cells arelabelled, so a failure names which arm diverged rather than which line did.
env.h("list")and that theuniversal output carries no template at all. Without it, a future eligibility
change would silently turn every cell into universal-vs-universal and the
suite would stay green for a reason that proves nothing.
describeruns the worklet fixture through the same 2×2. Its premiseguard pins the two slot-kind strings themselves — not merely that a template
exists — because a lowering that stopped emitting
p:main-thread:refwould bea different program than the one that ships.
@octanejs/lynxentry ratherthan the renderer alone: a worklet module imports from three of them, and the
previous rule dropped the two it needed.
three fixtures. This is coverage for a pairing that had none, which is what
No vitest project ever executes target: 'lynx' output at runtime — the L1 × L3 pair production ships has zero committed coverage #87 asks for; it is not a bug fix.
Validation
vitest run --project octane— 439 files, 6,804 tests, all passnew-lynxfb8426e95(which now carries test(bench): count who installs the nodes-ref selector during a recycle #128–test(bench): report which selector regime an FCP arm ran in #133) is inthis head;
vitest run --project lynxon it — 36 files, 480 tests, passpnpm sync— no generated changespnpm format:fileson the changed file — unchangedpnpm typecheck— ranpnpm typecheck:fileson the changed file. Itreports one error,
TS7016on the pre-existingimport { compile } from '../src/compiler/compile.js'at line 15. Thaterror is byte-identical on the unmodified committed file (verified by
restoring
HEAD's copy and re-running), so it is an artifact of scopedsingle-file checking, not of this diff. The added lines introduce no
type error.
pnpm test— not run against this branch. It was run on this containerat
new-lynx+ the nodes-ref stack shortly before: 21,096 passed, 4failed, all four already attributed as this container's persistent
failures in
#125's per-file attribution
(
octane-events-browsersuspense-hydration,drei-adapted-browserupstream-e2e,dropzoneprobes/hydration,rspeedy-pluginnative-demo). This diff touches one test file in a package whose wholeproject is run green above.
The oracles were verified red, three times
A differential that passes proves nothing until it is shown to fail, and this
one has a specific blind spot worth stating: it compares encodings, so any
change that affects both equally is invisible to it by construction. Both
ablations for the list therefore target the template path alone, in
TEMPLATE_ENV.p:item-keyturns both list tests red — but through a validatorthrow, which would happen even if the comparison were vacuous, so it only
proves the pipeline runs;
reuse-identifier, which no validator guards, turns them redthrough the comparison itself, and the diff shows substantive content on
every axis: the journal's per-row entries,
update-list-info's three{item-key, position, reuse-identifier}insertions, and the materializedcell. The label reports
lynx+stagedas the diverging arm.The worklet differential was verified the same way: dropping
main-thread:refin
TEMPLATE_ENV.pturns it red through the comparison, reportinglynx+stagedas the diverging cell. That test also asserts the wiring positively rather than
resting on cell agreement alone — four cells could agree on a tree that wired
nothing — so it pins the descriptor onto the node and checks that its capture is
the same ref cell the prop bound.
packages/lynx/src/main-renderer.tswas restored and the suite re-run green;none of the three ablations is part of this diff.
Risk / follow-ups
@catchremains uncovered here. It is deliberately left alone: target 'lynx' and target 'universal' render different first screens when a prop value throws #70 alreadycarries a committed red test for the arm-flip under a
@tryboundary, andits fix is blocked on a design decision — which evaluation order is canonical
— that a coverage PR should not pre-empt. Adding a fixture here would
duplicate that test without settling it.
main-thread:refand one main-thread event. Itdoes not exercise
runOnBackground, the call bridge, or a worklet on arecycled list cell.
lynx-targetvitest projectrunning
packages/lynx/tests/**— is still not taken. Thelynxproject'sother 36 files run only
target: 'universal'.change letting a nested host lower independently would widen the matrix, and
the premise guard is what would notice.
Provenance
agent-authored)