Skip to content

[next] Fix dev HMR dropping edits that race a full rediscovery rebuild - #3529

Merged
alangenfeld merged 1 commit into
mainfrom
alangenfeld/dev-hmr-full-rebuild-race
Aug 14, 2026
Merged

[next] Fix dev HMR dropping edits that race a full rediscovery rebuild#3529
alangenfeld merged 1 commit into
mainfrom
alangenfeld/dev-hmr-full-rebuild-race

Conversation

@alangenfeld

@alangenfeldalangenfeld commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary & Motivation

A full rebuild reads sources twice — once when the bundler consumes them, once when the classifier baseline is refreshed from disk afterwards — so an edit landing in between was absorbed into the baseline without being built, and its queued watcher event classified as a no-op. pinBaselinesAcrossFullRebuild pins baselines across the rebuild instead: pre-build values for files present in both maps, and the snapshots classifyRebuild read for the files that triggered the rebuild, so routine duplicate watcher events still diff equal rather than cascading into another full rebuild.

This is the largest ongoing CI flake — the nextjs-webpack local-dev e2e HMR fuzz test writes a step definition right after triggering a rediscovery and times out at 300s when the write lands mid-rebuild (~60 attempt-1 job failures in 10 days). For files the in-flight rebuild discovered for the first time this narrows a create-then-edit race rather than closing it; the initial-build startup window has the same shape and is out of scope, documented at the call site.

Test Plan

Unit tests cover the absorb race and the duplicate-event no-op; the previously-flaky HMR fuzz e2e passed 3/3 locally against nextjs-webpack where main reproduced the manifest drop, and a mid-rediscovery edit rig went from 2/6 dropped on base to 0/6.

@changeset-bot

changeset-botBot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 098a15a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
NameType
@workflow/nextPatch
workflowPatch
@workflow/world-testingPatch
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/webPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

Not sure what this means? Click here to learn what changesets are.

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

@vercel

vercelBot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreviewAug 14, 2026 10:14pm
example-nextjs-workflow-webpackReadyReadyPreviewAug 14, 2026 10:14pm
example-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-astro-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-express-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-fastify-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-hono-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-nestjs-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-nitro-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-nuxt-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-python-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-sveltekit-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-tanstack-start-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workbench-vite-workflowReadyReadyPreviewAug 14, 2026 10:14pm
workflow-docsReadyReadyPreview, v0Aug 14, 2026 10:14pm
workflow-swc-playgroundReadyReadyPreviewAug 14, 2026 10:14pm
workflow-tarballsReadyReadyPreviewAug 14, 2026 10:14pm
workflow-webReadyReadyPreviewAug 14, 2026 10:14pm

@github-actions

github-actionsBot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

⚠️ Flaky E2E Tests (passed on retry)

These tests failed at least once and passed on a retry. A recurring entry here is a real race worth investigating.

  • addTenWorkflow via pages router (nextjs-webpack)

🛠 Infra Events (absorbed by the harness)

Platform anomalies the e2e harness detected and worked around (e.g. a run the queue never picked up, replaced by a fresh run). Clustered timestamps indicate a backend blip; a steady drip indicates a platform issue worth escalating.

  • run-pickup-stall · addTenWorkflow (tanstack-start) · at 22:18:45Z · abandoned wrun_01M015NWT9RZRDSKQRFT27DRWS

E2E Test Summary

Summary
PassedFailedSkippedTotal
✅ ▲ Vercel Production347407384212
✅ 💻 Local Development381005584368
✅ 📦 Local Production381005584368
✅ 🐘 Local Postgres381005584368
✅ 🪟 Windows31200312
✅ 🌐 Cross-language Conformance90128137
✅ vercel-multi-region270027
Total152520254017792
Details by Category

✅ ▲ Vercel Production

