Recompiler tests: GPU checks for f32 ceil/trunc/rndne, f32/i32 min/max #734
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/739"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by 13hourstilliland on 2026-11-24T04:21:43Z.
Adds a GPU test for nine RDNA2 instructions that
emit.rstranslates but no test runs:v_ceil_f32,v_trunc_f32,v_rndne_f32,v_max_f32,v_min_f32,v_max3_f32,v_min3_f32,v_max_i32andv_min_i32. Test only, no runtime change.What is in it
gpu_valu_round_and_min_max_f32_i32incrates/xcl/src/gpu/recomp/tests.rs, afterf32_compares_with_nan(away from the lines open PRs add to): one kernel with all 9 instructions, run as wave64 where the adapter has it and as wave32 everywhere (gpu_waves), 32 batches of operands: edge values (±0, ±0.5, ±1.5, ±2.5, 0.49999997, ±8388607.5, ±1e30, ±inf, NaN), values on 1/256 steps up to 2^23 and random bit patterns, with denormals flushed to a signed zero and NaNs quieted, each lane compared with the RDNA2 definition computed on the CPU: rounding keeps the sign of a zero; a quiet NaN operand of an f32 min/max gives the other operand (minNum/maxNum), and min/max zero results are compared without their sign.3db536e(before the rebase onto main91f9a5e; the test code did not change): with the reference changed (referenceround_ties_evenreplaced byround:wave32, 188 wrong (V_RNDNE_F32: 188), no other instruction) the test fails; with ceil as floor, trunc as round, rndne as trunc, max and min swapped, max3 and min3 with the inner op swapped, signed i32 min and max made unsigned applied toemit.rsall at once it fails and names every instruction (wave32, 5199 wrong (V_CEIL_F32: 634, V_TRUNC_F32: 217, V_RNDNE_F32: 217, V_MAX_F32: 956, V_MIN_F32: 956, V_MAX3_F32: 628, V_MIN3_F32: 629, V_MAX_I32: 481, V_MIN_I32: 481), 217 to 956 wrong per instruction). Those edits are not in the PR.v_min_f32also appears in the open #247, inside an image-sample test; that PR does not test it on its own.Tested
stable-x86_64-pc-windows-gnu(MinGW linker), DXC 1.9.2609.5, debug build, commit586edbac69(on main91f9a5e9f0)cargo test --workspace --no-fail-fast -- --test-threads=4, run in the interactive desktop session: 693 passed, 0 failed, 41 ignored (lib: 653 passed, 0 failed, 21 ignored;e2e3 of 3;gpu_valu_round_and_min_max_f32_i32ok).main91f9a5e9f0on the same machine: 692 passed, 0 failed, 41 ignored (lib: 652 passed, 0 failed, 21 ignored)SKIPPED(no wave64 on this GPU):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareNot tested
stable-x86_64-pc-windows-msvc): built with the GNU toolchain only.crates/xcl/srcruntime file changes).gpu_typed_buffer_loads_and_stores,gpu_uma_import_check_at_init,gpu_valu_16_and_64_bitand this test) and were killed. The same four tests together passed twice, the lib suite alone passed 4 of 4,mainpassed 4 of 4, and the full-suite run counted above passed. I did not find the cause.AI use
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T04:39:51Z.
Test run of
586edbac69ebec057acaa9927957683036958dceon AMD RDNA4. I merged it onto currentmain64b3f35locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 702 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 661 passed, 0 failed, 21 ignoredSKIPPED; the new rounding / min-max GPU test passes.Review: Overlap:
v_ceil_f32,v_trunc_f32andv_rndne_f32are also covered by #655 (gpu_float_rounding_ops), andv_min_f32/v_max_f32by #719; new here arev_max3_f32,v_min3_f32and the i32 min / max. If those land first, this could keep only the new ones. The references are right (ceil(−0.5) = −0, min / max zero results compared without the sign, as D3D allows).Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T04:46:51Z.
An NVIDIA run, since the report above is on RDNA4 (native wave64). Tested exact head
586edba(on its base91f9a5e).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 693 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.gpu::recomp::tests::gpu_valu_round_and_min_max_f32_i32 ... ok.Not tested
AI use
Imported from ivall/xcl. Originally posted by ItsMrDubey on 2026-11-24T04:57:21Z.
Test report for
586edbac69ebec057acaa9927957683036958dce(this PR's head)Tested
stable-x86_64-pc-windows-msvc), debug; DXC 1.9.2602.17 from Windows SDK 10.0.2610016 test binaries: 692 passed, 1 failed, 41 ignored. Same machine,
main64b3f3559: 700 passed, 1 failed, 41 ignored.This PR's tests:
gpu::recomp::tests::gpu_valu_round_and_min_max_f32_i32: okFailures:
hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memoryfails on this machine on every run, on this PR's head and onmain64b3f3559alike (5 of 5 reruns onmain), so it is not from this PR. #650 fixes it here.16 test binaries instead of
main's 17 because this branch predatestests/sparse_reinit.rs; nothing crashed.SKIPPED (no wave64 on this GPU):
gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.AI use: Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report from their output.
upstream-sync referenced this pull request2026-11-24 19:06:45 +00:00
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:03:11Z.
Empirical test report (
586edbac)Verified PR #739 at commit
586edbac69ebec057acaa9927957683036958dcein a clean detached checkout.Hardware / environment
XCL_ADAPTER=A770, on Windows x64 build 26200 with an AMD Family 23 Model 113 CPU.1.100.0 (0ef1bc386 2026-11-09). The test ran in the unoptimized Cargo test profile with incremental compilation and debug info disabled.1.9.2609.5(01b62ad47indxc.exe --version). The fixture reported loadingdxcompileranddxilversion1.9.2609.5.Commands and results
cargo test -p xcl --lib --no-runcompleted with exit code 0 before acquiring the GPU lock.Invoke-ArcTest.ps1, withRUST_TEST_NOCAPTURE=1, ranxcl-00e28da3621caf64.exe gpu::recomp::tests::gpu_valu_round_and_min_max_f32_i32 --exact --nocapture --test-threads=1using the executable from that build. Exit code 0. The log showed 1 passed, 0 failed, 0 ignored, 0 skipped and 673 filtered out. The fixture completed in 0.73 seconds.Observed behavior
The fixture compiled its recompiled shader with DXC and completed its GPU comparisons against the CPU reference. It checked nine VOP3 instructions over 32 batches per executed wave mode. Coverage included f32 ceil, truncation and nearest-even rounding, two- and three-operand f32 min/max, and signed i32 min/max. The fixture checked signed zero for rounding and numeric results for min/max with a single quiet NaN. The result confirms wave32 coverage. The log does not enumerate the wave modes, so native wave64 coverage was not established by this run.
Not tested
The full GPU workspace suite and game smoke runs were omitted. No other GPU was tested.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr739-focused.logand published.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:28:55Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:41:44Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T08:32:23Z.
merge-check claim
head:
586edbac69Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T08:37:54Z.
merge-check
base:
d52ff48caahead:
586edbac69merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2876 passed, 2 failed, 51 ignored; 29 SKIPPED lines
failing: test_title_runs_and_game_folder_is_untouched
review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review.
performance: not assessed beyond the suite.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017
correction: this check first reported the PR as "not yet" because of a test failure that is not the PR's. The base-comparison step failed to run (test names contain a double colon, not a legal Windows filename), so an empty read was mistaken for "passes on base".
gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16fails on based52ff48cby itself (verified separately with the same command: "assertion failed: 2D D16 resinfo clobbered v2/v3"). Verdict corrected. Apologies for the noise.Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T10:02:16Z.
merge-check claim
head:
586edbac69Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T10:09:34Z.
merge-check
base:
9dfbe3ea66head:
586edbac69merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. The new test
gpu_valu_round_and_min_max_f32_i32passed; on this card it runs the wave32 form only (no wave64).review: no blocking finding; test-only, one file, read in full. One GPU test of
v_ceil_f32,v_trunc_f32,v_rndne_f32,v_max/min_f32,v_max3/min3_f32andv_max/min_i32against CPU references, 32 dispatches of edge values and random bits. Denormals are turned into zeros and NaNs quieted in the inputs, and zero results of min / max are compared without their sign; the comment gives the reasons (driver flush behaviour, D3D leaving -0 against +0 open), so those cases are left unpinned on purpose. Sibling of #655 (rounding, fract) and #737 / #738; I found no PR with the same test.performance: none; tests only.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:02:50Z.
Triage (#1607) – head
586edbaPartial overlaps, all opened later: #1672 and #2620 also test V_CEIL_F32 / V_TRUNC_F32 / V_RNDNE_F32 in wider unary-math tests. #1301 and #1577 test V_MIN/MAX(3)_F32 on -0 against +0, which this test leaves out on purpose (it compares zero min/max results without their sign). None of them covers the same set, and none of these checks is on main.
No problems found in the diff.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-02T18:43:56Z.
merge-check
base:
c53e969602head:
586edbac69verdict: safe to merge
Windows / AMD RDNA4 — VALU rounding and min/max tests on
586edbaClean merge onto
main(merge commit88605f6db0d8a60eb53152259496ede3baa763f5).git diff --checkwas clean.Setup
AMD Radeon RX 9060 XT (32.0.32029.2010), Ryzen 7 5700X, Windows 10 21H2 build 19044.6332, Rust 1.100.0 debug, Agility 1.620.2, DXC 1.9.2609.5.
Tested
cargo test -p xcl --lib gpu_valu_round_and_min_max_f32_i32 -- --test-threads=1 --show-output --nocapture— 1 passed, 0 failed, 0 ignored, 0 skip notices.Diff review
The diff adds only the GPU test. It checks integral f32 rounding and ordered floating-point and signed-integer min, max, and median cases against expected per-lane results.
Not tested
The full workspace suite, retail smoke, or another GPU vendor in this run.
AI use
Codex (GPT-6) merged the PR, reviewed the test diff, ran the test, and drafted this report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.