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

[core] Make a duplicate attr_set inert instead of terminal#3849
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 secondattr_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 ownerAugust 27, 2026 17:05
@changeset-bot

changeset-botBot 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
NameType
@workflow/worldPatch
@workflow/corePatch
@workflow/web-sharedPatch
@workflow/cliPatch
@workflow/vitestPatch
@workflow/webPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
@workflow/world-testingPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
workflowPatch
@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 27, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, v0Aug 28, 2026 3:44am
example-nextjs-workflow-webpackReadyReadyPreview, v0Aug 28, 2026 3:44am
example-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workbench-astro-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workbench-express-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workbench-fastify-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workbench-hono-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workbench-nestjs-workflowBuildingBuildingPreview, v0Aug 28, 2026 3:44am
workbench-nitro-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workbench-nuxt-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workbench-python-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workbench-sveltekit-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workbench-tanstack-start-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workbench-vite-workflowReadyReadyPreview, v0Aug 28, 2026 3:44am
workflow-docsReadyReadyPreview, v0Aug 28, 2026 3:44am
workflow-swc-playgroundReadyReadyPreview, v0Aug 28, 2026 3:44am
workflow-tarballsReadyReadyPreview, v0Aug 28, 2026 3:44am
workflow-webReadyReadyPreview, v0Aug 28, 2026 3:44am

@github-actions

github-actionsBot 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
PassedFailedSkippedTotal
❌ ▲ Vercel Production357087424320
❌ 💻 Local Development392115584480
✅ 📦 Local Production392205584480
✅ 🐘 Local Postgres392205584480
✅ 🪟 Windows32000320
❌ 🌐 Cross-language Conformance09132141
✅ vercel-http-transport8170143960
✅ vercel-multi-region270027
✅ vercel-ws-transport553087640
Total1705218277819848
Details by Category

❌ ▲ Vercel Production

AppPassedFailedSkipped
✅ astro-node132028
✅ astro-quickjs132028
✅ example-node132028
✅ example-quickjs132028
✅ express-node132028
✅ express-quickjs132028
✅ fastify-node132028
✅ fastify-quickjs132028
✅ hono-node132028
✅ hono-quickjs132028
✅ nest-node132028
✅ nest-quickjs132028
✅ nextjs-turbopack-node15703
✅ nextjs-turbopack-quickjs15703
✅ nextjs-webpack-node15703
✅ nextjs-webpack-quickjs15703
✅ nitro-node132028
✅ nitro-quickjs132028
✅ nuxt-node132028
✅ nuxt-quickjs132028
❌ python-node08152
✅ sveltekit-node15109
✅ sveltekit-quickjs15109
✅ tanstack-start-node132028
✅ tanstack-start-quickjs132028
✅ vite-node132028
✅ vite-quickjs132028

❌ 💻 Local Development

AppPassedFailedSkipped
✅ astro-stable-node134026
✅ astro-stable-quickjs134026
✅ express-stable-node134026
✅ express-stable-quickjs134026
✅ fastify-stable-node134026
✅ fastify-stable-quickjs134026
✅ hono-stable-node134026
✅ hono-stable-quickjs134026
✅ nest-stable-node134026
✅ nest-stable-quickjs134026
✅ nextjs-turbopack-canary-node141019
✅ nextjs-turbopack-canary-quickjs141019
✅ nextjs-turbopack-stable-node16000
✅ nextjs-turbopack-stable-quickjs16000
✅ nextjs-webpack-canary-node141019
✅ nextjs-webpack-canary-quickjs141019
✅ nextjs-webpack-stable-node16000
✅ nextjs-webpack-stable-quickjs16000
✅ nitro-stable-node134026
✅ nitro-stable-quickjs134026
✅ nuxt-stable-node134026
✅ nuxt-stable-quickjs134026
✅ sveltekit-stable-node15307
✅ sveltekit-stable-quickjs15307
✅ tanstack-start-node134026
✅ tanstack-start-quickjs134026
✅ vite-stable-node134026
❌ vite-stable-quickjs133126

✅ 📦 Local Production

AppPassedFailedSkipped
✅ astro-stable-node134026
✅ astro-stable-quickjs134026
✅ express-stable-node134026
✅ express-stable-quickjs134026
✅ fastify-stable-node134026
✅ fastify-stable-quickjs134026
✅ hono-stable-node134026
✅ hono-stable-quickjs134026
✅ nest-stable-node134026
✅ nest-stable-quickjs134026
✅ nextjs-turbopack-canary-node141019
✅ nextjs-turbopack-canary-quickjs141019
✅ nextjs-turbopack-stable-node16000
✅ nextjs-turbopack-stable-quickjs16000
✅ nextjs-webpack-canary-node141019
✅ nextjs-webpack-canary-quickjs141019
✅ nextjs-webpack-stable-node16000
✅ nextjs-webpack-stable-quickjs16000
✅ nitro-stable-node134026
✅ nitro-stable-quickjs134026
✅ nuxt-stable-node134026
✅ nuxt-stable-quickjs134026
✅ sveltekit-stable-node15307
✅ sveltekit-stable-quickjs15307
✅ tanstack-start-node134026
✅ tanstack-start-quickjs134026
✅ vite-stable-node134026
✅ vite-stable-quickjs134026