AppPassedFailedSkipped
✅ astro-node128028
✅ astro-quickjs128028
✅ example-node128028
✅ example-quickjs128028
✅ express-node128028
✅ express-quickjs128028
✅ fastify-node128028
✅ fastify-quickjs128028
✅ hono-node128028
✅ hono-quickjs128028
✅ nest-node128028
✅ nest-quickjs128028
✅ nextjs-turbopack-node15303
✅ nextjs-turbopack-quickjs15303
✅ nextjs-webpack-node15303
✅ nextjs-webpack-quickjs15303
✅ nitro-node128028
✅ nitro-quickjs128028
✅ nuxt-node128028
✅ nuxt-quickjs128028
✅ python-node80148
✅ sveltekit-node14709
✅ sveltekit-quickjs14709
✅ tanstack-start-node128028
✅ tanstack-start-quickjs128028
✅ vite-node128028
✅ vite-quickjs128028

✅ 💻 Local Development

AppPassedFailedSkipped
✅ astro-stable-node130026
✅ astro-stable-quickjs130026
✅ express-stable-node130026
✅ express-stable-quickjs130026
✅ fastify-stable-node130026
✅ fastify-stable-quickjs130026
✅ hono-stable-node130026
✅ hono-stable-quickjs130026
✅ nest-stable-node130026
✅ nest-stable-quickjs130026
✅ nextjs-turbopack-canary-node137019
✅ nextjs-turbopack-canary-quickjs137019
✅ nextjs-turbopack-stable-node15600
✅ nextjs-turbopack-stable-quickjs15600
✅ nextjs-webpack-canary-node137019
✅ nextjs-webpack-canary-quickjs137019
✅ nextjs-webpack-stable-node15600
✅ nextjs-webpack-stable-quickjs15600
✅ nitro-stable-node130026
✅ nitro-stable-quickjs130026
✅ nuxt-stable-node130026
✅ nuxt-stable-quickjs130026
✅ sveltekit-stable-node14907
✅ sveltekit-stable-quickjs14907
✅ tanstack-start-node130026
✅ tanstack-start-quickjs130026
✅ vite-stable-node130026
✅ vite-stable-quickjs130026

✅ 📦 Local Production

AppPassedFailedSkipped
✅ astro-stable-node130026
✅ astro-stable-quickjs130026
✅ express-stable-node130026
✅ express-stable-quickjs130026
✅ fastify-stable-node130026
✅ fastify-stable-quickjs130026
✅ hono-stable-node130026
✅ hono-stable-quickjs130026
✅ nest-stable-node130026
✅ nest-stable-quickjs130026
✅ nextjs-turbopack-canary-node137019
✅ nextjs-turbopack-canary-quickjs137019
✅ nextjs-turbopack-stable-node15600
✅ nextjs-turbopack-stable-quickjs15600
✅ nextjs-webpack-canary-node137019
✅ nextjs-webpack-canary-quickjs137019
✅ nextjs-webpack-stable-node15600
✅ nextjs-webpack-stable-quickjs15600
✅ nitro-stable-node130026
✅ nitro-stable-quickjs130026
✅ nuxt-stable-node130026
✅ nuxt-stable-quickjs130026
✅ sveltekit-stable-node14907
✅ sveltekit-stable-quickjs14907
✅ tanstack-start-node130026
✅ tanstack-start-quickjs130026
✅ vite-stable-node130026
✅ vite-stable-quickjs130026

✅ 🐘 Local Postgres

AppPassedFailedSkipped
✅ astro-stable-node130026
✅ astro-stable-quickjs130026
✅ express-stable-node130026
✅ express-stable-quickjs130026
✅ fastify-stable-node130026
✅ fastify-stable-quickjs130026
✅ hono-stable-node130026
✅ hono-stable-quickjs130026
✅ nest-stable-node130026
✅ nest-stable-quickjs130026
✅ nextjs-turbopack-canary-node137019
✅ nextjs-turbopack-canary-quickjs137019
✅ nextjs-turbopack-stable-node15600
✅ nextjs-turbopack-stable-quickjs15600
✅ nextjs-webpack-canary-node137019
✅ nextjs-webpack-canary-quickjs137019
✅ nextjs-webpack-stable-node15600
✅ nextjs-webpack-stable-quickjs15600
✅ nitro-stable-node130026
✅ nitro-stable-quickjs130026
✅ nuxt-stable-node130026
✅ nuxt-stable-quickjs130026
✅ sveltekit-stable-node14907
✅ sveltekit-stable-quickjs14907
✅ tanstack-start-node130026
✅ tanstack-start-quickjs130026
✅ vite-stable-node130026
✅ vite-stable-quickjs130026

