Skip to content

fix: prepare and share upscaler pipelines asynchronously - #83

Merged
DennisSmolek merged 2 commits into
mainfrom
fix/async-pipeline-startup
Oct 7, 2026
Merged

DennisSmolek merged 2 commits into
mainfrom
fix/async-pipeline-startup

Conversation

@DennisSmolek

@DennisSmolek DennisSmolek commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Fixes #82. On Windows, synchronous compute-pipeline creation blocks the GPU main thread. Initialization now uses async compilation through a four-slot queue shared by GPUDevice, caches identical modules/pipelines, and prepares only the selected path. Debug and disabled shading-change passes remain lazy. TSL/presenter integrations render the input while preparation is pending; optional activation preserves the current input jitter and split-frame settings. API migration: raw callers must configure and await init() before dispatch, including after switching to an unprepared path. Adds prepare(), isReady, and a compile-free isSupported(device) check. MomentsPass and UpscalePass expose async initialization. Exposure behavior and shader math are preserved. Windows measurements (Chrome 154, RTX 3060 Laptop, three fresh profiles plus matching reloads): - Median GPU-main compute-creation time: cold 1647.425 → 2.077 ms; warm 152.924 → 0.958 ms. - Default temporal startup: 10 sync → 8 async pipelines; spatial: 10 sync → 3 async. - Two-instance split demo: 20 sync → 8 shared async pipelines. - Dawn traces place upscaler DXC compilation on ThreadPoolForegroundWorker. Residual render-shader stalls remain; this is not a total-startup speedup claim. Validation: - Node 22.23.3/npm 11.5.1: lint, typecheck, 472 portable tests, library/gallery builds, packed-consumer build. - Packed Chrome GPU check: 16 ordered split frames, two backing textures, zero monolithic fallbacks. - All 20 Chrome demos; six representative Edge demos; resize/DPR and 32 mode/debug selections; real MomentsPass and device-loss checks. - All three benchmark source bundles completed Q1/ratio-2 ABBA smoke with no browser validation errors. - Full Ubuntu verification passed on the initial implementation; final-revision CI is tracked on this PR. See Windows audit and roadmap and docs/windows-evidence/ for committed samples and coverage. Remaining findings: the existing POSIX release-workflow harness fails on native Windows (excluded from the portable result); demo 14 retains synchronous calls inside three-gpu-pathtracer; browser discovery/Windows CI need follow-up; S2 reads timings without opting in. Forced FXC and other adapter families were not tested. No package release or merge is performed.

Breaking initialization contract

Upscaler.init() now returns Promise<void>. Existing raw callers that ignore it can dispatch before preparation completes and throw; shader compilation rejection is asynchronous. MomentsPass requires a new explicit awaited init. UpscalePass and TSL nodes provide preparation fallback.

Configure first, await init/prepare, then start raw dispatch. This must be reviewed and released as a breaking API change with migration guidance; it is not compatible with the old immediate raw-dispatch pattern. No merge or release has been performed.

@DennisSmolek
DennisSmolek force-pushed the fix/async-pipeline-startup branch from 9ccf42a to 2ef20ef Compare October 7, 2026 03:56
@DennisSmolek
DennisSmolek merged commit 5dd86e7 into main Oct 7, 2026
1 check passed
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.

Synchronous pipeline creation and eager pass compilation stall the GPU process on Windows

1 participant