Skip to content

[core] Make a duplicate attr_set inert instead of terminal - #3849

Merged
pranaygp merged 2 commits into
mainfrom
peter/attr-set-duplicate-inert
Aug 28, 2026
Merged

pranaygp merged 2 commits into
mainfrom
peter/attr-set-duplicate-inert

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Problem

A workflow-body attribute write draws a correlation id that resolves exactly once: the dispatcher's consumer takes the matching event and deregisters. If the log ends up holding a second attr_set under that id — two replays at the same body position draw the same id, and a World commits both — that second event has no callback left, and never will.

attr_set had no entry in ENTITY_EVENT_CLASS_BY_TYPE, so the duplicate skip could not take it. It is in PARKABLE_EVENT_TYPES, so it was parked instead, waiting for a consumer that cannot come.

Parking is settled by the workflow function returning, and anything still held there is reported through strandedEvent:

Replay finished without consuming event: eventType=attr_set, correlationId=attr_…, eventId=…

So the run did all of its work — every step completed successfully — and then the final replay, the one where the body returns, failed it. Because the log is immutable, every recovery replay reproduced it identically, which burned the whole REPLAY_DIVERGENCE_MAX_RETRIES budget in about a second and terminated the run with CORRUPTED_EVENT_LOG.

This has been observed in production. It is rare (it needs two replays to land on the same drawn attribute id), but when it happens the run is always lost, always at the very end, and always after the user-visible work has already succeeded.

Fix

Give attr_set an entity event class. The straggler then takes skipDuplicateEvent like every other one — committed but inert, which is the invariant duplicate-events.test.ts already documents for step_created / step_started / wait_created.

Parking still covers the case it was added for: an attr_set the walk reaches before the body has made the call that claims it. That one is a first arrival, still owed to a consumer, and is unaffected.

An attribute write from a step body carries no correlation id and is claimed by the structural lifecycle consumer in workflow.ts on the way past, so it is consumed rather than skipped, and several of them never collapse into one class.

Tests

Three, all failing before the change except the guard:

  • events-consumer.test.ts — a second attr_set for a resolved id is skipped, reports through onDuplicateEvent, leaves nothing stranded, and the walk still reaches the event after it.
  • events-consumer.test.ts — a first-arrival attr_set with no subscriber yet still parks and is still claimable by a late subscriber (guards against the skip swallowing it; passes before and after).
  • duplicate-events.test.ts — drives the real setAttributes primitive against a log holding the duplicate, and asserts strandedEvent is undefined once the body returns. This is the exact predicate workflow.ts evaluates.

packages/core 2284 passed, packages/world 165 passed.

Note

This is the read side. The write side — a World committing two events under one drawn id — is worth closing separately; this change means a run survives it either way.

A workflow-body attribute write draws a correlation id that resolves exactly
once: the dispatcher's consumer takes the matching event and deregisters. A
second event under that id therefore has no callback left and never will.

`attr_set` had no entry in ENTITY_EVENT_CLASS_BY_TYPE, so the duplicate skip
could not take it, and `PARKABLE_EVENT_TYPES` does list the type, so it was
parked for a consumer that could never come. Parking is settled by the workflow
function returning, and a survivor there is reported through `strandedEvent` as
a replay divergence. So the run did all of its work, every step succeeded, and
the final replay failed it, deterministically enough to burn the whole
replay-divergence recovery budget and terminate with CORRUPTED_EVENT_LOG.

Give `attr_set` a class so the straggler is skipped like every other one:
committed but inert. Parking still covers the first arrival, for a replay that
walks past an attribute event before the body reaches the call that claims it.
An attribute write from a step body carries no correlation id and is consumed by
the structural lifecycle consumer, so it is unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code owner August 27, 2026 17:05
@changeset-bot

changeset-bot Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0d4612c

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

This PR includes changesets to release 20 packages
Name Type
@workflow/world Patch
@workflow/core Patch
@workflow/web-shared Patch
@workflow/cli Patch
@workflow/vitest Patch
@workflow/web Patch
@workflow/world-local Patch
@workflow/world-postgres Patch
@workflow/world-testing Patch
@workflow/world-vercel Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/nitro Patch
workflow Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt Patch

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

vercel Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Aug 28, 2026 3:44am
example-nextjs-workflow-webpack Ready Ready Preview, v0 Aug 28, 2026 3:44am
example-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workbench-astro-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workbench-express-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workbench-fastify-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workbench-hono-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workbench-nestjs-workflow Building Building Preview, v0 Aug 28, 2026 3:44am
workbench-nitro-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workbench-nuxt-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workbench-python-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workbench-sveltekit-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workbench-tanstack-start-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workbench-vite-workflow Ready Ready Preview, v0 Aug 28, 2026 3:44am
workflow-docs Ready Ready Preview, v0 Aug 28, 2026 3:44am
workflow-swc-playground Ready Ready Preview, v0 Aug 28, 2026 3:44am
workflow-tarballs Ready Ready Preview, v0 Aug 28, 2026 3:44am
workflow-web Ready Ready Preview, v0 Aug 28, 2026 3:44am

@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

❌ Some tests failed

❌ Failed E2E Tests

▲ Vercel Production (8 failed)

python-node (8 failed):

  • promiseAllWorkflow | wrun_41M137DB0Z0GSZVZQWF453F97C | 🔍 observability
  • sleepingWorkflow | wrun_41M137E00W0GZ6HK7KMHM1JJYE | 🔍 observability
  • parallelSleepWorkflow | wrun_41M137E0HC0GYP2AECXVESWXZZ | 🔍 observability
  • nullByteWorkflow | wrun_41M137E6XE0GTYGZQ4MQ8TMRR0 | 🔍 observability
  • cancelRun - cancelling a running workflow | wrun_41M137JV5R0GKRE06R1ZB0QB3Y | 🔍 observability
  • cancelRun via CLI - cancelling a running workflow | wrun_41M137JWTA0GQK7AJ51FTFSEGD | 🔍 observability
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_41M137K6AZ0GT2H9D2XAMG80BB | 🔍 observability
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_41M137KS3R0GYJ16X6WCSCVPV7 | 🔍 observability

💻 Local Development (1 failed)

vite-stable-quickjs (1 failed):

  • hookWorkflow | wrun_41M137DPTT0GMYWAKK6V3ABTWR

🌐 Cross-language Conformance (9 failed)

python (9 failed):

  • deploymentId: 'latest' is a no-op in non-Vercel worlds | wrun_01M137QNVX2Z3VVS0J18VWTMYH
  • promiseAllWorkflow | wrun_41M137DB0Z0GSZVZQWF453F97C
  • sleepingWorkflow | wrun_41M137E00W0GZ6HK7KMHM1JJYE
  • parallelSleepWorkflow | wrun_41M137E0HC0GYP2AECXVESWXZZ
  • nullByteWorkflow | wrun_41M137E6XE0GTYGZQ4MQ8TMRR0
  • cancelRun - cancelling a running workflow | wrun_41M137JV5R0GKRE06R1ZB0QB3Y
  • cancelRun via CLI - cancelling a running workflow | wrun_41M137JWTA0GQK7AJ51FTFSEGD
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_41M137K6AZ0GT2H9D2XAMG80BB
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_41M137KS3R0GYJ16X6WCSCVPV7

