Skip to content

Shader: prevent WARP device loss on constant floating compares - #152

Open
avt0m4t48 wants to merge 2 commits into
fxceless:mainfrom
avt0m4t48:fix/warp-constant-float-compares
Open

avt0m4t48 wants to merge 2 commits into
fxceless:mainfrom
avt0m4t48:fix/warp-constant-float-compares

Conversation

@avt0m4t48

Copy link
Copy Markdown

Refs #136. Lower the constant DXIL predicates for v_cmp{,x}_{f,tru}_f{16,32} through the existing lane-mask path. The emitted shaders then store the constant result instead of passing fcmp false or fcmp true to WARP.

This is the floating-point portion of Marvisak/VIctory#1326, including the source-built regression by fuzeofficial. Upstream patch

The same Windows-2025 WARP job verified both versions. The patched test checked all eight opcodes across finite, zero, infinity, quiet-NaN and signaling-NaN inputs. Restoring the original lowering suspended the WARP device on dispatch. Windows verification

On Linux, all eight emitted DXIL modules passed dxv and disassembled to the expected constant stores. The shader library suite passed 170 tests with two ignored. Windows-target Clippy with warnings denied and cargo xtask policy also passed. This run used WARP and source-built inputs.

AI-assisted using Codex.

Backport the floating-point lowering and regression from Marvisak/VIctory#1326 by fuzeofficial (75d919f32deeab5988a68bacd9e6994d60e6eefb).
@bawhen

bawhen commented Nov 24, 2026

Copy link
Copy Markdown

Checked on an RX 7700 (RDNA3, driver 32.0.32029.2010) and WARP.

cargo test -p victory-shader --locked --lib float_compares_that_are_always_false_or_true -- --nocapture

build result
PR head 08cb7ed passes on hardware and WARP
PR test, lower.rs and bitcode.rs from main hardware pass is fine; then warp: dispatch failed: The GPU device instance has been suspended, the WARP device removal from #136

So on this card it's a WARP/CI fix only: the RX 7700 handles fcmp false/fcmp true correctly.

Setup: AMD Radeon RX 7700 (RDNA3, 16 GB), driver 32.0.32029.2010, Ryzen 7 8700F, 16 GB RAM, Windows 11 (build 26300), Rust 1.98.1 from rust-toolchain.toml. Baseline main at 4e17478: cargo test --workspace --locked gives 496 passed, 0 failed, 7 ignored. The "without the fix" run checks out main's version of the PR's non-test files and keeps the PR's new test. No game files used.

AI use: Claude Code (Claude Opus 5.5) ran the tests and drafted this comment; posted at my request.

@avt0m4t48

Copy link
Copy Markdown
Author

Rechecked the current PR head dbd9a894099845977fca87c8fdf66a4115897c98 on Windows Server 2025 with VICTORY_WARP=1. The exact float_compares_that_are_always_false_or_true regression passed for all eight opcode variants, with no skipped device. The verification commit adds only the workflow, and the job checks that before running the test.

Windows WARP run

AI-assisted using Codex.

triippywhale pushed a commit to triippywhale/victory-fork that referenced this pull request Nov 25, 2026
…the released ID3D12Device8 IID

Cherry-picked from PalmVIDev, clean on this tree:
- 6b7e09077 (davutsimsekk) Shaders: VOP3 CMPX writes EXEC, not VDST
- cc6d50326 (davutsimsekk) GPU: use the released ID3D12Device8 IID
- 02025cb1f (dharmon96) GPU: the earlier ID3D12Device8 IID is still answered beside the released one

The rest of fxceless#152 conflicts (lower.rs split, 64-bit shifts, formats 189-191,
interpolation rows, due-slot selection, shader overrides, patch trap) and is
handled or recorded separately in PALM-PORTS.md.

Co-authored-by: dharmon96 <lettucedevils51@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
triippywhale pushed a commit to triippywhale/victory-fork that referenced this pull request Nov 25, 2026
Hand port of PalmVIDev 48075c6e3 (in fxceless#152): victory-formats' layout table
gains the console formats 189 (4 bytes), 190 (1 byte) and 191 (4 bytes),
matching victory-gpu's resource::element, which already listed them. With
its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
triippywhale pushed a commit to triippywhale/victory-fork that referenced this pull request Nov 25, 2026
…resolves; a read back's size cannot overflow

Hand port of PalmVIDev 61ae827af (in fxceless#152; the resolve-mip-sizing and
checked read-back sizing parts of fxceless#708 by AscilCH): a
resolve compares the sizes of the subresources it resolves, not level 0,
to choose ResolveSubresource or a clipped ResolveSubresourceRegion; a read
back whose footprint size overflows is refused instead of wrapping.

Co-Authored-By: AscilCH <178020422+AscilCH@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants