Tests: check subtracts with a borrow and reverse subtracts on the GPU #1188
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1197"
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 jesuarchive on 2026-11-24T13:08:01Z.
v_sub_co_u32,v_subrev_co_u32,v_sub_co_ci_u32,v_subrev_co_ci_u32,v_sub_nc_i32andv_subrev_f32are translated (emit.rs) but had no GPU test. This adds one, test-only.What is in it
crates/xcl/src/gpu/recomp/tests.rs:gpu_sub_borrow_and_reverse_subtracts. It checks each result and its borrow mask, read per lane throughv_cndmask_b32, over equal operands, either side larger, 0, the u32 ends and signed overflow. The*_co_ciforms run in VOP2 (borrow in and out through VCC, chained into a 64-bit subtract) and VOP3 (borrow in from SRC2, out to an SGPR pair).v_sub_nc_i32runs with and withoutCLAMP. Runs on every adapter throughgpu_waves().Tested
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 from the Windows SDK; debug.cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware, no wave64).main47efa2eon the same machine: 741 / 0 / 41, the same two skipped.cargo test -p xcl --lib -- gpu_sub_borrow_and_reverse_subtracts --nocapture --test-threads=1: 1 passed, not skipped (wave32 pass only on this adapter).emit.rs, reverted: thev_sub_co_u32borrow asb >= ainstead ofb > a,v_subrev_co_ci_u32not swapping its operands,v_sub_nc_i32ignoringCLAMP. The test fails on each, naming the instruction.Regression run
Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:18:58Z.
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug; DXC 1.8.2502.11.
cargo test -p xcl --lib subtract: 1 passed, 0 failed —gpu_sub_borrow_and_reverse_subtractson real hardware.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Imported from ivall/xcl. Originally posted by bjarngard on 2026-11-24T13:23:53Z.
Test report for head
3b76282(AMD, native wave64)Tested
XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no SKIPPEDXCL_REQUIRE_GPU=wave64:gpu_sub_borrow_and_reverse_subtractspassedgpu_waves(), so on this adapter both the wave64 and the wave32 pass ran, including the wave64 pass with 64-bit borrow masksNot tested: Intel, Wine.
AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:00:28Z.
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 Foniass on 2026-12-01T05:04:12Z.
Triage (#1607) – head
3b76282Main already has a partial check of the borrow chain (
gpu_scalar_sext_mulhi_and_vector_i24_sub_co_ci_u64_shifts, commitce22d27: VOP3 v_sub_co_ci_u32 and VOP2 v_subrev_co_ci_u32). This test adds v_sub_co_u32 / v_subrev_co_u32 borrow-out, VOP2 v_sub_co_ci_u32, VOP3 v_subrev_co_ci_u32, v_sub_nc_i32 with CLAMP and v_subrev_f32, over wave32 and wave64. #202 tests the CLAMP=1 forms of these as part of a code change. No open PR adds the same test.No problems found in the diff (the comment
v[23:22] = v[3:1] - v[4:2]means v3:v1 - v4:v2).Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.