Repository navigation
Performance Research G06 Shader Deduplication and Prewarm
| Field | Value |
|---|---|
| Evidence state | Historical cache-hit evidence; runtime/stutter qualification remains build-specific |
| Inspected source | 322986f4c5502b3fa887a9605ac8cd88e9b2c579 |
| First experiment | Exact-source deduplication independent of driver pipeline caching |
| Scope | Addendum dated September 15, 2026; not a current-main benchmark or implementation status |
Unproven performance research · Performance research — common test protocol · Performance research — reproducible checks
Existing implementation, distinct remaining question. The retained prewarm document records an older diagnostic with 141 stage-module misses, 463.419 ms of glslang work, a single frame containing 18.217 ms of compilation, and 20 different-key/same-source recompilations. It also records successful warm artifact reuse. Those records establish a concrete compiler-work mechanism, not a current-head FPS guarantee. Prewarm research.
Three layers must remain separate. Generated-source identity can deduplicate compilation; SPIR-V persistence can avoid recompiling known source across runs; driver pipeline caching/precreation addresses later pipeline creation. A SPIR-V hit does not eliminate GLSL generation, reflection, module construction, or graphics-pipeline creation. Khronos documents and measures pipeline cache reuse as a separate mechanism. Pipeline management.
Implementation details. Keys need complete effective source, stage, target, compiler/generator policy, and relevant options. Validate cache bounds and stage/layout information. Use immutable in-memory hits during gameplay, transactional writes outside the hot path, and a full compile fallback on invalid data. Source bytes must remain authoritative behind any hash.
Expected gain. Reduced cold/first-encounter or repeat-run hitches; often little steady-state gain once everything is already warm. Keep cold, source-warm, artifact-warm, and driver-pipeline-warm test conditions distinct.
Acceptance. Exact current-head cold/warm fixed routes, new areas beyond the trained route, corruption, failed module/reflection construction, eviction, renderer switching, shutdown, and peak memory. Successful cache hits alone do not clear adverse frame tails.
Distinguish source deduplication, SPIR-V persistence and driver pipeline precreation. Keep gameplay-path file I/O out of the first implementation.
generate exact source -> validated artifact lookup -> compile on miss -> common module/reflection path
Locate the inspected seam before editing; names or ownership may have changed since the pinned review:
git grep -n -E 'spirv|glslang|prewarm|reflection' -- hw/xbox/nv2a/pgraph/vk docs/performanceThese are implementation gates to add or exercise, not claims that production tests already exist or passed. Retained standalone checks are on the checks page.
| Test ID | Setup / deliberate control | Required oracle |
|---|---|---|
G06.01 |
Two different state keys generating byte-identical stage/source under identical compiler options. | The second eligible compile is reused; output and module inputs match. |
G06.02 |
Fresh empty cache, warm validated cache, changed compiler/ABI, corrupt/truncated record and module-construction failure. | Exact hits reuse; invalid data falls back transactionally and partial resources are released. |
G06.03 |
Renderer switch, live setting toggle, shutdown and a route encountering new shaders. | Lifetimes/writeback remain valid; compile, reflection and pipeline stalls are measured separately. |
Collect: source_identities, state_keys, compile_hits, compile_misses, compile_ns, reflection_ns, module_ns, pipeline_ns, cache_bytes. Keep exact counts separate from sampled durations; use an uninstrumented build for performance qualification.
Reject or hold: A high cache-hit rate is reuse evidence, not a tail-latency result. Retain adverse historical tail results and requalify the exact repaired candidate.
Follow the common protocol for source identities, previous-main/fixed-baseline controls, raw results, confidence and retail/XISO qualification. No gain becomes proven from a model, cache hit, local operation count, or shifted wait label alone.
DSP tooling guide and navigation updated November 2, 2026 for experimental PR #384, source 8f51d237. Capture/replay usage and limits.
The earlier wiki-wide review was published November 1, 2026. Emulator source: b7140848. Reviewed wiki content: 1d2b671. Current status · Release availability · Publication process.
- Home
- Current status
- Stable versus main
- Implemented mechanisms
- Controls and defaults
- Measured results and limits
- Complete change register
- System
- CPU and vCPU
- Memory and DMA
- Graphics / NV2A
- APU and audio
- Timing and timers
- Platform and I/O
- Hardware observations
- Fidelity boundaries
- Methodology
- PGR2 routes
- Debugging lag / hot paths
- Tools and commands
- DSP capture, replay and fuzzing
- HLE readiness and public XISO proof
- Concurrent DSP shadow and OpenAL proof
- DSP HLE operation inventory
- DSP HLE fix examples and testing
- Development
- Upstream shortlist
- Wiki maintenance
- Research / retired work
- Optimization catalog
- Hot-path shortcuts
- Researched experiments
- Unproven proposal directory
- PR lessons
- September26 snapshot
Repository · PRs · Issues