Skip to content

test(web): async-gen refetch oracle counts only answers the payload carried - #4446

Merged
ryansolid merged 10 commits into
nextfrom
claude/project-thread-bgafe5
Oct 30, 2026
Merged

ryansolid merged 10 commits into
nextfrom
claude/project-thread-bgafe5

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Follow-up to #4371: this narrows the hydration campaign's no-refetch oracle to the rule as worded. A first ask of a memo the server never streamed is not a refetch (#4313, #4414).

  • emit.ts: the emitted app calls ctx.id?.("m<i>") just before creating each memo.
  • hydrate.spec.tsx: the client half records each memo's hydration id (peekNextChildId(getOwner())). An ask counts as a refetch only when the shell or a chunk carries _$HY.r["<id>"]. This replaces the earlier "memos the tree reads" approximation.

Re-run on next (seed 3289, 400 cases): 251 of the 561 memos were served and are still checked. The one remaining finding (m2 asked after the root errored on the server, so m2 was never streamed) no longer counts as a refetch. Test-only change, 0 client bytes. The web typecheck passes.


Generated by Claude Code

… over async memos, with safety and liveness oracles

An opt-in campaign (ASYNC_GEN=1, pnpm async-gen) that generates small apps
(signals, sync and async memos with manual flights, latest()/isPending()
reads, Loading / Errored / Show / leaves with grouped or split attribute
effects) and scripts (writes, actions, settling flights in any order,
flush / microtask / task). Oracles: nothing throws or logs, no unhandled
rejection, no hole shows undefined/NaN, and once every flight has settled
the screen equals a fresh synchronous render of the final inputs. Survey,
shrink and minimize modes; the minimizer reduces the app as well as the
script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWKJDzwaZPgaGWE181b
…t Errored, store twin, flush mode, owned memos)

ASYNC_GEN_PAIRS=E1,E2,E2e,E3,E6,E7 runs each scenario a second time
rewritten without changing its meaning and compares the screens at every
settle point (after the first render, each task step and the end);
differences are grouped by what each side shows. Scenarios also choose
whether memos are created at module level or inside the root component.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWKJDzwaZPgaGWE181b
1,500 generated scenarios (seed 3289, ~15 s) run with the web suite; each
case's safety and liveness laws are compared to baseline.json. A case that
newly breaks a law fails the suite (a change broke a neighbouring shape);
a recorded failure that no longer reproduces is reported, and
ASYNC_GEN_UPDATE=1 records it. The baseline holds today's 20 failing cases
(#4362-#4367 shapes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWKJDzwaZPgaGWE181b
Each generated scenario is emitted as a TSX module, rendered through
renderToStream (server half), then hydrated chunk by chunk (client half).
Oracles: no refetch of a read memo before the first write, no
console.error or hydration warning, hydrated screen equals a fresh CSR
render, then the scenario's steps and final liveness. Opt-in via
ASYNC_GEN_HY=1 (pnpm async-gen:hydrate); minimize-hydration.mts reduces a
failing case through both halves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWKJDzwaZPgaGWE181b
ASYNC_GEN_RECORD on a reference build writes every case's screens, final
screen and broken laws; ASYNC_GEN_DIFF on a candidate build replays the
same seed and fails on any difference. Both the client campaign and the
hydration campaign take it: the gate for the reader-seat carve. Same-build
record/diff is clean (client 500 cases, hydration 300).

minimize-hydration.mts loads minimize.ts through a computed specifier so
tsc (no allowImportingTsExtensions) accepts it; runCase's return type
names screens/final.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWKJDzwaZPgaGWE181b
E8 re-creates the tree's readers in the flush that applies each write and
compares screens where nothing is in flight; E9 reads each latest(x) the
tree makes through a memo of it. Both from the carve audit's seat pairs.
First run (1,000 cases): #4377, #4378.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWKJDzwaZPgaGWE181b
…arried

A first ask of a memo the server never streamed is not a refetch (#4313,
#4414): the emitted app reports each memo's hydration id before creating
it, and the hydration campaign counts an ask only when the shell or a
chunk carries that id's answer. Re-run on next: the one remaining
hydration finding (m2 after an errored root) goes away; 251 of 561
memos are served and still checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWKJDzwaZPgaGWE181b
@changeset-bot

changeset-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6fe145b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown

Size (brotli, eager entry chunk)

scenario head vs base minified vs base minified vs recorded cap lazy chunks (not counted)
signals: core floor (createSignal/Memo/Effect/Root/flush) 7.42 KB 0 B 0 B +1 B 7.43 KB ✅
signals: + createStore 14.88 KB 0 B 0 B +1 B 14.96 KB ✅
signals: + isPending/latest 11.03 KB 0 B 0 B +1 B 11.05 KB ✅
signals: + until/refresh (truth readers, no optimism) 8.04 KB 0 B 0 B +1 B 8.06 KB ✅
app: render + one signal (the simple-app floor) 9.77 KB 0 B 0 B +1 B 9.79 KB ✅
app: hydrating (no stores) with Show/For/Loading/Errored/lazy 18.73 KB 0 B 0 B +19 B 18.72 KB ⚠️ over by 6 B, 1 B minified headroom lazy-page.js 0.04 KB
app: hydrating + every store primitive family 32.42 KB 0 B 0 B +19 B 32.42 KB ✅ lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.42 KB 0 B 0 B +1 B 13.43 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 15.19 KB 0 B 0 B +1 B 15.20 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 29.73 KB 0 B 0 B +1 B 29.79 KB ✅ lazy-page.js 0.04 KB
app: compiled floor (one template, one text hole, one delegated click) 9.96 KB 0 B 0 B +1 B 9.98 KB ✅
app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store) 26.26 KB 0 B 0 B +1 B 26.31 KB ✅ stats.js 0.18 KB
app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable) 32.42 KB 0 B 0 B +19 B 32.46 KB ✅ stats.js 0.20 KB
frames: eager client consumer (frames client + transport, lazy codec) 11.75 KB 0 B 0 B 0 B 11.77 KB ✅
page: base server components (hydrating + dynamic + frames + sf reference) 33.65 KB 0 B 0 B +19 B 33.68 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.03 KB, wire.js 3.47 KB
page: live server components (base + live/GET + action + isPending/latest) 38.73 KB 0 B 0 B +19 B 38.75 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.03 KB, wire.js 3.47 KB
page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread) 35.65 KB 0 B 0 B +19 B 35.72 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.06 KB, sc-comments.js 0.20 KB, trace.js 8.99 KB, wire.js 3.47 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 42.64 KB 0 B 0 B +19 B 42.65 KB ✅ eager (counted): web.js 22.75 KB; assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.07 KB, sc-comments.js 0.19 KB, trace.js 9.07 KB, wire.js 3.47 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 41.22 KB 0 B 0 B +19 B 41.16 KB ⚠️ over by 55 B, 1 B minified headroom assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, server.js 1.03 KB, serverForms.js 3.57 KB, trace.js 9.02 KB, wire.js 3.48 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 48.37 KB 0 B 0 B +19 B 48.31 KB ⚠️ over by 58 B, 1 B minified headroom eager (counted): client.js 27.95 KB; assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.30 KB, trace.js 9.00 KB, wire.js 3.49 KB
server: floor (getRequestEvent + isServer) 1.27 KB 0 B 0 B 0 B 1.29 KB ✅
server: renderToString (the server-render floor) 22.79 KB 0 B 0 B 0 B 22.80 KB ✅

