Shader tests: the 0x403 loose metadata is built in the test, not the title's bytes #4223
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4223"
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 babuakhil on 2026-11-30T17:34:22Z.
What it changes
loose_metadata_reads_version_0x403(698ab79e, for #3831) held 0x118 bytes the title handed over, as a hex string. That's what docs/asset-policy.md asks us not to commit, and the policy refuses it: onmain(84bd61e2),cargo xtask policyfails withcrates/victory-shader/src/native.rs: 560-character hex/base64 run (embedded data?), and so does xtask'srepository_passes_policy.The test now builds a 0x403 block with the test module's
record(): the 0x18-byte header, a sampler, SRV and UAV table, a CBV, a skipped 0x42 declaration and the end record. It checks what the old test did (version, 0x60 code dwords, four resources in order) and also the lower bounds, the root parameters and their user data, thatloose_computemakes a container from it, and that a size that disagrees is refused. Test code only. The parser is unchanged.Removing the string here doesn't remove it from history. Whether that matters is the maintainer's call.
How it was tested
cargo xtask policyfails on the hex run;cargo test -p xtaskgives 6 passed, 1 failed.cargo xtask policygives462 files ok;cargo test -p xtaskgives 7 passed.cargo test -p victory-shader: 535 passed, 1 failed. The failure issplit_lds_wave32_read_after_read_barrier_coalescing_and_parityon an RTX 3060, which fails the same way onmain. Clippy onvictory-shaderstops atlower.rs:114(loop_capsnever read), which is onmaintoo.cargo testpassed for the crates it touches: yes, apart from that GPU test, which fails onmainas well.Checked for overlap
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-11-30T18:56:55Z.
Test report for
0d7bf355on84bd61e2. Windows 11, RTX 5080, Rust 1.98.1 (pinned). Test code only, so no game run.main84bd61e2cargo xtask policynative.rs: 560-character hex/base64 runasset policy: 462 files okcargo test -p xtaskrepository_passes_policy)cargo test -p victory-shader --lib -- native::testsloose_metadata_reads_version_0x403cargo clippy -p victory-shader --all-targets -- -D warningsloop_capsnever read (lower.rs:114, #4296)--all-featuresloop_capsnever read (lower.rs:114, #4296)So it does what it says: policy is clean, and the test passes and still checks 0x403.
One coverage gap compared with the test it replaces: no test reaches
RootType::ImmediateSamplerinrecords()any more. The removed metadata's sampler record had root type 4, an immediate sampler:sgprs = 0, so it adds no root parameter. Its three tables also shared one slot and one user-data dword. Here the sampler is a table (root type 3), and nothing else in the crate's tests uses root type 4, so theRootType::ImmediateSampler => 0arm went untested when the hex string went.A one-record fix: add an immediate sampler, e.g.
record(0x41, 1, 4, 0, 5, 4, 0, 9), before the end record. Assert that it shows up inusedand adds nothing tolayout. For a version that keeps the removed test's record mix (immediate sampler, SRV/UAV/CBV tables behind one user-data dword, three 0x42 declarations, the hash, 0x118 bytes, all values made up), see Lyrnc/VIctory-NVIDIA@c99a1f4a on branchfix/synthetic-loose-metadata-test. Results for it, same machine: policy462 files ok,native::tests21 passed, and clippy shows only the samelower.rs:114error. Take whichever you like. I won't open a competing PR.The
split_lds_wave32_read_after_read_barrier_coalescing_and_parityfailure you saw on main is the test's own dead UAV load (since #2623). Fix: #4320.AI use: tested with Claude Code. Commands and results are as listed.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by babuakhil on 2026-11-30T19:06:19Z.
Thanks @Lyrnc, good catch on the immediate sampler.
5efff6f2adds one, your record:record(0x41, 1, 4, 0, 5, 4, 0, 9)before the end record. The test now checks that it's read (a fifthusedentry,RootType::ImmediateSampler, slot 9) and thatlayoutstill has only the four root parameters.Checked that it guards that arm: with
RootType::ImmediateSampler => 0removed, or changed to give it an SGPR, the test fails, as it still does for the four 0x403 header and offset mistakes. Same machine as before (Windows 11, Rust 1.98.1):cargo xtask policy462 files ok,cargo test -p xtask7 passed,native::tests21 passed, and Clippy shows only thelower.rs:114error thatmainhas.I kept the smaller fixture rather than your fuller one, so the test stays readable record by record, but thanks for putting it up. And thanks for pointing to #4320 for the split-LDS failure.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-12-01T03:52:55Z.
Checked the immediate sampler as merged (
a717774a), Windows 11, rustc 1.98.1:cargo test -p victory-shader --lib -- native::testsgives 21 passed,loose_metadata_reads_version_0x403among them. WithRootType::ImmediateSampler => 1(an SGPR) the test fails at thelayoutassert, so that arm is covered again. Thanks for adding it.AI use: Claude Code (Claude Opus 5.5) ran these checks and wrote this.