Skip to content

[world-vercel] Add /run-id sub-export with tagged ULID encode/decode#1978

Merged
TooTallNate merged 7 commits into
mainfrom
world-vercel-tagged-run-id
May 26, 2026
Merged

[world-vercel] Add /run-id sub-export with tagged ULID encode/decode#1978
TooTallNate merged 7 commits into
mainfrom
world-vercel-tagged-run-id

Conversation

@TooTallNate
Copy link
Copy Markdown
Member

@TooTallNate TooTallNate commented May 13, 2026

Summary

Adds a new sub-export @workflow/world-vercel/run-id exposing encode and decode helpers that produce ULID-shaped workflow run IDs carrying:

  • A tag bit (MSB of byte 0) marking the value as a tagged run ID — distinguishes the scheme from a plain ULID and shifts the first char into the range 4..7.
  • A 5-bit version (0–31) — defaults to 1; 0 is reserved as a "no metadata" sentinel.
  • A 6-bit region ID (0–63) — maps to a known Vercel compute region (e.g. iad1, fra1, sfo1).

Tagged values remain valid 26-char Crockford-Base32 ULIDs, so they continue to sort lexicographically and flow through any system that accepts ULIDs.

Bit layout

byte[0]   bit 7        TAG bit (1 = tagged run ID)
byte[14]  bits 0..2    version high 3 bits
byte[15]  bits 6..7    version low 2 bits   } 5-bit version (0..31)
byte[15]  bits 0..5    regionId (0..63)

Randomness: 80 bits → 69 bits preserved (~5.9 × 10²⁰ values per ms).

Region table

Covers the 21 currently-deployed Vercel compute regions plus hel1 and zrh1, which are reserved for future rollout. 0 = unknown sentinel.

IDs are stable and append-only — never reorder or reuse, since they're encoded on the wire in every run ID emitted.

API

import { encode, decode, isTagged, REGION_IDS } from '@workflow/world-vercel/run-id';

// Accepts either a RegionCode or a numeric region ID
const taggedRunId = encode(ulid(), 'iad1');

const { tagged, region, regionId, version, ulid: cleared } = decode(taggedRunId);
// tagged === true, region === 'iad1', regionId === 1, version === 1

decode clears only the tag bit on the returned ulid field — the 11 metadata bits remain in place so the encoded info is recoverable from the "cleared" value too.

Verification

  • pnpm vitest run src/run-id/ → 34/34 pass (includes exact-string assertions for all encoded outputs)
  • pnpm typecheck → clean
  • pnpm build → emits dist/run-id/{index,codec,regions}.{js,d.ts,...}

Files

  • packages/world-vercel/src/run-id/regions.ts — region table + lookupRegion/regionIdFor
  • packages/world-vercel/src/run-id/codec.ts — Crockford-Base32 ↔ 16-byte bit-packing
  • packages/world-vercel/src/run-id/index.ts — public encode/decode/isTagged API
  • packages/world-vercel/src/run-id/codec.test.ts (13 tests) + index.test.ts (21 tests)
  • packages/world-vercel/package.json./run-id added to exports
  • .changeset/tagged-run-id.md — minor bump for @workflow/world-vercel

Encodes a tag bit, 5-bit version, and 6-bit Vercel region ID into a
ULID-shaped string used for workflow run IDs. Tagged values remain
valid 26-char Crockford-Base32 ULIDs so they still sort and round-trip
through any system that accepts ULIDs.
Copilot AI review requested due to automatic review settings May 13, 2026 07:38
@TooTallNate TooTallNate requested a review from a team as a code owner May 13, 2026 07:38
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 13, 2026

🦋 Changeset detected

Latest commit: 9c28bf4

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

This PR includes changesets to release 17 packages
Name Type
@workflow/world-vercel Minor
@workflow/cli Patch
@workflow/core Patch
@workflow/web Patch
workflow Patch
@workflow/world-testing Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared 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
Copy link
Copy Markdown
Contributor