⚠️ Over the brotli cap within the minified allowance (passes)

  • app: hydrating (no stores) with Show/For/Loading/Errored/lazy: over brotli cap by 6 B; minified 53,585 B vs 53,566 B recorded with the cap (+19 B) — 1 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate): over brotli cap by 55 B; minified 125,435 B vs 125,416 B recorded with the cap (+19 B) — 1 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate): over brotli cap by 58 B; minified 142,547 B vs 142,528 B recorded with the cap (+19 B) — 1 B of the 20 B minified allowance left; +0 B minified over this PR's base

Bundled with Rolldown (what Vite ships), brotli q11, decimal KB. A scenario fails only when it is over its brotli cap and its minified size is more than 20 B over the minified recorded with the cap; over the cap within that allowance is brotli layout noise and passes with a warning. Caps and their recorded minified in scripts/size/scenarios.js; the floor and page caps in floor-caps.json are frozen (lower only, or Size-Exception: in the PR body). npm run ratchet lowers caps per RC; it never raises one (scripts/size/README.md).

@coveralls

coveralls commented Oct 30, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 41025165683

Coverage remained the same at 78.1%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1362
Covered Lines: 1125
Line Coverage: 82.6%
Relevant Branches: 1090
Covered Branches: 790
Branch Coverage: 72.48%
Branches in Coverage %: Yes
Coverage Strength: 29.82 hits per line

💛 - Coveralls

@ryansolid
ryansolid merged commit 5add969 into next Oct 30, 2026
8 checks passed
@codspeed

codspeed Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 14.72%

2 warnings

⚠️ 3 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 199 untouched benchmarks
⏩ 5 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ projection derive: write one NESTED field (reference) 2.4 ms 2.1 ms +14.72%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/project-thread-bgafe5 (3873eec) with next (e56a4a0)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants