You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebScene drains window.postMessage tasks after the Worker/ServiceWorker/MessagePort/WebSocket rotation but before any due timer. A message handler that refills its own window-message queue can therefore prevent a zero-delay timer from running indefinitely, even after the asynchronous-message fairness fix proven locally for #287.
This matches the unchanged Code OSS remote extension-host bootstrap. Its protocol writer requests a timer-coalesced 1,071,424-byte initialization send, while iframe/window messaging remains active. The timer request is retained immediately, but native WebSocket.send is not entered for several seconds.
Reduced evidence
On exact WebScene main 1bd8596e3dc07a3281204504acad379eb1f6bc78 plus local unpushed #287 candidate b75d37958ef7ce3f73a5b08de6b0516b0f8f57eb, the product-shaped 20-cycle oracle adds one self-refilling window.postMessage source alongside Worker, MessagePort, WebSocket, FileReader, and the 1,071,425-byte body:
protocol flush maximum: 3229.87 ms
p95: 96.456 ms
window-message tasks before the delayed flush: 700,000
window-message queue remains self-refilling rather than growing without bound
Without the window source, the same candidate reports maximum 0.204 ms and p95 0.157 ms. The packaged unchanged-Code trace independently measured protocol-send request → native WebSocket.send entry at 3698 ms, followed by a 0.783 ms send and 0.834 ms microtask. The close agreement identifies task arbitration rather than wire throughput.
Evidence: /private/tmp/webscene-289-b75d3795-window-message-oracle.log (SHA-256 d2f77ef271fe8863b36370e77feba57c730939bcf7844e8a6f955777fcc5416d) and /private/tmp/vscode-252-product-b75d3795.log (SHA-256 f58b40413fe5dd30567d0d6a3d207b668fd07bea96b594aae9c5568509a38252).
Scope
Make due timers fair with the window.postMessage task source while preserving FIFO ordering, origin/source/transfer semantics, bounded queue limits, and the four-source Worker/ServiceWorker/MessagePort/WebSocket rotation. Do not alter transferred MessagePort lifetime ownership or add Code OSS special cases.
Draft #292 touches the same runtime dispatcher. Its DOM-listener retirement work is semantically independent, but this implementation must wait for #292 to merge or split, then rebase without regressing #281's four-source rotation.
Acceptance
A product-neutral native/browser fixture runs the actual 13-byte header + 1,071,425-byte body, timer-coalesced protocol write against continuously ready window/Worker/MessagePort/WebSocket/FileReader sources for 20 cold/warm cycles.
Due timer latency is p95 ≤ 25 ms and max ≤ 100 ms; at most four window-message tasks run before a due timer.
Parent scheduler issue: #287
Remote handshake attribution: #289
Workspace acceptance: #252
Runtime collision/dependency: draft PR #292
Problem
WebScene drains
window.postMessagetasks after the Worker/ServiceWorker/MessagePort/WebSocket rotation but before any due timer. A message handler that refills its own window-message queue can therefore prevent a zero-delay timer from running indefinitely, even after the asynchronous-message fairness fix proven locally for #287.This matches the unchanged Code OSS remote extension-host bootstrap. Its protocol writer requests a timer-coalesced 1,071,424-byte initialization send, while iframe/window messaging remains active. The timer request is retained immediately, but native
WebSocket.sendis not entered for several seconds.Reduced evidence
On exact WebScene main
1bd8596e3dc07a3281204504acad379eb1f6bc78plus local unpushed #287 candidateb75d37958ef7ce3f73a5b08de6b0516b0f8f57eb, the product-shaped 20-cycle oracle adds one self-refillingwindow.postMessagesource alongside Worker, MessagePort, WebSocket, FileReader, and the 1,071,425-byte body:Without the window source, the same candidate reports maximum 0.204 ms and p95 0.157 ms. The packaged unchanged-Code trace independently measured protocol-send request → native
WebSocket.sendentry at 3698 ms, followed by a 0.783 ms send and 0.834 ms microtask. The close agreement identifies task arbitration rather than wire throughput.Evidence:
/private/tmp/webscene-289-b75d3795-window-message-oracle.log(SHA-256d2f77ef271fe8863b36370e77feba57c730939bcf7844e8a6f955777fcc5416d) and/private/tmp/vscode-252-product-b75d3795.log(SHA-256f58b40413fe5dd30567d0d6a3d207b668fd07bea96b594aae9c5568509a38252).Scope
Make due timers fair with the
window.postMessagetask source while preserving FIFO ordering, origin/source/transfer semantics, bounded queue limits, and the four-source Worker/ServiceWorker/MessagePort/WebSocket rotation. Do not alter transferredMessagePortlifetime ownership or add Code OSS special cases.Draft #292 touches the same runtime dispatcher. Its DOM-listener retirement work is semantically independent, but this implementation must wait for #292 to merge or split, then rebase without regressing #281's four-source rotation.
Acceptance
window.postMessageorder,source,origin, transferred ports, microtask checkpoints, and existing queue byte/count caps remain correct.