Shaders: a mesh program's PSV0 counts shared memory only when it has some #2857
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2857
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@kais7654 on GitHub · 2026-11-25 22:31 UTC · original
kais7654:shader/a-mesh-programs-lds-counts-when-it-has-some→main· +45 −5 · 2 files · 1 commits · openA 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.
@kais7654 on GitHub · 2026-11-25 22:31 UTC · original
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.
@fuzeofficlal on GitHub · 2026-11-25 23:00 UTC · original
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.
@cloph-dsp on GitHub · 2026-11-25 23:00 UTC · original
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).
@Marvisak on GitHub · 2026-11-26 03:22 UTC · original
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
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.