vercel Bot commented May 13, 2026

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment May 26, 2026 5:39pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment May 26, 2026 5:39pm
example-workflow Ready Ready Preview, Comment May 26, 2026 5:39pm
workbench-astro-workflow Ready Ready Preview, Comment May 26, 2026 5:39pm
workbench-express-workflow Ready Ready Preview, Comment May 26, 2026 5:39pm
workbench-fastify-workflow Ready Ready Preview, Comment May 26, 2026 5:39pm
workbench-hono-workflow Ready Ready Preview, Comment May 26, 2026 5:39pm
workbench-nitro-workflow Ready Ready Preview, Comment May 26, 2026 5:39pm
workbench-nuxt-workflow Ready Ready Preview, Comment May 26, 2026 5:39pm
workbench-sveltekit-workflow Ready Ready Preview, Comment May 26, 2026 5:39pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment May 26, 2026 5:39pm
workbench-vite-workflow Ready Ready Preview, Comment May 26, 2026 5:39pm
workflow-docs Ready Ready Preview, Comment, Open in v0 May 26, 2026 5:39pm
workflow-swc-playground Ready Ready Preview, Comment May 26, 2026 5:39pm
workflow-tarballs Ready Ready Preview, Comment May 26, 2026 5:39pm
workflow-web Ready Ready Preview, Comment May 26, 2026 5:39pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

🧪 E2E Test Results

All tests passed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1222 0 219 1441
✅ 💻 Local Development 1615 0 219 1834
✅ 📦 Local Production 1615 0 219 1834
✅ 🐘 Local Postgres 1615 0 219 1834
✅ 🪟 Windows 131 0 0 131
✅ 📋 Other 741 0 176 917
Total 6939 0 1052 7991

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 105 0 26
✅ example 105 0 26
✅ express 105 0 26
✅ fastify 105 0 26
✅ hono 105 0 26
✅ nextjs-turbopack 129 0 2
✅ nextjs-webpack 129 0 2
✅ nitro 105 0 26
✅ nuxt 105 0 26
✅ sveltekit 124 0 7
✅ vite 105 0 26
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 106 0 25
✅ express-stable 106 0 25
✅ fastify-stable 106 0 25
✅ hono-stable 106 0 25
✅ nextjs-turbopack-canary 112 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 131 0 0
✅ nextjs-webpack-canary 112 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 131 0 0
✅ nitro-stable 106 0 25
✅ nuxt-stable 106 0 25
✅ sveltekit-stable 125 0 6
✅ vite-stable 106 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 106 0 25
✅ express-stable 106 0 25
✅ fastify-stable 106 0 25
✅ hono-stable 106 0 25
✅ nextjs-turbopack-canary 112 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 131 0 0
✅ nextjs-webpack-canary 112 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 131 0 0
✅ nitro-stable 106 0 25
✅ nuxt-stable 106 0 25
✅ sveltekit-stable 125 0 6
✅ vite-stable 106 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 106 0 25
✅ express-stable 106 0 25
✅ fastify-stable 106 0 25
✅ hono-stable 106 0 25
✅ nextjs-turbopack-canary 112 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 131 0 0
✅ nextjs-webpack-canary 112 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 131 0 0
✅ nitro-stable 106 0 25
✅ nuxt-stable 106 0 25
✅ sveltekit-stable 125 0 6
✅ vite-stable 106 0 25
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 131 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 106 0 25
✅ e2e-local-dev-tanstack-start- 106 0 25
✅ e2e-local-postgres-nest-stable 106 0 25
✅ e2e-local-postgres-tanstack-start- 106 0 25
✅ e2e-local-prod-nest-stable 106 0 25
✅ e2e-local-prod-tanstack-start- 106 0 25
✅ e2e-vercel-prod-tanstack-start 105 0 26

