Shader tests: run 24-bit multiply and multiply-add ops on the GPU #1810

Closed
github-bot wants to merge 1 commit from gh-pr/1810/head into gh-pr/1810/base
Owner

@⁠n-romanovich on GitHub · 2026-11-24 22:55 UTC · original
n-romanovich:test/valu-mul-mad-24 → main · +51 −0 · 1 files · 1 commits · closed without merging

Adds a synthetic GPU/WARP execution test (valu_24bit_mul_and_mad_match_rdna2) in crates/victory-shader/src/emit/valu_tests.rs covering v_mul_i32_i24 (0x109), v_mul_u32_u24 (0x10b), v_mad_i32_i24 (0x142), and v_mad_u32_u24 (0x143).

Verifies ignoring upper bits [31:24], sign-extension from bit 23 vs zero-extension, and full 32-bit src2 addend accumulation.

AI-assisted; verified with cargo test -p victory-shader --locked -- valu_24bit_mul_and_mad_match_rdna2 and cargo clippy -p victory-shader --all-targets --locked on Windows 11 / RTX 5060 Ti + WARP, plus independent subagent review.

**@⁠n-romanovich** on GitHub · 2026-11-24 22:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1810) `n-romanovich:test/valu-mul-mad-24` → `main` · +51 −0 · 1 files · 1 commits · closed without merging Adds a synthetic GPU/WARP execution test (`valu_24bit_mul_and_mad_match_rdna2`) in `crates/victory-shader/src/emit/valu_tests.rs` covering `v_mul_i32_i24` (`0x109`), `v_mul_u32_u24` (`0x10b`), `v_mad_i32_i24` (`0x142`), and `v_mad_u32_u24` (`0x143`). Verifies ignoring upper bits `[31:24]`, sign-extension from bit 23 vs zero-extension, and full 32-bit `src2` addend accumulation. AI-assisted; verified with `cargo test -p victory-shader --locked -- valu_24bit_mul_and_mad_match_rdna2` and `cargo clippy -p victory-shader --all-targets --locked` on Windows 11 / RTX 5060 Ti + WARP, plus independent subagent review.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:45:17 +00:00
github-bot closed this pull request 2026-11-26 04:45:17 +00:00
Author
Owner

@⁠DesertGamer on GitHub · 2026-11-24 22:56 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.

**@⁠DesertGamer** on GitHub · 2026-11-24 22:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/1810#issuecomment-7146815991) ### 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). :warning: 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.*
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 23:11 UTC · original

NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug, e85d368 (on main 70564ae). valu_24bit_mul_and_mad_match_rdna2 passes, as on the RTX 5060.

AI-assisted (Claude Code). Synthetic tests only.

**@⁠upipibi** on GitHub · 2026-11-24 23:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/1810#issuecomment-7147110412) NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug, `e85d368` (on `main` `70564ae`). `valu_24bit_mul_and_mad_match_rdna2` passes, as on the RTX 5060. AI-assisted (Claude Code). Synthetic tests only.
Author
Owner

@⁠Headache3318 on GitHub · 2026-11-25 01:54 UTC · original

Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head c634442 applied cleanly onto current main ccfb029.

  • cargo test -p victory-shader --locked: 144 passed, 0 failed, 2 ignored. All tests pass. The new valu_24bit_mul_and_mad_match_rdna2 test is GPU-specific (requires dxil.dll/WARP) and is skipped on Linux.
  • cargo clippy -p victory-shader --all-targets -- -D warnings: 4 pre-existing errors in test code (fail identically on main ccfb029). The PR introduces no new clippy warnings.

Not tested: Windows MSVC build, the title itself. AI-assisted.

**@⁠Headache3318** on GitHub · 2026-11-25 01:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/1810#issuecomment-7150096844) Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head `c634442` applied cleanly onto current `main` `ccfb029`. - `cargo test -p victory-shader --locked`: 144 passed, 0 failed, 2 ignored. All tests pass. The new `valu_24bit_mul_and_mad_match_rdna2` test is GPU-specific (requires dxil.dll/WARP) and is skipped on Linux. - `cargo clippy -p victory-shader --all-targets -- -D warnings`: 4 pre-existing errors in test code (fail identically on main `ccfb029`). The PR introduces no new clippy warnings. Not tested: Windows MSVC build, the title itself. AI-assisted.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:27 UTC · original

Automated triage for the maintainers.

Merge candidate. valu_24bit_mul_and_mad_match_rdna2 in crates/victory-shader/src/emit/valu_tests.rs runs v_mul_i32_i24, v_mul_u32_u24, v_mad_i32_i24 and v_mad_u32_u24 on the host GPU and WARP. I checked the VOP3 encodings (VOP2 0x009/0x00b plus 0x100, VOP3 0x142/0x143) against gfx10/opcodes.rs. The reference sign- or zero-extends bits [23:0], ignores [31:24] and wraps the 32-bit result and addend, as the ISA defines. The cases cover high-bit garbage, bit 23 and mixed signs.

Appends to the same file as #1804, #1811 and #1812; trivial rebase after the first one lands.

CI: check passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/1810#issuecomment-7154807968) <!-- victory-triage v1 head=c634442b7d5cff9d4fce4d11468ce917b927cd18 verdict=merge-candidate at=2026-11-25T07:04:00Z --> Automated triage for the maintainers. **Merge candidate.** `valu_24bit_mul_and_mad_match_rdna2` in `crates/victory-shader/src/emit/valu_tests.rs` runs `v_mul_i32_i24`, `v_mul_u32_u24`, `v_mad_i32_i24` and `v_mad_u32_u24` on the host GPU and WARP. I checked the VOP3 encodings (VOP2 0x009/0x00b plus 0x100, VOP3 0x142/0x143) against `gfx10/opcodes.rs`. The reference sign- or zero-extends bits [23:0], ignores [31:24] and wraps the 32-bit result and addend, as the ISA defines. The cases cover high-bit garbage, bit 23 and mixed signs. Appends to the same file as #1804, #1811 and #1812; trivial rebase after the first one lands. CI: `check` passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:02 UTC · original

Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because main already tests these with more inputs. integers_match_the_hardware in emit/semantics_tests.rs runs v_mad_u32_u24 and v_mad_i32_i24 over edge pairs with four addends, and v_mul_u32_u24 and v_mul_i32_i24 over edge pairs, against the same 24-bit model, on hardware and WARP. The only difference here is the VOP3 encoding of the multiplies, which the lowering handles by name like the VOP2 one. The expected values are right.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 22:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/1810#issuecomment-7175864800) Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because `main` already tests these with more inputs. `integers_match_the_hardware` in `emit/semantics_tests.rs` runs `v_mad_u32_u24` and `v_mad_i32_i24` over edge pairs with four addends, and `v_mul_u32_u24` and `v_mul_i32_i24` over edge pairs, against the same 24-bit model, on hardware and WARP. The only difference here is the VOP3 encoding of the multiplies, which the lowering handles by name like the VOP2 one. The expected values are right. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1810
No description provided.