Repository navigation
fix: prepare and share upscaler pipelines asynchronously - #83
Merged
Merged
Conversation
This was referenced Oct 6, 2026
DennisSmolek
marked this pull request as ready for review
October 7, 2026 02:16
DennisSmolek
force-pushed
the
fix/async-pipeline-startup
branch
from
October 7, 2026 03:56
9ccf42a to
2ef20ef
Compare
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.
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 returnsPromise<void>. Existing raw callers that ignore it can dispatch before preparation completes and throw; shader compilation rejection is asynchronous.MomentsPassrequires a new explicit awaited init.UpscalePassand 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.