Tests: 16-bit VALU results keep the other half of VDST #1115
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!1115
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@4usphs on GitHub · 2026-11-24 11:56 UTC · original
4usphs:tests/16-bit-results-keep-other-half→main· +101 −0 · 1 files · 1 commits · openA 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
@fromthemoonx on GitHub · 2026-11-24 12:26 UTC · original
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
@JoaoPauluu on GitHub · 2026-11-24 13:45 UTC · original
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
@wanchudao on GitHub · 2026-11-24 15:41 UTC · original
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.
@DavidM1911 on GitHub · 2026-11-25 08:16 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
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.