Tests: check the cube face ops on the GPU against the ISA #668
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!668
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@lemosss on GitHub · 2026-11-24 03:10 UTC · original
lemosss:tests/gpu-cube-face-ops→main· +98 −0 · 1 files · 1 commits · openv_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
@MesshM on GitHub · 2026-11-24 03:18 UTC · original
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.
@lordon1a on GitHub · 2026-11-24 03:26 UTC · original
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.@JJAutoCompare on GitHub · 2026-11-25 06:24 UTC · original
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.
@DavidM1911 on GitHub · 2026-11-25 12:21 UTC · original
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!
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.