Skip to content

[DO NOT MERGE] CI dry-run: QuickJS as the default workflow VM engine - #3253

Draft
TooTallNate wants to merge 12 commits into
quickjs-vm-threshold-snapshotsfrom
quickjs-vm-default
Draft

[DO NOT MERGE] CI dry-run: QuickJS as the default workflow VM engine#3253
TooTallNate wants to merge 12 commits into
quickjs-vm-threshold-snapshotsfrom
quickjs-vm-default

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Jul 31, 2026

Copy link
Copy Markdown
Member

Warning

Not intended to merge. This PR exists to exercise the full CI matrix — and the event-log-race-repro stress workflow (via its label) — with QuickJS as the default engine, as a dress rehearsal for an eventual real default flip. It stays a draft; when the underlying stack (#3048#3049#3250#3251, plus #3263) is merged, a fresh flip PR will be cut against main with the learnings from this one.

What it changes (for the dry run)

  • useQuickJSVm defaults to the QuickJS engine when neither the run's stamped executionContext.workflowVm nor WORKFLOW_VM specifies one; WORKFLOW_VM=node is the explicit node:vm opt-in.
  • CI matrix inverted to match: quickjs legs leave WORKFLOW_VM unset (exercising the default-selection path end to end); node legs opt in explicitly. Labels/artifacts unchanged via MATRIX_VM.
  • Entrypoint test suites that assert node replay-loop internals pin WORKFLOW_VM=node (see the comment at each pin).
  • Docs updated for the flipped default.

Findings so far (feeding the real flip PR)

  • The event-ceiling gap this PR's CI exposed (event-limit red) was real and is fixed on QuickJS engine: inline step execution + WASM module caching #3049 (in-loop re-check + run_failed/MAX_EVENTS_EXCEEDED conversion).
  • The global-surface gap is substantially closed on Add opt-in QuickJS WASM VM engine (WORKFLOW_VM=quickjs) #3048 (deterministic crypto, frozen process.env, loud Intl/locale guards); remaining differences are enumerated in the docs.
  • Outstanding requirement for the real flip: unconditional engine stamping at start() — under a flipped default, unset WORKFLOW_VM currently produces unstamped runs that would switch engines mid-run on rollback (review finding on this PR). The real flip PR must stamp the resolved engine.

@TooTallNate
TooTallNate requested review from a team and ijjk as code ownersJuly 31, 2026 08:52
CopilotAI review requested due to automatic review settings July 31, 2026 08:52
@changeset-bot

changeset-botBot commented Jul 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8a78801

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

This PR includes changesets to release 16 packages
NameType
@workflow/coreMinor
@workflow/buildersMinor
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/webPatch
workflowMinor
@workflow/world-testingPatch
@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

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercelBot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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

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

@TooTallNateTooTallNate added the event-log-race-repro Run the event log race reproduction job label Jul 31, 2026
@github-actions

github-actionsBot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

❌ Failed E2E Tests

▲ Vercel Production (1 failed)

express-quickjs (1 failed):

📦 Local Production (1 failed)

astro-stable-node (1 failed):

  • webhookWorkflow | wrun_41KZQYSH9X0GZQBXQC793JBE48

E2E Test Summary

Summary
PassedFailedSkippedTotal
❌ ▲ Vercel Production346515904056
✅ 💻 Local Development382905394368
❌ 📦 Local Production396515584524
✅ 🐘 Local Postgres396605584524
✅ 🪟 Windows31200312
✅ vercel-multi-region270027
Total155642224517811
Details by Category

❌ ▲ Vercel Production

AppPassedFailedSkipped
✅ astro-node128028
✅ astro-quickjs128028
✅ example-node128028
✅ example-quickjs128028
✅ express-node128028
❌ express-quickjs127128
✅ 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
✅ 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-quickjs-snapshot15600
✅ nextjs-turbopack-stable-node15600
✅ nextjs-turbopack-stable-quickjs15600
✅ nextjs-webpack-canary-node137019
✅ 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-node129126
✅ 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-quickjs-snapshot15600
✅ 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-quickjs-snapshot15600
✅ 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

✅ vercel-multi-region

AppPassedFailedSkipped
✅ nextjs-turbopack2700

📋 View full workflow run

@TooTallNate
TooTallNate marked this pull request as draft July 31, 2026 08:53

@VaguelySeriousVaguelySerious left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review: blocking issues found

Comment threadpackages/core/src/runtime/vm-mode.ts
Comment threaddocs/content/docs/v5/configuration/runtime-tuning.mdx
Comment threaddocs/content/docs/v5/configuration/runtime-tuning.mdx
Comment threadpackages/core/src/runtime.test.ts
…ck into node:vm)
- useQuickJSVm defaults to the QuickJS engine when neither the run's
stamped executionContext.workflowVm nor WORKFLOW_VM specifies one;
WORKFLOW_VM=node is the explicit node:vm opt-in.
- CI matrix inverted to match: quickjs legs leave WORKFLOW_VM unset so
the default-selection path is exercised end to end; node legs opt in
explicitly (labels/artifacts unchanged via MATRIX_VM).
- Entrypoint tests that assert node replay-loop internals against mock
worlds pin WORKFLOW_VM=node (the quickjs path would instantiate a WASM
VM per call).
- Docs + changeset updated. Runs keep the engine stamped at start().
@github-actions

