Tests: add VALU hardware tests for integer min3/max3/med3, class_f32 and s_bfe_u32 #278

Open
towiice wants to merge 1 commit from upstream-pr/278 into main
towiice commented 2026-11-24 23:09:38 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by towiice on 2026-11-24T23:09:38Z.


Test-only: synthetic GFX10 tests in crates/victory-shader/src/emit/valu_tests.rs. Rebased on c96b4f2 as one commit.

What is in it

  • integer v_min3/max3/med3 (_i32, _u32)
  • f16 forms added to max_and_min_order_negative_zero_below_positive_zero
  • v_cmp_class_f32: the ten IEEE classes, complement and zero masks, ignored upper bits
  • s_bfe_u32 added to bfe_signed_and_unsigned_match_rdna2, including width 32

The earlier MinGW delay-load change is no longer in this PR (thanks @ErRusso).

Tested (b83cce1; GTX 1650 SUPER, driver 32.0.16.1088, Windows 11, Rust 1.98.1 x86_64-pc-windows-gnullvm)

  • cargo test --locked -p victory-shader --lib valu_tests: 22 passed, 0 failed, 1 ignored.
  • cargo test --workspace --locked --no-fail-fast: 506 passed, 1 failed, 8 ignored. The failure is load_probe: building its fixture fails to link on gnullvm (/DELAYLOAD).
  • cargo clippy --workspace --all-targets --locked -- -D warnings fails with placed_filler_twins is never used (crates/victory-gpu/src/resource.rs), a file this PR does not touch.
  • rustfmt --check reports differences in this file only outside the lines this PR adds.

Not tested

  • AMD or Intel GPUs, the MSVC toolchain, the all-features Clippy run, a game.

