Shaders: negative-zero ordering test for the f16 min/max forms #1050

Merged
LouisRiverstone merged 1 commit from upstream-pr/1050 into main 2026-11-25 00:21:13 +00:00
LouisRiverstone commented 2026-11-24 15:16:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LouisRiverstone on 2026-11-24T15:16:43Z.


Fixes #802.

max_and_min_order_negative_zero_below_positive_zero covers the f32 forms. v_max_f16, v_min_f16, v_max3_f16 and v_min3_f16 use the same max_min() helper after widening to f32 (#448) but had no test.

New test f16_max_and_min_order_negative_zero_below_positive_zero runs the same four -0/+0 cases through the four f16 opcodes and compares the low half of v0.

The opcodes in #802 for v_max_f16/v_min_f16 (0x111, 0x10E) are not those instructions. They are VOP2 0x39/0x3a, so VOP3 0x139/0x13A, which is what the test uses. The three-operand forms (0x354, 0x351) were right.

Test only, no production change.

Verify: cargo test -p victory-shader f16_max_and_min (Windows, hardware GPU or WARP). I could not run it locally: the shader test module is Windows-only.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6585075387 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1050). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-11-24T15:16:43Z. --- Fixes #802. `max_and_min_order_negative_zero_below_positive_zero` covers the f32 forms. `v_max_f16`, `v_min_f16`, `v_max3_f16` and `v_min3_f16` use the same `max_min()` helper after widening to f32 (#448) but had no test. New test `f16_max_and_min_order_negative_zero_below_positive_zero` runs the same four -0/+0 cases through the four f16 opcodes and compares the low half of `v0`. The opcodes in #802 for `v_max_f16`/`v_min_f16` (`0x111`, `0x10E`) are not those instructions. They are VOP2 `0x39`/`0x3a`, so VOP3 `0x139`/`0x13A`, which is what the test uses. The three-operand forms (`0x354`, `0x351`) were right. Test only, no production change. **Verify:** `cargo test -p victory-shader f16_max_and_min` (Windows, hardware GPU or WARP). I could not run it locally: the shader test module is Windows-only. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ThomasHFWright commented 2026-11-24 16:05:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ThomasHFWright on 2026-11-24T15:27:18Z.


Independent Linux/Wine hardware run of 259ba31e28ca4ceb379682d6383c3b6f75bad014 on base ffe310e: the changed regression passes, exercising 16 signed-zero cases across the four f16 min/max forms. Built and run from this PR alone, without instrumentation changes.

Rust 1.98.1, Windows MSVC target, Wine 11.22, RTX 5090 / NVIDIA 620.73.04, vkd3d-proton 30b0eb9bc12dc9f. Both requested backend paths completed, but this Wine/DXVK setup is not evidence of genuine Windows WARP coverage. No device/backend skip was reported. These are dispatch/readback checks.

Separately, I combined #1046, #1048, #1050, #1052 and #1053 (all patches applied cleanly) and ran all 14 generated workspace unit/integration test executables with all features. Combined: 345 passed, 5 failed, 6 ignored; matched baseline: 341 passed, 5 failed, 6 ignored. This full-suite result belongs to the combined tree. The five failures match baseline: empty pipeline library (#347), Wine Winsock export (#217), checksum-rejection expectation, nested Cargo fixture build, and Windows xtask launching host Git. Native Linux checks of that tree pass: shader 96 passed / 1 ignored, xtask 4 passed, asset policy clean.

Windows-target shader Clippy with all targets/features and -D warnings passes on this PR alone. Combined workspace Clippy finds a type-complexity warning in #1052, reported there.

Offline and offscreen; no game data, gameplay, native Windows or Wine doctests. Native d3dcompiler_47 supplied for full-suite GPU fixtures. Aggregate counts include existing early-return tests without optional console compilers/DXIL validator; these changed GPU tests executed. Coverage overlaps #1045, but its exact head was not tested here.

AI-assisted testing with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7136053705 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1050#issuecomment-7136053705). Originally posted by [ThomasHFWright](https://github.com/ThomasHFWright) on 2026-11-24T15:27:18Z. --- Independent Linux/Wine hardware run of `259ba31e28ca4ceb379682d6383c3b6f75bad014` on base `ffe310e`: **the changed regression passes**, exercising 16 signed-zero cases across the four f16 min/max forms. Built and run from this PR alone, without instrumentation changes. Rust 1.98.1, Windows MSVC target, Wine 11.22, RTX 5090 / NVIDIA 620.73.04, vkd3d-proton `30b0eb9bc12dc9f`. Both requested backend paths completed, but this Wine/DXVK setup is not evidence of genuine Windows WARP coverage. No device/backend skip was reported. These are dispatch/readback checks. Separately, I combined #1046, #1048, #1050, #1052 and #1053 (all patches applied cleanly) and ran all 14 generated workspace unit/integration test executables with all features. **Combined: 345 passed, 5 failed, 6 ignored; matched baseline: 341 passed, 5 failed, 6 ignored.** This full-suite result belongs to the combined tree. The five failures match baseline: empty pipeline library (#347), Wine Winsock export (#217), checksum-rejection expectation, nested Cargo fixture build, and Windows xtask launching host Git. Native Linux checks of that tree pass: shader 96 passed / 1 ignored, xtask 4 passed, asset policy clean. Windows-target shader Clippy with all targets/features and `-D warnings` passes on this PR alone. Combined workspace Clippy finds a type-complexity warning in #1052, reported there. Offline and offscreen; no game data, gameplay, native Windows or Wine doctests. Native `d3dcompiler_47` supplied for full-suite GPU fixtures. Aggregate counts include existing early-return tests without optional console compilers/DXIL validator; these changed GPU tests executed. Coverage overlaps #1045, but its exact head was not tested here. AI-assisted testing with Codex.
Zipettte commented 2026-11-24 17:04:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T16:30:16Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 259ba31: cargo test -p victory-shader passes, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137767890 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1050#issuecomment-7137767890). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T16:30:16Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 259ba31: `cargo test -p victory-shader` passes, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
mercuryVM commented 2026-11-24 21:27:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T21:13:26Z.

Review: APPROVED


Tested 259ba31e on Windows 11, RTX 5070, MSVC: merged into our fork together with #1048, cargo test -p victory-shader -- --test-threads=1 passes (189 passed, 2 ignored), and the workspace tests pass.

This is a good test. Feeding ±0 in both operand orders to v_max_f16/v_min_f16 and the three-operand forms pins the RDNA2 ordering of −0 below +0, which max_min gets after widening to f32.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6047504877 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1050#pullrequestreview-6047504877). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T21:13:26Z. **Review:** APPROVED --- Tested 259ba31e on Windows 11, RTX 5070, MSVC: merged into our fork together with #1048, `cargo test -p victory-shader -- --test-threads=1` passes (189 passed, 2 ignored), and the workspace tests pass. This is a good test. Feeding ±0 in both operand orders to `v_max_f16`/`v_min_f16` and the three-operand forms pins the RDNA2 ordering of −0 below +0, which `max_min` gets after widening to f32. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 01:05:24 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!1050
No description provided.