Repository navigation
test(lynx): cover the target:'lynx' first screen end to end (#87) - #96
Merged
Merged
Conversation
The `lynx` vitest project compiles its fixtures with the background preset (`lynxRspeedyRenderers` -> `target: 'universal'`), so no committed test ever executed `target: 'lynx'` output, while the real Rspeedy main-thread bundle carries the L1 slot-kind table and create-function locals verbatim. L1 and L3 were each covered alone: the compile-output differential compares first-screen batches without reaching `host-driver.ts`, and the applier differential never saw a template-encoded plan. The pair production ships was uncovered (#87). One fixture, compiled at both targets, rendered, then applied through both the direct and staged appliers: four cells compared on physical tree and adoption snapshot. A premise guard asserts the fixture really does reach the create-function encoding and that the universal build does not, so the cells cannot quietly degrade into comparing `universal` with itself. #87 suggests a whole `lynx-target` vitest project over `packages/lynx/tests/**`. That does not work: the main-thread renderer carries `main-thread-render-only`, so the background suites would fail by design. The gap is the composition, and a test is the right size for it. Scope, stated honestly: this is a differential across encoding x applier. It catches divergence between cells — skipping native event installation in the direct applier turns it red — and not a regression that moves all four cells together, such as dropping the class patch in the shared `applyProps`. Absolute prop application stays pinned by the host-driver suite. The fixture also adds `@if`/`@else` to the covered shapes; the L1 fixture has only `@for`. `@try`/`@pending` through the template encoding stays open. The fake Element PAPI moves to `tests/_fixtures/` so both packages drive the same host emulation rather than duplicating it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
Huxpro
changed the base branch from
perf/lynx-template-local-naming
to
new-lynx
August 19, 2026 18:31
Huxpro
marked this pull request as ready for review
August 19, 2026 18:31
# Conflicts: # packages/lynx/tests/first-screen-direct.test.ts
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
lynxvitest project compiles its fixtures with the background preset(
lynxRspeedyRenderers→lynxRspeedyBackgroundRenderers→target: 'universal'), so no committed test has ever executedtarget: 'lynx'output — while the real Rspeedy main-thread bundle carries the L1 slot-kind
table and create-function locals verbatim.
L1 (#63) and L3 (#65) were each covered alone.
lynx-target-templates.test.tscompares compile output and first-screen batches and never reaches
host-driver.ts;first-screen-direct.test.tscompares the appliers and neversees a template-encoded plan. The pair production ships fell between them.
Reported as #87.
Changes
packages/octane/tests/lynx-target-first-screen.test.ts: one fixture,compiled at both targets, rendered, then applied through both appliers —
four cells over the same fake Element PAPI, compared on physical tree and
adoption snapshot.
packages/lynx/tests/_fixtures/fake-element-papi.ts: the fake Element PAPImoves out of
first-screen-direct.test.tsso both packages drive the samehost emulation instead of duplicating it. That suite is otherwise unchanged
and still passes (8/8).
It lives in
packages/octane/tests/because compiler-executing tests must(issue #66 §2 note 2: importing
compile.jsinside thelynxproject fails,the plugin tries to transform the compiler itself).
#87's suggested remedy does not work. It proposes a
lynx-targetvitestproject running
packages/lynx/tests/**with the main-thread renderers,mirroring
octane/octane-prod. ButlynxMainThreadRenderercarries themain-thread-render-onlycapability — the main renderer deliberately neverpublishes effects, refs, state ownership, or later updates
(
packages/lynx/README.md:98-103) — so recompiling the background suites underit would fail them by design, not find bugs. The uncovered thing is the
composition, and a test is the right size for it.
Validation
A premise guard runs first: the fixture must actually reach the create-function
encoding (
"kind": "template","slots", ann0local) and the universalbuild must not contain it. Without that, an eligibility regression would quietly
turn the four cells into
universalcompared with itself and the suite wouldstay green while proving nothing. It caught exactly that during development —
my first fixture put a component at the
@forbody root and never templated atall.
pnpm typecheckpnpm sync(no generated changes)pnpm format:fileson every changed pathpnpm vitest run --project octane --project octane-prod --project lynx—870 files / 12,806 tests passed
pnpm testrepo-wide (run at perf(lynx): classify host updates without building the prop patch (issue-66 A4) #92 and perf(compiler): name lynx create-function locals by depth (#86) #95; the only failures were thepre-existing browser cases established on the base commit)
No changeset: test-only.
Scope — what this does and does not catch
Stated plainly, because a differential is easy to over-read. It compares cells
against each other, so it catches divergence between encodings or between
appliers, and it does not catch a regression that moves all four cells together.
Measured, not assumed:
applyPropsdrops the class patchAbsolute prop application stays pinned by the host-driver suite. What this adds
is the composition #87 names, plus
@if/@elsecoverage — the L1 fixture hasonly
@for.Risk / follow-ups
@try/@pendingthrough the template encoding is still unexercised atruntime, which is the residual the completeness critic flagged and target 'lynx' and target 'universal' render different first screens when a prop value throws #70's
neighbourhood. This fixture does not reach it.
is the point — they were meant to agree — but it is worth knowing when reading
a failure in either.
@lynx-js/testing-environment(packages/lynx/src/testing.ts) exposes thevendored element tree and would be a stronger host than the fake. Using it
here would have meant a second, differently-shaped harness in the same
comparison; keeping one host across all four cells is what makes the cells
comparable. Worth revisiting if the fake ever diverges from the real one.
Provenance
agent-authored)Generated by Claude Code