Shaders: probe v_cvt_f32_i32 at its rounding midpoints #3479

Open
github-bot wants to merge 2 commits from github-bot/gh-3479 into main AGit
Owner

@⁠noobezlol on GitHub · 2026-11-27 07:15 UTC · original
noobezlol:test/cvt-sat-round-tests → main · +17 −1 · 1 files · 2 commits · open

Tests only, one file (crates/victory-shader/src/emit/semantics_tests.rs).

Picks up the remaining part of #1602 (by @⁠vladbondarenko97, credited as co-author) and includes @⁠andrewpozdnakov7-jpg's follow-up commit (91795cd) probing both sides of the signed endpoint ties; claimed in #1633.

#1602 added f32/int conversion tests but has needed a rebase since 2026-11-25. Most of it is now covered on main by conversion_probes: i32/u32 truncation, saturation and NaN-as-zero (F32_EDGES), v_cvt_f32_u32 round-to-even (#2186), and the ubyte forms. The one gap left is v_cvt_f32_i32 above 2^24. This extends its probe with #2186's midpoint pattern, in both signs, plus the halfway points and neighbours next to i32::MAX/MIN. It checks the hardware adapter and WARP against a reference model.

Tested on Windows 11, NVIDIA GeForce RTX 3060 (driver 32.0.16.2140, 32 lanes), Rust 1.98.1:

  • cargo test -p victory-shader --lib -- emit::semantics_tests --test-threads=1 --nocapture: 34 passed, 0 failed, 1 ignored (existing defect marker); in conversions_match_the_hardware, v_cvt_f32_i32 gets 124 inputs with 0 mismatches on hardware and WARP (including @⁠andrewpozdnakov7-jpg's endpoint neighbours, 91795cd)
  • VICTORY_WARP=1 cargo test -p victory-shader --lib -- --exact emit::semantics_tests::conversions_match_the_hardware --test-threads=1 --nocapture: passes (124 inputs, 0 mismatches)
  • cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo xtask policy: 192 files ok

No game files used. AI-assisted (Claude Code).

**@⁠noobezlol** on GitHub · 2026-11-27 07:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/3479) `noobezlol:test/cvt-sat-round-tests` → `main` · +17 −1 · 1 files · 2 commits · open Tests only, one file (`crates/victory-shader/src/emit/semantics_tests.rs`). Picks up the remaining part of #1602 (by @⁠vladbondarenko97, credited as co-author) and includes @⁠andrewpozdnakov7-jpg's follow-up commit (`91795cd`) probing both sides of the signed endpoint ties; claimed in #1633. #1602 added f32/int conversion tests but has needed a rebase since 2026-11-25. Most of it is now covered on `main` by `conversion_probes`: i32/u32 truncation, saturation and NaN-as-zero (`F32_EDGES`), `v_cvt_f32_u32` round-to-even (#2186), and the ubyte forms. The one gap left is `v_cvt_f32_i32` above 2^24. This extends its probe with #2186's midpoint pattern, in both signs, plus the halfway points and neighbours next to i32::MAX/MIN. It checks the hardware adapter and WARP against a reference model. Tested on Windows 11, NVIDIA GeForce RTX 3060 (driver 32.0.16.2140, 32 lanes), Rust 1.98.1: - `cargo test -p victory-shader --lib -- emit::semantics_tests --test-threads=1 --nocapture`: 34 passed, 0 failed, 1 ignored (existing defect marker); in `conversions_match_the_hardware`, `v_cvt_f32_i32` gets 124 inputs with 0 mismatches on hardware and WARP (including @⁠andrewpozdnakov7-jpg's endpoint neighbours, `91795cd`) - `VICTORY_WARP=1 cargo test -p victory-shader --lib -- --exact emit::semantics_tests::conversions_match_the_hardware --test-threads=1 --nocapture`: passes (124 inputs, 0 mismatches) - `cargo clippy --workspace --all-targets -- -D warnings`: clean - `cargo xtask policy`: 192 files ok No game files used. AI-assisted (Claude Code).
Tests only. #2186 added round-to-nearest-even midpoint probes for
v_cvt_f32_u32; the signed form still saw only the generic integer
edges. Probe it at the neighbours of every midpoint from 2^24 to 2^30,
of both signs, and at the halfway points next to i32::MAX/MIN, on the
hardware adapter and WARP. This is the remaining part of #1602 not
already covered on main.

Co-authored-by: Vlad Bondarenko <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 07:23:00 +00:00
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 08:24 UTC · original

@⁠noobezlol I verified c3ffec5 on app-local WARP. The signed conversion matched the reference for all 122 inputs. At the signed endpoints the fixture included the tie and one neighbour on each side of zero, but left out the other neighbour at each tie (0x7fff_ffc1 and 0x8000_003f).

91795cd adds both by testing the midpoint and its two neighbours with both signs. All 124 signed inputs matched bit for bit on WARP, the conversion and floor-conversion tests passed, and strict shader Clippy passed with default and all features.

If you take the test, please retain Git authorship when cherry-picking or rebasing. If folded into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted with Codex. Synthetic shader tests only.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 08:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/3479#issuecomment-7213505153) @⁠noobezlol I verified `c3ffec5` on app-local WARP. The signed conversion matched the reference for all 122 inputs. At the signed endpoints the fixture included the tie and one neighbour on each side of zero, but left out the other neighbour at each tie (`0x7fff_ffc1` and `0x8000_003f`). [91795cd](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/91795cdc6840df4574250c2c6b55d576d916027b) adds both by testing the midpoint and its two neighbours with both signs. All 124 signed inputs matched bit for bit on WARP, the conversion and floor-conversion tests passed, and strict shader Clippy passed with default and all features. If you take the test, please retain Git authorship when cherry-picking or rebasing. If folded into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with Codex. Synthetic shader tests only.
Author
Owner

@⁠noobezlol on GitHub · 2026-11-27 08:49 UTC · original

thank you! I pulled in 91795cd (retaining your Git authorship) and re-verified on my RTX 3060 + WARP: all 124 v_cvt_f32_i32 inputs passed with 0 mismatches, and clippy -- -D warnings and xtask policy are clean

**@⁠noobezlol** on GitHub · 2026-11-27 08:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/3479#issuecomment-7213954504) thank you! I pulled in `91795cd` (retaining your Git authorship) and re-verified on my RTX 3060 + WARP: all 124 `v_cvt_f32_i32` inputs passed with 0 mismatches, and `clippy -- -D warnings` and `xtask policy` are clean
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-27 18:27 UTC · original

Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head 91795cd (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 866 passed, 0 failed, 10 ignored.
  • No new #[test] functions in the diff.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-27 18:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3479#issuecomment-7225516221) Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `91795cd` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **866 passed, 0 failed, 10 ignored**. - No new `#[test]` functions in the diff. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3479/head:github-bot/gh-3479'
git switch 'github-bot/gh-3479'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3479'
git switch 'github-bot/gh-3479'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3479'
git switch 'github-bot/gh-3479'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3479'
git switch 'main'
git merge --squash 'github-bot/gh-3479'
git switch 'main'
git merge --ff-only 'github-bot/gh-3479'
git switch 'main'
git merge 'github-bot/gh-3479'
git push origin 'main'
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!3479
No description provided.