shader: a node test that misses every node asks nothing of title memory #1440
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1440"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by LouisRiverstone on 2026-11-28T20:04:40Z.
Why
With
VICTORY_BVH_MISS=1(the launcher's default) every ray-tracing node test already answers a miss, but the lowering still looked the node up in the directory of title memory before branching:SLOT_MEMORYdirectory load per node test, whose result no branch read;SLOT_FAULTS.memory.rstake_faultsreads those notes every frame and, for each page, maps 64 KiB of card memory and sends it up (map+bring), for nodes that are never read.So on the default settings the trace programs cost VRAM, uploads and host work for nothing. That hurts most on 8 GB cards.
What changed
crates/victory-shader/src/emit/intersect.rs:bvh_miss()now takes the same early path asno_hit(). A box returnsNONE, anything else the triangle miss, and nothing is read. Those are the values the oldbvh_miss()branches returned, so the picture should not change. The two branches made dead by this are removed.The shader cache key includes the translator's sources (
VICTORY_TRANSLATOR), so cached translations are replaced on the first run of this build.Tests
a_node_test_that_misses_every_node_asks_nothing_of_title_memorychecks that, with every node missed, the program binds neitherSLOT_MEMORYnorSLOT_FAULTS, in both the 32- and 64-bit forms and both descriptor forms.cargo test -p victory-shader: 337 passed, 6 ignored. This includes the on-card node tests against the reference.cargo clippy -p victory-shader --all-targets: one warning, inemit/mod.rs:2837, which this PR does not touch.Not verified
The change has not been run in game. To check it on a card, compare the log's ten-second line "title memory by address" (faults and pages made should drop to about zero with the builder off), and VRAM and GPU time in F3, against a build without it. Expect a stutter on the first run while the affected shaders are translated again (or run
victory warm).