github-actionsBot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit 8a78801 · Tue, 11 Aug 2026 08:56:08 GMT · run logs

Backend: vercel · app: nextjs-turbopack

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep2251 (+113%) 🔻2517 🔴 (+114%) 🔻2575 🔴 (+114%) 🔻2706 🔴 (+58%) 🔻30
TTFSstream2315 (+122%) 🔻2522 🔴 (+121%) 🔻2576 🔴 (+121%) 🔻3136 🔴 (+159%) 🔻30
TTFShook + stream2262 (+81%) 🔻2784 🔴 (+104%) 🔻2967 🔴 (+112%) 🔻4659 🔴 (+209%) 🔻30
STSO1020 steps (inline)314 (+227%) 🔻1124 (+585%) 🔻1278 (+530%) 🔻1508 (+94%) 🔻1017
STSO1020 steps (queue-hop)41815129512951292
WO1020 steps876491 (+411%) 🔻876491 (+411%) 🔻876491 (+411%) 🔻876491 (+411%) 🔻1
SLstream latency119 (+31%) 🔻151 🔴 (-1.9%)160 🔴 (-7.0%)378 🔴 (-32%) 💚30
SOstream overhead (text)150 (+14%)226 (-18%) 💚231 (-30%) 💚516 (-34%) 💚30
SOstream overhead (structured)152 (+25%) 🔻245 (±0%)352 (+13%)397 (-12%)30
📈 STSO distribution vs main (inline / queue-hop histograms)

1020 steps (inline)

Cumulative STSO time: main 170410ms → this run 864672ms (Δ +694262ms, +407%)

 50-100 ms ┃ main 1 this 0 -1
100-150 ms ┃███████████████████████ main 627 this 0 -627
150-200 ms ┃██████████ main 279 this 0 -279
200-250 ms ┃█ main 59 this 0 -59
250-300 ms ┃ main 17 this 0 -17
300-350 ms ┃ main 8 this 30 +22
350-400 ms █┃ main 3 this 48 +45
400-450 ms █░┃ main 2 this 74 +72
450-500 ms █┃ main 1 this 61 +60
500-550 ms █┃ main 2 this 43 +41
550-600 ms ░┃ main 0 this 42 +42
600-650 ms ┃ main 2 this 25 +23
650-700 ms ┃ main 4 this 36 +32
700-750 ms █┃ main 3 this 45 +42
750-800 ms █┃ main 2 this 54 +52
800-850 ms █┃ main 3 this 60 +57
850-900 ms █┃ main 1 this 52 +51
900-950 ms ░┃ main 0 this 40 +40
950-1000 ms ┃ main 1 this 34 +33
1000-1050 ms ┃ main 1 this 35 +34
1050-1100 ms ░┃ main 0 this 50 +50
1100-1150 ms ░┃ main 0 this 59 +59
1150-1200 ms ░┃ main 0 this 60 +60
1200-1250 ms ┃ main 0 this 36 +36
1250-1300 ms █┃ main 1 this 48 +47
1300-1350 ms ┃ main 1 this 32 +31
1350-1400 ms ┃ main 0 this 21 +21
1400-1450 ms ┃ main 0 this 11 +11
1450-1500 ms ┃ main 0 this 7 +7
1500-1550 ms ┃ main 0 this 5 +5
1550-1600 ms ┃ main 0 this 5 +5
1600-1650 ms ┃ main 0 this 1 +1
1650-1700 ms ┃ main 1 this 2 +1
1800-1850 ms ┃ main 0 this 1 +1