AI use

  • Written with Antigravity (Gemini 4 Neon). Claude Code (Claude Sonnet 5.5) rebased it, resolved the conflict, ran the tests above and wrote this description.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6593261989 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/278). Originally posted by [towiice](https://github.com/towiice) on 2026-11-24T23:09:38Z. --- Test-only: synthetic GFX10 tests in `crates/victory-shader/src/emit/valu_tests.rs`. Rebased on `c96b4f2` as one commit. **What is in it** - integer `v_min3/max3/med3` (`_i32`, `_u32`) - f16 forms added to `max_and_min_order_negative_zero_below_positive_zero` - `v_cmp_class_f32`: the ten IEEE classes, complement and zero masks, ignored upper bits - `s_bfe_u32` added to `bfe_signed_and_unsigned_match_rdna2`, including width 32 The earlier MinGW delay-load change is no longer in this PR (thanks @ErRusso). **Tested** (`b83cce1`; GTX 1650 SUPER, driver 32.0.16.1088, Windows 11, Rust 1.98.1 `x86_64-pc-windows-gnullvm`) - `cargo test --locked -p victory-shader --lib valu_tests`: 22 passed, 0 failed, 1 ignored. - `cargo test --workspace --locked --no-fail-fast`: 506 passed, 1 failed, 8 ignored. The failure is `load_probe`: building its fixture fails to link on gnullvm (`/DELAYLOAD`). - `cargo clippy --workspace --all-targets --locked -- -D warnings` fails with `placed_filler_twins` is never used (`crates/victory-gpu/src/resource.rs`), a file this PR does not touch. - `rustfmt --check` reports differences in this file only outside the lines this PR adds. **Not tested** - AMD or Intel GPUs, the MSVC toolchain, the all-features Clippy run, a game. **AI use** - Written with Antigravity (Gemini 4 Neon). Claude Code (Claude Sonnet 5.5) rebased it, resolved the conflict, ran the tests above and wrote this description.
ErRusso commented 2026-11-25 00:09:37 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ErRusso on 2026-11-24T23:32:25Z.

Review: CHANGES_REQUESTED


Reviewed at 7aa1227 against 2119b0e.

Blocking: the MinGW delay-load support does not link.

cargo build --manifest-path tests/fixtures/hle-probe/Cargo.toml --target x86_64-pc-windows-gnu fails:

/usr/x86_64-w64-mingw32/bin/ld: unrecognized option '--delayload=victory-probe-delayed.dll'

GNU ld (the linker rustc uses for x86_64-pc-windows-gnu here) has no --delayload option. libdelayimp.a is present, but the flag is the blocker. Please either:

  • use a linker that supports it (e.g. lld with the matching flag), or
  • keep the delay-load fixture MSVC-only and skip it for GNU, or
  • implement MinGW delay-loading via dlltool/a delay-load import library.

Also check CARGO_CFG_TARGET_ENV == "gnu": that matches Linux GNU targets too, not just MinGW. Gate on CARGO_CFG_TARGET_OS == "windows" as well.

Tests: the new expectations look correct on inspection — the six integer min3/max3/med3 ops, f16 -0 < +0 for the four ops, the ten IEEE classes for v_cmp_class_f32, and the s_bfe_u32 width-32 case. I could not execute them here because this Wine host has no SM 6.6 device; they need the author's Windows hardware run.

Once the MinGW fixture links, this should be ready.

<!-- greyfinch-sync:fxceless/victory-fork:review:6049101625 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/278#pullrequestreview-6049101625). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-24T23:32:25Z. **Review:** CHANGES_REQUESTED --- Reviewed at `7aa1227` against `2119b0e`. **Blocking: the MinGW delay-load support does not link.** `cargo build --manifest-path tests/fixtures/hle-probe/Cargo.toml --target x86_64-pc-windows-gnu` fails: ```text /usr/x86_64-w64-mingw32/bin/ld: unrecognized option '--delayload=victory-probe-delayed.dll' ``` GNU ld (the linker rustc uses for `x86_64-pc-windows-gnu` here) has no `--delayload` option. `libdelayimp.a` is present, but the flag is the blocker. Please either: - use a linker that supports it (e.g. lld with the matching flag), or - keep the delay-load fixture MSVC-only and skip it for GNU, or - implement MinGW delay-loading via `dlltool`/a delay-load import library. Also check `CARGO_CFG_TARGET_ENV == "gnu"`: that matches Linux GNU targets too, not just MinGW. Gate on `CARGO_CFG_TARGET_OS == "windows"` as well. **Tests:** the new expectations look correct on inspection — the six integer `min3/max3/med3` ops, f16 `-0 < +0` for the four ops, the ten IEEE classes for `v_cmp_class_f32`, and the `s_bfe_u32` width-32 case. I could not execute them here because this Wine host has no SM 6.6 device; they need the author's Windows hardware run. Once the MinGW fixture links, this should be ready.
towiice commented 2026-11-25 00:10:09 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by towiice on 2026-11-24T23:38:43Z.


Thanks @ErRusso for catching the GNU ld vs lld difference on x86_64-pc-windows-gnu. The tests/fixtures/hle-probe/build.rs change is no longer in this PR. The head is now b83cce1, a single commit that only touches crates/victory-shader/src/emit/valu_tests.rs.

On your note that the tests need a Windows hardware run: on a GTX 1650 SUPER (Windows 11, x86_64-pc-windows-gnullvm), cargo test --locked -p victory-shader --lib valu_tests gave 22 passed, 0 failed, 1 ignored. Could you take another look when you have time?

(Edited with Claude Code, Claude Sonnet 5.5.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7147635203 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/278#issuecomment-7147635203). Originally posted by [towiice](https://github.com/towiice) on 2026-11-24T23:38:43Z. --- Thanks @ErRusso for catching the GNU `ld` vs `lld` difference on `x86_64-pc-windows-gnu`. The `tests/fixtures/hle-probe/build.rs` change is no longer in this PR. The head is now `b83cce1`, a single commit that only touches `crates/victory-shader/src/emit/valu_tests.rs`. On your note that the tests need a Windows hardware run: on a GTX 1650 SUPER (Windows 11, `x86_64-pc-windows-gnullvm`), `cargo test --locked -p victory-shader --lib valu_tests` gave 22 passed, 0 failed, 1 ignored. Could you take another look when you have time? (Edited with Claude Code, Claude Sonnet 5.5.)
upstream-sync changed title from [PR #278] Tests: add synthetic hardware tests for integer min3/max3/med3, f16 -0/+0, v_cmp_class_f32, and s_bfe_u32 to [PR #278] Tests: add VALU hardware tests for integer min3/max3/med3, class_f32 and s_bfe_u32 2026-11-25 02:09:23 +00:00
HAL9000RELOADED commented 2026-11-25 08:09:07 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by HAL9000RELOADED on 2026-11-25T08:08:27Z.


An AMD run for the "not tested on AMD" note.

Setup: Radeon RX 7900 XTX (RDNA3, waves of 32 to 64 lanes), Adrenalin 32.0.32015.7029, i7-13700KF, Windows 10 Pro 22H2 (19045), Rust 1.98.1. Windows 10's in-box D3D12 stops at SM 6.5, so the tree also carries the D3D12 Agility SDK 1.620 (the same approach as #69). The DXIL validator comes from SDK 10.0.26100 (VICTORY_DXIL). WARP stays below SM 6.6 on this machine, so the GPU cases ran on the card only. No game data used.

Base: main c96b4f2 plus the Agility patch and the stack-headroom test fix from Marvisak/VIctory#742. The PR head b83cce1 was merged on top of it.

v_cmp_class_f32_matches_rdna2 and v_med3_min3_max3_integer_matches_rdna2 pass on the card, and so does the extended bfe_signed_and_unsigned_match_rdna2 (with s_bfe_u32). Only WARP printed "skipped", so the hardware device ran every case. The whole workspace with this PR: 507 passed, 0 failed.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7156655128 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/278#issuecomment-7156655128). Originally posted by [HAL9000RELOADED](https://github.com/HAL9000RELOADED) on 2026-11-25T08:08:27Z. --- An AMD run for the "not tested on AMD" note. **Setup:** Radeon RX 7900 XTX (RDNA3, waves of 32 to 64 lanes), Adrenalin 32.0.32015.7029, i7-13700KF, Windows 10 Pro 22H2 (19045), Rust 1.98.1. Windows 10's in-box D3D12 stops at SM 6.5, so the tree also carries the D3D12 Agility SDK 1.620 (the same approach as #69). The DXIL validator comes from SDK 10.0.26100 (`VICTORY_DXIL`). WARP stays below SM 6.6 on this machine, so the GPU cases ran on the card only. No game data used. **Base:** `main` `c96b4f2` plus the Agility patch and the stack-headroom test fix from Marvisak/VIctory#742. The PR head `b83cce1` was merged on top of it. `v_cmp_class_f32_matches_rdna2` and `v_med3_min3_max3_integer_matches_rdna2` pass on the card, and so does the extended `bfe_signed_and_unsigned_match_rdna2` (with `s_bfe_u32`). Only WARP printed "skipped", so the hardware device ran every case. The whole workspace with this PR: 507 passed, 0 failed.
ErRusso commented 2026-11-25 12:06:46 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ErRusso on 2026-11-25T11:15:09Z.

Review: APPROVED


Reviewed at b83cce1. The MinGW delay-load fixture change is gone; the diff is now only crates/victory-shader/src/emit/valu_tests.rs (+152).

Verified here:

  • cargo test -p victory-shader --lib: 171 passed, 0 failed.
  • cargo xwin check --release --target x86_64-pc-windows-msvc -p victory-shader: passes.

The new cases match the RDNA2 semantics: six integer min3/max3/med3 forms, f16 -0 < +0, the ten v_cmp_class_f32 classes with complement and upper-bit masks, and s_bfe_u32 width 32. @HAL9000RELOADED's RX 7900 XTX run covers the new tests on hardware, and your GTX 1650 SUPER run covers gnullvm.

LGTM.

<!-- greyfinch-sync:fxceless/victory-fork:review:6056596539 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/278#pullrequestreview-6056596539). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-25T11:15:09Z. **Review:** APPROVED --- Reviewed at `b83cce1`. The MinGW delay-load fixture change is gone; the diff is now only `crates/victory-shader/src/emit/valu_tests.rs` (+152). Verified here: - `cargo test -p victory-shader --lib`: 171 passed, 0 failed. - `cargo xwin check --release --target x86_64-pc-windows-msvc -p victory-shader`: passes. The new cases match the RDNA2 semantics: six integer `min3/max3/med3` forms, f16 `-0 < +0`, the ten `v_cmp_class_f32` classes with complement and upper-bit masks, and `s_bfe_u32` width 32. @HAL9000RELOADED's RX 7900 XTX run covers the new tests on hardware, and your GTX 1650 SUPER run covers gnullvm. LGTM.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/278:upstream-pr/278'
git switch 'upstream-pr/278'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/278'
git switch 'upstream-pr/278'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/278'
git switch 'upstream-pr/278'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/278'
git switch 'main'
git merge --squash 'upstream-pr/278'
git switch 'main'
git merge --ff-only 'upstream-pr/278'
git switch 'main'
git merge 'upstream-pr/278'
git push origin 'main'
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
fxceless/victory-fork!278
No description provided.