⚠️ 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 (tanstack-start)
  • cancelRun via CLI - cancelling a running workflow (nitro)
  • hookWithSleepFinalStepWorkflow - step only on final payload (nextjs-turbopack)
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep (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.

35 infra events
  • cold-start-warmup · suite warmup (python) · at 03:44:40Z · abandoned wrun_41M137CV8S0GMABW1139YA39K4 · (+7 more)
  • run-pickup-stall · promiseAllWorkflow (python) · at 03:44:57Z · abandoned wrun_41M137GFZA0GPXQHK559K6EWKG
  • run-pickup-stall · nullByteWorkflow (python) · at 03:44:57Z · abandoned wrun_41M137GFZK0GN3AX7529TH8E4D
  • run-pickup-stall · parallelSleepWorkflow (python) · at 03:44:57Z · abandoned wrun_41M137GFZG0GM2ESHWFMWC4Q6R
  • run-pickup-stall · sleepingWorkflow (python) · at 03:44:57Z · abandoned wrun_41M137GFZG0GM2ESHWFMWC4Q6Q
  • run-pickup-stall · cancelRun - cancelling a running workflow (python) · at 03:44:57Z · abandoned wrun_41M137GGAP0GRBF19QDPGX79NF
  • run-pickup-stall · cancelRun - cancelling a running workflow (python) · at 03:45:30Z · abandoned wrun_41M137HG1V0GWSHVA0705528EM
  • run-pickup-stall · nullByteWorkflow (python) · at 03:45:57Z · abandoned wrun_41M137JBAR0GZBRBD0QAE0AADX
  • run-pickup-stall · parallelSleepWorkflow (python) · at 03:45:57Z · abandoned wrun_41M137JBB20GMM32YA0DV72X2N
  • run-pickup-stall · promiseAllWorkflow (python) · at 03:45:57Z · abandoned wrun_41M137JBDY0GRA0RA6MS8H0YRV
  • run-pickup-stall · sleepingWorkflow (python) · at 03:45:57Z · abandoned wrun_41M137JBA90GQ07Q4BDQA5RMFP
  • cold-start-warmup · suite warmup (tanstack-start) · at 03:46:28Z · abandoned wrun_01M137JY56V2MSNF1WMSDSWZC8
  • run-pickup-stall · cancelRun via CLI - cancelling a running workflow (python) · at 03:46:48Z · abandoned wrun_41M137JFTA0GVFMJNMSQE7VXRW
  • cold-start-warmup · suite warmup (python) · at 03:47:21Z · abandoned wrun_01M137HQE5631W03G7Q54MRS10 · (+7 more)
  • run-pickup-stall · deploymentId: 'latest' is a no-op in non-Vercel worlds (python) · at 03:47:36Z · abandoned wrun_01M137NCJVSV4SVXEQ35F6JPF1
  • run-pickup-stall · nullByteWorkflow (python) · at 03:47:36Z · abandoned wrun_01M137NCK5KB79EDW45M3T0HDT
  • run-pickup-stall · promiseAllWorkflow (python) · at 03:47:36Z · abandoned wrun_01M137NCJVSV4SVXEQ35F6JPF2
  • run-pickup-stall · sleepingWorkflow (python) · at 03:47:36Z · abandoned wrun_01M137NCK1GB4EHD5GXNEP952R
  • run-pickup-stall · parallelSleepWorkflow (python) · at 03:47:36Z · abandoned wrun_01M137NCK23NMP8RCVMXP8VVKZ
  • run-pickup-stall · stepFunctionAsStartArgWorkflow - step function reference passed as start() argument (nuxt) · at 03:47:54Z · abandoned wrun_01M137NYKP2QJW2KNPSE7PT5KZ
  • run-pickup-stall · cancelRun via CLI - cancelling a running workflow (python) · at 03:48:29Z · abandoned wrun_41M137N7PW0GSEQTCAYWE1P3CE
  • run-pickup-stall · sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration (python) · at 03:48:29Z · abandoned wrun_41M137N36W0GY1VQXX2E9ZGT2V
  • run-pickup-stall · promiseAllWorkflow (python) · at 03:48:36Z · abandoned wrun_01M137Q76MZVV9JC55G9D8A0E8
  • run-pickup-stall · deploymentId: 'latest' is a no-op in non-Vercel worlds (python) · at 03:48:36Z · abandoned wrun_01M137Q76HHVGJ9706NB0WDGR5
  • run-pickup-stall · sleepingWorkflow (python) · at 03:48:36Z · abandoned wrun_01M137Q76PJP7KDJN99A3MNXFS
  • run-pickup-stall · parallelSleepWorkflow (python) · at 03:48:36Z · abandoned wrun_01M137Q76SVEQS7VPXNEN3CQF6
  • run-pickup-stall · nullByteWorkflow (python) · at 03:48:36Z · abandoned wrun_01M137Q76YMKTC7Z2FYDVASH6J
  • run-pickup-stall · cancelRun - cancelling a running workflow (python) · at 03:49:36Z · abandoned wrun_01M137S1T825AZ6T1PK2MJZXD2
  • run-pickup-stall · sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration (python) · at 03:49:36Z · abandoned wrun_01M137S1TPZBKNBVYFAYAP2JP1
  • run-pickup-stall · cancelRun via CLI - cancelling a running workflow (python) · at 03:49:36Z · abandoned wrun_01M137S1TJ2AMTG1HWPD22BF4A
  • run-pickup-stall · cancelRun via CLI - cancelling a running workflow (python) · at 03:50:06Z · abandoned wrun_01M137SZ64EH3HSMC70A8ZT3H9
  • run-pickup-stall · cancelRun - cancelling a running workflow (python) · at 03:50:06Z · abandoned wrun_01M137SZ657ZYCB7CK2D7FJ17V
  • run-pickup-stall · sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration (python) · at 03:50:36Z · abandoned wrun_01M137TWDTMZ71ZZVQ99BZZ1NR
  • run-pickup-stall · hookCleanupTestWorkflow - hook token reuse after workflow completion (nextjs-webpack) · at 03:53:05Z · abandoned wrun_01M137ZDZP1Z5GZ7TGN6P7SEMR
  • run-pickup-stall · concurrent hook token conflict - two workflows cannot use the same hook token simultaneously (nextjs-webpack) · at 03:53:07Z · abandoned wrun_01M137ZGA96XG0R82YX2Z6RMB7

E2E Test Summary

Summary
Passed Failed Skipped Total
❌ ▲ Vercel Production 3570 8 742 4320
❌ 💻 Local Development 3921 1 558 4480
✅ 📦 Local Production 3922 0 558 4480
✅ 🐘 Local Postgres 3922 0 558 4480
✅ 🪟 Windows 320 0 0 320
❌ 🌐 Cross-language Conformance 0 9 132 141
✅ vercel-http-transport 817 0 143 960
✅ vercel-multi-region 27 0 0 27
✅ vercel-ws-transport 553 0 87 640
Total 17052 18 2778 19848
Details by Category

❌ ▲ Vercel Production

App Passed Failed Skipped
✅ astro-node 132 0 28
✅ astro-quickjs 132 0 28
✅ example-node 132 0 28
✅ example-quickjs 132 0 28
✅ express-node 132 0 28
✅ express-quickjs 132 0 28
✅ fastify-node 132 0 28
✅ fastify-quickjs 132 0 28
✅ hono-node 132 0 28
✅ hono-quickjs 132 0 28
✅ nest-node 132 0 28
✅ nest-quickjs 132 0 28
✅ nextjs-turbopack-node 157 0 3
✅ nextjs-turbopack-quickjs 157 0 3
✅ nextjs-webpack-node 157 0 3
✅ nextjs-webpack-quickjs 157 0 3
✅ nitro-node 132 0 28
✅ nitro-quickjs 132 0 28
✅ nuxt-node 132 0 28
✅ nuxt-quickjs 132 0 28
❌ python-node 0 8 152
✅ sveltekit-node 151 0 9
✅ sveltekit-quickjs 151 0 9
✅ tanstack-start-node 132 0 28
✅ tanstack-start-quickjs 132 0 28
✅ vite-node 132 0 28
✅ vite-quickjs 132 0 28

❌ 💻 Local Development

App Passed Failed Skipped
✅ astro-stable-node 134 0 26
✅ astro-stable-quickjs 134 0 26
✅ express-stable-node 134 0 26
✅ express-stable-quickjs 134 0 26
✅ fastify-stable-node 134 0 26
✅ fastify-stable-quickjs 134 0 26
✅ hono-stable-node 134 0 26
✅ hono-stable-quickjs 134 0 26
✅ nest-stable-node 134 0 26
✅ nest-stable-quickjs 134 0 26
✅ nextjs-turbopack-canary-node 141 0 19
✅ nextjs-turbopack-canary-quickjs 141 0 19
✅ nextjs-turbopack-stable-node 160 0 0
✅ nextjs-turbopack-stable-quickjs 160 0 0
✅ nextjs-webpack-canary-node 141 0 19
✅ nextjs-webpack-canary-quickjs 141 0 19
✅ nextjs-webpack-stable-node 160 0 0
✅ nextjs-webpack-stable-quickjs 160 0 0
✅ nitro-stable-node 134 0 26
✅ nitro-stable-quickjs 134 0 26
✅ nuxt-stable-node 134 0 26
✅ nuxt-stable-quickjs 134 0 26
✅ sveltekit-stable-node 153 0 7
✅ sveltekit-stable-quickjs 153 0 7
✅ tanstack-start-node 134 0 26
✅ tanstack-start-quickjs 134 0 26
✅ vite-stable-node 134 0 26
❌ vite-stable-quickjs 133 1 26

✅ 📦 Local Production

App Passed Failed Skipped
✅ astro-stable-node 134 0 26
✅ astro-stable-quickjs 134 0 26
✅ express-stable-node 134 0 26
✅ express-stable-quickjs 134 0 26
✅ fastify-stable-node 134 0 26
✅ fastify-stable-quickjs 134 0 26
✅ hono-stable-node 134 0 26
✅ hono-stable-quickjs 134 0 26
✅ nest-stable-node 134 0 26
✅ nest-stable-quickjs 134 0 26
✅ nextjs-turbopack-canary-node 141 0 19
✅ nextjs-turbopack-canary-quickjs 141 0 19
✅ nextjs-turbopack-stable-node 160 0 0
✅ nextjs-turbopack-stable-quickjs 160 0 0
✅ nextjs-webpack-canary-node 141 0 19
✅ nextjs-webpack-canary-quickjs 141 0 19
✅ nextjs-webpack-stable-node 160 0 0
✅ nextjs-webpack-stable-quickjs 160 0 0
✅ nitro-stable-node 134 0 26
✅ nitro-stable-quickjs 134 0 26
✅ nuxt-stable-node 134 0 26
✅ nuxt-stable-quickjs 134 0 26
✅ sveltekit-stable-node 153 0 7
✅ sveltekit-stable-quickjs 153 0 7
✅ tanstack-start-node 134 0 26
✅ tanstack-start-quickjs 134 0 26
✅ vite-stable-node 134 0 26
✅ vite-stable-quickjs 134 0 26

✅ 🐘 Local Postgres

App Passed Failed Skipped
✅ astro-stable-node 134 0 26
✅ astro-stable-quickjs 134 0 26
✅ express-stable-node 134 0 26
✅ express-stable-quickjs 134 0 26
✅ fastify-stable-node 134 0 26
✅ fastify-stable-quickjs 134 0 26
✅ hono-stable-node 134 0 26
✅ hono-stable-quickjs 134 0 26
✅ nest-stable-node 134 0 26
✅ nest-stable-quickjs 134 0 26
✅ nextjs-turbopack-canary-node 141 0 19
✅ nextjs-turbopack-canary-quickjs 141 0 19
✅ nextjs-turbopack-stable-node 160 0 0
✅ nextjs-turbopack-stable-quickjs 160 0 0
✅ nextjs-webpack-canary-node 141 0 19
✅ nextjs-webpack-canary-quickjs 141 0 19
✅ nextjs-webpack-stable-node 160 0 0
✅ nextjs-webpack-stable-quickjs 160 0 0
✅ nitro-stable-node 134 0 26
✅ nitro-stable-quickjs 134 0 26
✅ nuxt-stable-node 134 0 26
✅ nuxt-stable-quickjs 134 0 26
✅ sveltekit-stable-node 153 0 7
✅ sveltekit-stable-quickjs 153 0 7
✅ tanstack-start-node 134 0 26
✅ tanstack-start-quickjs 134 0 26
✅ vite-stable-node 134 0 26
✅ vite-stable-quickjs 134 0 26

✅ 🪟 Windows

App Passed Failed Skipped
✅ nextjs-turbopack-node 160 0 0
✅ nextjs-turbopack-quickjs 160 0 0

❌ 🌐 Cross-language Conformance

App Passed Failed Skipped
❌ python 0 9 132

✅ vercel-http-transport

App Passed Failed Skipped
✅ example 132 0 28
✅ express 132 0 28
✅ hono 132 0 28
✅ nextjs-turbopack 157 0 3
✅ nitro 132 0 28
✅ vite 132 0 28

✅ vercel-multi-region

App Passed Failed Skipped
✅ nextjs-turbopack 27 0 0

✅ vercel-ws-transport

App Passed Failed Skipped
✅ example 132 0 28
✅ express 132 0 28
✅ nextjs-turbopack 157 0 3
✅ vite 132 0 28

📋 View full workflow run

@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit 0d4612c · Fri, 28 Aug 2026 04:06:20 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 191 (+1.6%) 1236 🔴 (+11%) 1309 🔴 (+14%) 1785 🔴 (+23%) 🔻 30
TTFS stream 199 (+24%) 🔻 1440 🔴 (+28%) 🔻 1456 🔴 (+26%) 🔻 1643 🔴 (+21%) 🔻 30
TTFS hook + stream 1543 (+29%) 🔻 1630 🔴 (+17%) 🔻 1669 🔴 (+15%) 🔻 2202 🔴 (+44%) 🔻 30
Fan-out TTFS Promise.all(100 steps) 589 (-9.4%) 2011 (+14%) 2027 (+5.5%) 2039 (-3.2%) 10
Fan-out TTLS Promise.all(100 steps) 1943 (+4.1%) 3912 (+5.2%) 3939 (+3.4%) 4227 (-39%) 💚 10
STSO 1020 steps (inline) 100 (-8.3%) 145 (-8.8%) 161 (-13%) 277 (-3.1%) 1019
WO 1020 steps 146048 (-5.0%) 146048 (-5.0%) 146048 (-5.0%) 146048 (-5.0%) 1
CRTT first chunk (pooled) 94 (-1.1%) 151 (-5.0%) 197 (-1.0%) 278 (-17%) 💚 28

Streams

Scenario CRTT 1st p75 p90 p99 CDV max iters
paced control (100/s, 60B) 123 (-10%) 159 (-13%) 263 (+6%) 420 (-23%) 152 (-17%) 10
size sweep (100/s, 160B-12KB) 122 (-7%) 161 (-24%) 275 (-53%) 579 (-35%) 142 (-33%) 10
replay gateway-gpt-5.4-nano-2000t (1x) 188 (+38%) 119 (-33%) 161 (-33%) 365 (-12%) 331 (+1%) 3
replay eve-gpt-5.6-sol-2000t (1x) 112 (-22%) 132 (-29%) 183 (-36%) 567 (-17%) 411 (-35%) 2
replay eve-gpt-5.6-sol-2000t (2x) 120 (-20%) 196 (-22%) 355 (-31%) 676 (-28%) 269 (-43%) 3
📈 STSO distribution vs main (inline / queue-hop histograms)

1020 steps (inline)

Cumulative STSO time: main 153650ms → this run 144769ms (Δ -8881ms, -6%)

100-150 ms  ████████████████████░░░┃  main 681  this 818  +137
150-200 ms  ████┃███                  main 264  this 176   -88
200-250 ms  ┃█                        main  52  this  11   -41
250-300 ms  ┃                         main  15  this   6    -9
300-350 ms  ┃                         main   5  this   3    -2
350-400 ms  ┃                         main   2  this   2    +0
400-450 ms  ┃                         main   0  this   2    +2
500-550 ms  ┃                         main   0  this   1    +1
📈 CRTT drill-down vs main (RTT distributions & profiles)
variant  RTT 1ms→5s+             avg         p50         p90         p99     n
control  ······▅█▂····    129 (-16%)  112 (-19%)   263 (+6%)  420 (-23%)  3000
sweep    ······▆█▂▁···    128 (-32%)  110 (-19%)  275 (-53%)  579 (-35%)  3000
gw 1x    ·····▁█▇▁▁···  106.6 (-28%)   98 (-27%)  161 (-33%)  365 (-12%)  5295
eve 1x   ·····▁██▂▁···  122.2 (-24%)   99 (-28%)  183 (-36%)  567 (-17%)  5186
eve 2x   ·····▁▃█▃▁···  157.3 (-29%)  129 (-26%)  355 (-31%)  676 (-28%)  7779

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

control  █▄▅▄▁▁▁▂▂▁  111–174ms
sweep    ▅█▃▂▆▆▁▆▆▂  113–144ms
gw 1x    █▂▆▅▂▁▁▂▃▃  95–133ms
eve 1x   ▂▁▂▄▂▃▅█▄▁  93–192ms
eve 2x   ▃▁▁▂▂▂▃█▄▂  120–259ms

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

sweep  ▃▄█▇▄▁▁  126–131ms

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

control  █▅▆▅▁▂▄▃▆▄  34–43ms
sweep    ▄▁▂▅█▄▄▅▄▆  35–60ms
gw 1x    █▁▆▃▂▄▂▂▃▂  26–38ms
eve 1x   ▁▂▁▁▂▃█▆▄▂  20–32ms
eve 2x   ▇▃▁▂▄▅▄▅▃█  19–32ms
📜 Previous results (1)

20f051f

Thu, 27 Aug 2026 17:22:14 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1215 (+232%) 🔻 1292 🔴 (+13%) 1335 🔴 (+8.1%) 1420 🔴 (-1.2%) 30
TTFS stream 1207 (+391%) 🔻 1272 🔴 (+13%) 1292 🔴 (+13%) 1319 🔴 (-8.3%) 30
TTFS hook + stream 475 (+1.3%) 1578 🔴 (+12%) 1677 🔴 (+16%) 🔻 6061 🔴 (+222%) 🔻 30
Fan-out TTFS Promise.all(100 steps) 536 (-13%) 814 (-4.5%) 1868 (+98%) 🔻 1989 (+19%) 🔻 10
Fan-out TTLS Promise.all(100 steps) 1873 (-13%) 2446 (-10%) 3880 (+35%) 🔻 8850 (+25%) 🔻 10
STSO 1020 steps (inline) 92 (-9.8%) 121 (-27%) 💚 142 (-26%) 💚 186 (-33%) 💚 1019
WO 1020 steps 120940 (-23%) 💚 120940 (-23%) 💚 120940 (-23%) 💚 120940 (-23%) 💚 1
CRTT first chunk (pooled) 88 (-18%) 💚 115 (-30%) 💚 139 (-35%) 💚 250 (-60%) 💚 28

Streams

Scenario CRTT 1st p75 p90 p99 CDV max iters
paced control (100/s, 60B) 113 (-14%) 126 (-40%) 199 (-56%) 989 (+35%) 134 (-65%) 10
size sweep (100/s, 160B-12KB) 97 (-39%) 113 (-67%) 144 (-76%) 276 (-64%) 105 (-42%) 10
replay gateway-gpt-5.4-nano-2000t (1x) 113 (-24%) 107 (-43%) 140 (-51%) 255 (-54%) 134 (-72%) 3
replay eve-gpt-5.6-sol-2000t (1x) 121 (-9%) 123 (-24%) 263 (+20%) 3461 (+300%) 1981 (+239%) 2
replay eve-gpt-5.6-sol-2000t (2x) 113 (-20%) 148 (-41%) 201 (-48%) 485 (-22%) 334 (+9%) 3
ℹ️ Metric definitions & methodology

Streams: 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-2000t eaf22f5946e7c61f3c65c7006d550df180cfabd4e706254a09f22aec0cfb420d · gateway-gpt-5.4-nano-2000t 6f24ac518b6b83ff1d0e85a5fe78230db192716d66a7fc6b2fe022752001d041

🔴 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-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟠 world-sim scenario book — 1 fail of 41 total

fence=per-spec

scenario outcome events virt replay violations
✅ smoke-no-steps completed 3 0ms ok 0
✅ smoke-one-step completed 6 0ms ok 0
✅ hook-at-step-started completed 12 0ms ok 0
✅ hook-at-step-completed completed 12 0ms ok 0
✅ hook-at-hook-created completed 12 0ms ok 0
✅ deadline-hook-wins completed 7 1.0h ok 0
✅ deadline-expires completed 7 1.0h ok 0
✅ long-sleep completed 11 30.0d ok 0
✅ hook-never-arrives stalled 3 0ms skipped 0
✅ step-retries-twice completed 10 2.0s ok 0
✅ parallel-steps completed 9 0ms ok 0
✅ hook-on-execution-state completed 12 0ms ok 0
✅ peek-hook-before-branch completed 12 0ms ok 0
✅ peek-hook-after-branch completed 12 0ms ok 0
✅ peek-hook-at-registration completed 12 0ms ok 0
✅ race-hook-before-probe completed 12 0ms ok 0
✅ race-hook-after-probe completed 12 0ms ok 0
✅ race-duplicate-delivery completed 13 0ms ok 0
✅ attr-hook-before-step completed 11 0ms ok 0
✅ attr-hook-after-step completed 11 0ms ok 0
✅ attr-from-step-body completed 13 0ms ok 0
✅ fork-hook-after-timeout completed 14 1.0m ok 0
✅ fork-hook-before-timeout completed 14 1.0m ok 0
✅ count-hook-after-timeout completed 17 1.0m ok 0
✅ count-hook-before-timeout completed 20 1.0m ok 0
✅ stale-read-step-count-fork completed 20 1.0m ok 0
✅ stale-read-equal-step-counts completed 14 1.0m ok 0
✅ step-vs-step-fork completed 12 0ms ok 0
✅ step-vs-step-fork-fenced completed 12 0ms ok 0
✅ fence-catches-benign-direction completed 12 5ms ok 0
✅ in-flight-before-decision completed 17 1.0m ok 0
❌ in-flight-before-decision-counted completed 17 1.0m ok 0
✅ in-flight-after-decision completed 19 2.0m ok 0
✅ stale-read-step-count-fork-fenced completed 20 1.0m ok 0
✅ fork-hook-wins completed 13 1.0m ok 0
✅ fork-timeout-wins completed 13 1.0m ok 0
✅ unclaimed-payload-under-fork completed 17 1.0m ok 0
✅ claimed-payload-under-fork completed 17 1.0m ok 0
✅ writers-independent-step-bodies completed 12 0ms ok 0
✅ writers-scripted-tempo completed 12 0ms ok 0
✅ cancel-mid-step cancelled 7 0ms skipped 0

Full trace: world-sim.txt

@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor
Framework Flow route Step reg. Framework output
hono 200.9 KiB (±0) 40.3 KiB (+22 B) 1.76 MiB (-42 B)
nextjs-turbopack 206.3 KiB (±0) 439 B (±0) 763.3 KiB (-218 B)
About these numbers

Sizes are gzip; parentheses show the change against main.
Flow route and Step reg. gate this job, on raw bytes rather than the gzip shown, at max(2%, 50.0 KiB). Framework output is informational.

0d4612c · run

@vercel vercel Bot 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.

Additional Suggestion:

A duplicate attr_set that is parked before its consumer subscribes is never reconciled against the event class recorded when an earlier parked copy is consumed, so it stays parked and strands the run as a CORRUPTED_EVENT_LOG at end of log.

Fix on Vercel

@pranaygp pranaygp 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.

simple change. makes sense to me

The class map alone decides a straggler only where the walk meets it after a
consumption recorded the class. When neither copy has a consumer yet both
park — the walk steps over the first and re-enters in the same tick, with
nothing consumed and so no class recorded — and the drain then claims one and
holds the other for a callback that will never be registered. That survivor is
`strandedEvent`, which is the CORRUPTED_EVENT_LOG this branch set out to stop,
reached by the other road. `dropParkedDuplicates` releases it on the same terms
the walk skips one. Not an `attr_set` property: `wait_completed` parks in pairs
too, and `ONE_SHOT_EVENT_TYPES` only sees the order where the consumption came
first.

Giving `attr_set` a class also moved the observability UI, which reads the same
`entityEventClass` to grey out events a run passed over. It kept treating the
straggler as live, because its terminal-class set had no `attr_set` while the
dispatcher's consumer does deregister on the first event under an id. The two
now share `classifyEntityEvent` and `TERMINAL_EVENT_CLASSES` rather than each
keeping a copy of the rule.

That sharing needs the entity rule to be exact, because a step-written
`attr_set` carries no correlation id: keyed on the run it would collapse every
attribute write a run made into one class, and a captured production log in
`__fixtures__` holds forty. `classifyEntityEvent` gives such an event no class
at all, so neither side can read the second as a repeat of the first.

The shared fixture corpus had nothing for `attr_set`, which is why the drift
between the two halves went unseen. It has four now, and each of them fails on
both sides without the fix above it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pranaygp

Copy link
Copy Markdown
Contributor

Took this over to finish it — the bot's suggestion was correct, and chasing it turned up a second gap in a neighbouring codebase. Pushed as 0d4612c.

1. The parked ordering (the bot's finding)

Confirmed and reproduced. The class map decides a straggler only where the walk meets it after a consumption recorded the class. When neither copy has a consumer yet, both park — the walk steps over the first and re-enters in the same tick, with nothing consumed and so no class recorded — and drainParked then claims one and holds the other for a callback that can never be registered. That survivor is strandedEvent, i.e. the same CORRUPTED_EVENT_LOG this branch set out to stop, reached by the other road.

dropParkedDuplicates releases it on the same terms the walk skips one. It is not an attr_set property — wait_completed parks in pairs too, and ONE_SHOT_EVENT_TYPES only covers the order where the consumption came first — so both types have a test.

2. The observability UI stopped agreeing with the runtime

Giving attr_set a class also moved @workflow/web-shared, which reads the same entityEventClass to grey out events a run passed over. It kept rendering the straggler as live, because its terminal-class set had no attr_set while the dispatcher's consumer does deregister on the first event under an id. On the same log: runtime skips events[3], UI reported [].

The two now share classifyEntityEvent and TERMINAL_EVENT_CLASSES from @workflow/world instead of each keeping a copy of the rule.

3. Step-written attribute events must not collapse

That sharing needs the entity rule to be exact. A step-written attr_set carries no correlation id, so keyed on the run it would fold every attribute write a run made into one class — and the captured production log in packages/core/src/__fixtures__/ holds forty. classifyEntityEvent gives such an event no class at all, so neither side can read the second as a repeat of the first. Naively adding attr_set to the UI's terminal set without this closes the run's own entity bucket and truncates the fold at the next run-level event.

Coverage

DUPLICATE_EVENT_FIXTURES had nothing for attr_set, which is why the drift went unseen — that corpus is the thing holding the two halves together. Four fixtures added, plus three consumer tests. Each fails without the fix above it, verified by reverting them one at a time:

revert fails
dropParkedDuplicates 2 consumer tests (attr_set, wait_completed)
the UI change 2 fixtures, web-shared side
the entity rule 4 fixtures, both sides

Green: core 2291, world 165, web-shared 212, typecheck clean. Sim book unchanged at 41 scenarios / 1 fail — in-flight-before-decision-counted, which fails identically on #3845–#3847 and is a count-guard scenario unrelated to this.

Not done: a sim-world scenario for the duplicate write. Producing a genuine second attr_set under one id needs a way to commit an out-of-band event that the scenario API does not expose, and a scenario built on an indirect stale-read arrangement would be red for reasons other than the one it names. Worth a follow-up if the sim grows that capability.

The two failing checks are both pre-existing: E2E Vercel Prod Tests (python - node) is red on every recent PR, and E2E Python Conformance only ran here because this touches packages/world — it fails on specVersion 7 exceeding the Python SDK's pydantic bound, which wants its own issue.

@pranaygp
pranaygp merged commit 855e479 into main Aug 28, 2026
180 of 184 checks passed
@pranaygp
pranaygp deleted the peter/attr-set-duplicate-inert branch August 28, 2026 18:45
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 855e479 (AI decision).

This is a genuine correctness fix (a parked duplicate attr_set surfacing as strandedEvent and terminating a completed run with CORRUPTED_EVENT_LOG), but it builds entirely on infrastructure that exists only on main: packages/world/src/event-metadata.ts (entityEventClass/ENTITY_EVENT_CLASS_BY_TYPE), packages/web-shared/src/lib/duplicate-events.ts, and the shared duplicate-event fixtures are all absent from origin/stable, and stable's packages/core/src/events-consumer.ts contains no parking, skipDuplicateEvent, or strandedEvent machinery at all. The defect therefore does not exist on the maintenance line and the change has nothing to apply against; if the underlying duplicate-event tolerance is ever backported, this fix should go with it.

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

855e47990c0da35419325da27976bae925afb0e9

This branch was successfully deployed

18 active deployments
Preview – workflow-swc-playground — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workflow-docs — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – example-nextjs-workflow-turbopack — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – example-nextjs-workflow-webpack — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-nuxt-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-tanstack-start-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – example-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-sveltekit-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-astro-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-vite-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-hono-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-express-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-fastify-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-nitro-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-nestjs-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workflow-tarballs — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workflow-web — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-python-workflow — 0d4612c7 Deployed Aug 28, 2026 by vercel[bot]
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.

2 participants