main: 867 vertex programs fail validation ("Flags must match usage") since cd94d35 #1973
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#1973
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?
@zed6000 on GitHub · 2026-11-25 02:07 UTC · original
Since
cd94d35("GPU: shaders mark the pages they write through views; copy-backs compare only those"), 867 vertex programs that validated before now fail DXIL validation with:I measured offline with
victory translate --validate --listovershaders.rpffrom a retail 1.0.2.1 dump (dxil.dll 1.8.2502) and compared program by program, the same method as #1247:ccfb029(parent ofcd94d35)cd94d35940d32fcd94d35No other program changes outcome.
cargo test -p victory-shader --libstill passes (247/0 on an RX 7900 XTX), so the unit tests don't catch it.Likely cause (a reading of the error, not verified in the code): with this commit, vertex programs write through views, which means UAV writes from the vertex stage. DXIL requires such a module to declare the corresponding shader flag ("UAVs at every shader stage"). The validator recomputes the flags from the module and rejects it when the declared ones don't match. Setting that flag when a non-pixel, non-compute stage writes a UAV may be all it needs.
These are validator rejections. As with the other validator-only failures in #201 / #1247, a driver may still accept the pipelines, but the modules are invalid DXIL. Offline counts only; no program names or data, per the asset policy.
@BastienRodz on GitHub · 2026-11-25 02:11 UTC · original
Taking this. The plan:
UAVsAtEveryStage(ShaderFlags bit 16, with its SFI0 feature bit) set when a non-pixel, non-compute stage uses a UAV, as DXC computes it, plus a synthetic vertex-program test. I'll ask you to recheck the 867 with your offline method once the PR is up.@zed6000 on GitHub · 2026-11-25 02:12 UTC · original
Tested fix. Declaring "UAVs at every stage" when a vertex or geometry program uses a UAV restores all 867. On main
940d32f, with the patch below:940d32f+ patch vs940d32f940d32f+ patch vsccfb029(beforecd94d35)cargo test -p victory-shader --libgives 247 passed and 0 failed on an RX 7900 XTX. Clippy with-D warningsis clean with and without--all-features. The patch sets DXIL shader flag bit 16 (UAVsAtEveryStage) and the matchingSFI0feature bit0x4when a program that is not pixel, compute or mesh has root UAVs or one of the new written-pages handles:The condition covers the UAVs this converter gives vertex-like stages today: root UAVs and the page and view-mark bitmaps. A typed UAV from the heap in a vertex program would need the same flag, if that ever happens. Offline counts only; no program names or data.
@DesertGamer on GitHub · 2026-11-25 02:27 UTC · original
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
@BastienRodz on GitHub · 2026-11-25 02:27 UTC · original
PR: #1989 (
UAVsAtEveryStageand SFI00x4for non-pixel, non-compute stages with a declared UAV, as DXC collects them below validator 1.8). Could you rerun your offlinetranslate --validatecount on its branch,BastienRodz:shader/uavs-at-every-stage, to confirm the 867 come back?@Dathinel on GitHub · 2026-11-25 02:37 UTC · original
The two candidate fixes agree on the synthetic vertex shader. The mesh shader distinguishes them. I ran the same fixture from #1989 against all three revisions on native Windows, requiring
dxil.dllvalidation for each emitted module.940d32fe3cefe50f11320On the failing mesh case the validator reported declared flags
0x40000010, expected0x40010010. The missing bit is 16. The corresponding SFI0 feature bit0x4was also clear. As a control on #1977, changing only the stage predicate to!self.pixel && (self.threads.is_none() || self.mesh.is_some())made all six cases pass.To reproduce, use
emit::tests::vertex_uav_writes_declare_uavs_at_every_stagefrom #1989 and require the validator load in itstranslate_stagehelper. I also ran the mesh fixture withview_marks: false. All runs used the same Windows SDK 10.0.26100.0 x64 validator (file version 1.8.2502.11, SHA-256 prefix77e039c905030a64).AI-assisted. This comparison covers synthetic DXIL validation. The requested 867-program corpus recheck remains with the reporter.
@zed6000 on GitHub · 2026-11-25 02:41 UTC · original
The real-data recheck is done, on #1989 itself: head
0f11320on940d32fgives +867, 0 lost, identical to beforecd94d35(comment).@Dathinel thanks, that's a correction to my patch above. Like #1977, it left mesh programs out (
self.mesh.is_none()), so it misses the mesh case your fixture shows. On this title no mesh program has view marks or root UAVs today, which is why both give the same 867 here. #1989 is the complete fix; mine shouldn't be used.@Calvix2k on GitHub · 2026-11-25 03:32 UTC · original
Corpus recheck on a third vendor/fourth machine, as Dathinel asked: release build of #1989 (
0f11320),victory translate … --validate --listover the 1.0.2.1shaders.rpfon Windows 10 / RX 7800 XT:main 940d32f: 23,918 validated, 868Flags must match usagelines (867 programs + summary).0f11320: 24,785 validated, 0.+867, 0 lost, matching your table and zed6000's. Validator here is the SDK 10.0.26100.0
dxil.dll(1.7), so the PSV0 false failures are present at the same rate in both runs and cancel out.@YaBulochka on GitHub · 2026-11-25 04:55 UTC · original
Independent offline re-check of both candidates, same method as the report:
victory translate shaders.rpf --validate --listover a retail 1.0.2.1 dump. Both restore the full 867 and they are indistinguishable in outcome.940d32f940d32f(baseline)3d6a54f)0f11320)Checks beyond the total:
common the sorted program lists gives +867 and -0;Flags must match usage.), and they disappear in both.Environment, since it differs from the original report: Linux + Wine 11.22,
x86_64-pc-windows-gnurelease,dxil.dll1.9.2609.5 (the report used 1.8.2502), retailshaders.rpf411,695,600 B / 26,503 containers. So the validator version is newer than yours; the numbers landed on the same 23,918 -> 24,785.Wall time, for what it is worth: 138.7 s baseline, 169.6 s #2016, 215.8 s #1989 (single runs, not controlled).
I have no stake in either implementation; from here they are equivalent on this dump.
@Marvisak on GitHub · 2026-11-25 12:46 UTC · original · edited 2026-11-25 18:45 UTC
Automated triage for the maintainers.
Fixed in
mainbya1a2077("Shaders: vertex, geometry and mesh programs with UAVs say so in their flags"). Incrates/victory-shader/src/emit/shader.rs,flags::UAVS_EVERY_STAGE(bit 16) is now defined.Shader::finishsets it for any program that is neither pixel nor compute (vertex, geometry and mesh) when it declares a UAV range: root UAVs, the memory bitmap or the view-write bitmap. TheSFI0word gets0x4with it. This is the same pair of bits #1989 and #2016 add, and mesh programs are covered too. The test isemit::shader::tests::uavs_outside_pixel_and_compute_programs_are_declared.New since the last triage: a per-program recount on an RTX 4090 (
940d32f→67e8ae1) confirms the fix on real data. All 867 vertex programs that failed withFlags must match usagevalidate again, and none were lost. Vertex and pixel programs now validate 14,242 of 14,242. The other 61 programs restored in that range come from unrelated translator changes. No mesh program on this title hit the message, so the mesh half is covered only by the synthetic test.#1989 has been closed. #2016 is still open and is superseded by this commit except for its
note:line intranslate --validate.Proposed close as fixed in
main(a1a2077), now independently confirmed. #1987 reports the same regression. This issue will be closed in 48 hours unless the reporter replies or a maintainer removes thetriage: proposed closelabel.Generated by Claude Code
@reboot0000-cmd on GitHub · 2026-11-25 18:02 UTC · original
Stage-and-cause breakdown of what the merge burst restored, from per-program before/after on this host (RTX 4090, DXC 1.8.2502 validator,
shaders.rpf, 26,084 programs,940d32f→67e8ae1). 928 programs newly validate, 0 lost. Every one of the 928 was already present in the earlier listing under a different failure, so this attributes the gain rather than just counting it:validator: Flags must match usagecd94d35/ fixed bya1a2077emit: a descriptor read only as dataemit: a register joining a lane mask and data, read as dataemit: a lane-mask join of an untracked maskemit: barycentrics read directlySo the aggregate "+928 validated" is not one fix: 867 of it is the view-mark flag regression and 61 is unrelated translator work. Two consequences:
Flags must match usagefailures were vertex programs; zero mesh and zero pixel programs carried that message before the fix. That doesn't contradict Dathinel's synthetic mesh fixture — it means this title never reaches the mesh case, so a reviewer cannot settle#1977versus#1989on real data here and should rely on the fixture.mainshould read 14,242 of 14,242 vertex and pixel programs validated, and the37 pixelfigure above is why a vertex-only expectation of 2,191 will look wrong when checked stage by stage.Geometry: all 195
Gsprograms fail atresources: an address in an SGPR that is no root parameteridentically at both revisions and never reach validation, so the "geometry" ina1a2077's title is preventative on this title, not a measured recovery.