✅ 🪟 Windows

AppPassedFailedSkipped
✅ nextjs-turbopack-node15600
✅ nextjs-turbopack-quickjs15600

✅ 🌐 Cross-language Conformance

AppPassedFailedSkipped
✅ python90128

✅ vercel-multi-region

AppPassedFailedSkipped
✅ nextjs-turbopack2700

📋 View full workflow run

@github-actions

github-actionsBot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit 098a15a · Fri, 14 Aug 2026 22:32:30 GMT · run logs

Backend: vercel · app: nextjs-turbopack

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep1361 (+482%) 🔻1461 🔴 (+28%) 🔻1490 🔴 (+25%) 🔻1539 🔴 (-14%)30
TTFSstream468 (+104%) 🔻1441 🔴 (+33%) 🔻1482 🔴 (+29%) 🔻1521 🔴 (±0%)30
TTFShook + stream1413 (+246%) 🔻1823 🔴 (+33%) 🔻2045 🔴 (+46%) 🔻2247 🔴 (+45%) 🔻30
Fan-out TTFSPromise.all(100 steps)9225 (-1.9%)10636 (+1.9%)10713 (-5.9%)15084 (-59%) 💚10
Fan-out TTLSPromise.all(100 steps)17981 (-5.8%)19813 (-12%)19865 (-14%)24745 (-46%) 💚10
STSO1020 steps (inline)103 (-28%) 💚153 (-69%) 💚178 (-67%) 💚346 (-51%) 💚1019
WO1020 steps150356 (-66%) 💚150356 (-66%) 💚150356 (-66%) 💚150356 (-66%) 💚1
CRTTfirst chunk (pooled)101 (-3.8%)156 (-20%) 💚379 (-56%) 💚426 (-52%) 💚28

Streams

Scenariowr c/srd c/swr KiB/srd KiB/sCRTT 1stp75p90p99CDV maxiters
paced control (100/s, 60B)100 (±0%)101 (±0%)5 (±0%)5.1 (±0%)138 (-14%)159 (-37%)237 (-32%)404 (-57%)131 (-30%)10
size sweep (100/s, 160B-12KB)100 (±0%)100 (+3%)334 (±0%)335 (+3%)125 (+2%)162 (-58%)266 (-57%)446 (-53%)138 (-62%)10
replay gateway-gpt-5.4-nano-2000t (1x)89.2 (±0%)89.3 (±0%)16.2 (±0%)16.2 (±0%)123 (-2%)156 (-5%)262 (+1%)602 (-32%)376 (-47%)3
replay eve-gpt-5.6-sol-2000t (1x)54.7 (±0%)54.7 (±0%)355 (±0%)355 (±0%)152 (+10%)134 (-23%)174 (-23%)344 (-5%)429 (+26%)2
replay eve-gpt-5.6-sol-2000t (2x)109 (±0%)112 (+2%)710 (±0%)724 (+2%)278 (+35%)333 (-1%)1020 (+90%)1558 (+92%)730 (+93%)3
📈 STSO distribution vs main (inline / queue-hop histograms)

1020 steps (inline)

Cumulative STSO time: main 440013ms → this run 150170ms (Δ -289843ms, -66%)

 100-150 ms █░░░░░░░░░░░░░░░░░░░░░░┃ main 1 this 723 +722
