Recompiler tests: GPU checks for v_max3_u16, v_min3_u16 and v_med3_u16 #738
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!738
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-738"
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?
@13hourstilliland on GitHub · 2026-11-24 04:21 UTC · original
13hourstilliland:recomp-tests-max3-min3-med3-u16→main· +51 −0 · 1 files · 1 commits · openAdds a GPU test for three RDNA2 instructions that
emit.rstranslates but no test runs:v_max3_u16,v_min3_u16andv_med3_u16. Test only, no runtime change.What is in it
gpu_valu_16_bit_unsigned_min3_max3_med3incrates/xcl/src/gpu/recomp/tests.rs, aftergpu_grouped_loads_bounds_and_inactive_lanes(away from the lines open PRs add to): one kernel with all 3 instructions, run as wave64 where the adapter has it and as wave32 everywhere (gpu_waves), 32 rounds of operands per lane: u16 edges (0, 1, 2, 0x00F1, 0x7FFE, 0x7FFF, 0x8000, 0x8001, 0xFFFE, 0xFFFF) and random halves, always with non-zero bits in each source's high half, each lane compared with the RDNA2 definition computed on the CPU (sort the three low halves). Only the low 16 bits of the result are compared: the AMD machine-readable RDNA2 spec (VOP3OP_SELfield) saysop_sel[3] = 0zeroes the high half, while LLVM'sGCNSubtarget::zeroesHigh16BitsOfDestsays gfx10 preserves it, so the high half is left unchecked.91f9a5e(the base of this branch): with the reference changed (reference withv_med3_u16returning the minimum:wave32, 984 wrong (V_MED3_U16: 984), no other instruction) the test fails; with max3 with the inner op as min, min3 with the inner op as max, and med3 with the third operand replaced by the second applied toemit.rsall at once it fails and names every instruction (wave32, 1940 wrong (V_MAX3_U16: 659, V_MIN3_U16: 635, V_MED3_U16: 646), 635 to 659 wrong per instruction). Those edits are not in the PR.Tested
stable-x86_64-pc-windows-gnu(MinGW linker), DXC 1.9.2609.5, debug build, commit3f812638b5(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_16_bit_unsigned_min3_max3_med3ok).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).AI use
@MesshM on GitHub · 2026-11-24 04:39 UTC · original
Test run of
3f812638b55811d96d57047b6629d699828aab15on 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;gpu_valu_16_bit_unsigned_min3_max3_med3passes.Review: med3 is the middle of the three sorted values and only D[15:0] is compared, as the ISA defines. Overlap: #638's description says #445 has the 16-bit min3 / max3 / med3; if #445 covers the unsigned forms too, one of the two is enough.
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.
@futurepro62 on GitHub · 2026-11-24 04:46 UTC · original
An NVIDIA run, since the report above is on RDNA4 (native wave64). Tested exact head
3f81263(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_16_bit_unsigned_min3_max3_med3 ... ok.Not tested
AI use
@ItsMrDubey on GitHub · 2026-11-24 04:57 UTC · original
Test report for
3f812638b55811d96d57047b6629d699828aab15(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_16_bit_unsigned_min3_max3_med3: 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.
@luckyteagirl on GitHub · 2026-11-24 05:59 UTC · original
Native RDNA2 check of the untouched destination half
The PR description notes the ambiguity over the upper 16 bits. On the RX 6800M (
gfx1031), nativev_min3_u16,v_max3_u16andv_med3_u16all preserved the untouched destination half.Tested
30.0.13002.13003, AMD OpenCL3302.6 (PAL,LC).0xA55AC33C. It wrote the low half with defaultop_sel, and a separate instruction wrote the high half withop_sel:[0,0,0,1]. The three source low halves supplied the u16 operands. Their high halves were nonzero.0xA55Afor low writes and0xC33Cfor high writes. Four work-items per case agreed.For inputs
0x0000,0xFFFFand0x7FF8, the native median results were0xA55A7FF8for the default write and0x7FF8C33Cfor the high-half write.Not tested
The PR's translated GPU test and other GPU generations. This measures the three native RDNA2 instructions.
AI use
OpenAI Codex (GPT-6 family, exact model variant unavailable) wrote and ran the probe and drafted this report.
@JJAutoCompare on GitHub · 2026-11-25 06:03 UTC · original
Empirical test report (
3f812638)Verified PR #738 at
3f812638b55811d96d57047b6629d699828aab15.Hardware / environment
XCL_ADAPTER=A770. Windows build 26200 on x64 (AuthenticAMD family 23, model 113).rustc 1.100.0 (0ef1bc386 2026-11-09), Cargo unoptimized test profile with debug info and incremental compilation disabled.dxc.exe --versionreported DXC 1.9.2609.5 (01b62ad47). The fixture logged dxcompiler and dxil 1.9.2609.5 at runtime.Commands and results
cargo test -p xcl --lib --no-runexited 0 outside the GPU lock.Ran the emitted library test executable (
$testExe) underInvoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1:Exit code 0. The captured libtest summary showed 1 passed, 0 failed, 0 ignored, with 673 filtered out and 0.73 s elapsed. The log contained 0
SKIPPEDmarkers.Observed behavior
The GPU fixture compared the low 16 bits from
v_max3_u16,v_min3_u16, andv_med3_u16against a Rust reference that sorts the three unsigned inputs. It completed 32 rounds per wave mode selected by the fixture with no mismatches. Inputs included boundary and pseudorandom values with nonzero upper halves. The passing fixture did not log the selected wave modes.Not tested
The full GPU workspace suite and game smoke runs were omitted. This fixture checks only the low 16 bits of each destination.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr738-focused.logand published.@DavidM1911 on GitHub · 2026-11-25 11:29 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
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.