Repository navigation
Conversation
`root_view` cut a root SRV at 1 MiB (a root CBV at D3D12's 64 KiB), so the title's vertex and index data past that read from a host copy that was never brought up to date: the world's geometry read zeros while its constants and small buffers were fine. The refresh copies only the pages the title wrote since they were last copied, so naming the whole remaining extent costs nothing when nothing changed. Same finding as upstream Marvisak#294 (full root SRV extent), kept to this tree.
On top of integrate/shaders2. Conflicts: - lower.rs: Marvisak#265's scratch() stays; flat() takes Marvisak#294's root SRV/UAV doc. - valu_tests.rs: the shader side's test helpers (emit with a Target) stay; Marvisak#294's two root UAV tests are appended. - shader_cache.rs: both new tests kept (Marvisak#320 wave-size key, Marvisak#358 cache that cannot keep an entry). - HostShader initialisers in scratch_tests.rs and valu_tests.rs get root_uavs; emit() calls in tests get Target::ANY. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
|
Review question on cost (built on RootView::Uav => {
let len = shadow.left(address);
shadow.refresh(list, address, len);
shadow.gpu_writes(list, address, len);
Has this been measured on a large buffer? If the view's real extent cannot be known, a cap with a logged warning when it is hit (as From reading and synthetic tests only; I have no copy of the title. |
|
Tested
So this does not resolve #97 on my machine; that is not evidence against the root-UAV functionality itself. Only aggregate counts and error classes shared, no game data or raw game logs. AI-assisted (Kimi Code). |
|
Thanks @r4tedx, good catch: it had not been measured on a large buffer, and the UAV snapshot/compare is the expensive part. Pushed 0050ce5:
The fallback VAs and root UAV support are unchanged. Gate: clippy (both configs), |
Build D3 page-faulted the GPU 47 s into the world on an RX 7600, at a compute dispatch about 1.4 GB past the nearest title copy. Root views have no bounds checks on the host, and root UAVs (Marvisak#294) are the newest way a shader reaches unchecked memory. Until that is understood, a shader that needs a root UAV stops at "a typed root view" again and its dispatch is dropped, as before Marvisak#294; VICTORY_ROOT_UAVS=1 turns them back on. The shader cache keys on the switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
Build D3 page-faulted the GPU 47 s into the world on an RX 7600, at a compute dispatch about 1.4 GB past the nearest title copy. Root views have no bounds checks on the host, and root UAVs (Marvisak#294) are the newest way a shader reaches unchecked memory. Until that is understood, a shader that needs a root UAV stops at "a typed root view" again and its dispatch is dropped, as before Marvisak#294; VICTORY_ROOT_UAVS=1 turns them back on. The shader cache keys on the switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66 (cherry picked from commit ea38011)
|
Tested this PR at
All six previously stopped on root UAV / typed root view handling with #489. The SDK preserved all six emitted DXIL hashes. For the live comparison I kept the previous mission build, including #457 and the same readback instrumentation, and added #489 and this PR. The startup logs show 682 early pipeline keys for the previous build and 683 for the combined build. I staged identical 682-key seeds, but the harness set only the data directory and both launchers used the shared pipeline cache. The runs therefore do not give a controlled cache or frame-time comparison. A diagnostic observer matched nonempty direct dispatches for five distinct shaders to their submitted command lists. The native queue fence completed at the submitted value for both batches. The mission screen remained near black. This run establishes dispatch progress, with visible rendering and frame-time impact still unresolved. I also isolated why the sixth shader fails pipeline creation on this adapter. Its validated DXIL requires a 64-lane wave, and DXC accepts the production root signature for it. The RTX 5070 reports WaveOps support with both the minimum and maximum wave size at 32. I compared two ordinary 512-thread compute shaders with 1,024 bytes of group-shared memory and the same root signature. Both passed SDK and root-signature validation. Changing only Separately, the production root-binding and guest copy-back path passed a bounded synthetic check on the same GPU. A direct dispatch and a one-group indirect dispatch both wrote the expected guest dword. An unmapped UAV wrote to the designated sink, the separate zero buffer stayed zero, and surrounding guest bytes stayed intact. Each submission completed its fence with the device reporting |
|
In game on AMD RDNA4 (RX 9060 XT, Windows 11), opening cutscene: With But the device hangs ( With Not checked: which dispatch faults; GBV. AI-assisted (Claude Code, Claude Opus 5.5); no game data. |
|
I checked the root-SRV extent change on Windows in a local integration that also uses the bounded root-SRV tables from #493. The synthetic I also replayed six dropped world compute shaders offline on that integration. All six reached the program IR, but none produced a host compute pipeline. Four stopped during resource tracking with “an address in an SGPR that is no root parameter” and the two meshlet-culling variants stopped in emission with “a hardware SGPR input”. In this configuration the translator stops before these programs can exercise the runtime root-UAV binding. This check verifies the SRV refresh separately from the title’s lighting. |
LAKSHYA-cmd-tech
left a comment
There was a problem hiding this comment.
LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. cargo test -p victory-shader passed (71 passed) and cargo test -p victory-gpu passed (48 passed, 1 benchmark ignored). End-to-end Root UAV support (shader lowering, VSH2 cache format, root signature deduplication, write-back, and UAV barriers) along with safe fallback VAs resolves Part 1 of #614 and prevents unmapped root view GPU hangs.
|
Thanks @nullmarsh and @miniongk for the live hardware reports! Re: the 16–28 s
|
# Conflicts: # crates/victory-gpu/src/draw.rs # crates/victory-gpu/src/pipeline/host.rs # crates/victory-gpu/src/shader_cache.rs # crates/victory-shader/src/emit/host.rs # crates/victory-shader/src/emit/lower.rs # crates/victory-shader/src/emit/mod.rs # crates/victory-shader/src/emit/shader.rs # crates/victory-shader/src/emit/valu_tests.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fer accesses Brings byte and half loads/stores on buffers, flat and global memory, sub-word cbuffer reads, and structured UAVs for 64-bit atomics. Resolutions against the branch: - scalar loads through root descriptors keep Marvisak#294's built-source path; - root view bounds (Marvisak#650) gate the sub-dword and atomic paths too (atomics narrow their active lanes by the bound); - the Marvisak#383 LDS byte path uses lds_ptr and refuses 64-bit LDS atomics; - memory_tests fill root view sizes in user data, as Marvisak#650 requires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… into integ4 (cherry picked from commit f862329) (cherry picked from commit 92bbf8860e34da76c3455bb813848252656ffeac)
|
Read of head
Adding |
The ray-tracing builder passes buffer addresses as a pair of root constants rather than as root views, so its programs failed with "an address from a root parameter that is no address". The tracker now takes a root constant as an address's low half when the next dword of the same parameter is its high half, and records which dword (`Address::dword`). The emitter binds such an address as a root CBV or raw SRV, as it does for root descriptors, at a register that names the parameter and the dword (`RootView`, `(dword + 1) << 8 | slot`); root view registers are 16 bits now. The GPU side reads the address from the two constants the title set and binds it as it does a root view. The shader cache format is VSH2 (16-bit registers). Root UAVs (Marvisak#294) and the spill table (Marvisak#302) are still needed for the builder's programs to translate in the title; tested with synthetic programs only (tracking, lowering, dxil.dll validation, pipeline creation on an RTX 5080), no game data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 995f7f3)
…ot UAVs - Refresh the full remaining Shadow buffer extent for Root SRVs and Root UAVs instead of truncating at 1 MiB (keeping Root CBVs at the 64 KiB D3D12 limit). - Guard shadow::find/loose against low (<0x10000) and uncommitted addresses, and bind permanently-alive 4 MiB zeroed/sink fallback GPU VAs instead of skipping Set*Root*View when a root view is unset, null, or unmapped. - Support Root UAVs (u<slot>, space1 RWByteAddressBuffer) end-to-end across victory-shader (descriptor handle, global_store_dword*, s_load_dword* on root descriptors, PSV0/dx.resources metadata, SFI0/ShaderFlags UAVsAtEveryStage=1<<16), shader_cache (VSH2), pipeline::host (deduplicating shared (kind, slot) root views across stages), and draw (binding, gpu_writes write-back, and post-draw/dispatch UAV barriers). - Add unit, dxil.dll validation, WARP, and host GPU tests covering >1 MiB Root SRV dirty-page refresh, null/unmapped fallback VAs, cross-stage root view deduplication, and Root UAV execution/write-back.
Root SRVs and UAVs took the whole rest of their buffer's host copy, so a root UAV near the start of a very large backing copy kept and compared that whole range on every submission. A root view has no size and the translated shader does not report its range yet, so bound them: root SRVs refresh at most 4 MiB, root UAVs refresh, snapshot and copy back at most 2 MiB, constant buffers keep the 64 KiB D3D12 maximum. A cut is logged once per view kind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prevent RootView::Uav in draw::root_view from falling back to shadow::loose() copies of arbitrary committed title memory. Because RootView::Uav schedules Shadow::gpu_writes copy-back after submission, binding a loose window for an unregistered or bogus root UAV address allowed GPU shader stores to overwrite unrelated title CPU objects (reported as 0xc0000005 access violations by Vaximous and nullmarsh). - Split shadow::find_buffer() out of shadow::find() to look up only registered title buffers (never LOOSE windows). - Route RootView::Uav through shadow::find_buffer() so misses bind the writable sink fallback VA without registering copy-back; RootView::Cbv and RootView::Srv continue to allow read-only loose lookups. - Add draw::tests::root_uav_on_unregistered_loose_memory_uses_fallback_without_copy_back verifying that an unregistered committed address (even with an active loose shadow from CBV/SRV) misses RootView::Uav and is never modified by GPU compute stores.
Add root_uavs to the waterfall test HostShader literal and pass the structured lane info to resource::track in the new Root UAV tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @dpalacios69 for the catch. The branch is now rebased onto upstream For the earlier in-world reports of a device hang at a compute program with two raw root UAVs (@nullmarsh, @itsRevela, @erickbobd): your own data shows the hang goes away once #650 (bounding root view accesses by the host-bound size) is stacked on this PR, so #650 should land with or before this one. AI-assisted (Claude Code); checked on Windows 11 / RTX 5090. |
c00c1bc to
a4e0feb
Compare
…sak#709 on Marvisak#1077's root UAVs Marvisak#709's test used Marvisak#294's Root::Uav; this host binds a zeroed root UAV (SetComputeRootUnorderedAccessView) and reads it back after the views' UAVs. Also the fork's track() signature, and stride-0 structured accesses keep the fork's runtime stride-table view (Marvisak#193/Marvisak#704) after Marvisak#709's structured(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Fixes Root SRV truncation past 1 MiB, null/unmapped root view faults, and adds full Root UAV support end-to-end:
draw.rs):Shadowbuffer extent (shadow.left(address)) for Root SRVs and Root UAVs while keeping Root CBVs at the 64 KiB D3D12 limit.shadow.rs,draw.rs):shadow::find/looseagainst low (< 0x10000), overflowing top-of-u64, and uncommitted addresses, and binds permanently-alive 4 MiB zeroed/sink fallback GPU VAs instead of skippingSet*Root*View.victory-shader,victory-gpu):u<slot>, space1RWByteAddressBuffer) acrossvictory-shader(descriptor handle,global_store_dword*,s_load_dword*on root descriptors,PSV0/dx.resourcesmetadata,SFI0/ShaderFlagsUAVsAtEveryStage),shader_cache(VSH2),pipeline::host(deduplicating shared(kind, slot)root views across stages), anddraw.rs(binding,gpu_writeswrite-back, and post-draw/dispatch/ExecuteIndirectUAV barriers).Verification
cargo clippy --workspace --all-targets— passed (zero new warnings)cargo clippy -p victory --features diagnostics --all-targets— passedcargo test --workspace— passed (victory-gpu: 47 passed, 1 ignored;victory-shader: 71 passed includingdxil.dllvalidation, WARP, and host GPU tests)cargo xtask policy— passed (151 files ok)