150-200 ms █░░░░░░┃ main 33 this 235 +202
200-250 ms ┃ main 15 this 35 +20
250-300 ms ┃█ main 49 this 11 -38
300-350 ms ┃███ main 129 this 5 -124
350-400 ms ┃██ main 90 this 7 -83
400-450 ms ┃███████ main 227 this 0 -227
450-500 ms ┃████████ main 260 this 1 -259
500-550 ms ┃███ main 128 this 2 -126
550-600 ms ┃ main 43 this 0 -43
600-650 ms ┃ main 18 this 0 -18
650-700 ms ┃ main 11 this 0 -11
700-750 ms ┃ main 6 this 0 -6
750-800 ms ┃ main 2 this 0 -2
800-850 ms ┃ main 3 this 0 -3
850-900 ms ┃ main 2 this 0 -2
950-1000 ms ┃ main 1 this 0 -1
📈 CRTT drill-down vs main (RTT distributions & profiles)
variant RTT 1ms→5s+ avg p50 p90 p99 n
control ······▄█▂···· 132.9 (-27%) 120 (-12%) 237 (-32%) 404 (-57%) 3000
sweep ······▃█▁···· 134 (-39%) 118 (-20%) 266 (-57%) 446 (-53%) 3000
gw 1x ·····▁▄█▂▁··· 134 (-10%) 115 (-9%) 262 (+1%) 602 (-32%) 5295
eve 1x ·····▁▅█▁▁··· 118.7 (-17%) 110 (-11%) 174 (-23%) 344 (-5%) 5186
eve 2x ·····▁▃█▃▁▁·· 222.2 (-1%) 138 (-22%) 1020 (+90%) 1558 (+92%) 7779

RTT over stream progress (avg per tenth of stream, bars scaled min→max):

control █▃▃▄▃▁▂▁▂▃ 114–183ms
sweep ▆▃▅▄▁▁█▂▃▂ 120–158ms
gw 1x ██▂▄▄▇▄▂█▁ 111–154ms
eve 1x ▆▁▄▂▄▂█▆▅▆ 105–133ms
eve 2x █▆▅▁▁▁▃▃▁▂ 129–434ms

RTT by chunk size (avg per log size bin, ~160B → ~12KB serialized, bars scaled min→max):

sweep ▆█▆▆▃▁▃ 132–136ms

Delivery jitter over stream progress (avg positive CDV per tenth of stream, bars scaled min→max):

control ▁█▇█▅▆▆▄▆▇ 30–43ms
sweep ▁▇█▆▆▅█▆▆▅ 34–61ms
gw 1x ▄▅▁▃▂▇▆▅█▃ 34–44ms
eve 1x ▅▁▂▂▄▅█▂▅▆ 21–29ms
eve 2x █▆▁▂▂▂▃▁▁▄ 19–45ms
📜 Previous results (4)

f715b96

Fri, 14 Aug 2026 21:10:45 GMT · run logs

vercel / nextjs-turbopack

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep231 (-67%) 💚1401 🔴 (+39%) 🔻1434 🔴 (+41%) 🔻1798 🔴 (+19%) 🔻30
TTFSstream243 (-75%) 💚1402 🔴 (+42%) 🔻1429 🔴 (+41%) 🔻1479 🔴 (+41%) 🔻30
TTFShook + stream382 (-68%) 💚1700 🔴 (+32%) 🔻1749 🔴 (+31%) 🔻1903 🔴 (+18%) 🔻30
Fan-out TTFSPromise.all(100 steps)941310720108371092910
Fan-out TTLSPromise.all(100 steps)1846819995200652062610
STSO1020 steps (inline)1374705197011018
STSO1020 steps (queue-hop)44074407440744071
WO1020 steps418797 (+8.5%)418797 (+8.5%)418797 (+8.5%)418797 (+8.5%)1
SLstream latency102 (+26%) 🔻147 🔴 (+11%)168 🔴 (+20%) 🔻456 🔴 (+155%) 🔻30
SOstream overhead (text)143 (+42%) 🔻212 (+18%) 🔻301 (+49%) 🔻908 (+263%) 🔻30
SOstream overhead (structured)140 (+41%) 🔻249 (+54%) 🔻349 (+79%) 🔻985 (+354%) 🔻30

bddc74f

Fri, 14 Aug 2026 19:17:31 GMT · run logs

