perf(rt): add opt-in VICTORY_BVH_NO_HIT and dead-RT compute pass skipping #254
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/TaynanGT--Vice-Tay!254
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-254"
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?
@Vladimir-Human on GitHub · 2026-11-27 12:31 UTC · original
Vladimir-Human:perf/bvh-no-hit-skip-dead-rt→main· +579 −6 · 5 files · 1 commits · openSummary
Adds strictly opt-in (OFF by default), independently selectable switches for avoiding unrehydrated BVH memory walks and dead ray-tracing compute work when
VICTORY_BVH_BUILDERis off (related to #168, #143):VICTORY_BVH_NO_HIT=1(opt-in, OFF by default):fxceless/victory-fork: lowersimage_bvh_intersect_ray/image_bvh64_intersect_rayto immediate miss constants (MISSfor triangles / other,NONEfor boxes) with zeroSLOT_MEMORYloads and zeroSLOT_FAULTSwrites.VICTORY_BVH_BUILDER=1.shader_cache.rs(VICTORY_BVH_NO_HIT=1\0) only when active so default / builder-on shader caches are completely unaffected.VICTORY_RT_SKIP_DEAD=1(opt-in, OFF by default, independent ofVICTORY_BVH_NO_HIT):CSComputeSkinning*,CSGenerateHairVB,CS_ScreenProbes_TraceRays*_BVH*,CS_RaytraceVBuffer*excludingVoxels/Fallback) inpipeline/make.rs.computestage; non-RT skinning (CS_PedStandardSkinning*,CS_PosOnlyLodSkinning*,computeclothSkinning) and non-BVH trace/resolve passes never match.VICTORY_BVH_BUILDER=1.VICTORY_RT_SKIP_GATHER_COPY=1(opt-in, OFF by default, independent):CS_Primary_GatherCopycompute pipelines whenVICTORY_BVH_BUILDER != 1.Because all three switches default to OFF and are independently toggleable, default behavior is unchanged and each arm can be A/B tested cleanly against the same baseline:
VICTORY_BVH_NO_HIT=1VICTORY_RT_SKIP_DEAD=1VICTORY_BVH_NO_HIT=1 VICTORY_RT_SKIP_DEAD=1+ VICTORY_RT_SKIP_GATHER_COPY=1Changed Files
crates/victory-shader/src/emit/mod.rs:bvh_no_hit(),bvh_no_hit_for().crates/victory-shader/src/emit/intersect.rs: miss-only lowering path (no_hit()).crates/victory-shader/src/emit/intersect_tests.rs: env policy unit tests + hardware/WARP zero-SLOT_MEMORY/SLOT_FAULTSexecution tests.crates/victory-gpu/src/shader_cache.rs: cache-key registration for activeVICTORY_BVH_NO_HIT=1+ subprocess cache-key separation tests.crates/victory-gpu/src/pipeline/make.rs:DeadRtKind,dead_rt_kind,DeadRtPolicy, and stage/container/policy unit tests.Verification
Verified on local D3D12 hardware (NVIDIA GeForce RTX 4070 SUPER) and WARP (
VICTORY_D3D12_DEBUG=1,--test-threads=1,0D3D12 debug errors):cargo clippy -p victory-shader -p victory-gpu --all-targets --locked -- -D warnings(default &--features victory-gpu/diagnostics): 0 warnings.cargo test -p victory-shader --locked emit::intersect_tests -- --test-threads=1: 10/10 passed (hardware + WARP, 0 skips).cargo test -p victory-gpu --locked pipeline::make::tests -- --test-threads=1: 11/11 (default), 12/12 (diagnostics).cargo test -p victory-gpu --locked shader_cache::tests -- --test-threads=1: 5/5 (default &diagnostics).cargo run -p xtask --locked -- policy&cargo test -p xtask --locked: 11/11 passed.@CowboyBingus on GitHub · 2026-11-27 12:40 UTC · original
For reference: #143 (open, mergeable) also makes the ray-tracing node test answer none / miss, behind
VICTORY_RT_MISS=1, with run-time skip lists (VICTORY_RT_SKIN_NAMES,VICTORY_RT_TRACE_NAMES) that take effect only with that switch on andVICTORY_BVH_BUILDERnot1.Measured there on an RTX 5070 Ti (ms/frame medians, interleaved runs; the two sets used different builds; full setup and tables in the linked comments):
dropped .../frame without a host pipelinelines, the skinning list accounts for 95.3 (ML1) and 95.1 (ML2) per frame and the tracing list for 4.0 per frame in both.On #143 the maintainer wrote: "I’ll keep the lists opt-in."
This PR's description says
VICTORY_BVH_BUILDERis "off (default)", the no-hit mode is "Auto-enabled wheneverVICTORY_BVH_BUILDER != 1" and the pass skipping is "Active wheneverVICTORY_BVH_BUILDER != 1 && victory_shader::emit::bvh_no_hit()", with its skinning and tracing passes listed there. In its code at9633fe2, its tests assert thatbvh_no_hit_for(None, None)is true and thatDeadRtPolicy::from_env(None, true, None, None)givesskip_dead: true, so with none of these variables set both are on.VICTORY_BVH_NO_HIT=0turns off both, andVICTORY_RT_SKIP_DEAD=0turns off the pass skipping.@TaynanGT on GitHub · 2026-11-27 12:41 UTC · original
@Vladimir-Human Please keep no-hit and pass skipping opt-in for the first matched run. A miss-only shader and a skipped producer change different parts of the frame. Compare them separately with the same cache state, skinning, hair and water in view, and keep the existing builder guard intact.
@TaynanGT on GitHub · 2026-11-27 12:47 UTC · original
@CowboyBingus The #143 split is the right reference: the lists removed about 99 draws per frame, with no consistent gain in the two rounds. Your check of the default policy confirms why these switches need to stay opt-in. Let’s keep miss handling and producer skipping separately selectable and compare them against the same baseline.
perf(rt): port VICTORY_BVH_NO_HIT and auto-skip dead RT compute passes (#168)to perf(rt): add opt-in VICTORY_BVH_NO_HIT and dead-RT compute pass skipping9633fe21a1toade3409766@Vladimir-Human on GitHub · 2026-11-27 13:32 UTC · original
Thank you @CowboyBingus and @TaynanGT for the review and #143 context! Updated in
ade34097:VICTORY_BVH_NO_HIT,VICTORY_RT_SKIP_DEAD, andVICTORY_RT_SKIP_GATHER_COPYto strictly opt-in (OFF by default) so default runtime behavior and default shader cache keys are unchanged.VICTORY_RT_SKIP_DEADandVICTORY_RT_SKIP_GATHER_COPYfromVICTORY_BVH_NO_HITso each switch can be A/B tested independently or combined against the same baseline (whileVICTORY_BVH_BUILDER=1still forces all three off).bvh_no_hit_for,DeadRtPolicy::from_env,Pending::new_with, andshader_cache::testsaccordingly and re-verified clippy (-D warnings, default +diagnostics),xtask, and D3D12 HW + WARP tests (0 debug layer errors).@TaynanGT on GitHub · 2026-11-27 13:37 UTC · original
@Vladimir-Human The independent opt-ins make this comparable with #143. Keep the baseline, miss-only and skip-only runs on the same camera path and cache state. The builder’s override is the right guard for the combined case.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.