1020 steps (queue-hop)

Cumulative STSO time: 9310ms over 2 samples

No main baseline with raw samples yet — showing this run's distribution on its own; the diff appears once a run on main has recorded them.

4000-4500 ms ████████████████████████ steps 1
5000-5500 ms ████████████████████████ steps 1
📜 Previous results (4)

c671016

Mon, 10 Aug 2026 20:52:43 GMT · run logs

vercel / nextjs-turbopack

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep393 (-60%) 💚1346 🔴 (+12%)2318 🔴 (+86%) 🔻2723 🔴 (+104%) 🔻30
TTFSstream435 (+68%) 🔻2303 🔴 (+104%) 🔻2489 🔴 (+109%) 🔻2653 🔴 (+90%) 🔻30
TTFShook + stream633 (+48%) 🔻2718 🔴 (+80%) 🔻2823 🔴 (+73%) 🔻6004 🔴 (+184%) 🔻30
STSO1020 steps (inline)254 (+176%) 🔻1203 (+634%) 🔻1411 (+635%) 🔻1746 (+306%) 🔻1016
STSO1020 steps (queue-hop)26566300630063003
WO1020 steps915613 (+473%) 🔻915613 (+473%) 🔻915613 (+473%) 🔻915613 (+473%) 🔻1
SLstream latency102 (-8.9%)155 🔴 (-18%) 💚167 🔴 (-62%) 💚222 🔴 (-62%) 💚30
SOstream overhead (text)142 (+3.6%)249 (+4.6%)294 (-21%) 💚540 (-57%) 💚30
SOstream overhead (structured)144 (-5.3%)294 🔴 (+13%)349 (-7.7%)723 (+5.1%)30

d41872a

Mon, 10 Aug 2026 19:58:41 GMT · run logs

vercel / nextjs-turbopack

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep907 (+298%) 🔻2458 🔴 (+127%) 🔻2568 🔴 (+130%) 🔻2864 🔴 (+139%) 🔻30
TTFSstream2350 (+963%) 🔻2518 🔴 (+133%) 🔻2595 🔴 (+137%) 🔻2658 🔴 (+125%) 🔻30
TTFShook + stream2603 (+666%) 🔻2806 🔴 (+111%) 🔻2870 🔴 (+110%) 🔻3038 🔴 (+102%) 🔻30
STSO1020 steps (inline)237 (+121%) 🔻996 (+538%) 🔻1152 (+544%) 🔻1515 (+376%) 🔻1017
STSO1020 steps (queue-hop)39535702570257022
WO1020 steps779592 (+403%) 🔻779592 (+403%) 🔻779592 (+403%) 🔻779592 (+403%) 🔻1
SLstream latency100 (+6.4%)137 🔴 (-5.5%)146 🔴 (-23%) 💚524 🔴 (-35%) 💚30
SOstream overhead (text)118 (-16%) 💚160 (-44%) 💚190 (-41%) 💚321 (-77%) 💚30
SOstream overhead (structured)112 (-23%) 💚156 (-65%) 💚191 (-77%) 💚297 (-72%) 💚30

74bd053

Tue, 04 Aug 2026 01:01:14 GMT · run logs