vercel / nextjs-turbopack

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep1341 (+31%) 🔻1452 🔴 (+23%) 🔻1503 🔴 (+19%) 🔻1913 🔴 (+46%) 🔻30
TTFSstream1325 (+422%) 🔻1401 🔴 (+22%) 🔻1431 🔴 (+19%) 🔻1493 🔴 (+19%) 🔻30
TTFShook + stream1587 (+198%) 🔻1731 🔴 (+17%) 🔻1760 🔴 (+14%)1823 🔴 (+5.3%)30
Fan-out TTFSPromise.all(100 steps)9001 (+1.9%)9313 (-1.4%)9600 (-6.3%)13936 (+34%) 🔻10
Fan-out TTLSPromise.all(100 steps)17479 (+0.7%)17826 (-2.4%)18533 (-3.6%)23905 (+18%) 🔻10
STSO1020 steps (inline)135 (+0.7%)183 (-22%) 💚201 (-30%) 💚320 (-54%) 💚1019
WO1020 steps179900 (-21%) 💚179900 (-21%) 💚179900 (-21%) 💚179900 (-21%) 💚1
SLstream latency104 (-1.0%)148 🔴 (-26%) 💚172 🔴 (-62%) 💚389 🔴 (-52%) 💚30
SOstream overhead (text)126 (-6.7%)216 (-27%) 💚242 (-56%) 💚1278 🔴 (±0%)30
SOstream overhead (structured)124 (-22%) 💚234 (-14%)298 (-19%) 💚2208 🔴 (+194%) 🔻30

bbfb581

Thu, 13 Aug 2026 23:43:22 GMT · run logs

vercel / nextjs-turbopack

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep1325 (+248%) 🔻1494 🔴 (+34%) 🔻1506 🔴 (+32%) 🔻3410 🔴 (+123%) 🔻30
TTFSstream399 (-60%) 💚1422 🔴 (+34%) 🔻1446 🔴 (+35%) 🔻1516 🔴 (+37%) 🔻30
TTFShook + stream1611 (+26%) 🔻1722 🔴 (+24%) 🔻1752 🔴 (+23%) 🔻1960 🔴 (+21%) 🔻30
Fan-out TTFSPromise.all(100 steps)8936 (±0%)10472 (+5.2%)13499 (+34%) 🔻15056 (+11%)10
Fan-out TTLSPromise.all(100 steps)17362 (-1.8%)19074 (+1.1%)22001 (+16%) 🔻24669 (+5.2%)10
STSO1020 steps (inline)120 (-2.4%)195 (+2.1%)231 (+0.9%)474 (-18%) 💚1019
WO1020 steps193836 (-0.8%)193836 (-0.8%)193836 (-0.8%)193836 (-0.8%)1
SLstream latency104 (+32%) 🔻143 🔴 (+30%) 🔻173 🔴 (+34%) 🔻294 🔴 (-14%)30
SOstream overhead (text)119 (+7.2%)246 (+37%) 🔻401 (+95%) 🔻3638 🔴 (+502%) 🔻30
SOstream overhead (structured)150 (+56%) 🔻243 (+56%) 🔻328 (+96%) 🔻414 (+127%) 🔻30

b59f23a

Thu, 13 Aug 2026 22:47:36 GMT · run logs

vercel / nextjs-turbopack

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep1323 (+619%) 🔻1377 🔴 (+24%) 🔻1390 🔴 (+14%)1493 🔴 (-6.2%)30
TTFSstream1309 (+452%) 🔻1362 🔴 (+23%) 🔻1392 🔴 (+23%) 🔻1399 🔴 (+16%) 🔻30
TTFShook + stream1542 (+302%) 🔻1678 🔴 (+22%) 🔻1696 🔴 (+22%) 🔻2067 🔴 (+35%) 🔻30
Fan-out TTFSPromise.all(100 steps)8810 (-2.3%)9193 (-11%)14363 (+20%) 🔻15748 (-95%) 💚10
Fan-out TTLSPromise.all(100 steps)17458 (-1.6%)17763 (-13%)24140 (-65%) 💚24319 (-92%) 💚10
STSO1020 steps (inline)117 (-23%) 💚157 (-30%) 💚173 (-33%) 💚247 (-53%) 💚1019
WO1020 steps154776 (-32%) 💚154776 (-32%) 💚154776 (-32%) 💚154776 (-32%) 💚1
SLstream latency86 (-8.5%)109 🔴 (-27%) 💚120 🔴 (-25%) 💚143 🔴 (-60%) 💚30
SOstream overhead (text)104 (-34%) 💚180 (-39%) 💚228 (-47%) 💚561 (-63%) 💚30
SOstream overhead (structured)98 (-17%) 💚149 (-63%) 💚169 (-70%) 💚411 (-84%) 💚30
ℹ️ Metric definitions & methodology

