Shaders: name what a scalar memory read is, and which descriptor dword it reads #1083
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!1083
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1083"
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?
@adamdotpy on GitHub · 2026-11-24 15:35 UTC · original
adamdotpy:shader/descriptor-dwords→main· +344 −9 · 1 files · 2 commits · openAI-assisted; measured on my own machine.
What
Two commits on the descriptor-data path, both about what a refusal says rather than what translates.
Name what a scalar memory read is. A scalar instruction that is not a load of dwords stopped the program with one string, "a scalar memory read as data", whatever it was. Each now names it: a timestamp (
s_memtime/s_memrealtime), a wave's index in its group, a scalar cache instruction, a scalar store, a scratch load, or — the common one — a scalar memory read as data.Name which descriptor dword. A descriptor dword the translation cannot rebuild from the host view stopped it with "a descriptor's address or format read as data" (92 programs at
ffe310e), whichever dword it was. Each now names what it holds: an image's address, array pitch or mip limits, compression fields or metadata address; a buffer's address, stride or high address, or format and swizzle. A descriptor that a vector access uses later keeps a reason of its own, because an error at that point would give every dword the same one.Only the reasons change; nothing translates that did not before. The point is
victory translateand census output: it can say which descriptor dwords the title's programs actually need, and that is what decides whether a dword can come from the used-resource list (a buffer's stride can, for one).Testing
cargo test -p victory-shader: 123 passed, 1 ignored (the new tests cover the instruction names and a table of image and buffer dwords).cargo clippy -p victory-shader --all-targets --all-features -- -D warnings: clean.cargo build --release -p victory: builds.I did not run
victory translateover the title's shader set for this revision — no title data on this machine — so the census numbers a full set gives are still to be measured.Stacked
This is the naming change plus the per-dword reasons only. The root-view commit, which reads a root view's memory for scalar loads, is #1056 and is deliberately not included here.
@adamdotpy on GitHub · 2026-11-24 16:05 UTC · original
A reviewer's note on this one, since it is the least risky of the open shader PRs and the diff is bigger than it looks.
It cannot change what translates.
Whyistype Why = &'static strand the only consumers are the refusal message and the error text, so there is no decision downstream that reads a reason.descriptor_fieldhas exactly one call site (lower.rs:3137,descriptor_field(image.is_some(), rel).unwrap_or(OTHER)), and every arm returns a string; the_ => return Nonearm keeps the old generic wording, so an unlisted dword cannot start behaving differently.The one structural change, and it is the interesting half to review: the per-descriptor path collects all uses (
filter_map(...).collect()intouses) instead offind_map-ing the first, so it can ask whether a vector access uses the descriptor later (uses[1..]) and give that its own reason. It is a read-only widening of what the diagnostic can see; theSome(&(at, first)) = uses.first()guard keeps the original path when there are no uses.Measured on
dbea3a1(Windows 11, Rust 1.98.1):cargo test -p victory-shader123 passed, 1 ignored; clippy-D warningsclean;cargo build --release -p victorybuilds. Base is currentmain(ffe310e), so it merges as it stands.The one claim nobody here can check is the census number — "92 programs at
ffe310e" and which dwords they read needs the title's shader set. That is the number that decides whether a dword can come from the used-resource list, so it is worth a re-measure by anyone with the pack before the follow-up that acts on it.@Zipettte on GitHub · 2026-11-24 16:29 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
dbea3a1:cargo test -p victory-shaderpasses, 123 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@adamdotpy on GitHub · 2026-11-24 17:10 UTC · original
Thanks for the run @Zipettte — 123 passed / 0 failed at
dbea3a1, baseline green. As noted on the branch this one is diagnostic-only, so a green run is the expected result; the dword reasons are what the next shader PRs will consume.@Marvisak on GitHub · 2026-11-25 00:34 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-shader/src/emit/lower.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.