Tests: check the cube face ops on the GPU against the ISA #663
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/668"
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 lemosss on 2026-11-24T03:10:42Z.
v_cubeid_f32,v_cubesc_f32,v_cubetc_f32andv_cubema_f32had no test of their own: onlyv_cubeidruns, insidegpu_sdwa_dpp_and_cross_lane, on three directions with one dominant axis (faces −x, +y, −z) and no ties. Their translation (cube_id/cube_sc/cube_tc/cube_mainemit.rs) picks the major axis by hand, and a wrong tie rule or sign there changes which face and texel a cube sample reads. This adds a GPU test that checks all four against the ISA's pseudocode, bit for bit. Test only: no runtime change. I found no issue or open PR for these ops (searched forcube,v_cube, and the open "GPU checks" test PRs).What is in it
crates/xcl/src/gpu/recomp/tests.rs:gpu_cube_face_ops_randomand its CPU referencecube_ref(the ISA pseudocode: z is the major axis when |z| ≥ |x| and |z| ≥ |y|, else y when |y| ≥ |x|, else x). Random directions, one wave per dispatch in 50 dispatches (XCL_FUZZ_ITERS=nfor more), as wave64 where the GPU has it and as wave32:NEGon SRC0 andABSon SRC2, applied before the axis is picked;Tested
stable-x86_64-pc-windows-msvc, VS 2022 Build Tools (MSVC 14.44), DXC 1.9.2609.5 (GitHub release,XCL_DXC_DIR); debug buildcargo test -p xcl --lib gpu_cube_face_ops_random -- --nocapture: passed,wave32: lanes 1600, with a tie 903, faces +x/-x/+y/-y/+z/-z [157, 176, 207, 242, 422, 396], 0 distinct failurescube_scchanged from>=to>, the test reports 376 distinct failures, e.g.cubesc(-1.25e0, -1.25e0, -1.25e0) = -1.25e0, want 1.25e0cargo build --workspace+cargo test --workspace --no-fail-fast -- --test-threads=4on this branch (maindd2ae9a+ this commit): 691 passed, 0 failed, 41 ignoredSKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareRegression run
tests.rs, no runtime fileNot tested
maindd2ae9awithout this commit (not run separately)AI use
Imported from ivall/xcl. Originally posted by towiice on 2026-11-24T03:47:24Z.
Review: COMMENTED
Tested:
01b62ad4), toolchainstable-x86_64-pc-windows-gnullvm(llvm-mingw 23.1.6).cargo test -p xcl --lib cube -- --nocapturegpu_cube_face_ops_randomverified across 1600 wave32 lanes across all 6 cube faces (+x/-x/+y/-y/+z/-z [157, 176, 207, 242, 422, 396]) with 0 distinct failures.gpu_cube_array_slicesgpu_retail_vs_blit_gen_amb_cubeCube face operations match ISA expectations cleanly on Turing hardware.
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T03:18:17Z.
Test run of
be9f1e5cb9a6dc2f3ad731d3accd06b9be3ecfb6on AMD RDNA4 (native wave64). I merged it onto currentmain63cdc25locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 693 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 653 passed, 0 failed, 21 ignoredSKIPPED;gpu_cube_face_ops_randompasses.Review: The reference picks the major axis as the ISA does (z when |z| ≥ |x| and |z| ≥ |y|, else y when |y| ≥ |x|, else x), so ties resolve the hardware's way, and the NEG / ABS variants check that the source modifiers are applied before the face is chosen. I found nothing to change.
Not tested: no retail title (not needed for a test-only change), release build; the PR's head on its old base was not run, only its merge onto
main.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 lordon1a on 2026-11-24T03:26:50Z.
Independent GPU test report on
be9f1e5:Tested
616.64, wave32, SM 6.6), Intel i7-12700H, Windows 11 Home 26H2 (build 26200),rustc 1.100.0(x86_64-pc-windows-gnullvm), debug build, DXC1.9.2609.5(01b62ad4)cargo test -p xcl --lib cube -- --nocapture0.84sgpu::recomp::tests::gpu_cube_face_ops_random:wave32: lanes 1600, with a tie 903, faces +x/-x/+y/-y/+z/-z [157, 176, 207, 242, 422, 396],0 distinct failures— okNot tested
AI use
be9f1e5in a detached worktree, audited the diff, ran the GPU test, and posted this report.upstream-sync referenced this pull request2026-11-24 19:06:45 +00:00
upstream-sync referenced this pull request2026-11-25 07:04:28 +00:00
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:24:44Z.
Empirical test report (
be9f1e5c)Hardware / environment
be9f1e5cb9a6dc2f3ad731d3accd06b9be3ecfb6(detached checkout of PR #668).32.0.101.9175. AMD Ryzen 7 3800X 8-Core Processor.10.0.26200.9974. Rust1.100.0 (0ef1bc386 2026-11-09), hostx86_64-pc-windows-msvc.dxcompiler 1.9.2609.5 (01b62ad4),dxil 1.9.2609.5. Unoptimized test profile with debug info and incremental compilation disabled.Commands and results
cargo test -p xcl --lib --no-runexited 0 outside the Arc lock. This compiled the library test executable without running tests.XCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1, ran the following insideInvoke-ArcTest.ps1. In the command,$testExeis the library test executable emitted by Cargo.SKIPPEDin the UTF-8 log.Observed behavior
The test compared the four cube-face instructions and selected VOP3 NEG and ABS cases against its ISA-derived CPU reference, bit for bit. The Wave32 run checked 1,600 lanes, including 903 with tied component magnitudes. The face counts in +X, −X, +Y, −Y, +Z, −Z order were 157, 176, 207, 242, 422, and 396. The test reported zero distinct failures.
Not tested
The full GPU workspace suite, game smoke runs, and native Wave64 execution were omitted.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr668-focused.log and published.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T12:21:01Z.
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!
Pull request closed