✅ 🐘 Local Postgres

AppPassedFailedSkipped
✅ astro-stable-node134026
✅ astro-stable-quickjs134026
✅ express-stable-node134026
✅ express-stable-quickjs134026
✅ fastify-stable-node134026
✅ fastify-stable-quickjs134026
✅ hono-stable-node134026
✅ hono-stable-quickjs134026
✅ nest-stable-node134026
✅ nest-stable-quickjs134026
✅ nextjs-turbopack-canary-node141019
✅ nextjs-turbopack-canary-quickjs141019
✅ nextjs-turbopack-stable-node16000
✅ nextjs-turbopack-stable-quickjs16000
✅ nextjs-webpack-canary-node141019
✅ nextjs-webpack-canary-quickjs141019
✅ nextjs-webpack-stable-node16000
✅ nextjs-webpack-stable-quickjs16000
✅ nitro-stable-node134026
✅ nitro-stable-quickjs134026
✅ nuxt-stable-node134026
✅ nuxt-stable-quickjs134026
✅ sveltekit-stable-node15307
✅ sveltekit-stable-quickjs15307
✅ tanstack-start-node134026
✅ tanstack-start-quickjs134026
✅ vite-stable-node134026
✅ vite-stable-quickjs134026

✅ 🪟 Windows

AppPassedFailedSkipped
✅ nextjs-turbopack-node16000
✅ nextjs-turbopack-quickjs16000

❌ 🌐 Cross-language Conformance

AppPassedFailedSkipped
❌ python09132

✅ vercel-http-transport

AppPassedFailedSkipped
✅ example132028
✅ express132028
✅ hono132028
✅ nextjs-turbopack15703
✅ nitro132028
✅ vite132028

✅ vercel-multi-region

AppPassedFailedSkipped
✅ nextjs-turbopack2700

✅ vercel-ws-transport

AppPassedFailedSkipped
✅ example132028
✅ express132028
✅ nextjs-turbopack15703
✅ vite132028

📋 View full workflow run

@github-actions

github-actionsBot 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

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep191 (+1.6%)1236 🔴 (+11%)1309 🔴 (+14%)1785 🔴 (+23%) 🔻30
TTFSstream199 (+24%) 🔻1440 🔴 (+28%) 🔻1456 🔴 (+26%) 🔻1643 🔴 (+21%) 🔻30
TTFShook + stream1543 (+29%) 🔻1630 🔴 (+17%) 🔻1669 🔴 (+15%) 🔻2202 🔴 (+44%) 🔻30
Fan-out TTFSPromise.all(100 steps)589 (-9.4%)2011 (+14%)2027 (+5.5%)2039 (-3.2%)10
Fan-out TTLSPromise.all(100 steps)1943 (+4.1%)3912 (+5.2%)3939 (+3.4%)4227 (-39%) 💚10
STSO1020 steps (inline)100 (-8.3%)145 (-8.8%)161 (-13%)277 (-3.1%)1019
WO1020 steps146048 (-5.0%)146048 (-5.0%)146048 (-5.0%)146048 (-5.0%)1
CRTTfirst chunk (pooled)94 (-1.1%)151 (-5.0%)197 (-1.0%)278 (-17%) 💚28

Streams

ScenarioCRTT 1stp75p90p99CDV maxiters
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

MetricScenarioBest (ms)P75 (ms)P90 (ms)P99 (ms)Samples
TTFSstep1215 (+232%) 🔻1292 🔴 (+13%)1335 🔴 (+8.1%)1420 🔴 (-1.2%)30
TTFSstream1207 (+391%) 🔻1272 🔴 (+13%)1292 🔴 (+13%)1319 🔴 (-8.3%)30
TTFShook + stream475 (+1.3%)1578 🔴 (+12%)1677 🔴 (+16%) 🔻6061 🔴 (+222%) 🔻30
Fan-out TTFSPromise.all(100 steps)536 (-13%)814 (-4.5%)1868 (+98%) 🔻1989 (+19%) 🔻10
Fan-out TTLSPromise.all(100 steps)1873 (-13%)2446 (-10%)3880 (+35%) 🔻8850 (+25%) 🔻10
STSO1020 steps (inline)92 (-9.8%)121 (-27%) 💚142 (-26%) 💚186 (-33%) 💚1019
WO1020 steps120940 (-23%) 💚120940 (-23%) 💚120940 (-23%) 💚120940 (-23%) 💚1
CRTTfirst chunk (pooled)88 (-18%) 💚115 (-30%) 💚139 (-35%) 💚250 (-60%) 💚28

Streams

ScenarioCRTT 1stp75p90p99CDV maxiters
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-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 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

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.txt

@github-actions

github-actionsBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor
FrameworkFlow routeStep reg.Framework output
hono200.9 KiB (±0)40.3 KiB (+22 B)1.76 MiB (-42 B)
nextjs-turbopack206.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

@vercelvercelBot 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

@pranaygppranaygp 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:

revertfails
dropParkedDuplicates2 consumer tests (attr_set, wait_completed)
the UI change2 fixtures, web-shared side
the entity rule4 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 mainAug 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

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

@VaguelySerious@pranaygp