📋 View full workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.032s (-28.2% 🟢) 1.006s (~) 0.974s 10 1.00x
💻 Local Nitro 0.032s (-25.8% 🟢) 1.006s (~) 0.974s 10 1.01x
💻 Local Next.js (Turbopack) 0.044s 1.005s 0.961s 10 1.37x
🐘 Postgres Express 0.047s (-19.1% 🟢) 1.013s (~) 0.966s 10 1.47x
🐘 Postgres Nitro 0.051s (-46.7% 🟢) 1.012s (-2.9%) 0.962s 10 1.59x
🐘 Postgres Next.js (Turbopack) 0.058s 1.011s 0.953s 10 1.83x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 0.286s (-30.2% 🟢) 2.154s (-14.2% 🟢) 1.868s 10 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.071s (-5.3% 🟢) 2.007s (~) 0.935s 10 1.00x
💻 Local Express 1.080s (-4.0%) 2.006s (~) 0.926s 10 1.01x
🐘 Postgres Nitro 1.085s (-4.9%) 2.010s (~) 0.925s 10 1.01x
🐘 Postgres Express 1.085s (-5.3% 🟢) 2.010s (~) 0.925s 10 1.01x
💻 Local Next.js (Turbopack) 1.092s 2.005s 0.913s 10 1.02x
🐘 Postgres Next.js (Turbopack) 1.136s 2.010s 0.874s 10 1.06x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 1.594s (-59.1% 🟢) 3.466s (-41.3% 🟢) 1.872s 10 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 10.403s (-5.0%) 11.022s (~) 0.619s 3 1.00x
🐘 Postgres Nitro 10.417s (-4.2%) 11.020s (~) 0.602s 3 1.00x
💻 Local Express 10.418s (-4.6%) 11.023s (~) 0.605s 3 1.00x
🐘 Postgres Express 10.419s (-5.0%) 11.018s (~) 0.600s 3 1.00x
💻 Local Next.js (Turbopack) 10.507s 11.020s 0.513s 3 1.01x
🐘 Postgres Next.js (Turbopack) 10.721s 11.022s 0.301s 3 1.03x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 13.291s (-44.0% 🟢) 14.688s (-41.5% 🟢) 1.397s 3 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 13.426s (-8.0% 🟢) 14.019s (-6.7% 🟢) 0.593s 5 1.00x
🐘 Postgres Express 13.461s (-7.7% 🟢) 14.017s (-6.7% 🟢) 0.555s 5 1.00x
💻 Local Nitro 13.468s (-10.6% 🟢) 14.027s (-12.5% 🟢) 0.559s 5 1.00x
💻 Local Express 13.526s (-9.6% 🟢) 14.027s (-6.7% 🟢) 0.501s 5 1.01x
💻 Local Next.js (Turbopack) 13.695s 14.025s 0.330s 5 1.02x
🐘 Postgres Next.js (Turbopack) 14.123s 15.017s 0.894s 4 1.05x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 20.813s (-67.7% 🟢) 22.590s (-66.1% 🟢) 1.777s 3 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 11.872s (-29.3% 🟢) 12.022s (-29.4% 🟢) 0.150s 8 1.00x
🐘 Postgres Express 11.986s (-14.4% 🟢) 12.517s (-14.2% 🟢) 0.531s 8 1.01x
🐘 Postgres Nitro 11.995s (-14.1% 🟢) 12.390s (-13.4% 🟢) 0.395s 8 1.01x
💻 Local Express 12.003s (-27.7% 🟢) 12.273s (-27.9% 🟢) 0.270s 8 1.01x
💻 Local Next.js (Turbopack) 12.291s 13.024s 0.733s 7 1.04x
🐘 Postgres Next.js (Turbopack) 13.135s 14.017s 0.882s 7 1.11x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 30.322s (-92.8% 🟢) 32.277s (-92.4% 🟢) 1.956s 3 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.146s (-9.1% 🟢) 2.008s (~) 0.862s 15 1.00x
🐘 Postgres Nitro 1.148s (-9.9% 🟢) 2.008s (~) 0.859s 15 1.00x
💻 Local Nitro 1.180s (-27.6% 🟢) 2.006s (-3.3%) 0.826s 15 1.03x
💻 Local Express 1.198s (-19.5% 🟢) 2.007s (~) 0.808s 15 1.05x
💻 Local Next.js (Turbopack) 1.228s 2.005s 0.777s 15 1.07x
🐘 Postgres Next.js (Turbopack) 1.233s 2.008s 0.775s 15 1.08x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.641s (-6.3% 🟢) 4.127s (-4.5%) 1.485s 8 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.203s (-48.8% 🟢) 2.009s (-33.2% 🟢) 0.805s 15 1.00x
🐘 Postgres Express 1.204s (-49.0% 🟢) 2.007s (-33.3% 🟢) 0.802s 15 1.00x
🐘 Postgres Next.js (Turbopack) 1.358s 2.007s 0.649s 15 1.13x
💻 Local Next.js (Turbopack) 1.711s 2.005s 0.294s 15 1.42x
💻 Local Nitro 1.777s (-43.5% 🟢) 2.007s (-48.3% 🟢) 0.230s 15 1.48x
💻 Local Express 1.817s (-38.5% 🟢) 2.073s (-40.0% 🟢) 0.257s 15 1.51x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.528s (-12.9% 🟢) 6.029s (+1.8%) 2.501s 5 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.332s (-61.7% 🟢) 2.010s (-49.9% 🟢) 0.678s 15 1.00x
🐘 Postgres Express 1.336s (-61.7% 🟢) 2.007s (-49.9% 🟢) 0.671s 15 1.00x
🐘 Postgres Next.js (Turbopack) 1.625s 2.007s 0.381s 15 1.22x
💻 Local Next.js (Turbopack) 4.400s 5.011s 0.611s 7 3.30x
💻 Local Nitro 5.400s (-35.3% 🟢) 5.678s (-37.1% 🟢) 0.278s 6 4.05x
💻 Local Express 5.482s (-34.2% 🟢) 6.013s (-33.4% 🟢) 0.531s 6 4.12x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.952s (+68.8% 🔺) 8.081s (+46.0% 🔺) 2.129s 4 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.143s (-9.1% 🟢) 2.009s (~) 0.865s 15 1.00x
🐘 Postgres Express 1.148s (-8.7% 🟢) 2.008s (~) 0.860s 15 1.00x
🐘 Postgres Next.js (Turbopack) 1.207s 2.007s 0.800s 15 1.06x
💻 Local Next.js (Turbopack) 1.289s 2.005s 0.716s 15 1.13x
💻 Local Express 1.426s (-24.7% 🟢) 2.006s (-15.1% 🟢) 0.580s 15 1.25x
💻 Local Nitro 1.770s (-5.1% 🟢) 2.392s (+2.2%) 0.622s 13 1.55x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.743s (+11.6% 🔺) 4.076s (-2.2%) 1.333s 8 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.204s (-48.5% 🟢) 2.009s (-33.2% 🟢) 0.805s 15 1.00x
🐘 Postgres Express 1.222s (-47.8% 🟢) 2.009s (-33.3% 🟢) 0.787s 15 1.01x
🐘 Postgres Next.js (Turbopack) 1.326s 2.007s 0.681s 15 1.10x
💻 Local Next.js (Turbopack) 1.930s 2.220s 0.290s 14 1.60x
💻 Local Nitro 2.026s (-33.9% 🟢) 2.507s (-35.5% 🟢) 0.481s 12 1.68x
💻 Local Express 2.121s (-32.3% 🟢) 2.591s (-31.1% 🟢) 0.470s 12 1.76x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.518s (+8.8% 🔺) 5.334s (+5.1% 🔺) 1.817s 6 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.321s (-62.1% 🟢) 2.008s (-49.9% 🟢) 0.688s 15 1.00x
🐘 Postgres Express 1.324s (-62.2% 🟢) 2.010s (-49.9% 🟢) 0.687s 15 1.00x
🐘 Postgres Next.js (Turbopack) 1.611s 2.074s 0.463s 15 1.22x
💻 Local Next.js (Turbopack) 4.964s 5.344s 0.381s 6 3.76x
💻 Local Express 5.720s (-35.0% 🟢) 6.215s (-33.0% 🟢) 0.495s 5 4.33x
💻 Local Nitro 6.154s (-32.7% 🟢) 6.615s (-34.0% 🟢) 0.461s 5 4.66x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 6.877s (+35.0% 🔺) 8.949s (+31.3% 🔺) 2.072s 4 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.451s (-45.0% 🟢) 1.006s (~) 0.555s 60 1.00x
💻 Local Nitro 0.467s (-52.4% 🟢) 1.004s (-8.2% 🟢) 0.537s 60 1.03x
🐘 Postgres Express 0.479s (-43.0% 🟢) 1.007s (-1.6%) 0.528s 60 1.06x
💻 Local Express 0.548s (-44.3% 🟢) 1.022s (-5.1% 🟢) 0.473s 59 1.22x
💻 Local Next.js (Turbopack) 0.568s 1.004s 0.436s 60 1.26x
🐘 Postgres Next.js (Turbopack) 0.682s 1.006s 0.324s 60 1.51x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.082s (-77.0% 🟢) 7.124s (-70.3% 🟢) 2.042s 9 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.090s (-44.9% 🟢) 1.705s (-24.5% 🟢) 0.616s 53 1.00x
🐘 Postgres Nitro 1.100s (-42.9% 🟢) 1.692s (-19.4% 🟢) 0.592s 54 1.01x
💻 Local Nitro 1.169s (-61.5% 🟢) 2.006s (-46.6% 🟢) 0.837s 45 1.07x
💻 Local Express 1.233s (-59.1% 🟢) 2.006s (-44.1% 🟢) 0.773s 45 1.13x
💻 Local Next.js (Turbopack) 1.388s 2.005s 0.617s 45 1.27x
🐘 Postgres Next.js (Turbopack) 1.641s 2.030s 0.388s 45 1.51x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 12.401s (-68.6% 🟢) 14.569s (-64.7% 🟢) 2.168s 7 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.030s (-50.5% 🟢) 2.477s (-46.2% 🟢) 0.446s 49 1.00x
🐘 Postgres Express 2.086s (-47.7% 🟢) 2.616s (-40.1% 🟢) 0.530s 46 1.03x
💻 Local Nitro 2.654s (-71.5% 🟢) 3.007s (-70.0% 🟢) 0.354s 40 1.31x
💻 Local Express 2.738s (-70.3% 🟢) 3.032s (-69.7% 🟢) 0.295s 40 1.35x
💻 Local Next.js (Turbopack) 2.994s 3.493s 0.499s 35 1.47x
🐘 Postgres Next.js (Turbopack) 3.265s 4.008s 0.743s 30 1.61x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 26.661s (-72.5% 🟢) 29.498s (-70.0% 🟢) 2.836s 5 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.162s (-42.7% 🟢) 1.006s (~) 0.844s 60 1.00x
🐘 Postgres Express 0.196s (-30.5% 🟢) 1.023s (+1.5%) 0.826s 59 1.21x
🐘 Postgres Next.js (Turbopack) 0.231s 1.006s 0.776s 60 1.42x
💻 Local Nitro 0.398s (-34.2% 🟢) 1.004s (-1.7%) 0.606s 60 2.45x
💻 Local Express 0.429s (-23.5% 🟢) 1.004s (~) 0.575s 60 2.64x
💻 Local Next.js (Turbopack) 0.495s 1.004s 0.509s 60 3.05x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.091s (+25.9% 🔺) 4.218s (+25.9% 🔺) 2.127s 15 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.289s (-41.8% 🟢) 1.007s (~) 0.718s 90 1.00x
🐘 Postgres Express 0.303s (-40.5% 🟢) 1.017s (+1.1%) 0.714s 89 1.05x
🐘 Postgres Next.js (Turbopack) 0.436s 1.006s 0.569s 90 1.51x
💻 Local Nitro 2.132s (-16.0% 🟢) 2.767s (-8.1% 🟢) 0.635s 33 7.38x
💻 Local Next.js (Turbopack) 2.170s 2.795s 0.626s 33 7.51x
💻 Local Express 2.172s (-13.6% 🟢) 2.821s (-6.3% 🟢) 0.649s 32 7.52x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.608s (+73.9% 🔺) 7.844s (+62.7% 🔺) 2.235s 12 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.614s (-22.3% 🟢) 1.006s (~) 0.393s 120 1.00x
🐘 Postgres Express 0.621s (-24.1% 🟢) 1.006s (-1.1%) 0.385s 120 1.01x
🐘 Postgres Next.js (Turbopack) 0.886s 1.069s 0.183s 113 1.44x
💻 Local Nitro 10.184s (-9.0% 🟢) 10.609s (-9.0% 🟢) 0.425s 12 16.60x
💻 Local Express 10.251s (-8.4% 🟢) 10.778s (-9.7% 🟢) 0.528s 12 16.70x
💻 Local Next.js (Turbopack) 10.386s 10.942s 0.557s 12 16.92x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 14.259s (+84.6% 🔺) 16.357s (+74.0% 🔺) 2.098s 8 1.00x
▲ Vercel Express ⚠️ missing - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.126s (+449.1% 🔺) 2.002s (+100.3% 🔺) 0.001s (-33.3% 🟢) 2.009s (+98.7% 🔺) 0.884s 10 1.00x
💻 Local Nitro 1.134s (+430.5% 🔺) 2.005s (+99.6% 🔺) 0.013s (+0.8%) 2.020s (+98.3% 🔺) 0.887s 10 1.01x
🐘 Postgres Express 1.135s (+453.1% 🔺) 2.000s (+100.3% 🔺) 0.001s (-31.3% 🟢) 2.010s (+98.7% 🔺) 0.875s 10 1.01x
💻 Local Express 1.138s (+471.4% 🔺) 2.006s (+99.7% 🔺) 0.012s (-0.8%) 2.020s (+98.4% 🔺) 0.882s 10 1.01x
💻 Local Next.js (Turbopack) 1.144s 2.003s 0.010s 2.017s 0.873s 10 1.02x
🐘 Postgres Next.js (Turbopack) 1.201s 2.002s 0.001s 2.010s 0.809s 10 1.07x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.209s (-42.3% 🟢) 3.353s (-36.5% 🟢) 1.860s (+150.7% 🔺) 5.894s (-9.1% 🟢) 3.685s 10 1.00x
▲ Vercel Express ⚠️ missing - - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - - -

🔍 Observability: Nitro

stream pipeline with 5 transform steps (1MB)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.501s (+138.3% 🔺) 2.001s (+98.8% 🔺) 0.004s (+4.4%) 2.026s (+98.0% 🔺) 0.524s 30 1.00x
🐘 Postgres Nitro 1.514s (+142.6% 🔺) 2.002s (+98.9% 🔺) 0.004s (+2.4%) 2.028s (+98.4% 🔺) 0.514s 30 1.01x
💻 Local Nitro 1.525s (+81.9% 🔺) 2.011s (+98.8% 🔺) 0.010s (+8.1% 🔺) 2.023s (+81.3% 🔺) 0.498s 30 1.02x
💻 Local Express 1.539s (+103.3% 🔺) 2.011s (+95.5% 🔺) 0.011s (+12.2% 🔺) 2.024s (+94.7% 🔺) 0.485s 30 1.03x
🐘 Postgres Next.js (Turbopack) 1.722s 2.044s 0.004s 2.061s 0.338s 30 1.15x
💻 Local Next.js (Turbopack) 1.977s 2.010s 0.010s 2.424s 0.447s 25 1.32x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 6.109s (-79.2% 🟢) 7.689s (-75.0% 🟢) 1.083s (+867.2% 🔺) 9.342s (-70.6% 🟢) 3.234s 7 1.00x
▲ Vercel Express ⚠️ missing - - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - - -

🔍 Observability: Nitro

10 parallel streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.641s (-33.8% 🟢) 1.030s (-17.5% 🟢) 0.000s (-17.2% 🟢) 1.046s (-16.8% 🟢) 0.405s 58 1.00x
🐘 Postgres Express 0.650s (-32.3% 🟢) 1.032s (-19.2% 🟢) 0.000s (+58.6% 🔺) 1.047s (-19.9% 🟢) 0.396s 58 1.01x
🐘 Postgres Next.js (Turbopack) 0.782s 1.054s 0.000s 1.060s 0.278s 57 1.22x
💻 Local Nitro 1.340s (+9.6% 🔺) 2.015s (~) 0.000s (+100.0% 🔺) 2.016s (~) 0.676s 30 2.09x
💻 Local Express 1.363s (+11.3% 🔺) 2.016s (~) 0.000s (-40.0% 🟢) 2.018s (~) 0.655s 30 2.13x
💻 Local Next.js (Turbopack) 1.369s 2.012s 0.000s 2.015s 0.647s 30 2.13x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 4.080s (+33.8% 🔺) 5.538s (+26.1% 🔺) 0.002s (+2500.0% 🔺) 6.004s (+24.9% 🔺) 1.924s 10 1.00x
▲ Vercel Express ⚠️ missing - - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - - -

🔍 Observability: Nitro

fan-out fan-in 10 streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.243s (-30.6% 🟢) 1.871s (-12.6% 🟢) 0.000s (-12.5% 🟢) 1.915s (-11.9% 🟢) 0.672s 32 1.00x
🐘 Postgres Express 1.309s (-26.1% 🟢) 2.065s (-5.2% 🟢) 0.000s (+Infinity% 🔺) 2.079s (-5.4% 🟢) 0.770s 29 1.05x
🐘 Postgres Next.js (Turbopack) 1.730s 2.311s 0.000s 2.319s 0.589s 26 1.39x
💻 Local Nitro 3.114s (-8.1% 🟢) 3.968s (-1.6%) 0.001s (-6.2% 🟢) 3.970s (-1.6%) 0.856s 16 2.51x
💻 Local Next.js (Turbopack) 3.166s 3.900s 0.001s 3.903s 0.737s 16 2.55x
💻 Local Express 3.181s (-8.3% 🟢) 4.030s (~) 0.001s (~) 4.033s (~) 0.852s 15 2.56x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.827s (+42.3% 🔺) 7.288s (+35.6% 🔺) 0.000s (+37.5% 🔺) 7.751s (+33.8% 🔺) 1.924s 8 1.00x
▲ Vercel Express ⚠️ missing - - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - - -

🔍 Observability: Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Nitro 15/21
🐘 Postgres Nitro 16/21
▲ Vercel Nitro 21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 18/21
Next.js (Turbopack) 🐘 Postgres 11/21
Nitro 🐘 Postgres 17/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Add exact-string expectations for encoded outputs at known inputs,
covering the default region/version pair, numeric region IDs, version
overrides, boundary values (all-zero, all-max), the dirty-input
overwrite case, and the lexicographic-order checks. Also adds an
explicit byte-array expectation for the canonical ULID-spec example
string and an additional first-char-range coverage test for isTagged.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new @workflow/world-vercel/run-id sub-export that can encode/decode tagged ULID-shaped workflow run IDs, embedding a tag bit, a 5-bit version, and a 6-bit Vercel region ID while preserving ULID sortability.

Changes:

  • Add a region table (REGION_IDS) and helpers for mapping between region codes and 6-bit region IDs.
  • Implement a Crockford-Base32 ↔ 16-byte codec and public encode/decode/isTagged API for tagged ULIDs.
  • Add tests for codec correctness and encode/decode behavior; expose the new subpath export via package.json and add a changeset.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/world-vercel/src/run-id/regions.ts Adds stable region↔ID mapping and lookup helpers used by tagged run IDs.
packages/world-vercel/src/run-id/index.ts Public API for encoding/decoding tagged ULIDs + re-exports/constants.
packages/world-vercel/src/run-id/index.test.ts Tests for encode/decode semantics, validation, and ordering properties.
packages/world-vercel/src/run-id/codec.ts Implements ULID base32 packing/unpacking and tag-bit detection helper.
packages/world-vercel/src/run-id/codec.test.ts Tests for codec round-trips, validation, and tag-bit detection.
packages/world-vercel/package.json Exposes ./run-id as a public package sub-export.
.changeset/tagged-run-id.md Declares a minor release for the new sub-export/API surface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/world-vercel/src/run-id/codec.ts Outdated
Comment thread packages/world-vercel/src/run-id/regions.ts Outdated
Comment thread packages/world-vercel/src/run-id/index.ts Outdated
Copy link
Copy Markdown
Contributor

@karthikscale3 karthikscale3 left a comment

Choose a reason for hiding this comment

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

Reviewed for blockers/regressions — none found. Change is purely additive (new sub-export, nothing in the repo consumes it yet). Three non-blocking nits below.

Comment thread packages/world-vercel/src/run-id/index.ts Outdated
Comment thread packages/world-vercel/src/run-id/index.ts
Comment thread packages/world-vercel/src/run-id/regions.ts
Address review feedback on #1978:

1. **Metadata at top of randomness, not bottom.** Place `regionId` (6
   bits) in the high bits of byte[6] and `version` (5 bits) straddling
   bytes 6 and 7, leaving the bottom 69 bits of randomness untouched by
   `encode`. This means a `monotonicFactory()`-style ULID generator's
   intra-millisecond bottom-bit increments survive encoding intact, so
   consecutive `encode(ulid(), region, { version })` calls with the
   same metadata produce strictly increasing strings. Previously the
   metadata sat in the bottom 11 bits — exactly the bits the monotonic
   factory uses — causing same-ms collisions/inversions.