vercel / nextjs-turbopack

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep2144 (+213%) 🔻2365 🔴 (+148%) 🔻2481 🔴 (+150%) 🔻6410 🔴 (+291%) 🔻30
TTFSstream2087 (+125%) 🔻2270 🔴 (+132%) 🔻2337 🔴 (+135%) 🔻2587 🔴 (+153%) 🔻30
TTFShook + stream2171 (+505%) 🔻2423 🔴 (+99%) 🔻2463 🔴 (+86%) 🔻2846 🔴 (+66%) 🔻30
STSO1020 steps (inline)221 (+163%) 🔻1005 (+553%) 🔻1237 (+583%) 🔻1614 (+386%) 🔻1018
STSO1020 steps (queue-hop)4439 (+113%) 🔻4439 (+113%) 🔻4439 (+113%) 🔻4439 (+113%) 🔻1
WO1020 steps776076 (+399%) 🔻776076 (+399%) 🔻776076 (+399%) 🔻776076 (+399%) 🔻1
SOstream overhead (text)127 (-5.2%)188 (-28%) 💚235 (-26%) 💚518 (+24%) 🔻30
SOstream overhead (structured)116 (-4.1%)184 (-17%) 💚193 (-43%) 💚311 (-51%) 💚30

6af2c2c

Fri, 31 Jul 2026 23:40:21 GMT · run logs

vercel / nextjs-turbopack

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
STSO1020 steps (inline)218 (+69%) 🔻1062 (+134%) 🔻1253 (+147%) 🔻1578 (+120%) 🔻1017
STSO1020 steps (queue-hop)4670 (+213%) 🔻6273 (+99%) 🔻6273 (+99%) 🔻6273 (+99%) 🔻2
WO1020 steps835997 (+114%) 🔻835997 (+114%) 🔻835997 (+114%) 🔻835997 (+114%) 🔻1
SLstream latency95 (+27%) 🔻139 🔴 (+21%) 🔻144 🔴 (+13%)448 🔴 (+32%) 🔻30
SOstream overhead (text)112 (+12%)218 (+60%) 🔻254 (+49%) 🔻513 (+134%) 🔻30
SOstream overhead (structured)135 (+32%) 🔻265 🔴 (+39%) 🔻406 (+73%) 🔻1205 🔴 (+86%) 🔻30
ℹ️ Metric definitions & methodology

