victory-gpu: DXR 1.1 TLAS root/heap binding, cache serialization & RayQuery telemetry (#339) #357
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/357"
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 Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T15:47:53Z.
Phase 3 PR #8 for #339 (combines #354 [
feat/hw-rt-phase3-traversal-lifter] and Phase 2 #349 [feat/hw-rt-phase2-mesh-decoders]; targetingfeat/hw-rt-phase3-traversal-lifter).Summary
pipeline/host.rs,draw.rs): DeclareD3D12_ROOT_PARAMETER_TYPE_SRV(Flags: NONE) root parameters forHostShader::ray_queries.tlas_srvs, resolve console TLAS GPU VAs from root descriptor tables indraw::bind, and bind host DXR TLAS VAs viahwrt::tlas_gpu_va(dropping dispatches safely if the DXR manager is unavailable).descriptor/host.rs): CreateD3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTURESRVs onView::Shaderentries viahwrt::tlas_for_descriptorand bypassListViewscaching for acceleration-structure slots so dynamic TLAS rebuilds stay current.shader_cache.rs): Serialize/deserializeHostShader::ray_querieswhile staying backwards-compatible with legacy cache entries (entries_round_trip_and_reject_damageupdated and verified).hwrt.rs,pipeline.rs,pipeline/make.rs,draw.rs): Log liftedRayQuerycounts per compute program (note_program) and direct/indirect dispatch (note_dispatch), include per-frame lifted/partly/fallback stats inhwrt::report_line, and enableCS_RaytracingResolvewhenVICTORY_HW_RT=1unless explicitly disabled (VICTORY_RT_RESOLVE=0).Verification
cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy --staged(7 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib emit::rayquery -- --test-threads=1(11 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib hwrt:: -- --test-threads=1(27 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib shader_cache::tests(2 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib pipeline::make::tests(11 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib pipeline::host::tests(6 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib root::tests(11 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-hle --lib xboxbvh::(2 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings(0 warnings)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --all-features -- -D warnings(0 warnings)GPL-3.0 references:
TrustNo1-Coder/Darner,readmet3xt-lab/foxhoundImported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T16:08:03Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingAutomated Technical Review — PR #357
Verdict:
needs-gpu-test(CI passing; gated behindVICTORY_HW_RT=1, off by default).What was reviewed
(Note: this PR is stacked on #354 /
feat/hw-rt-phase3-traversal-lifter+ #349, so the diff againstorigin/mainwas truncated at 120 KB;descriptor/host.rs,draw.rs,host.rs,host/menu.rs, and the first ~2750 lines ofhwrt.rswere inspected directly.)crates/victory-gpu/src/descriptor/host.rs:HostHeap::make_listed_batchedskipsListViewscaching forD3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTUREwhencrate::hwrt::requested()is set, avoiding stale TLAS descriptors across rebuilds.make_twinneddecodes the 64-bit console VA fromd[4]/d[5](matching the 16-byte-alignedD3D12_SHADER_RESOURCE_VIEW_DESCunion offset) and creates aD3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTURESRV withNoneresource viacrate::hwrt::tlas_for_descriptor.crates/victory-gpu/src/draw.rs:State::bindresolves console TLAS VAs fromstage.tlas_srvsroot descriptor tables and binds the host VA viacrate::hwrt::tlas_gpu_va, safely dropping the dispatch if no DXR TLAS manager is active.crate::hwrt::note_dispatch.crates/victory-gpu/src/host.rs&host/menu.rs:Deferred::held/HostList::holdcleanly ties lease/readback lifetimes to command list reset, andHostList::untouchedaccounts fordeferred.held.VICTORY_HW_RTis exposed inITEMSasUNSET_ON(off by default).Minor non-blocking notes
crates/victory-gpu/src/hwrt.rs(HwRtManager::execute_build): On the TLAS path,dst_inst_bufis transitioned fromUNORDERED_ACCESStoNON_PIXEL_SHADER_RESOURCEbeforeself.lease(list, info.ScratchDataSizeInBytes)andself.alloc_or_reuse_as(...). If either allocation returnsNone(OOM), the earlyreturnskips transitioningdst_inst_bufback toUNORDERED_ACCESSbefore it is returned toself.leaseson list reset.crates/victory-gpu/src/hwrt.rs(HwRtManager::alloc_or_reuse_as): Still contains a leftover// TODO(phase3): notify TLAS SRV descriptor bindings when RayQuery traversal lifting lands.comment.view_addressfor TLAS table entries: Indraw.rs(State::bind),stage.tlas_srvsextractsconsole_tlas_vaviacrate::descriptor::view(handle).and_then(|v| crate::descriptor::host::view_address(&v)). Confirm during GPU testing that console TLAS table descriptors yield non-zeroconsole_tlas_va(and don't silently fall back to0/ empty TLAS) on real RT dispatches.Suggested real-GPU smoke test
Requires a DXR 1.1 + SM 6.5+ GPU. Run with
VICTORY_HW_RT=0(default regression check) andVICTORY_HW_RT=1(with D3D12 debug layer if available), checking:BuildRaytracingAccelerationStructurebarriers.hwrt::report_line/hwrt: built native DXR TLASlogs show non-zero BLAS/TLAS builds, matched remaps, and lifted RayQuery dispatches without device removal.VICTORY_HW_RT=1.Generated with Antigravity CLI (
agy).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T17:04:33Z.
Holding merge (
triage: needs work) per Deep Static Audit Pass #2 (#282comment7352688269, DXR 1.1 P0/P1 findings #1–#20 routed to#339; note#354must not merge without#357'sshader_cache.rskey isolation #10).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T22:03:53Z.
Holding merge per Deep Static Audit Pass #4 (
#282comment7359964895):#1and#3–#11are all cleanly resolved![P0]blocker froma4aab821: ungatedHostList::shadow_to/shadows_commonbreaks theVICTORY_HW_RT=0/unset zero-impact guarantee and trapsShadow::bufferinCOPY_DEST/UNORDERED_ACCESS/GENERIC_READacross untracked descriptor-table SRV/CBV/UAV, root SRV/CBV, andtexture.rsaccesses.shadow_to/shadows_commonhooks indraw.rs,host/place.rs,indirect.rs, andhost.rs:9196, and write the 8–16 byteemit_postbuildresult intosh.bufferinsidehwrt::active()via a 1-thread UAV compute shader (SetComputeRootUnorderedAccessView+ plain UAV barrier) soShadow::bufferstays inCOMMONoutsidehwrt.Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T00:03:08Z.
Deep Static Logic Audit Pass #5 (
#282comment7362568946) gave GREEN LIGHT to#357(5d0eedbd, superset incorporating#347,#349, and#354) behindVICTORY_HW_RT=1:[P0]resolved (d065fff:shadow_to/shadows_commonreverted, strictly zero non-RT impact whenVICTORY_HW_RT=0/unset, 1-thread compute UAVemit_postbuild).[P2]resolved (65e3d13/e680116: transitive PHI-to-PHI seeding incollect_rq_needed_vals+resolve_rq_phi_arm).46994746181GREEN and merges cleanly ontomain(5bfc066c).Merging the complete
#339DXR 1.1RayQuerysuperset tomain(off by default behindVICTORY_HW_RT=1); closing subsumed stack PRs#347,#349, and#354.