Encode the native BVH64 mirror base before shader execution #219
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!219
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-219"
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-02 19:12 UTC · original
tommiehansen:perf/bvh64-native-pointer→main· +147 −39 · 7 files · 5 commits · merged 2026-12-03 17:20 UTCThe native node-test shader reconstructs the GPU mirror address and puts it into the hardware pointer format each time it issues a node test. This branch encodes and biases the fixed base on the CPU. The shader adds the absolute guest node number in pointer units. It keeps the original descriptor and checks for mirror bounds, descriptor bounds and node width. The qualification probe exercises the same full-address encoding alongside the relative-address check.
The base is biased modulo the address bits retained by the instruction. Before and after this change, the same aligned byte address contributes bits 6 through 47 to the pointer and the same three bits encode the node kind. Canonical sign extension is outside the retained bits. The branch also updates the translator cache version so cached shaders using the old root data are invalidated.
The new encoding removes integer IR from the native test path. The Vulkan compiler may already fold some of the arithmetic, and shader register use remains to be measured. The portable shader suite passed 280 tests with two ignored. The test covering the emitted pointer operations matched the original formula for 20,480 inputs. The GPU crate and executable passed Windows-target Rust checking.
Shader work removed
This table describes the emitted IR, not guaranteed final RDNA ISA. The follow-up below documents the bounds-check verification.
Hardware testing
Hardware benchmarking was unavailable. Please compare the qualification probe, target shader ISA and frame times at native 1080p on RX 9060 XT 16 GB and native 1440p on RX 9070 XT under Linux, with RT enabled and frame generation disabled. Include a cold shader cache and a warm repeat.
Follow-up on native mirror bounds
The shader now compares absolute node indices with the mirror window. This removes two 64-bit relative subtractions per native test and keeps the original descriptor limit, box32 extent, and miss result. The emitted predicate matched 35,840 cases, the shader suite passed 281 tests with two ignored, and diagnostic Windows-target Rust checking passed. Actual ISA, occupancy, and GPU timing still need hardware testing.
8d540e1e34toe7e7bb4c25