Shaders: hardware test for v_cvt_f32_ubyte0..3 #1876

Closed
LouisRiverstone wants to merge 1 commit from upstream-pr/1878 into main
LouisRiverstone commented 2026-11-24 23:58:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LouisRiverstone on 2026-11-24T23:58:59Z.


v_cvt_f32_ubyte0 .. v_cvt_f32_ubyte3 (VOP1 0x11..0x14) share one arm in lower.rs that takes the byte number from the instruction name. Only byte 0 had a test.

New test v_cvt_f32_ubyte_converts_each_byte runs six values (including bytes at 0x80 and 0xFF) through all four opcodes and compares the f32 bits with the byte converted in Rust (every byte value is exact in f32).

Test only, no production change.

Verify: cargo test -p victory-shader v_cvt_f32_ubyte (Windows, hardware GPU or WARP). I type-checked it with clippy for x86_64-pc-windows-msvc, but could not run it locally: the shader test module is Windows-only.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6593925062 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1878). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-11-24T23:58:59Z. --- `v_cvt_f32_ubyte0` .. `v_cvt_f32_ubyte3` (VOP1 0x11..0x14) share one arm in `lower.rs` that takes the byte number from the instruction name. Only byte 0 had a test. New test `v_cvt_f32_ubyte_converts_each_byte` runs six values (including bytes at 0x80 and 0xFF) through all four opcodes and compares the f32 bits with the byte converted in Rust (every byte value is exact in f32). Test only, no production change. **Verify:** `cargo test -p victory-shader v_cvt_f32_ubyte` (Windows, hardware GPU or WARP). I type-checked it with clippy for `x86_64-pc-windows-msvc`, but could not run it locally: the shader test module is Windows-only. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
catminou4 commented 2026-11-25 03:02:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:09:56Z.

Review: APPROVED


Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (940d32f), cargo test → 144 passed, 0 failed. GPU execution tests are #[cfg(all(test, windows))] and run only on Windows.

victory-shader. Hardware test for v_cvt_f32_ubyte0..3: RDNA2-matched (Windows-gated).

<!-- greyfinch-sync:Marvisak/VIctory:review:6050606205 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1878#pullrequestreview-6050606205). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T02:09:56Z. **Review:** APPROVED --- Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (940d32f), cargo test → 144 passed, 0 failed. GPU execution tests are #[cfg(all(test, windows))] and run only on Windows. victory-shader. Hardware test for v_cvt_f32_ubyte0..3: RDNA2-matched (Windows-gated).
Marvisak commented 2026-11-25 09:06:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:19:30Z.


Automated triage for the maintainers.

Proposed close. This test is already in main.

crates/victory-shader/src/emit/semantics_tests.rs builds a probe for each of v_cvt_f32_ubyte0..3 in conversion_probes() (for n in 0..4u16 { ... vop1(0x11 + n, ...) ... }), and conversions_match_the_hardware runs them. They use the same model, ((x >> 8n) & 0xFF) as f32, on the hardware adapter and on WARP, and over a wider set of integer edge inputs than this PR. So the PR's premise that "only byte 0 had a test" no longer holds, and v_cvt_f32_ubyte_converts_each_byte duplicates that coverage. CI (check) passes.

The PR will be closed in 48 hours unless the author pushes a change (for example, a case the existing probes miss) or a maintainer removes the label.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7156885288 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1878#issuecomment-7156885288). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T08:19:30Z. --- <!-- victory-triage v1 head=2b2d844965a4c13c2d2d918b66839efa9b2c1953 verdict=proposed-close at=2026-11-25T08:19:21Z --> Automated triage for the maintainers. **Proposed close.** This test is already in `main`. `crates/victory-shader/src/emit/semantics_tests.rs` builds a probe for each of `v_cvt_f32_ubyte0..3` in `conversion_probes()` (`for n in 0..4u16 { ... vop1(0x11 + n, ...) ... }`), and `conversions_match_the_hardware` runs them. They use the same model, `((x >> 8n) & 0xFF) as f32`, on the hardware adapter and on WARP, and over a wider set of integer edge inputs than this PR. So the PR's premise that "only byte 0 had a test" no longer holds, and `v_cvt_f32_ubyte_converts_each_byte` duplicates that coverage. CI (`check`) passes. The PR will be closed in 48 hours unless the author pushes a change (for example, a case the existing probes miss) or a maintainer removes the label. --- _Generated by [Claude Code](https://claude.ai/code)_
sinan-cmyk commented 2026-11-25 12:03:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T11:55:41Z.


Offline measurement on a retail dump

Result: no count change against main.

I merged head 2b2d8449 onto main 940d32f (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 23,918 on main, 23,918 with this PR.

No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.

No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7161690264 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1878#issuecomment-7161690264). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-25T11:55:41Z. --- ### Offline measurement on a retail dump **Result: no count change against `main`.** I merged head 2b2d8449 onto `main` 940d32f (clean merge) and ran `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with `main` program by program (25,889 programs). Validated: 23,918 on `main`, 23,918 with this PR. No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 16:06:25 +00:00

Pull request closed

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!1876
No description provided.