Repository navigation
Conversation
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], and op_sel[0..2] read the sources' high halves. valu16 does this (`(cur & 0xFFFF0000u) | t`), but only v_add_f16 had a check of it: the other 16-bit tests compare D[15:0] alone. gpu_16_bit_results_keep_the_other_half presets every VDST to 0xCAFE_BABE and runs the 16-bit integer ops of valu16 that RDNA2 has, the op_sel forms the RDNA2 assembler takes (v_add/sub_nc_u16/i16, v_mad_u16/i16), and v_cvt_u16_f16 / v_cvt_i16_f16. The expected values follow what RDNA2 (gfx1036) and RDNA4 (gfx1201) silicon gave for the same instructions as inline assembly through OpenCL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ufoptg
pushed a commit
that referenced
this pull request
Nov 24, 2026
…ites `pc_resource_desc` takes ALLOW_UNORDERED_ACCESS from a depth buffer the console also lets shaders write (the PC refuses ALLOW_DEPTH_STENCIL with ALLOW_UNORDERED_ACCESS). Only CreatePlacedResourceX (#44) moved such a resource's initial state off UNORDERED_ACCESS as well (to DEPTH_WRITE). The other paths that create a resource of the converted description only masked the state with PC_RESOURCE_STATES: the committed fallback of CreateCommittedResource (#27 / #76 / #127, reached without unified memory or when its coherent window is full), the PC-way retry and the committed fallback of CreatePlacedResource (#29), and its memory-of-its- own path for textures larger on the PC. A console texture with flags DEPTH_STENCIL | UNORDERED_ACCESS created in UNORDERED_ACCESS was then asked for in a state D3D12 refuses for a resource without the UAV flag (E_INVALIDARG; the #29 own-memory path fell back to COMMON). `device_x::pc_initial_state` does both steps; #44 uses it with no change in behaviour, and the four other sites use it with the console flags (or the PC description's, which keep ALLOW_DEPTH_STENCIL). Tests: a unit test of the helper; a GPU test placing a 256x256 D16 depth+UAV texture in UNORDERED_ACCESS as XCL now does (not run here). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Upstream PR xcl-dev#1115 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 xcl-dev#638 and xcl-dev#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: xcl-dev#638 (comment), 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
Mirror of xcl-dev#1115 (auto-synced, do not edit).