Shaders: recover record counts for descriptor-only structured buffers #329
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!329
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-329"
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?
@Raxstreams on GitHub · 2026-11-24 02:20 UTC · original
Raxstreams:codex/data-only-buffer-records→main· +159 −37 · 3 files · 1 commits · openSome compute shaders load a four-dword buffer descriptor and test its record count without ever issuing a buffer access. The emitter previously needed a resource instruction to infer the view type and stopped at
a descriptor read only as data.For a static table load at an exact binding offset, the emitter can recover the record count with
GetDimensionswhen the native metadata supplies a valid structured stride and the original PSV0 declarations confirm a structured buffer. Conflicting declarations across register spaces, unknown bindings, and dynamic ranges keep the existing unsupported path.On Windows with an RTX 3080 Ti, the isolated
CS_MinTimestepReduceshader validated and created a D3D12 compute pipeline on this branch, based on upstream main. A synthetic GPU test checks the actual returned counts for buffers with 3 and 11 records and covers conflicting declarations. All 70 shader library tests and the repository asset-policy check passed.This is independent of the SGPR spill work in #298 and #309 and leaves the world-rendering issue open.
@SpaghettiMaster545 on GitHub · 2026-11-24 03:12 UTC · original
Tested
02564c5merged alone ontomaind2a4bae, with the title, againstmainon the same machine.VICTORY_CACHE_DIR, scripted keys into story mode, until the host GPU failure (#71, unrelated).a descriptor read only as data: onmain, 21 programs stop with this reason (15–21 over three runs, depending on how far each run gets). With this PR, 1 of those 21 translates and 20 still stop with the same reason. No program stops with it that did not onmain.main, nothing that ran there stops with this PR.So on this title the PR's case covers one of the programs with this reason. The other 20 load the descriptor in some other way than a static table load at an exact binding offset with a native structured stride, or lack one of the conditions the PR checks. I have not looked at which.
Not tested
(Claude Code, Claude Opus 5.5: ran the title on both builds and compared the logs program by program.)
@EduAzevedo on GitHub · 2026-11-24 04:55 UTC · original
Measured
02564c5on the retail shaders (v1.0.2.1, Series X package), offline withvictory translate --jobs 8 --list, all 26,148 programs, againstmaind2a4bae, alone and merged with #309 (64c7188, clean merge):maina descriptor read only as data19 more programs translate (18 pixel, 1 compute); none that translate on
mainstop. For comparison on the same corpus, #180 takesa descriptor read only as datato 1 (with or without #309), so the two overlap; I have not measured them together.AI-assisted.
@EduAzevedo on GitHub · 2026-11-24 05:02 UTC · original
Follow-up to the overlap question above, from the same logs: the 19 programs this PR makes translate do not translate with #180 (
5ff639e, alone or with #309). With #180, 18 of them get pasta descriptor read only as dataand stop ata scalar memory read as data; the other 1 is the singlea descriptor read only as dataprogram #180 leaves. So on the title's shaders the two are complementary rather than redundant: this PR finishes those 19, #180 covers the other ~160.AI-assisted.
@Marvisak on GitHub · 2026-11-25 00:14 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,crates/victory-shader/src/emit/mod.rs,crates/victory-shader/src/emit/valu_tests.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.