[DO NOT MERGE] CI dry-run: QuickJS as the default workflow VM engine - #3253
[DO NOT MERGE] CI dry-run: QuickJS as the default workflow VM engine#3253TooTallNate wants to merge 12 commits into
Conversation
🦋 Changeset detectedLatest commit: 8a78801 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
🧪 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):
E2E Test SummarySummary
Details by Category❌ ▲ Vercel Production
✅ 💻 Local Development
❌ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
✅ vercel-multi-region
|
VaguelySerious
left a comment
There was a problem hiding this comment.
AI review: blocking issues found
…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().
1ff3cc8 to
6af2c2c
Compare
📊 Workflow Benchmarkscommit Backend:
📈 STSO distribution vs main (inline / queue-hop histograms)1020 steps (inline) Cumulative STSO time: main 170410ms → this run 864672ms (Δ +694262ms, +407%) 1020 steps (queue-hop) Cumulative STSO time: 9310ms over 2 samples No 📜 Previous results (4)c671016Mon, 10 Aug 2026 20:52:43 GMT · run logs
d41872aMon, 10 Aug 2026 19:58:41 GMT · run logs
74bd053Tue, 04 Aug 2026 01:01:14 GMT · run logs
6af2c2cFri, 31 Jul 2026 23:40:21 GMT · run logs
ℹ️ Metric definitions & methodologyThe 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: Best/P75/P90/P99 deltas compare against the most recent benchmark run on 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 ( Cold starts are kept in the numbers on purpose — they are part of real bursty-workload latency. The workbench deployment cold-starts the |
|
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,
¹ 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 ( A fair comparison needs |
|
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
Performance (postgres, from event-log forensics):
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 ( |
Event Log Race Repro4 of 14 latest repro runs hit event-log regressions. Run History
Latest Scenario Breakdown
Latest Non-Completed Runs
|
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.
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:
All four failures decrypt to the exact same signature as the node engine's hook-storm failures on #3447: 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
The merge also closed the entrypoint's precondition-guard KNOWN GAP (all replay-context writes now fenced, including snapshot-restore-aware view seeding from |
Warning
Not intended to merge. This PR exists to exercise the full CI matrix — and the
event-log-race-reprostress 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)
useQuickJSVmdefaults to the QuickJS engine when neither the run's stampedexecutionContext.workflowVmnorWORKFLOW_VMspecifies one;WORKFLOW_VM=nodeis the explicit node:vm opt-in.WORKFLOW_VMunset (exercising the default-selection path end to end); node legs opt in explicitly. Labels/artifacts unchanged viaMATRIX_VM.WORKFLOW_VM=node(see the comment at each pin).Findings so far (feeding the real flip PR)
event-limitred) 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).crypto, frozenprocess.env, loudIntl/locale guards); remaining differences are enumerated in the docs.start()— under a flipped default, unsetWORKFLOW_VMcurrently 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.