Repository navigation
feat: share the WebGPU core across Three and Babylon - #91
bpodwinski wants to merge 2 commits into
Conversation
|
I'm for sure interested in the concept but can we talk about your methods a bit? |
|
Thanks for the feedback. I've been using your upscaler for months in my Babylon.js WebGPU project (Exokosm). Babylon has no temporal equivalent, so I extracted the WebGPU core and wrote an adapter for the Babylon Frame Graph. Methods: yes, I used an AI agent (Claude Code) heavily, directed and reviewed by me. Guardrails:
Not done yet: final low-variance perf acceptance, exhaustive visual review, real driver-crash recovery, remote CI. Details in Where to look:
The diff is big: happy to split it (core / Babylon / examples+docs) if you prefer. |
Resolve import conflicts in UpscalerNode.ts and resolution.test.ts: keep the branch's .js import specifiers and add upstream's getPassRenderResolution (pmndrs#89). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The diff is big and I'll review it. I dont mind an agent working as long as theres humans behind the thinking. I want to think about how we do a "core" and how then the packages are built for the different vendors. If you look at the work here: https://github.com/pmndrs/denoiser I've already kind of started it. im thinking I convert to a mono-repo with sub-packages for vendors that consume the core. I will take a stab at this today and use this PR for the babylon base work |
|
Hey @bpodwinski, thanks for this, and for the patience. The monorepo split is up as #94, and #91 was the reference for its Babylon side. How it's structured (same shape as pmndrs/denoiser):
Babylon (
The opt-in features from #91 are now tracked as their own issues, so each one can be judged on its own evidence:
Each issue says what exists today, what has to stay byte-identical, and what GPU evidence would land it. You've already done most of that work in #91, so if you'd like to take any of them on top of the new layout, PRs are very welcome. If you have a repro of the split-frame problem behind #96, please drop it there. Could you try #94 in Exokosm and tell me what breaks or what's missing for your Frame Graph setup? Once you're happy with the Babylon adapter there, I think we can close #91 in favour of these. The work here shaped the whole split, so thank you. |
Three currently owns the upscaler orchestration, preventing another WebGPU engine
from reusing it directly. This change extracts a shared GPUDevice-based core and
makes the existing Three API an adapter, then adds a Babylon 9.29 Frame Graph
adapter with native texture ownership and history rotation.
/core,/threeand/babylon; preserve root Three exports and signatures.Engine peers are optional and isolated packed consumers verify declarations and runtime imports.
ordering checks, asynchronous preparation cancellation and explicit history reset.
host pre-exposure correction and age-conditioned temporal RCAS. Neutral defaults
preserve existing Three shader behavior; spatial sharpening is unchanged.
reactive coverage and split guides. Group the gallery by engine and document contracts.
The package name/version, repository metadata and release/Pages workflows stay
upstream. No npm publication or application migration is included.
Validation
gallery builds, packed Three guides build and isolated packed entrypoint consumers pass.
An earlier run under contention had three release-fixture timeouts and a Vitest
RPC timeout; the full repeat and targeted affected cases passed. Both logs are retained.
guides pass. All twelve built mesh pages passed again on both RX 580 and RTX 5080,
including odd resize, NativeAA, aliasing, reset and disabled/reenabled history.
output. Core/Babylon each exercised 24 dynamic configurations and two host effects
between guides/upscale; per-frame GPU readback checks both exposure domains.
Babylon restoration awaits actual WebGPU initialization before graph/task recreation.
Three rejects old-instance preparation and renders again after caller recreation.
pixel for pixel. New cross-build throughput probes ran on both devices.
RX ratios 1/1.5/2/3, RTX ratios 1/1.5. Older runs and all new samples are retained.
RTX drift remains 9.87–11.46%, limiting sensitivity to small regressions.
exactly in the measured windows. Scene captures were inspected.
dilution and requires a tenfold signal over stationary jitter. The alpha meter
verifies browser ownership and closes it through CDP; its busy-port regression passes.
launched profile before creating a page; occupied-port fixtures stay open.
cloning does not inherit seed-local Git configuration. Personal Git configuration is unchanged.
parity tool now rejects missing/extra captures; packaged guide example links are portable.
Limits
Final low-variance performance acceptance and exhaustive human visual review remain
open. Device loss was triggered through WebGPU, not an OS/driver crash. Babylon internals are centralized and
guarded, with peer support limited to 9.29.x. Dependency WebGPU declaration collisions
may require skipLibCheck for Babylon/Three consumers; core declarations are checked
without it. Full contracts and evidence: docs/webgpu-core.md,
docs/babylon-framegraph.md and docs/webgpu-validation.md.