Shaders: a descriptor only read as data of eight dwords is a measured image #81
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!81
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-81"
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?
@undeadhuman37 on GitHub · 2026-11-24 21:19 UTC · original
undeadhuman37:fx/descriptor-data-only→main· +157 −53 · 3 files · 2 commits · openWhat
A scalar load of an image descriptor whose dwords the code reads only as numbers (the width and height bits, never sampled) was refused with "a descriptor read only as data", because the view's kind came only from a use. Now the table's range names the view's kind, and an entry in the resource heap that no range names is taken for a 2D image when it is eight dwords (marked
shortcut:in the code). The size then comes fromgetDimensions.Two pixel programs of the title's first scene were refused for exactly this and now translate.
Tested
cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace(497 passed, 0 failed) andcargo xtask policypass, on Windows with an RTX 4070 and the host GPU tests enabled.a_descriptor_only_read_as_data_gives_its_views_size: a hand-assembled waterfall program that reads a texture's size throughs_load_dwordx8andv_alignbit_b32, with no sampling. It fails with the old refusal without the change.AI use: an AI tool (Claude Code) wrote this change; a person ran and reviewed the checks.
@dkdknight on GitHub · 2026-11-24 21:34 UTC · original
Tested on an RTX 5080 (merged with #71, #77 and #38 on
4e17478): the four pixel programs that4e17478refused with a descriptor read only as data translate, and the run had no device removal.2fd01fca16993001,6b6db9f1a526daeb,7d0f14ce44746d7e,e5b2121a02f4f741:shader does not translateon4e17478,shader translatedwith this PR, in the same scene (Series X profile, same save, ~2 min standing in the world).4e17478, 5 with the four PRs (all five compute:v_cvt_f32_f64×2,v_permlanex16_b32, a descriptor's address or format read as data, a lane mask exchanged where not every lane runs). The frame numbers for the merged build are on #71.Setup: NVIDIA GeForce RTX 5080 16 GB, driver 621.14, i9-13900KF, Windows 11 26200, release build.
AI use: Claude Code, Claude Opus 5.5 built the merged branch, ran it on the machine above (the person at the machine played) and read the logs.
@adriaespii on GitHub · 2026-11-24 21:37 UTC · original
Independent test run on commit
6236d57(AMD RDNA4):x86_64-pc-windows-msvc)cargo clippy --workspace --all-targets -- -D warnings: 0 warningscargo test --workspace: 497 passed, 0 failed, 7 ignored (victory-shader: 211 passed, 0 failed, 2 ignored;victory-gpu: 110 passed, 0 failed, 1 ignored)AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.
@rocobalt1 on GitHub · 2026-11-24 21:42 UTC · original
Offline coverage of this PR on the retail shader pack, measured alone on its base
4e17478.Method: worktree at
4e17478,cargo build --release -p victory, thenvictory.exe translate <shaders.rpf> --validate --list --jobs 20with the same Windows SDK validator, compared program by program by program hash against the same command on4e17478alone.4e17478+35 gained, 0 lost.
All 35 are puddle detection, and only three distinct programs, repeated across containers:
That is exactly the refusal the title reports on my machine:
converter shader.dxil v1: GFX10 code at 0x51c4/0x49dc/0x4f8c/0x5204/0x4808/0x4c88: a descriptor read only as data is not supported, whose hashes map toPS_PuddleDetect_2dd9cfaa. Six distinct pixel pipelines are refused on this build, allPS_PuddleDetect, and their draws are dropped.So this one should be testable as a visual difference (wet ground) rather than a count. Largest clean gain I have measured on this pack after the BVH branch (which was +334), and unlike #52 it takes nothing away.
No game data; counts and program names only.
@arminkhaleghirod on GitHub · 2026-11-24 21:42 UTC · original
Merged onto main
90228a7and ranvictory translate --validateover the full title (26,148 programs) on Windows 11 / RTX 4080. Changes against main, by failure reason:a descriptor read only as data: 40 → 5Pipeline State Validation does not matchgroup, like most programs on main.@oeirughrepuiohg on GitHub · 2026-11-24 22:39 UTC · original
A visual regression with this PR under Linux/Proton: the cell's walls disappear in the first gameplay room. Skipping the two pixel programs it makes translate brings them back.
RTX 4070 Ti 12 GB, NVIDIA 620.70.06 (open modules), Fedora 45; Proton Experimental Wine, vkd3d-proton
cae8353e(with a local dxil-spirv fix, see below), DXC 1.9.2609. Diag build of90228a7+ #20 + VIctory #454, Series X, default loop limit,VICTORY_SKIP_PIPELINES=eeed82b877b44b5f,VK_NV_raw_access_chainsdisabled.Three runs, same scene (Lucia at the cell window, then walking into the room):
6236d57cherry-picked)6b6db9f1a526daeb,7d0f14ce44746d7einVICTORY_SKIP_PIPELINESSo with the two pixel programs translated, their draws (3 and 8 per frame here) cover the room's walls. My guess is the shortcut in the change: an eight-dword entry that no range names is taken for a 2D image, and here it may be another kind of view (a cube, for example), so the programs sample the wrong thing. I have not checked what they bind. One run each, so treat it as a lead. It may not show on Windows: the Windows reports above don't mention missing walls.
Unrelated to the walls, for anyone else on Linux: these runs use a local fix for dxil-spirv's endless recursion in the dominator computation (HansKristian-Work/dxil-spirv#376, since closed by its maintainer with a fix on another branch). Without it, four compute pipelines kill their worker thread under Wine every run and stay "being made".
AI use: Claude Code (Claude Opus 5.5) ran these tests on my machine and drafted this comment.
@oeirughrepuiohg on GitHub · 2026-11-24 23:17 UTC · original
Correction to my comment above: the missing walls are not caused by this PR.
Two later runs that skip both pixel programs (
6b6db9f1a526daeb,7d0f14ce44746d7e) also lost the cell walls in the same scene (they differed from run C only in speed switches:VICTORY_CARD_BUFFERS_MIN_MB=1in one,VICTORY_WIDE_BACK=1in the other). So on this setup the walls come and go between runs, and B and C differing was chance. The shirt's printed text disappears in the same runs, so it looks more like the room's assets sometimes not arriving than like a shader translating wrongly.Sorry for the noise. Nothing here speaks against the change.
AI use: Claude Code (Claude Opus 5.5) ran these tests on my machine and drafted this comment.
@Peppacodes on GitHub · 2026-11-24 23:49 UTC · original
Correction: the window difference in my report above probably isn't caused by this PR, the same conclusion as the correction above mine.
A later run without this PR, on the same machine and scene, came out with the same clear glass and no papers on the wall. That run was the base build plus an unrelated change, with the late-wait switches on. Over five runs these details came and went: without this PR the papers were missing in 2 of 4 runs and the glass was clear in 1 of 4. One run each can't pin them on this PR.
The rest of the report stands: both refusals are gone (8 → 6 refused programs), and the build held 20 minutes with no device loss.
AI-assisted (Claude Code).
@Peppacodes on GitHub · 2026-11-24 23:22 UTC · original · edited 2026-11-25 00:04 UTC
Tested on an RTX 5080 (Windows 11, driver 621.24, 32.0.16.2124, Ryzen 7 5700X3D). Build:
4e17478+ this PR, plus #28's watchdog hook and bigger pipeline-worker stacks. Settings:VICTORY_NO_WATCHDOG=1, no relay, no input.2fd01fca16993001and6b6db9f1a526daebtranslate. One is bound in the opening scene. Refused programs in the run went from 8 to 6.The two programs this PR fixes were refused before, so their draws didn't run in the run without it. The window and wall difference therefore suggests the change also alters how some other, already-translating program resolves its views. A likely candidate is "the table's range names the view's kind". I haven't traced which program draws the glass or the papers. Is the clear glass what you see on the 4070 too?
AI-assisted (Claude Code). Runs on my own machine with my own copy; no captures attached.
@ArturoWolff on GitHub · 2026-11-25 04:42 UTC · original · edited 2026-11-25 04:52 UTC
Native Linux, CPU-only A/B on
310c6eb: I matched the four pixel containers from #633 by the same BLAKE3 prefix the runtime logs, then passed the same bytes directly tovictory_shader::emit::translatewith host max wave set to 32. No game launch, shader cache, #633 patch, or other PR in either arm. For the B arm I integrated9327f1e, keeping main'sVICTORY_DESC_WHYdiagnostic inside the PR's refusal branch indescriptor_data(the one merge conflict).a descriptor read only as data)2fd01fca169930010x51c46b6db9f1a526daeb0x49dc7d0f14ce44746d7e0x5204e5b2121a02f4f7410x4a1cThe first two hashes were bound in the same frame in our earlier Series X Proton trace. As an unaffected control, the final-composite pixel shader
4f4ec7b16673362femitted byte-identical output on both builds. Microsoft's Linuxdxv(DXC releasev1.9.2609) returnedValidation succeededfor all four newly emitted containers and the control; a copy with an invalid PSV0 runtime-info size failed withPSV0 part is not well-formed. Nativevictory-shader --lib: 171 passed, 0 failed, 2 ignored.This isolates the same four translation gains reported above without the other PRs. Unlike the full-title Windows run on
90228a7, these particular outputs passed this particular validator. Different build, validator and sample: it doesn't invalidate the Windows result or establish host pipeline creation, correct lighting, or visible gameplay. No title data or shader binaries attached.Pair check (same integration): both frame-2251 pixel shaders were bound with mesh
4f23fd8d99482703. Replayed that exact mesh container: emitted 17,293 bytes and passeddxv. For each pair, all 19 mesh-output vs pixel-input signature entries matched in DXC disassembly (semantic name/index, component mask, register, system value, format; not a comparison of the usage column). This rules out a mismatch in those declared fields, not a bad value at runtime. No PSO result: a separate software-only Proton capability probe timed out before returning a mesh tier; no hardware run or draw.AI disclosure: Hermes Agent performed the integration, ran the comparisons, and wrote this comment on ArturoWolff’s behalf.
@deadkid14 on GitHub · 2026-11-25 06:47 UTC · original
Tested on Linux/Proton (RTX 5070 Ti, NVIDIA 620.73.04, GE-Proton11-14's vkd3d-proton) on top of the fork at
c96b4f2, together with the follow-up5b18c7efrom trexies'VIwork(take a measured image only for programs refused otherwise).c96b4f2it conflicts indescriptor_data: the fork now haslet Some((at, first)) = use_at else { … }. I adapted it to the shape here, anif let … elsethat returns(first, src, props, image, uav, used)from both branches, and kept the fork'sVICTORY_DESC_WHYprint at the refusal.victory-shadertests under Wine: 213 pass, 1 fails (stub_pipeline_is_created, the known Wine digest difference, unrelated).pixel 6b6db9f1a526daebnow translates and its mesh pipeline is made ([mesh 4f23fd8d99482703, pixel 6b6db9f1a526daeb]). No "a descriptor read only as data" refusal is left in the run, and there was no device removal.AI-assisted: Claude Code ran the builds and tests on my machine, read the logs and wrote this comment; posted at my request.
@Curry-976 on GitHub · 2026-11-25 07:32 UTC · original
Ported onto current
main(8dd30ab), and an in-game A/B: the five pixel programs translate, they light the scene, but in one cutscene shot a face comes out covered in coloured speckles. The speckles go away without this PR.Port
Lower's descriptor-as-data path. Since this PR's base,mainadded two things to theelsearm: aVICTORY_DESC_WHYdiagnostic, and the case for an address taken throughview_address(count <= 4). I kept both, ahead of your new 2D fallback, and applied yourif let … elserestructure,ONLY_DATA/MEASURED, theemit/emit_formsretry inmod.rsand your test unchanged. The diff is the same size as yours (+157 −53). I can paste it here if it would help with a rebase.cargo test -p victory-shaderon the port: 215 passed, 0 failed, 3 ignored, includinga_descriptor_only_read_as_data_gives_its_views_size.In game
8dd30ab+ #36 + #646 + #579, with and without the port.VICTORY_RELAY=2, builder off.2fd01fca16993001,6b6db9f1a526daeb,7d0f14ce44746d7e,c8df7216c69cecbdande5b2121a02f4f741.c8df7216was not in your list.6b6db9f1and7d0f14ceare bound there. In the run without the port, all five are refused.So the programs carry real light (the background goes dark without them), but they produce garbage on that face. My guess is the
shortcut:in the fallback: the descriptor is taken as a 2D image and measured withgetDimensions, so if the title's view is 3D or an array, or is used with sizes other than those of a 2D view, the program works from the wrong extents. I have not checked this.#203 also gets these programs translated (they were not refused in a #487 run on this card). A face close-up in that run looked clean, but it was a different shot, so it is not a like-for-like comparison.
Not tested
6b6db9f1and7d0f14cecauses the speckles.victory-shader's tests were run.Unrelated to this PR: with the structure builder on, the title crashed during loading at
image+0x23cf683(write to 0) in 4 of 9 runs on this card, with and without this PR.AI-assisted (Claude Code, Claude Opus 5.5): the port, the runs and the A/B are mine, on my own copy of the title. Hashes and counts from the logs, and observations from screenshots; no game data.
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.