The collapsed STSO distribution section above buckets every step gap of the sequential-steps run (not a sampled window), split by whether the step ending the gap ran inline — in the same warm process as the step before it, so the gap is pure framework overhead — or after a queue-hop — the first step of a fresh process, which pays queue dispatch, client reinit and event-log replay. Bars overlay the two runs: is main, marks where this run lands, bridges the gap when this run has more samples in a bucket.

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, deployment clocks) · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (whole-run time outside step bodies, in-deployment anchored) · SL: stream latency (in-deployment write → read propagation, readAt - writtenAt) · SO: stream overhead (end-to-end write+consume time beyond the modelled generation window)

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 · stream latency: parallel reader/writer steps on a dedicated stream; SL is the in-deployment write->read propagation (readAt - writtenAt) · stream overhead (text): writer streams 300 variable-length text token deltas paced at 100/s for 3s (a haiku-size LLM's token throughput) while a parallel reader drains the whole stream; SO is the end-to-end write+consume time beyond the 3s generation window (overhead/backpressure) · stream overhead (structured): same workload as stream overhead (text), but each delta is an AI-SDK-style structured object ({ type: 'text-delta', id, text }) instead of a raw string, so the SO gap vs the text scenario is the added serialization cost

🔴 marks a percentile over its target (within target is left unmarked). Targets (p75/p90/p99, ms) — TTFS 200/300/600 · SL 50/60/125 · SO 250/500/1000

All metrics are measured from deployment-side timestamps only. Runs are triggered by an in-deployment route that stamps the anchor (clientStart) right before start(), so the CI runner’s request and its path through api.vercel.com sit outside every measured window. TTFS = in-deployment start() → first step body (turbo uses the in-process fast path, non-turbo the dispatch path), and includes the VQS dispatch hop plus any /flow cold start. STSO/WO are measured between step bodies on the deployment. SL is measured inside the workflow (parallel reader/writer steps), so it no longer includes the api.vercel.com read path.

Cold starts are kept in the numbers on purpose — they are part of real bursty-workload latency. The workbench deployment cold-starts the /flow invocation for a large fraction of runs, inflating P75+; the Best column shows the fastest (warm-start) sample for comparison.

@pranaygp

Copy link
Copy Markdown
Contributor

Ran the event-log-race-repro storm locally against this branch on world-local and world-postgres (24 step-storm + 24 hook-storm per condition, concurrency 6, nextjs-turbopack production server; same harness as the event-log-race-repro CI label). Control = this same branch with WORKFLOW_RUNTIME=node, so the only delta is the VM.

conditionworldstep-stormhook-storm
node VM (control)local24 corrupted / 0 completed21 corrupted / 3 completed
QuickJSlocal0 corrupted / 24 stuck0 corrupted / 24 stuck
node VM (control)postgres¹3 corrupted / 12 stuck0 corrupted / 6 stuck
QuickJSpostgres¹0 corrupted / 12 stuck0 corrupted / 6 stuck + 1 err

¹ partial runs (21 and 19 landed of 48) — the launch budget cut them short.

Caveat before reading the zero: under QuickJS not a single storm run completed — every run blew past the harness's 240s cap (stuck = alive but too slow, not wedged). The storm's corruption mechanism needs tight races (watchdog-vs-step within ~300ms windows, concurrent replays interleaving), and the interpreter is slow enough that those races mostly never happen. So on this evidence QuickJS starves the repro rather than beating it — the 0 is a throughput artifact, not a demonstrated determinism win. The node control on the same branch reproducing main-level saturation (24/24, 21/24 on local) confirms the harness itself was working.

A fair comparison needs EVENT_LOG_RACE_REPRO_RUN_TIMEOUT_MS raised (600s+) so QuickJS runs can actually complete, then corruption compared per completed run. For reference, the same harness on the storage-side fix (#3269) reached hook-storm 0 corrupted / 24 completed on world-postgres — completions are what make a zero meaningful.

@pranaygp

Copy link
Copy Markdown
Contributor

Re-ran against the latest head (6af2c2c) with the harness run-timeout raised 240s → 600s so QuickJS runs get a fair chance to complete, plus a variant with the newest stack layer (#3263's cecd664a0, host-side serde via handles — not yet restacked into this branch) merged on top. Node control = same build, WORKFLOW_VM=node. 24 step-storm + 24 hook-storm per condition, world-postgres numbers from the per-run event logs.

condition (600s timeout)worldstep-stormhook-stormcompleted-run time
node controllocal18 corrupt / 6 stuck / 0 ok14 corrupt / 2 stuck / 8 err
node controlpostgres15 corrupt / 9 ok1 corrupt / 23 okp50 72s / p90 84s
QuickJS (this head)local0 corrupt / 24 stuck0 corrupt / 24 stucknone completed
QuickJS (this head)postgres0 corrupt / all stuck0 corrupt / all stucknone completed
QuickJS + #3263 serde (local merge)local0 corrupt / 24 stuck0 corrupt / 24 stucknone completed
QuickJS + #3263 serde (local merge)postgres0 corrupt / 16 stuck / 2 err0 corrupt / 24 stucknone completed

Performance (postgres, from event-log forensics):

  • node control: completed runs write ~603 events over ~71s ≈ 9 events/s sustained.
  • QuickJS as-shipped: runs were still appending when the 600s cap hit — p50 739 events at cutoff ≈ 1.2 events/s, a ~7–8× slowdown, with zero runs completing a workload node finishes in 72s. Storms this shape can't race at that speed, so "0 corrupted" remains a throughput artifact; the node control on the identical build still reproduces heavily.
  • QuickJS + the new QuickJS engine: host-side, side-effect-free serialization via handles #3263 serde commit: not slow — dormant. 38/42 runs burst ~98 events in the first ~8s (near node pace!) and then append nothing for the remaining ~10 minutes, no errors logged; stalled runs end on step_completed / hook_received — i.e. work landed and the run was never successfully resumed. The other 4 failed with USER_ERROR ("QuickJS runtime: workflow failed"). Caveat: I produced this tree by locally merging quickjs-host-serde onto this branch (clean, serde-scoped merge) since the restack hasn't happened — so it could be a serde×snapshotting interaction rather than QuickJS engine: host-side, side-effect-free serialization via handles #3263 alone, but the delta vs this head (continuous slow progress → hard stall at round ~1) is stark and reproducible across 62 runs.

Takeaways: (1) the corruption repro is alive on this branch under node; (2) a QuickJS corruption comparison is not yet meaningful — completion rate is 0/144 across every QuickJS condition even at 600s; (3) the ~8× interpreter gap is the first-order blocker, and the new serde layer (as merged here) introduces a wake/dormancy bug worth catching before the restack. Happy to share the harness setup (run-storm.sh) or the per-run forensics queries.

@github-actions

github-actionsBot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Event Log Race Repro

4 of 14 latest repro runs hit event-log regressions.

Run History

Metric2026-08-10 19:34 UTC #1
logs / deploy
2026-08-10 20:24 UTC #1
logs / deploy
2026-08-11 08:26 UTC #1
logs / deploy
Resultno regressions2/14 regressions4/14 regressions
Total141414
completed141210
CORRUPTED_EVENT_LOG004
USER_ERROR020
RUNTIME_ERROR000
stuck000
other000
infra000
Config14 runs / step-storm 6, hook-storm 6, hook-sleep 2 / c8 / 6x814 runs / step-storm 6, hook-storm 6, hook-sleep 2 / c8 / 6x814 runs / step-storm 6, hook-storm 6, hook-sleep 2 / c8 / 6x8
Timingwatchdog 2500ms / step 2200±250ms / stagger 400ms / poke 750ms / timeout 240000mswatchdog 2500ms / step 2200±250ms / stagger 400ms / poke 750ms / timeout 240000mswatchdog 2500ms / step 2200±250ms / stagger 400ms / poke 750ms / timeout 240000ms

Latest Scenario Breakdown

ScenarioTotalcompletedCORRUPTED_EVENT_LOGUSER_ERRORRUNTIME_ERRORstuckotherinfra
step-storm66000000
hook-storm62400000
hook-sleep22000000

Latest Non-Completed Runs

ScenarioAttemptOutcomeStatusError codeRun
hook-storm5CORRUPTED_EVENT_LOGfailedCORRUPTED_EVENT_LOGwrun_41KZQYT2GF0GGFCK46VENJ1PKX
hook-storm4CORRUPTED_EVENT_LOGfailedCORRUPTED_EVENT_LOGwrun_41KZQYT2GF0GGFCK46VENJ1PKW
hook-storm2CORRUPTED_EVENT_LOGfailedCORRUPTED_EVENT_LOGwrun_41KZQYT2GF0GGFCK46VENJ1PKT
hook-storm3CORRUPTED_EVENT_LOGfailedCORRUPTED_EVENT_LOGwrun_41KZQYT2GF0GGFCK46VENJ1PKV

VaguelySeriousand others added 8 commits August 10, 2026 12:46
Signed-off-by: Luca Maraschi <luca.maraschi@gmail.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
… so `Date` subclasses work (#3372)
* test: add failing test for Date subclassing in workflow VM
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: ar_tama <arata.makoto@gmail.com>
* fix(core): preserve `new.target` in the deterministic `Date` override so `Date` subclasses work in workflow functions
The VM's `Date` override was a plain function, so `class X extends Date`
lost the subclass identity: `super()` returned a fresh plain `Date` that
became `this`, dropping the subclass's methods and fields. This silently
broke `Date` subclasses like `TZDate` from `@date-fns/tz`.
Using `class Date extends Date_` keeps `new.target` intact, and `extends`
already wires up the prototype chain and statics, so the manual
`prototype` assignment and `Object.setPrototypeOf` fix-ups are no longer
needed. Determinism is unchanged: zero-arg construction still returns the
fixed timestamp and `Date.now()` is still overridden.
Fixes#3371
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: ar_tama <arata.makoto@gmail.com>
* test: add failing test for calling `Date()` without `new`
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: ar_tama <arata.makoto@gmail.com>
* fix(core): keep `Date()` callable without `new`
Use a plain function that branches on `new.target` and constructs via
`Reflect.construct(Date_, args, new.target)` instead of a class: subclassing
still works (`new.target` is forwarded), and calling `Date()` without `new`
now matches the spec — arguments are ignored and the (fixed) time string is
returned, where the previous override returned a `Date` object.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: ar_tama <arata.makoto@gmail.com>
* chore: update changeset to match the final `Reflect.construct` implementation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: ar_tama <arata.makoto@gmail.com>
---------
Signed-off-by: ar_tama <arata.makoto@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Combines the QuickJS-default dry-run with divergence-detection and
write-fencing parity (#3453) so the event-log-race repro measures the
same corruption classes on both engines. Conflict resolutions:
- makeLiveSession takes both the snapshot-state accessor and the
observed-events ledger; the snapshot-restore path runs the divergence
sweep against its delta view (a throw there falls back to a fresh
full replay, whose sweep is authoritative).
- The precondition view tracker seeds its event count from the restored
snapshot's metadata.eventCount (delta ids sort above the snapshot
cursor, so watermark+count still describe the full log); snapshots
without an eventCount fail open, and the restore-failure fallback
rebuilds the view from the refetched full log.
@TooTallNate

TooTallNate commented Aug 11, 2026

Copy link
Copy Markdown
MemberAuthor

Repro readout after merging quickjs-divergence-parity (#3453)

The 2026-08-11 08:26 run is the first repro pass where the QuickJS engine carries the node engine's divergence detection + write fencing. The instrument now works, and the picture changes materially:

Before parity (this PR's earlier runs)After parity (08:26 run)
step-storm6/6 completed6/6 completed
hook-storm0 CORRUPTED_EVENT_LOG, 0–2 USER_ERROR, rest "completed"4/6 CORRUPTED_EVENT_LOG, 0 USER_ERROR
hook-sleep2/22/2

All four failures decrypt to the exact same signature as the node engine's hook-storm failures:

step event step_created for step_... belongs to "recoverStep",
but the current step consumer is "finalizeStep"
(diverged 4 times after 3 recovery replays)

i.e. the racing-writer / correlation-id-renumbering class — not a false positive of the new detection (a genuine one-off log would be reproduced by the recovery replays; these diverge identically on every recovery pass, which is the definition of an unsatisfiable log).

What this means

  • QuickJS was never immune to the corruption class — it was blind to it. Its earlier "zero corruptions" here decomposed into USER_ERROR (self-HookConflictError when the shifted ordinal hit a hook token) and, for step-ordinal hits, silently wrong completions counted as green. With stepName validation those now classify identically to node.
  • The two engines now report the same disease with the same instrument: node (with the EventsConsumer rewrite) showed 1/6 hook-storm corruption; QuickJS shows 4/6 (small samples — but the direction is consistent with QuickJS's inline continuation loop holding live views across more writes).
  • No SDK-side engine work reaches zero on hook-storm; the racing branch-decision writes need write-side ordering (event slots / commit-ordered positions).

The merge also closed the entrypoint's precondition-guard KNOWN GAP (all replay-context writes now fenced, including snapshot-restore-aware view seeding from metadata.eventCount) — worth keeping in mind when comparing rates against runs before this merge.

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

Labels

event-log-race-reproRun the event log race reproduction job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@TooTallNate@pranaygp@VaguelySerious@lucamaraschi@ar-tama@caleb-vercel