Repository navigation
Conversation
- smem: an s_buffer_load from a descriptor read from the resource heap at a computed index (no used-resource entry) is a buffer view the host makes raw, so read it raw. It was lowered as a constant-buffer read, i.e. a CBV handle on an SRV slot (GBV mismatch, WARP null reads, can hang a GPU). Hit by the hair-strand compute shaders. - image_sample outside pixel shaders: emit SampleLevel at LOD 0 instead of Sample, which DXIL rejects there (CS_DensityShadowBlur_H failed validation). Biased or offset samples outside pixel shaders are now reported as untranslatable. - The device-removed failure names GetDeviceRemovedReason's code. - shader-info --verbose prints each container's runtime hash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GHAMAwekwWQWP6FsLe2hsw
|
We tested the scalar-buffer selection rule from this PR together with #1354 at The combined lowering keeps #1354’s inferred UAV class on the raw path and adds this PR’s resource-heap origin check for an unnamed read-only descriptor. A separate fixture exercised creation of all three descriptor classes through |
|
Independent verification of \cfc0edf\ on Windows 11 / AMD Radeon RX 9060 XT (RDNA4, \gfx1200) / Rust 1.98.1 MSVC:
Code audit: routing \RootType::ResourceHeap\ \s_buffer_load\ descriptors through raw SRV (11, 0)\ and lowering non-pixel \image_sample\ to \sampleLevel\ (level 0) looks clean and directly addresses the #1348 hang pattern; adding targeted unit tests for both paths would make regressions easy to catch. AI-assisted; synthetic tests only, no game files. |
- scalar_loads_from_a_resource_heap_descriptor_are_raw: an s_buffer_load on a descriptor s_load'ed from the ResourceHeap root parameter, with no used-resource entry, is read raw; the same load from a table stays a constant-buffer read. Counted by a test-only `heap_raw_loads`. - compute_image_sample_reads_level_zero: the indexed waterfall program with image_sample in place of image_sample_lz validates in compute and samples each lane's texture (hardware and WARP). Both fail with the fixes reverted (the second with the validator's "features incompatible with the shader stage (cs)"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GHAMAwekwWQWP6FsLe2hsw
|
Thanks both. @geiyiliyabumo, I've added the targeted tests in
Both fail with the fixes reverted. The second fails with the validator's @MichaelSmithAI, agreed on the open case. A heap CBV that is directly indexed, with no used-resource metadata, is read raw under this rule. If the title wrote a CBV into that slot, the host has built a CBV descriptor there, so the two don't match. The rule only looks at where the descriptor came from. One way to settle it would be for the host to record the view kind it built for each heap slot, so the translator, or a debug check, could compare against it. For now I'd treat that as a known limit rather than widen this PR. Separately, merged with #568, this gets an RX 6750 XT to about 6 minutes in the world (frame 6350). Details are in #508. |
Offline measurement on a retail dump, and the shader tests on AdaResult: +24 programs over Offline. I merged head de109f1 onto
All 24 are among the programs that #1402 gains. They failed in the validator on Tests: with the same merge, No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
…p scalar loads
|
In-world evidence for part 1, from a fork that runs
Reading only, nothing run. AI-assisted (Claude Code). |
Stacked on #1402: no change, and one behaviour contradicts #1015Result: 0 gained, 0 lost, and no failure reason changes on top of #1402. On Merging it needs two decisions. There are 5 conflict hunks in
With those choices, Method: |
|
Automated triage for the maintainers. Closing because this change is already in Its main fix (s_buffer_load through a heap-loaded descriptor read raw) is in main (lower.rs smem If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Two shader translation fixes found while chasing #1348, and a clearer device-removal message. These don't fix the world-load removal in #1348.
1.
s_buffer_loadon a descriptor read fromResourceDescriptorHeapBefore,
smem()lowered everys_buffer_loadwhose descriptor has no SRV used-resource entry as a constant-buffer read. For a descriptor the shader loads from the resource heap at a computed index, that put a CBV handle on a slot the host fills with a raw buffer view. GBV flagged the mismatch, WARP read nulls, and it can hang a GPU. The hair-strand compute shaders (smh_modify:CS_*Strand*) hit this.Selection rule (
smem()incrates/victory-shader/src/emit/lower.rs). The load is read raw, the same way as an SRV used-resource, when both of these hold:self.used_kind(src)isNone).Source::Loadedwhose scalar load traces, throughself.scalar[load].param, to a root parameter withroot == RootType::ResourceHeap. In practice that iss_load_dwordx4 s[n:n+3], s[heap_base], soffset, with the heap index(base + offset + soffset) >> 5fromheap_index().The rule looks only at where the descriptor was loaded from. It doesn't look at how the shader uses it: read-only and written heap descriptors are treated the same. It relies on the host making the heap's buffer views raw (
descriptor/host.rs). A descriptor that a used-resource entry names as a CBV still takes the CBV path.The read-only-descriptor case in #1354 at
cd9699f, which returned 73 through a CBV and 41 through an explicit raw table SRV, should be a direct control for this rule.2.
image_sampleoutside pixel shadersimage_samplein a compute, vertex or mesh shader emittedSample, which DXIL rejects outside pixel shaders ("features incompatible with the shader stage").CS_DensityShadowBlur_Hfailed validation this way. It now emitsSampleLevelat LOD 0.image_sample_oandimage_sample_boutside pixel shaders now fail as untranslatable instead of emitting invalid DXIL.3. Diagnostics
GetDeviceRemovedReason.shader-info --verboseprints each container's runtime hash: BLAKE3 of the container bytes, sized by the DXBC header at 0x18. Hashes in the logs can then be matched to containers.Testing
cargo clippyis clean, andcargo test -p victory-shaderpasses (120 passed, 1 ignored), rebased onffe310e.CS_DensityShadowBlur_Hnow passes validation.🤖 Generated with Claude Code
https://claude.ai/code/session_01GHAMAwekwWQWP6FsLe2hsw