Skip to content

test(lynx): paint native lists and main-thread worklets at the lynx target - #134

Merged
Huxpro merged 4 commits into
new-lynxfrom
test/lynx-target-native-list
Aug 22, 2026
Merged

Huxpro merged 4 commits into
new-lynxfrom
test/lynx-target-native-list

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 21, 2026 •

Copy link
Copy Markdown
Owner

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/text fixture. The
native <list> path that applyLynxFirstScreenDirect grew 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 the target: '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. 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 — and p:main-thread:ref is verbatim one
of the slot kinds #87 read out of the real Rspeedy main.lynx.bundle string
table. Every committed test of that wiring hands the driver a hand-written
{_wvid}/{_wkltId} descriptor, so the worklet the compiler actually emits had
never been painted either.

Why the pairing is reachable, and how the fixtures were chosen

Checked against the compiler rather than assumed. lynxTemplateEligible lowers
a whole plan root or none of it, and refuses any tree carrying a ref:

fixture what lowers env.h types in the lynx output
<list> under a <view>, no ref anywhere root plan and rows view, list, text, list-item
same, ref on the <list> rows only; root stays a plan list-item, text

The first is the case that has never run: the <list> element is constructed by
env.h("list") inside a create function. The second is the shape
examples/gallery ships — one ref costs the root its lowering while the rows
keep 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, and
matches the reasoning already recorded in first-screen-direct.test.ts: it is
the 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 two
    existing compile helpers to take a source and an export name, then adds a
    describe running each fixture through the 2×2 of target × applier. Each cell
    compares the painted tree, the adoption snapshot, the first-tree journal
    (logicalNodes and lists), the published update-list-info, and a cell
    materialized by calling the platform's own componentAtIndex. Cells are
    labelled, so a failure names which arm diverged rather than which line did.
  • A premise guard asserts the list actually reaches env.h("list") and that the
    universal 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.
  • A third describe runs the worklet fixture through the same 2×2. Its premise
    guard pins the two slot-kind strings themselves — not merely that a template
    exists — because a lowering that stopped emitting p:main-thread:ref would be
    a different program than the one that ships.
  • The harness's import rewrite now covers every @octanejs/lynx entry rather
    than the renderer alone: a worklet module imports from three of them, and the
    previous rule dropped the two it needed.
  • No production code changed. No defect found — every cell agrees on all
    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

  • targeted: the new file — 7 passed (2 pre-existing, 5 new)
  • targeted: vitest run --project octane — 439 files, 6,804 tests, all pass
  • base merged: new-lynx fb8426e95 (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 in
    this head; vitest run --project lynx on it — 36 files, 480 tests, pass
  • pnpm sync — no generated changes
  • pnpm format:files on the changed file — unchanged
  • pnpm typecheck — ran pnpm typecheck:files on the changed file. It
    reports one error, TS7016 on the pre-existing
    import { compile } from '../src/compiler/compile.js' at line 15. That
    error is byte-identical on the unmodified committed file (verified by
    restoring HEAD's copy and re-running), so it is an artifact of scoped
    single-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 container
    at new-lynx + the nodes-ref stack shortly before: 21,096 passed, 4
    failed, all four already attributed as this container's persistent
    failures in
    #125's per-file attribution
    (octane-events-browser suspense-hydration, drei-adapted-browser
    upstream-e2e, dropzone probes/hydration, rspeedy-plugin
    native-demo). This diff touches one test file in a package whose whole
    project 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:

  • dropping item-key turns both list tests red — but through a validator
    throw, which would happen even if the comparison were vacuous, so it only
    proves the pipeline runs;
  • dropping reuse-identifier, which no validator guards, turns them red
    through 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 materialized
    cell. The label reports lynx+staged as the diverging arm.

The worklet differential was verified the same way: dropping main-thread:ref
in TEMPLATE_ENV.p turns it red through the comparison, reporting lynx+staged
as 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.ts was restored and the suite re-run green;
none of the three ablations is part of this diff.

Risk / follow-ups

Provenance

  • An agent produced this diff (agent-authored)

`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
claude added 2 commits August 21, 2026 22:22
`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
@Huxpro Huxpro changed the title test(lynx): drive a native &lt;list&gt; through the create-function encoding test(lynx): paint native lists and main-thread worklets at the lynx target Aug 21, 2026
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]>
@Huxpro
Huxpro marked this pull request as ready for review August 22, 2026 05:28
@Huxpro
Huxpro merged commit 83d485e into new-lynx Aug 22, 2026
18 of 19 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