Streams: writer/reader sustained rates (steady window, 10% trimmed each side), first-chunk RTT (the stream-open path, before any buffering/backpressure), CRTT percentiles, and worst delivery stall (CDV max). Cells are medians across iterations; per-run values in the artifacts. No 🔴/🟢 marks until targets attach.

The collapsed STSO distribution section above buckets every step gap, split inline (same warm process — pure framework overhead) vs queue-hop (fresh process — dispatch, reinit, replay). = main, = this run, = fill.

The collapsed CRTT drill-down: per-variant RTT histograms (fixed log bins, · = empty) and mean RTT/positive-CDV profile lines over stream progress and chunk size. Histograms, avgs, and profiles merge exactly across runs; p50–p99 are percentile-of-percentiles. Per-index rows live in the artifacts.

Best/P75/P90/P99 deltas compare against the most recent benchmark run on main at the time of this run. 🔻 flags a delta worse than +15%, 💚 one better than −15%.

Metrics — TTFS: time to first step body (in-deployment start() → first step body) · Fan-out TTFS: fan-out time to first step (in-deployment start() → first of the parallel step bodies to complete) · Fan-out TTLS: fan-out time to last step (in-deployment start() → last of the parallel step bodies to complete, i.e. when the Promise.all resolves) · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (whole-run time outside step bodies, in-deployment anchored) · CRTT: chunk round-trip time (per-chunk write → read latency, one clock domain: deployment → stream backend → same deployment) · CDV: chunk delay variation / delivery jitter (inter-arrival gap minus inter-write gap per seq-adjacent pair; skew-free; the row is each run's MAX positive value, so one stall moves it)

Scenarios — step: one trivial no-op step, no stream; no hooks, so the run stays in turbo mode (in-process fast path) · stream: one streaming step; no hooks, so the run stays in turbo mode (in-process fast path) · hook + stream: registers a hook before one step, which exits turbo mode (dispatch path) · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges, and WO is the whole-run overhead outside step bodies · Promise.all(100 steps): 100 trivial no-op steps started together in a single Promise.all; Fan-out TTFS is the first of them to complete and Fan-out TTLS the last, both from the in-deployment clientStart, so their gap is the spread the runtime adds across the fan-out · paced control (100/s, 60B): the control: 300 tiny (~60B) deltas metronome-paced at 100/s — zero workload structure, so it reads the transport floor and flush cadence, and disambiguates transport-wide vs workload-specific when a replay row moves · size sweep (100/s, 160B-12KB): same pacing as the control with deltas padded in rotation across seven log-spaced sizes (~160B–12KB) — rotation decouples size from stream position, so it isolates whether chunk size causes latency · replay gateway-gpt-5.4-nano-2000t (1x): raw provider SSE cadence captured at the AI gateway boundary (gpt-5.4-nano, the most popular gateway model; per-token deltas p50 208B = the modal production chunk size), replayed exactly as measured — the typical customer's workload; its CDV is the typical customer's real delivery jitter · replay eve-gpt-5.6-sol-2000t (1x): a captured eve turn (gpt-5.6-sol, the most-used demanding eve model; ~2000 output tokens = production p50 turn length) replayed exactly as measured — eve's envelope protocol re-ships the cumulative message so sizes ramp 142B→13KB; the demanding outlier tenant's reality · replay eve-gpt-5.6-sol-2000t (2x): the same eve capture at 2x — the headroom/stress row; real fast-tier models emit the same chunk sizes at proportionally higher rate, so time compression is a faithful speed model · first chunk (pooled): every run's seq-0 RTT pooled across all stream scenarios — the first chunk precedes any workload differentiation, so pooling samples one shared stream-open path with exact percentiles

Replay cadences (semantic sha256) — eve-gpt-5.6-sol-2000teaf22f5946e7c61f3c65c7006d550df180cfabd4e706254a09f22aec0cfb420d · gateway-gpt-5.4-nano-2000t6f24ac518b6b83ff1d0e85a5fe78230db192716d66a7fc6b2fe022752001d041

🔴 marks a percentile over its target (within target is left unmarked). Targets (p75/p90/p99, ms) — TTFS 200/300/600

All timestamps are deployment-side; runs are triggered in-deployment, so the CI runner and api.vercel.com sit outside every measured window. TTFS = start() → first step body (includes dispatch + any cold start); Fan-out TTFS/TTLS = first/last step completion of one Promise.all from the same anchor (the gap is the runtime’s fan-out spread); STSO/WO between step bodies; CRTT inside the workflow (excludes the api.vercel.com read path).

Cold starts stay in the numbers (real bursty-workload latency, inflates P75+); Best is the warm floor.

@github-actions

github-actionsBot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟠 Mint-ordered log — 3 fail of 41 total

log=mint-ordered · fence=per-spec

scenariooutcomeeventsvirtreplayviolations
smoke-no-stepscompleted30msok0
smoke-one-stepcompleted60msok0
hook-at-step-startedcompleted120msok0
hook-at-step-completedcompleted120msok0
hook-at-hook-createdcompleted120msok0
deadline-hook-winscompleted71.0hok0
deadline-expirescompleted71.0hok0
long-sleepcompleted1130.0dok0
hook-never-arrivesstalled30msskipped0
step-retries-twicecompleted102.0sok0
parallel-stepscompleted90msok0
hook-on-execution-statecompleted120msok0
peek-hook-before-branchcompleted120msok0
peek-hook-after-branchcompleted120msok0
peek-hook-at-registrationcompleted120msok0
race-hook-before-probecompleted120msok0
race-hook-after-probecompleted120msok0
race-duplicate-deliverycompleted130msok0
attr-hook-before-stepcompleted110msok0
attr-hook-after-stepcompleted110msok0
attr-from-step-bodycompleted130msok0
fork-hook-after-timeoutcompleted141.0mok0
fork-hook-before-timeoutcompleted141.0mok0
count-hook-after-timeoutcompleted171.0mok0
count-hook-before-timeoutcompleted201.0mok0
stale-read-step-count-forkcompleted201.0mok0
stale-read-equal-step-countscompleted141.0mok0
step-vs-step-forkcompleted120msok0
step-vs-step-fork-fencedcompleted120msok0
fence-catches-benign-directioncompleted125msok0
in-flight-before-decisionfailed91.0mMISMATCH1
in-flight-before-decision-countedfailed91.0mMISMATCH1
in-flight-after-decisionfailed91.0mMISMATCH1
stale-read-step-count-fork-fencedcompleted201.0mok0
fork-hook-winscompleted131.0mok0
fork-timeout-winscompleted131.0mok0
unclaimed-payload-under-forkcompleted171.0mok0
claimed-payload-under-forkcompleted171.0mok0
writers-independent-step-bodiescompleted120msok0
writers-scripted-tempocompleted120msok0
cancel-mid-stepcancelled70msskipped0

Full trace: world-sim-mint.txt

🟢 Append-only log — 0 fail of 41 total

log=append-only · fence=per-spec

scenariooutcomeeventsvirtreplayviolations
smoke-no-stepscompleted30msok0
smoke-one-stepcompleted60msok0
hook-at-step-startedcompleted120msok0
hook-at-step-completedcompleted120msok0
hook-at-hook-createdcompleted120msok0
deadline-hook-winscompleted71.0hok0
deadline-expirescompleted71.0hok0
long-sleepcompleted1130.0dok0
hook-never-arrivesstalled30msskipped0
step-retries-twicecompleted102.0sok0
parallel-stepscompleted90msok0
hook-on-execution-statecompleted120msok0
peek-hook-before-branchcompleted120msok0
peek-hook-after-branchcompleted120msok0
peek-hook-at-registrationcompleted120msok0
race-hook-before-probecompleted120msok0
race-hook-after-probecompleted120msok0
race-duplicate-deliverycompleted130msok0
attr-hook-before-stepcompleted110msok0
attr-hook-after-stepcompleted110msok0
attr-from-step-bodycompleted130msok0
fork-hook-after-timeoutcompleted141.0mok0
fork-hook-before-timeoutcompleted141.0mok0
count-hook-after-timeoutcompleted171.0mok0
count-hook-before-timeoutcompleted201.0mok0
stale-read-step-count-forkcompleted201.0mok0
stale-read-equal-step-countscompleted141.0mok0
step-vs-step-forkcompleted120msok0
step-vs-step-fork-fencedcompleted120msok0
fence-catches-benign-directioncompleted125msok0
in-flight-before-decisioncompleted171.0mok0
in-flight-before-decision-countedcompleted171.0mok0
in-flight-after-decisioncompleted192.0mok0
stale-read-step-count-fork-fencedcompleted201.0mok0
fork-hook-winscompleted131.0mok0
fork-timeout-winscompleted131.0mok0
unclaimed-payload-under-forkcompleted171.0mok0
claimed-payload-under-forkcompleted171.0mok0
writers-independent-step-bodiescompleted120msok0
writers-scripted-tempocompleted120msok0
cancel-mid-stepcancelled70msskipped0

Full trace: world-sim-append-only.txt

@alangenfeld
alangenfeldforce-pushed the alangenfeld/dev-hmr-full-rebuild-race branch from bddc74f to f715b96CompareAugust 14, 2026 20:43
A full rebuild reads sources twice: once when the bundler consumes them
and once when refreshSourceSnapshots() re-anchors the classifier baseline
from disk afterwards. An edit landing between those reads (the rebuild
takes multiple seconds in real apps) was absorbed into the baseline
without ever being built, so its queued watcher event classified as a
no-op and the change never reached the manifest.
This is the dominant CI flake: the nextjs-webpack local-dev e2e HMR fuzz
test writes a new step definition right after triggering a full
rediscovery, and when the write lands mid-rebuild the added step never
appears in the manifest, timing out after 300s (~60 attempt-1 job
failures over the last 10 days, failing every day).
pinBaselinesAcrossFullRebuild() owns the fix structurally: it re-reads
the relevant files from disk immediately before the rebuild callback
runs and restores those values for files present in both maps after the
refresh, so a mid-rebuild edit still diffs against what the rebuild
consumed while duplicate watcher events for content the rebuild already
consumed diff equal instead of cascading.
The capture deliberately reads disk rather than cloning the live
baseline map: writes landing in the capture window (test-teardown
restores, multi-flush bursts) are content the imminent build consumes
anyway, and a zero-read clone formulation un-absorbs them into chains of
follow-up full rebuilds once real rebuilds take multiple seconds. That
formulation was tried and reverted after CI reproduced the chains; the
tradeoff is one serial read of the relevant set (~150-250ms at ~250
files) per full rediscovery.
Files first discovered by the in-flight rebuild keep their post-build
baseline: a new file the build missed has no baseline at all and its add
event forces the follow-up rebuild. A create-then-edit within one
rebuild window can still be absorbed - this narrows that pre-existing
race rather than closing it. The initial-build path has the same
two-read shape with no watcher yet attached; knowingly out of scope and
documented at the call site.
Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for ae16375 (AI decision).

This is a genuine correctness fix (dropped HMR edits / CI flake), but it depends entirely on machinery that does not exist on stable: git ls-tree origin/stable -- packages/next/src/watch-rebuild.ts returns nothing, and stable's builder-eager.ts has no source-snapshot baseline or classifyRebuild classification — every watcher change there triggers an unconditional fullRebuild(). The absorbed-baseline/no-op race being fixed therefore cannot occur on stable, so the change is inapplicable rather than a needed maintenance fix.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

ae1637502b35c8f635d2b0e103cd8de85b5ffcdd

Sign up for freeto 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.

2 participants

@alangenfeld@VaguelySerious