Tests: 16-bit VALU results keep the other half of VDST #1106
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1115"
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 4usphs on 2026-11-24T11:56:03Z.
A 16-bit VALU result goes into D[15:0] and leaves D[31:16] as it was, or with VOP3
op_sel[3]into D[31:16] leaving D[15:0].op_sel[0..2]read the sources' high halves.valu16does this ((cur & 0xFFFF0000u) | t,emit.rs~3051), but onlyv_add_f16has a check of it ingpu_valu_16_and_64_bit. The other 16-bit tests, including #638 and #639, compare D[15:0] alone. A change that zeroed or overwrote the other half would pass all of them.The expected behaviour is measured on RDNA2 silicon, the console's generation, not taken from the ISA text: https://github.com/ivall/xcl/pull/638#issuecomment-7127672871, plus the op_sel forms below.
What is in it
crates/xcl/src/gpu/recomp/tests.rs:gpu_16_bit_results_keep_the_other_half. Every VDST starts at0xCAFE_BABE. Each source has different values in its two halves. 24 rows:valu16that RDNA2 has, plain VOP3:v_add/sub_nc_u16/i16,v_mul_lo_u16,v_lshlrev/lshrrev_b16,v_ashrrev_i16,v_min/max_u16/i16,v_mad_u16/i16.v_subrev_nc_u16is left out: the RDNA2 / RDNA4 assembler refuses it.v_add/sub_nc_u16/i16,v_mad_u16/i16): writing D[31:16], reading the high halves, both.v_cvt_u16_f16/v_cvt_i16_f16(VOP1), f16 source with0xBEEFin its high half.Tested
XCL_ADAPTER: AMD Radeon iGPU of a Ryzen 7 9800X3D (gfx1036, RDNA2, native wave64, driver 32.0.21045.29003) and AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32029.2010). Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug.cargo test --workspace --no-fail-fast -- --test-threads=4ona8133ad: 742 passed, 0 failed, 41 ignored on each GPU, noSKIPPED(main47efa2e: 741 / 0 / 41 on each).XCL_REQUIRE_GPU=wave64: 3 / 3 passed on each GPU.valu16, reverted after:twritten alone): 108 failing rows, e.g.V_ADD_NC_I16 … got 0x00000000, want 0xcafe0000.op_sel[3]ignored: 36 failing rows (got 0xcafef777, want 0xf777babe).op_selsource bits ignored: 35 failing rows.0xCAFEBABE, wave32 and wave64. Every form the assembler accepted matches the rule above on both GPUs.Regression run
tests.rs), no runtime regression run.Not tested
v_mul_lo_u16, the shifts, min / max): the RDNA2 assembler refuses it, so there is no hardware reference for it.clamp, the console itself (gfx1036is a desktop RDNA2 APU of the same generation).AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-24T12:26:02Z.
NVIDIA (32-lane) run, since Not tested lists NVIDIA.
Tested
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17; debuga8133adca5c6ea5cd768b966f66383efd06e861c, which is on currentmain47efa2e(so also the merged result):cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.gpu_16_bit_results_keep_the_other_halfalone, 10 runs: 10 of 10 passed on this card. All 24 rows give the RDNA2-measured values here, including the op_sel forms and the two VOP1 conversions.emit.rs, reverted after):valu16's low-half write changed from({cur} & 0xFFFF0000u) | {t}to{t}: the new test fails with clear rows, e.g.V_ADD_NC_I16 op_sel=0b0000 … got 0x00000004, want 0xcafe0004.({cur} & 0xFFFFu) | ({t} << 16)to({t} << 16): the new test fails, e.g.V_ADD_NC_I16 op_sel=0b1010 … got 0xabd20000, want 0xabd2babe.gpu_valu_16_and_64_bitfails too, on itsv_add_f16 keeps the high halfchecks (lines 2707 and 2708), because all these ops share that one merge invalu16. So these two mutations were already caught byv_add_f16. The new test adds per-opcode and per-op_sel coverage, which matters for a change to one op's path, and failure messages that name the op and form.Not tested
AI use
Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T13:45:23Z.
A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler.
Tested
x86_64-pc-windows-gnu.a8133adas it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine.gpu::recomp::tests::gpu_16_bit_results_keep_the_other_half(--exact, one process): ok, no SKIPPED. DXC compiled it and it ran on the GPU in about 0.8 s.Not tested
AI use
Imported from ivall/xcl. Originally posted by wanchudao on 2026-11-24T15:41:16Z.
Tested —
a8133adon Windows 11 Pro build 26300, RTX 3070 Ti (driver 610.88),rustc 1.100.0, MSVC 14.44.35207, and DXC 1.9.2602.17.
cargo test -p xcl --lib gpu_16_bit_results_keep_the_other_half -- --nocaptureResult with the default adapter: 1 passed, 0 failed, 0 ignored, 719 filtered out.
The same test provided an additional result for xcl's split-wave64 path on this card:
XCL_ADAPTER=definitely-not-a-gpu, it printedSKIPPED ...: no GPU(0.03 s).SKIPPEDline (0.39 s). The first default run took 0.47 s.XCL_REQUIRE_GPU=wave64, a skip in this test would fail it. The test passed (0.47 s).Not tested — AMD reference hardware, native wave64, or
op_selon the VOP2-origin ops.AI use — DeepSeek Harness (DeepSeek V4.1 Flash) ran the tests and drafted this report.
OpenAI Codex (GPT-6.2 Sol) checked the archived results and revised it.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T08:16:02Z.
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:40:30Z.
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-01T04:51:41Z.
Triage (#1607) – head
a8133ad#638 also tests these 16-bit integer ops on the GPU but compares only D[15:0]; this PR checks the kept half and VOP3 op_sel (source halves and op_sel[3]), so they complement each other rather than duplicate. Main's
valu16inemit.rsalready implements these semantics, so this is coverage, not a fix.No problems found in the diff. The branch currently conflicts with main in
recomp/tests.rs.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.