Repository navigation
Upgrade workerd to 1.20261123.1 and skip the slow-timer releases - #245
Merged
Merged
Conversation
ruifigueira
requested review from
BernardoPe,
LuisDuarte1,
celso and
jonnyparris
as code owners
November 26, 2026 11:07
Collaborator
|
beep-boop-bernardo-agent-🤖 No blocking findings. Agent review: APPROVE sha=506115288ddc8bed4a2091b070eee04f66ab231d |
BernardoPe
approved these changes
Nov 26, 2026
LuisDuarte1
approved these changes
Nov 26, 2026
BernardoPe
approved these changes
Nov 26, 2026
Local engines ran workerd 1.20260911.1 through miniflare, wrangler and the vitest plugin. Move them to miniflare 5.20261123.1-beta, wrangler 4.168.0 and @cloudflare/vitest-plugin 1.9.2, which all resolve workerd 1.20261123.1, and workers-types to match. Skip the releases between them. From 1.20260917 workerd's local event loop runs on tokio, which held every zero-delay timer until its next 1 ms tick, so each setTimeout(0) took about 1.1 ms instead of microseconds (cloudflare/workerd#8476, fixed in 1.20261116.1). That is the evaluate floor in #164: 200 zero-delay timers take 3 ms on 1.20260911.1, 227 ms on 1.20260929.1 and 39 ms on 1.20261123.1. Two changes follow from the upgrade: - wrangler types now declares the "*.wasm" and "*.glue.js" modules in the generated worker-configuration.d.ts, so the engine's own declarations in src/wasm-modules.ts were duplicates (TS2300). - workerd's disk service now answers 404 for a path with an empty segment, where it used to collapse it. The Docker image's front.js collapses repeated slashes before it asks for a public/ file, so //fonts/a.txt is still served (scripts/workerd-config.test.mjs). Compatibility dates are unchanged. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
….20261123.1 The test transfers a TransformStream together with its own readable or writable side and expects structuredClone to throw DataCloneError. workerd 1.20261123.1 throws it; 1.20260911.1 did not. It passes in every run on the new workerd and fails in every run on the old one. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
While pausePageTaskPump holds page tasks (the PDF scene stream), a task queued in the meantime makes pageTimerDueWithin(0) true, so yieldToDuePageTasks took a wheel turn. A paused pump arms no wake, so each turn only waited out yieldToPageTasks' 50 ms grace cap: an evaluate during a PDF stream replied about 150 ms late and ran no page task anyway. It now drains microtasks, takes the one native macrotask and returns. The comment no longer prices a wheel turn at ~1.3 ms. That cost came from workerd's tokio event loop, which held every zero-delay timer until its next 1 ms tick (cloudflare/workerd#8476); the saving is the macrotasks that are skipped, whatever each one costs. The e2e test's name now says it covers both chain lengths. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
The fulfilled Response was built without a statusText. workerd up to 1.20261012 filled in the status code's reason phrase; 1.20261123.1 follows the Fetch spec and leaves it empty. A fulfilled 422 then had an empty statusText, which broke Playwright's "should work with status code 422". Playwright and Puppeteer both send responsePhrase. The phrase is now passed through to the Response and to the Network events. A phrase that is not a valid reason-phrase is rejected with Chrome's "Invalid http status code or phrase" error, not with a TypeError when the request is fulfilled. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
…asses "should fulfill with unuassigned status codes" expects the "Unknown" phrase that Playwright sends for status 599. It passes now that Fetch.fulfillRequest honors responsePhrase. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
…creenshot Page.captureScreenshot checks for a PageScript, then awaits a resource drain before it renders. A reload that starts during the drain unloads that document, so the render failed with "no PageScript loaded" or "recordScene rejected: PageScript: no document loaded". Chrome captures whichever document is committed. This broke Playwright's "should take fullPage screenshots during navigation" on workerd 1.20261123.1. The race was there before; the new timing hits it in every run. When the render fails and a navigation has started since the attempt began, wait for the new document and capture it. Stop after three attempts. Adds an e2e test that fails without this change, also on the workerd bump alone. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
Compression streams (brotli), TextDecoder arguments, Response bodies from streams, Response.redirect and two WebCrypto tests now pass. They passed in both CI runs on this branch. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
ruifigueira
force-pushed
the
rfigueira/bump-workerd
branch
from
November 26, 2026 14:45
901470b to
87c2422
Compare
Two cross-document assignments in one evaluate queue two navigation reports. Both wait until the reply, so the evaluate still returns its value. The case fails when the report goes back to a plain nativeSetTimeout, as the single-assignment test does. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
LuisDuarte1
approved these changes
Nov 26, 2026
ruifigueira
added a commit
that referenced
this pull request
Nov 27, 2026
WebMCP spec PR #245 moved ontoolactivated and ontoolcancel from window to ModelContext, and the pinned IDL now has the ToolActivatedEvent and ToolCancelEvent interfaces. The shim still sent plain Events to window, so the WPT abort tests waited for events that never came. Fire trusted ToolActivatedEvent and ToolCancelEvent at the tool's ModelContext, and add the three event handler attributes. ModelContext now uses the shared EventTarget, so listener options such as once and signal work and the event's target is the context. A WebMCP.invokeTool call fires the same events, and toolactivated fires even when execute() throws synchronously, as WebIDL turns the throw into a rejection. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
ruifigueira
added a commit
that referenced
this pull request
Nov 27, 2026
WebMCP spec PR #245 moved ontoolactivated and ontoolcancel from window to ModelContext, and the pinned IDL now has the ToolActivatedEvent and ToolCancelEvent interfaces. The shim still sent plain Events to window, so the WPT abort tests waited for events that never came. Fire trusted ToolActivatedEvent and ToolCancelEvent at the tool's ModelContext, and add the three event handler attributes. ModelContext now uses the shared EventTarget, so listener options such as once and signal work and the event's target is the context. A WebMCP.invokeTool call fires the same events, and toolactivated fires even when execute() throws synchronously, as WebIDL turns the throw into a rejection. beep-boop-🤖 Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade the local workerd from 1.20260911.1 to 1.20261123.1, and finish the follow-ups from #230.
The upgrade skips every workerd release from 1.20260917 to 1.20261115. In those releases, workerd's local event loop runs on tokio, which holds each zero-delay timer until its next 1 ms tick. Each
setTimeout(0)takes about 1.1 ms instead of microseconds. cloudflare/workerd#8476 fixed this in 1.20261116.1. Production uses a different event loop and is not affected. This bug caused most of the evaluate floor reported in #164: the 8 ms in that issue was measured on 1.20260929.1.The follow-up from #230: while the page-task pump is paused (during a PDF stream), an evaluate no longer waits out three 50 ms task turns that cannot run anything.
Behavior and API impact
None for CDP results. Two local-runtime changes:
front.jscollapses repeated slashes before it looks up a file inpublic/. workerd's disk service now returns 404 for a path with an empty segment, so without this change,//fonts/a.txtwould go to the engine instead of being served.Implementation
miniflareto 5.20261123.1-beta,wranglerto 4.168.0 and@cloudflare/vitest-pluginto 1.9.2, which all resolve workerd 1.20261123.1, and@cloudflare/workers-typesto match. Compatibility dates are unchanged. The page bundlers stay on esbuild 0.27.7. Two changes follow from the upgrade:wrangler typesnow declares the*.wasmand*.glue.jsmodules in the generatedworker-configuration.d.ts. That madepackages/engine/src/wasm-modules.tsa duplicate (TS2300), so this PR removes it.docker/front.jscollapses repeated slashes, as described above.streams/transferable/transform-stream-members.any.html, FAIL→PASS, in its own commit. On 1.20261123.1,structuredClonethrowsDataCloneErrorwhen the transfer list holds a TransformStream and one of its own streams.yieldToDuePageTasksreturns after one native macrotask while the pump is paused. A paused pump arms no wake, so each turn only waited out the 50 ms grace cap inyieldToPageTasks. The comment no longer prices a turn at ~1.3 ms, which came from the timer bug above. The e2e test name now says it covers both chain lengths.Validation
Evaluate latency. I ran the script from #164 (200 sequential
Runtime.evaluate("1+2")calls on a static page) againstscripts/wpt-engine.mjs serve, with the workerd binary selected throughMINIFLARE_WORKERD_PATH. This was local, on macOS arm64. "Before #230" is 0affe70, and "after #230" is this branch's code. The 1.20260911.1 row ismaintoday, and the 1.20261125.1 "after" row is this PR. The table shows p50 values.DOM.getDocumenttook about 0.17 ms in every run.200 sequential
await setTimeout(0)calls in a plain Worker take 3 ms on 1.20260911.1, 227 ms on 1.20260929.1 and 39 ms on 1.20261125.1.Benchmark method and raw output
Build one dist for each side, then serve each dist on each workerd binary (
@cloudflare/workerd-darwin-arm64@<version>from npm):The timer microbenchmark is a plain Worker run with
workerd serveon each version:1.20261125.1 stands in for 1.20261123.1, the version this PR pins. Both include cloudflare/workerd#8476.
Paused pump. The new case in
packages/engine/test/page-task-yield.test.ts, "takes no task turn for a due task while the pump is paused", fails onmain: it takes 3 turns in 156 ms. It passes on this branch.Disk service. On 1.20260911.1, the disk service returns 200 for
//fonts/a.txtand/fonts//a.txt. On 1.20261116.1 and 1.20261125.1, it returns 404 for both.scripts/workerd-config.test.mjscaught this. It fails on the upgrade without thefront.jschange and passes with it.Commands:
pnpm run check: passed on the upgrade alone, on the combined branch, and after rebasing onto 1b9e537.bazel test //packages/engine:vitest: passed on all three shards.pnpm run test:e2e --maxWorkers=4 eval timer console cookie navigat screenshot worker websocket fetch message-channel microtask pdf font local-storage iframe connect target: 114 files, 277 passed, 1 skipped.pnpm run test:e2e --maxWorkers=4 eval timer microtask pdf console message-channel settle webmcpon the combined branch: 35 files, 63 passed.pnpm run test:wpt --filter <dir>forhtml/webappapis,dom/events,webmessaging,streams,xhr/,workers/,fetch/api/basicandFileAPI. I ran the same filters onmain, which shows the same local deviations, except for two tests:transform-stream-memberspasses in 3/3 runs on the new workerd and fails in 3/3 onmain. This PR rebaselines it.dom/events/Event-dispatch-single-activation-behavior.htmlfinishes as FAIL in 6/6 local runs on the new workerd and 2/6 onmain. Its expectation pins TIMEOUT for CI on purpose, so I left it alone.What I could not check:
mainas well. This PR relies on CI for both lanes.Event-dispatch-single-activation-behavior.html, that test needs a rebaseline.Risks and follow-ups
Checklist
Signed-off-byline (git commit -s); see CONTRIBUTING.md.beep-boop-🤖