perf(webgpu): promote stable retained replay - #784
Conversation
Bundle ReportChanges will increase total bundle size by 26.96kB (0.08%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: exo-esm-esmAssets Changed:
Files in
view changes for bundle: exojs-tilemap-esmAssets Changed:
Files in
view changes for bundle: exo-esm-modules-esmAssets Changed:
Files in
Files in
Files in
Files in
Files in
Files in
view changes for bundle: exo-iife-Exo-iifeAssets Changed:
Files in
view changes for bundle: exo-iife-min-Exo-iifeAssets Changed:
Files in
view changes for bundle: exo-full-iife-min-Exo-iifeAssets Changed:
Files in
view changes for bundle: exo-full-iife-Exo-iifeAssets Changed:
Files in
|
0d73c4d to
d36fd00
Compare
Behavior
Stable WebGPU retained groups reuse native render bundles after 30 complete compatible replay frames and at least 32 supported batches. Construction is limited to 32 bundles per backend frame. Resource or recording invalidation immediately returns to ordinary replay and restarts observation without eager rebuilding.
Sprite, scalable geometry, Text and TileChunk keep their existing resource/uniform upkeep. Native reuse validates resource identities. Stencil, writable-depth and multiple-color-attachment passes use ordinary replay, preserve normal-pass bundles, and pause stability observation. Mixed renderer groups retain bind groups per layout. The 30/32/32 policy is internal, with no public tuning API.
Evidence
A controlled idle acquisition used nine fresh Chromium processes: three each for 10k/50k/100k sprites, eight alternating paired AB/BA blocks per process, without concurrent local builds or tests. All nine process medians are positive:
63/72 paired blocks are positive; all 24 blocks at 100k are positive. All timed frames have zero builds. Every acquisition verifies actual native execution, synchronized byte-identical pixels, a nonblank clear control, no WebGPU validation errors, and the 32-build frame budget. Raw data, source hashes and reproducer are committed. Measured runtime hashes remain identical after the final rebase.
These are CPU submission savings on one RTX 5070 Ti, not GPU time or FPS gains. They are smaller than the eager spike. Additional hardware, representative consumers and integrated churn performance remain follow-up work. The new canonical dataset supersedes uncontrolled desktop measurements; earlier data remains in Git history. Excluded exploratory raw data is removed from the final tree.
Validation
24 targeted cache tests pass, including fallback preservation, paused promotion, and resource changes on return. Real WebGPU stencil/MRT preservation tests pass. Focused tests also cover camera and texture changes, custom uniforms, mixed renderer transitions, render-target formats and synchronized pixels. All 25 static gates, unit/allocation/physics, WebGL, tilemap, structural benchmarks (60 cells, zero deviations), site build and 13 sampled example smokes pass. The full local WebGPU run stalled with 101 files / 618 tests passed; its test browser was terminated, and the remaining text-shaping parity file then passed all six tests in isolation with two workers. The stall is not proven to be local-only. Completed gates were not rerun on push; the final full remote WebGPU lane and overall CI must pass before merge.
#782 and #783 are merged; this branch is rebased onto their resulting next. Manual merge only, no automerge.