Ray-tracing builder: none of its compute shaders translate in the title (root UAVs, addresses in root constants) #614
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#614
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@etcetera-yt on GitHub · 2026-11-24 05:36 UTC · original
Counts and container-format facts only: no shader hashes, disassembly or other game data.
What happens
XboxBvhBuilder.dllholds 52 compute programs. In a release run into the first mission, the title uses 35 ofthem, and all 35 fail at pipeline creation, so their dispatches are dropped. In that run, 4 of the 7 programs
dropping the most dispatches per frame are builder programs: about 690 dropped dispatches per frame together.
Whatever reads the structures they should build then reads nothing.
How the builder's programs get their arguments
Read from the containers as
crates/victory-shader/src/native.rsdocuments them:RTS0root signature (version 2, flags 0x3000000: directly indexed heaps) made only ofroot views (UAV, SRV) and root constants (1 to 19 dwords); no descriptor tables.
while
COMPUTE_PGM_RSRC2asks for 4 user SGPRs. The program reads its arguments through the tables[0:1]points to (the high dword masked to a 40-bit address): dword
16 + kof the user data is at byte4 * k.That is the spill-table case #302 handles. With #302 merged, the 35 programs the title uses still fail, for these
reasons:
What it needs
Note:
victory translatedoes not apply #302's spill rewrite (apps/victory/src/translate.rscallsir::build),so on the command line all 52 still fail with "an address in an SGPR that is no root parameter". Comment on #302.
Related: #274 (the builder's containers use the same native format as the title's), #302, #294.
Checked on:
main(d2a4bae) with #175, #89, #302, #489, #307, #320, #550, #483, #452, #587 and 162 other open PRsmerged locally, release build, Windows 10 19045, RTX 5060 Ti (driver 621.14). Not checked on AMD.
AI use: Claude Code, Claude Opus 5.5.
@itsRevela on GitHub · 2026-11-24 06:28 UTC · original
Where the
an address from a root parameter that is no addressprograms go next, measured in the title's opening cutscene. Counts only.The case. On plain
mainthese programs stop earlier, atno root parameter. With #302 and #489, 8 compute programs in the cutscene stop here, all with the address passed as two root constants. 7 of the 8 first use that address in aglobal_load, and none stores or does atomics through it.The prototype. I prototyped the read-only route locally:
root_view.That's 12 unit tests and a GPU test on the RTX 3070 Ti and WARP, and the GPU bound the views without errors in the title.
The result. It clears this reason for all 8, but none of them translates yet. Each stops at the next case:
s_load_dword*) through the root-constant addressan address from a phia root UAV or typed root view(#294)an address in an SGPR that is no root parameter(another address in the same program)So on its own the change doesn't make these programs run, and I'm not opening it as a PR for now. It touches the same files as #294 and #307. Scalar loads through the same view would be the cheapest next step; the phi addresses and #294 are needed for the rest.
If someone takes this on, the branch is
itsRevela/VIctory:shaders/root-constant-addresses. It's on top of #489, and I'll push it on request.AI-assisted (Claude Code).
@itsRevela on GitHub · 2026-11-24 07:12 UTC · original
Update to my comment above: with scalar loads through the same view, and structured access through root UAVs (#709, on top of #294), 3 of those 8 programs translate, and the host accepts their pipelines. So I opened the root-constant address work as #710 (stacked on #489). The remaining 5 stop at
an address from a phi(2), another non-root address (1) and an LDS operation (1); one of them is the scalar-load case from my comment. Counts only. AI-assisted (Claude Code).@Cobrall on GitHub · 2026-11-24 07:30 UTC · original
"Hi everyone, seeing the struggles with shaders failing to translate or causing black screens/GPU hangs.
To help debug this, I built a verification harness that provides a bit-exact golden model for FidelityFX CAS: github.com/Cobrall/ffx-kit
Why it helps: Naive 'mathematically correct' CPU references often disagree with AMD's intended fast-math paths (like APrxLoRcpF1) by up to ~8.5%, causing false failures when validating a shader translator. This kit provides the exact expected output (including D3D saturate(NaN)=0 semantics), so you can definitively prove whether a translated shader is correct or if the bug lies elsewhere (e.g., descriptors, memory, or wave64 emulation).
It includes 8 verified fp32 .spv variants and a Python reference. Hope this saves some debugging time on the render loop!"
@Machad3x on GitHub · 2026-11-24 13:31 UTC · original
Data point for the compute shaders in this issue, measured offline with victory translate --list --validate over 48 untranslated world containers dumped from a run (fork Machad3x/VIctory, branch claude/gta6-shader-translation-crashes-705550): 48 fail on main; 41 after #302 + #489 (spill table) + #294 (root UAVs); 36 after #709, #585, #309. The 12 shaders that read through an address held in root constants (global_load through s[10:11] from root constants) are the ones still stopped by this issue; #667 does not merge cleanly on top of #294 (the root view register becomes 16 bits and draw.rs's RootView enum changes), so it needs a rebase after #294 lands. Also, one of the compute shaders that only translates since #302/#294 (4ddd6f9702fab2a7, in place, two root UAVs with the same address) stores -1 at byte 20580 and was followed once by a title fault on a corrupted pointer: root UAV write-back may need care.
@Machad3x on GitHub · 2026-11-24 16:27 UTC · original
Port of the root-constants idea onto a tree that already has #294/#650 (fork Machad3x/VIctory, commits 405011a, 74a2681, 8ff8a41, 31f4a19): root views are named by a 16-bit register, an address held in two root constants is bound as a root SRV (reads) or UAV (writes) whose address the host reads from the two dwords at bind time, the view size goes in a user-data dword past every parameter's registers and accesses are checked against it (also added a bounds check to global_store through root views). It follows #710's pair detection (the high-half constant identifies the pair), because #667's simpler form misses s10 + (v0 << 3) plus carry, the real shape in the corpus. Offline over 25 world compute shaders: translated compute 4 -> 9 of 25; 'an address from a root parameter that is no address' 8 -> 0; 'an address in an SGPR that is no root parameter' 1 -> 0; 'an address not from a root parameter' stays 12 but they are other shapes now (pointer chasing through GPU memory, constant<<8|12, per-branch addresses). A GPU test dispatches a program reading and writing through two constants-held addresses (re-reads the constants on the next dispatch, falls back when unset) and passes.
@nineforge0 on GitHub · 2026-11-24 08:12 UTC · original · edited 2026-11-24 23:13 UTC
We extracted the root parameter layouts of all 9,282 mesh shader programs and 2,647 compute shaders from the retail shader database (
shaders.rpfentry 0) using forge9. Here are the findings that may help with the rootless mesh shader translation:All mesh shaders follow a uniform 7-parameter binding model:
Key findings:
Full docs: https://github.com/nineforge0/forge9/blob/main/docs/mesh_shader_binding_model.md
To reproduce:
forge9 fssm shaders.rpf 0 --rootsdumps the complete root parameter map for all 25,194 programs.Hope this helps with the rootless shader translation path.
Edit: the source is the title's shader database (
shaders.rpfentry 0), not the pipeline cache. See the correction below for the scope of the last finding.@nineforge0 on GitHub · 2026-11-24 23:06 UTC · original
Correction to our comment above. Its numbers come from the title's shader database (
shaders.rpfentry 0), not the pipeline cache. Its last finding, "The 64 RT trace/BVH compute shaders use only Tables + ResourceHeap + SamplerHeap in their FSSM root layouts. No root UAVs or root-constant address pairs appear in FSSM metadata", is about the ray-traversal compute shaders in that database. This issue is about the 52 compute programs inXboxBvhBuilder.dll, which we did not read. So that finding says nothing about the builder's programs and does not contradict the root UAV and root-constant address measurements in this thread.AI use: drafted with Claude Code (Claude Opus 5.5) for @nineforge0.
@Marvisak on GitHub · 2026-11-25 01:45 UTC · original · edited 2026-11-25 06:49 UTC
Automated triage for the maintainers.
Correction to my earlier note, after the comment from @fuzeofficlal: on
main, an address built from a low/high pair of root constants is no longer refused.Tracer::traced_addressincrates/victory-shader/src/resource.rsstill returns "an address from a root parameter that is no address", but its callerTracer::addresstreats that reason (with the other "data" reasons) as title memory (MEMORY), covered by the testcomputed_addresses_are_title_memory. So the central case of this issue may already be served bymain.What would settle it: the per-reason counts of the ray-tracing builder's compute programs from a run on current
main(counts only, as before). If none are refused any more, this can be closed as fixed; if some are, the remaining reasons tell us what is still open.Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-25 05:55 UTC · original
Checked
940d32fwhile investigating this: 64-bit addresses passed inRootType::Constants(lo, hi)pairs are already served onmainvia the two-level raw-address page table (27c3dc9d/0f63757, as noted on #710).Specifically, while
Tracer::traced_address(crates/victory-shader/src/resource.rs:915) still returnsErr("an address from a root parameter that is no address"), its callerTracer::address(resource.rs:810-839) matches that string inDATAand routes the access toMEMORY(Lower::memory), covered byresource::tests::computed_addresses_are_title_memory(resource.rs:2518) andemit::memory_tests::title_memory_is_read_and_written_at_computed_addresses(memory_tests.rs:61).