Shaders: a mesh program's PSV0 counts shared memory only when it has some #2855
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2857"
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 Marvisak/VIctory. Originally posted by kais7654 on 2026-11-25T22:31:16Z.
A mesh program whose state declares group-shared memory its code never touches wrote the declared size into the PSV0's GroupSharedBytesUsed: DXC fills that field from the module's group-shared globals -- ours is made lazily, by
lds, when its code lowers one -- and the validator's rebuilt runtime info is compared byte for byte, so the container was refused whole. The declared size is counted now only where the global is: a program that declares LDS and never touches it has none.(#2798)
Generated by Mistral Vibe.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T22:50:25Z.
Review: COMMENTED
Correct DXC parity: PSV0 shared-mem comes from the module's group-shared globals, and the lazy lds() global means a declared-but-unused size contributes 0 — matching the validator's byte-compare. The 0-vs-16 lds_bytes control pair is the right coverage. LGTM.
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-25T22:31:32Z.
The declared size is counted now only where the global is.
emit::tests::unused_mesh_lds_is_not_counted_in_psv0: the triangle meshprogram of the existing tests, with
lds_bytes0 (a control) and 16,both read back from their
PSV0(the shared dword is 0 for each) andthrough
dxil.dllwhere there is one. Without the change it fails withleft: 16, right: 0(verified here).cargo test -p victory-shader --lib --test-threads=1(RTX 5090; minusthe suite's known skips): 260 passed + the new test — note 6 IEEE
discrepancies fail on clean main
61bfc77here (the BVHintersections' one-ULP,
arithmetic_matches_the_hardware,fspx_programs_run_with_the_hardwares_dot_products,image_atomics_of_64_bits); reproduced on a clean tree, not thisbranch's.
cargo clippy -p victory-shader --all-targets --locked, and with--all-features: 0 warnings, both.Generated with Mistral Vibe.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T23:00:36Z.
Reviewed and verified
9c608fceon Windows 11 (RTX 5090 + WARP +dxil.dll) againstmain(842b0cb):GroupSharedBytesUsedonself.lds.is_some()matches howShader::lds()lazily emits the[lds_dwords x i32]global and howdxil.dllrecomputes PSV0 from module globals (#2798), while keepinglds_dwords * 4when LDS is actually lowered.unused_mesh_lds_is_not_counted_in_psv01/1 (PSV0[4..8] == 0for both 0 and 16 declared bytes,dxil.dllaccepted),meshtests 6/6,ldstests 5/5 (includinglds_bytes_and_halves_match_the_hardware),emit::tests::18/18 on RTX 5090 and WARP,cargo clippy --locked -p victory-shader --all-targets -- -D warnings0 warnings,cargo xtask policy(186 files ok;emit/lower.rsuntouched).Looks clean and ready to merge.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-25T23:00:44Z.
Local verification on Windows / rustc 1.100.0 / MSVC, no game data, no GPU, no clippy/rustup.
cargo test --locked -p victory-shader --lib unused_mesh_lds_is_not_counted_in_psv0 --quiet-> 1 passed, 279 filtered.61bfc77: 2 files, +45/-5;git diff --checkclean.AI-assisted (Hy4 flash).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T03:22:40Z.
Automated triage for the maintainers.
Verdict: proposed close (duplicate). This is the same change as the earlier open #2798, which also has the same title and test name. Both gate mesh PSV0
GroupSharedBytesUsedinShader::finish(crates/victory-shader/src/emit/shader.rs) onself.lds.is_some()and addunused_mesh_lds_is_not_counted_in_psv0. #2798 merges cleanly, has validator runs before and after the change, and is already a merge candidate.If you have something #2798 lacks, please add it there as a review comment. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label.
CI:
checkpassing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T17:12:20Z.
Heads-up for coordination, not a judgement: this has the same title and the same shape as #2798 by @Moon0755, opened earlier and smaller (+35/−2 vs +45/−5). If yours is the same fix, closing one of the two saves a review; if it differs, say how and I will take this line out. Queue-wide triage is in #1633.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.