shader: use uniform handles for proven scalar guest loads #302
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!302
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-302"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tommiehansen on GitHub · 2026-12-03 09:42 UTC · original
tommiehansen:perf/t01-uniform-guest-loads→main· +85 −2 · 5 files · 1 commits · merged 2026-12-03 17:14 UTCProblem
Scalar guest loads use nonuniform heap handles even for addresses derived entirely from constants and host user data. That can force unnecessary descriptor divergence in the backend.
Implementation
When
VICTORY_UNIFORM_GUEST_LOADS=1, prove that both address words and the optional scalar offset are dispatch-uniform before selecting a uniform handle. Only proven literals, the shader's own user buffer, and bounded deterministic expressions enter the proof. Other paths preserve the nonuniform handle, including all vector accesses. Page lookup, read-only and missing-page behavior, fault stores, and guards remain the same. The option has a separate shader and pipeline cache identity.The optimization was motivated by ReVIctory 925ac0a3. This PR implements the conservative scalar-handle portion independently of global-load clustering.
Quantified behavior — translator output, not GPU timings
Evidence from related implementations
ReVIctory 925ac0a3 uses wave-uniform handles for scalar memory loads and reports validation of five RT shaders and PSO compilation on RX 9070 XT for its broader shader change. It does not report isolated FPS or GPU-time savings from uniform handles.
Issue #14 reports typically 25–40% occupancy and small waves lasting tens of microseconds on RX 9070. Avoiding unnecessary descriptor divergence is a plausible optimization for this workload; the compiler's actual handling and frequency of eligible loads must be measured.
Why this should be merged
The bounded proof avoids relying solely on the scalar opcode to establish uniformity. This is a narrow, opt-in translator optimization with a distinct cache key and a conservative fallback. It can be evaluated independently of #305 and the native RayQuery stack. Inspect final RADV ISA and shader timings to establish whether waterfalls or other unnecessary backend work actually disappear.
Validation
281 portable shader tests passed with 2 ignored. Windows-target checking with diagnostics and test targets passed on macOS using a check-only mimalloc override and pure Rust BLAKE3. Hardware benchmarking and RDNA ISA capture were unavailable.
Please compare the option on and off on RX 9060 XT 16 GB and RX 9070 XT, RT enabled, native Series X rendering at 1080p and 1440p respectively. Check the emitted descriptor code, shader GPU time, frame-time percentiles and image parity on the same scenes. The option is off by default.
depsandlocalsymlinks on main delete both folders on pull, including the Wine prefix and the saves #340github-bot referenced this pull request2026-12-03 19:17:31 +00:00