Repository navigation
Shader: key every heap handle cache by element type (#177 on main, fixes the NVIDIA compute-pipeline crash) - #2723
andyeox-systemd wants to merge 1 commit into
Conversation
bd8eef1 to
235c48c
Compare
|
Correct root cause and fix: one UAV read as float and targeted by an atomic legitimately needs two annotated handles (atomic requires integer component type), and caching by props.0 alone collapsed them. Extending the key to props.1 across all three caches (handles, entry_handles, join_handles) is the complete version of #177's fix. The test constructs the exact shape (image_load + image_atomic_umin, same descriptor) and asserts the two distinct annotations. Hardware-verified against the actual crash. |
|
The float-load/atomic regression uses one fixed table entry, so it exercises Could you add a uniform dynamic-offset case for AI-assisted with Codex. |
|
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP + Verification (
|
|
AMD/RADV offline check of the head commit (no game run).
18 programs' DXIL bytes change — 12 pixel, 6 compute — and this PR is the difference between "the host rejects the shader" and a working pipeline:
Examples: The other 731 translated programs are byte-identical to main, so nothing else moves. Worth mentioning in the description: on main these 18 shaders produce SPIR-V that validation refuses, i.e. any pipeline that uses them cannot be created at all. Not tested in a game run; not tested on NVIDIA. |
|
Independent WARP/CPU verification for head 235c48c against origin/main 13f91ca. State check: open, non-draft, clean merge-tree; no oni-swr comment found. Environment: Windows x64, Rust 1.98.1 (48a229cea 2026-09-01), Windows SDK dxil.dll 10.0.26100.0 (file version 1.8.2502.11); WARP/D3D12 WARP env vars set; CARGO_TARGET_DIR=D:\victory-warp-2720-target. Commands/results:
Review: no production blocker found. The regression test proves the float/U32 annotations coexist. It exercises the fixture’s actual cache path; the three cache-key edits are otherwise not independently isolated by separate fixtures. Not tested: physical GPU, retail title/game behavior, release build. AI disclosure: Codex (gpt-6-luna). |
|
NVIDIA + vkd3d-proton unit-test run, head Setup: Linux (Gentoo) / wine-proton 11.0.3 / vkd3d-proton 3.1, RTX 5080, NVIDIA 620.73.04; cross-built with cargo-xwin, rustc 1.98.1,
Not run: the retail title. The #144 world-load crash itself is not reproduced or verified here. AI-assisted (Claude Code) |
|
Tested on an RTX 5090 (driver 620.73.04) under Linux: Wine 11.22, vkd3d-proton 3.1-83 (GE-Proton11-14) and vkd3d-proton master Base:
AI-assisted (Claude); measured on my machine, no game data shared. |
|
Automated triage for the maintainers. Merge candidate. Now merges cleanly. The element type ( CI: not run yet on this head. Generated by Claude Code |
|
From a tester working with Claude (AI-assisted, Claude Code). Two things: a crash this fixes on AMD/Linux that isn't in the description yet, and a rebase onto main. Crash. Under vkd3d-proton (GE's 3.2 and master Whole-corpus check (all 25,889 distinct containers of the title's shader archive, translated offline through
Rebase. The conflict with main is only test-side: No game data: hashes, counts and error text only. |
|
I sent the two requested regression tests directly to this branch in andyeox-systemd/VIctory#1. All 30 shader-lowering tests passed on this PR head. Removing the element type from either cache key made just its corresponding test fail. I tested the cache-key change on an RX 9060 XT with RADV 26.2.7 and vkd3d-proton 3.2.0. I compared
Main exited with code 3 in all four affected cases. Microsoft’s DXIL validator accepted both affected shaders before and after the change. The difference showed up during D3D12 pipeline creation. I also ran the game with #1722 and this change together. It created the second affected pipeline and presented another 35 frames. The run completed the planned 110 seconds after the world marker and reached the opening credits. The first affected pipeline was exercised only in the isolated test. AI-assisted with Codex. |
…main)
A UAV read as float and also used by an atomic needs two handles: an
atomic on the float handle is invalid SPIR-V after conversion
("AtomicOr/AtomicUMax: expected Result Type to be integer scalar type")
and crashes NVIDIA's compiler in vkCreateComputePipelines.
Marvisak#177 added the element type to the `handles` key. main has since added
`entry_handles` and `join_handles`, which had the same problem; they are
keyed by both property words now as well. Includes Marvisak#177's test, with
`view_marks` added for the current `Parts`.
Co-authored-by: Ortomanic <360474481+Ortomanic@users.noreply.github.com>
Co-authored-by: gingertonik <91795517+gingertonik@users.noreply.github.com>
235c48c to
38f3697
Compare
Dukestar69
left a comment
There was a problem hiding this comment.
Tested merged onto origin/main (63bcca4) on Windows 11 x64:
cargo test -p victory-shader --lib emit::lower::tests: 34 passed, 0 failed (including newan_image_read_as_float_and_by_an_atomic_is_annotated_twice).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: FAIL — adding the new test inline inlower.rspushes it 282 bytes past the 512 KiB policy limit on currentmain(63bcca4):POLICY: crates/victory-shader/src/emit/lower.rs: 524570 bytes exceeds the 524288-byte limit
Moving the new test into a submodule under crates/victory-shader/src/emit/lower/ will clear the xtask policy gate cleanly.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
|
This head fails the asset-policy check.
Moving AI-assisted (Claude Code); checked on my machine. |
…nt type (#177 on main, fixes the NVIDIA compute-pipeline crash) From Marvisak/VIctory#2723 (opened by andyeox-systemd; original commits and authors kept). Not yet merged upstream. With #2977 merged too, lower.rs passed the asset policy's 512 KiB limit, so the two PRs' new tests moved to emit/annotation_tests.rs and emit/latch_tests.rs, unchanged but for their helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested on the retail title under Proton: this PR fixes the dxil-spirv abort from #3101, both offline and in-game. Stack
Offline (dxil-spirv
In-game
Still visible with this PR: blocky bands over the lower part of some shots, and 76–264 draws a frame dropped for untranslated shaders. These look unrelated. No game files attached. AI-assisted (Claude Code). |
…by element type (Marvisak#177 on main, fixes the NVIDIA compute-pipeline crash)
What this branch does about Wine: our run-time shaders as DXIL, Marvisak#1849, Marvisak#2249 and Marvisak#2723 merged, lower.rs's larger limit, why Marvisak#1010 stays, and the Wine PRs not taken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fuzeofficlal
left a comment
There was a problem hiding this comment.
Keying entry_handles, handles, and join_handles on both (props.0, props.1) (crates/victory-shader/src/emit/lower.rs:220-228, 5376, 5392, 5501) matches what Shader::annotate receives and preserves non-typed raw/structured/CBV/sampler sharing (props.1 == 0).
However, crates/victory-shader/src/emit/lower.rs on 38f36978 is 524,570 bytes—282 bytes over the repository's 524,288-byte asset-policy limit—causing cargo run --locked -p xtask -- policy to fail (exit 1).
Please move mimg_2d and an_image_read_as_float_and_by_an_atomic_is_annotated_twice (emit/lower.rs:12220-12309, ~3,513 bytes) into a separate test module so lower.rs passes xtask policy cleanly. (Optional follow-up: the new regression currently hits entry_handles; adding a dynamic Source::Loaded and a uniform Source::Phi property-mismatch case would directly exercise handles and join_handles too.)
Local checks on 38f36978:
cargo run --locked -p xtask -- policy: failed (524570 bytes exceeds the 524288-byte limit).cargo clippy -p victory-shader --all-targets -- -D warnings(default &--all-features): clean.emit::lower::tests34 passed,emit::shader::tests1 passed; onVICTORY_WARP=1,emit::memory_tests5 passedandemit::stride_tests8 passed; on RTX 5090,emit::memory_tests4 passed(skipping pre-existing Blackwellheap_direct_texture_reads_mark_their_heap_index) andemit::stride_tests6 passed(2 pre-existing NVIDIA 1M view-heap-cap failures).
|
Verified the complete typed-handle correction from 38f3697 on Linux/Wine/NVIDIA, including a previously failing retail compute PSO. This is a dirty local integration, not a pristine PR-head or whole-scene certification. Machine/stack: i7-13620H, 16 GiB RAM, RTX 4060 Laptop 8 GiB, NVIDIA 590.48.01, Wine 11.0, Rust 1.98.1/MSVC target. vkd3d-proton is the local diagnostic-relaxed 2576c0b4adfae4a+ build, not stock certification. Integration base Isolated failure before the typed-handle correction
After the complete three-cache correction
Visual/runtime limit: loading artwork at 45/90 s, black frames at 120/150 s. The user heard the first cinematic's audio while the screen stayed black. The guard time-stopped normally (180 s / exit 137), not on memory: GPU peak 5,503 MiB, minimum available RAM 4,307.4 MiB, scope peak 8,414.3 MiB, disk minimum 11.904 GiB. No controllable gameplay, scene-rendering or FPS success claimed. Thirty-nine unsupported Wave64 translations remain in the observed portion; their count is not comparable as an improvement against a different compile/progress window. Root-offset dispatch drops also remain (#2699/#2703); that thread's NVIDIA partial-BVH hang evidence rules out trialing #2703 alone. Local evidence:
No game assets, shader binaries or imagery attached. Useful regression extension: native PSO creation for the synthetic float-read/integer-atomic program on Wine/NVIDIA, because DXIL validation alone accepts the bad handle pairing. This PR fixes a demonstrated native pipeline blocker here; it does not by itself produce a visible scene. |
Builds on #177 (Ortomanic's fix and gingertonik's test, credited as co-authors), resolved against current
main(13f91ca), and extended to the two handle cachesmainadded since.The bug
When a UAV is read as float and is also the target of an atomic, the lowering reused one float-typed handle for both. After conversion to SPIR-V, the atomic is invalid (
AtomicOr/AtomicUMax: expected Result Type to be integer scalar type), and NVIDIA's compiler crashes invkCreateComputePipelines(0xc0000005/0xc000001din the Unix call). This is the crash in #144.#177 added the element type (
props.1) to thehandleskey.mainhas since addedentry_handlesandjoin_handles, which had the same problem, so this PR keys those by both property words as well. #177's test is included, withview_marksadded for the currentParts.Testing
RTX 4070 Ti, Arch Linux,
nvidia-open-dkms620.73.04, Wine 11.22, vkd3d-proton built from master (71cae09, dxil-spirvb540c8a). Shaders were dumped withVKD3D_SHADER_DUMP_PATHand checked withspirv-val --target-env vulkan1.3. I used fresh caches for both runs.main(13f91ca)vkCreateComputePipelines0xc0000005)AtomicOr,AtomicUMaxon a non-integer)cargo test -p victory-shader --libon Linux (with the Windows-only validator blocks compiled out locally): 159 passed, 0 failed, against 158 onmain. The extra one is #177's test.Separate vkd3d-proton issue
On vkd3d-proton 3.1 and earlier, the title crashes earlier for a different reason. dxil-spirv's old structurizer emits invalid control flow for three shaders ("Function end cannot be called in blocks", "block exits the loop headed by…"). Microsoft's
dxvaccepts our DXIL for all three, so that's not a VIctory bug. It is fixed by dxil-spirv's structurizer rewrite, which is in vkd3d-proton master and not in 3.1. NVIDIA under Wine needs both fixes.AI-assisted. No game data is included.