2. **DecodedRunId is now a discriminated union.** When `tagged: false`,
   the `regionId`, `version`, and `region` fields are typed as
   `null` instead of being populated with garbage bits from arbitrary
   ULIDs. This forces callers to discriminate on `tagged` before
   reading metadata.

3. **regionIdFor: keep runtime backstop, mark as ignored for coverage.**
   The unreachable-in-TS branch stays as a defensive runtime check for
   callers crossing a JS/TS boundary; an istanbul/c8 ignore comment
   keeps coverage tools quiet.

Doc strings and tests updated accordingly. The new layout adds a test
verifying that a sequence of incrementing-bottom-bit ULIDs (simulating
`monotonicFactory()`) round-trips through `encode` as a strictly
increasing sequence.

108/108 world-vercel tests pass; typecheck clean.
@TooTallNate
Copy link
Copy Markdown
Member Author

For anyone reviewing the new bit layout, here's what tagged ULIDs actually look like in practice (all outputs from the current branch, add0ce7):

Plain vs. tagged

Plain ULID:                01ARZ3NDEKTSV4RRFFQ69G5FAV
Same ULID tagged for iad1: 41ARZ3NDEK0GV4RRFFQ69G5FAV
                           ^         ^^^
                           │         │└── chars 10–12 carry regionId + version
                           │         └── tag bit shifts char 0 from '0' → '4'
                           └── chars 13–25 are byte-identical to the source

The last 14 characters of the tagged ULID are byte-identical to the source — that's the bottom 69 bits of randomness, untouched by encode, where a monotonic ULID factory's same-ms increments live.

Different regions, same source ULID

The metadata window lights up around chars 10–12:

iad1 → 41ARZ3NDEK0GV4RRFFQ69G5FAV
sfo1 → 41ARZ3NDEK10V4RRFFQ69G5FAV
pdx1 → 41ARZ3NDEK1GV4RRFFQ69G5FAV
…
fra1 → 41ARZ3NDEK50V4RRFFQ69G5FAV
syd1 → 41ARZ3NDEKBGV4RRFFQ69G5FAV

Same region (iad1), different versions

v=0  → 41ARZ3NDEK0GB4RRFFQ69G5FAV
v=1  → 41ARZ3NDEK0GV4RRFFQ69G5FAV   ← default
v=2  → 41ARZ3NDEK0HB4RRFFQ69G5FAV
v=15 → 41ARZ3NDEK0QV4RRFFQ69G5FAV
v=31 → 41ARZ3NDEK0ZV4RRFFQ69G5FAV

Decoded structure

encode('01ARZ3NDEKTSV4RRFFQ69G5FAV', 'fra1')
// → '41ARZ3NDEK50V4RRFFQ69G5FAV'

decode('41ARZ3NDEK50V4RRFFQ69G5FAV')
// → {
//     tagged: true,
//     ulid: '01ARZ3NDEK50V4RRFFQ69G5FAV',  // tag bit cleared
//     version: 1,
//     regionId: 10,
//     region: 'fra1'
//   }

Intra-millisecond monotonicity (the bit that motivated the layout change)

Five successive monotonicFactory()-style ULIDs (same timestamp, last char incrementing) all stay monotonic after tagging — the metadata window sits at the top of randomness, so increments at the bottom propagate through encode unchanged:

ulid #0 = 01ARZ3NDEKTSV4RRFFQ69G5F00 → 41ARZ3NDEK0GV4RRFFQ69G5F00
ulid #1 = 01ARZ3NDEKTSV4RRFFQ69G5F01 → 41ARZ3NDEK0GV4RRFFQ69G5F01
ulid #2 = 01ARZ3NDEKTSV4RRFFQ69G5F02 → 41ARZ3NDEK0GV4RRFFQ69G5F02
ulid #3 = 01ARZ3NDEKTSV4RRFFQ69G5F03 → 41ARZ3NDEK0GV4RRFFQ69G5F03
ulid #4 = 01ARZ3NDEKTSV4RRFFQ69G5F04 → 41ARZ3NDEK0GV4RRFFQ69G5F04
                                                                ↑
                                        increments preserved verbatim

This is the property the previous (bottom-bit) layout was breaking; locked in by the preserves order across a sequence of incrementing bottom bits regression test.

@github-actions
Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2114. (backport job run)

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.

3 participants