Repository navigation
fix(shader): truncate overflowing 32-bit bitfield masks - #1605
Conversation
|
Linux results on NVIDIA and RADV, since this was tested on Windows with an RX 9070 XT. Everything passes here, including the new Nobara 44 (Linux 7.2), GCC 16.2.1, Release,
The one CPU failure is |
Construct the low-bit mask at offset zero, then shift it in 32-bit arithmetic. AI-assisted: yes.
Cover all width/offset pairs and independent ignored upper operand bits for scalar and vector masks. AI-assisted: yes.
Exercise 4096 width/offset inputs through Vulkan and preserve both SCC values. AI-assisted: yes.
Register the regression with CTest and configure Windows runtime lookup. AI-assisted: yes.
AI-assisted: yes. Full current-main project build passed. Seven focused Windows tests pass; four shader tests also pass in full and none optimization modes with actual Vulkan execution required. Updated Linux and title runs remain pending.
AI-assisted: yes. Full current-main project build passed. Seven focused Windows tests pass; four shader tests also pass in full and none optimization modes with actual Vulkan execution required. Updated Linux and title runs remain pending.
…groups Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
|
Hardware measurement for the TechnicalDebt entry this PR adds, and a run of the PR. Radeon 610M (gfx1036), Inputs are the test's own domain: widths 0–31 × offsets 0–31 × upper bits 0, 32, 0x80000000, 0xffffffe0 (4,096 pairs).
PR head ca16eaa merged onto Not measured: gfx1013; AI-assisted: yes. |
|
Checked Added on your branch:
Merging once CI is green. |
ca16eaa to
6fee7e8
Compare
…k-overflow fix(shader): truncate overflowing 32-bit bitfield masks
What
Fixes
S_BFM_B32andV_BFM_B32lowering when the masked width and offset add to more than 32. Construct the low-bit mask at offset zero and shift in 32-bit arithmetic so overflow bits are discarded. Width/offset masking, vector EXEC masking and scalar SCC preservation remain intact. For width 2 and offset 31, the expected result is0x80000000.Semantics: AMD RDNA 1.0 ISA, section 12.1 opcode 36 and section 12.12 opcode 867; SPIR-V OpBitFieldInsert.
The GPU regression uses zero-stride byte buffers with
OOB_SELECT=3, the raw bounds mode in RDNA ISA section 8.1, Table 35. The earlier fixture selected structured bounds with stride zero and dropped stores when run against current main. The descriptor is corrected; all result and SCC assertions remain, with actual/expected values added to failure messages. The technical-debt entry is placed with related shader entries to avoid shared insertion conflicts.Tested
Windows 11, WinLibs MinGW-w64 GCC 15.2.0 UCRT/POSIX/SEH, Ninja Release,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON; updated to maind70b89989473ba1f6ae13e44e079e67f1f8a44b0.The complete default project build succeeded on the combined validation tree containing these two independent PRs. Seven focused tests passed:
guest_hostname,guest_errors,guest_standard_streams,bitfield_mask,agc_driver_bitfield_mask,agc_driver_scalar_sop2, andagc_driver_vop3_integer_alu. The four shader tests also passed withAPS5_SPIRV_OPT=fullandnone.ANYPS5_REQUIRE_VULKAN=1required actual GPU execution on the AMD Radeon RX 9070 XT. Conventions, whitespace and test registration checks passed. The complete CTest suite was not run.bitfield_maskchecks 32,768 translation/constant-folding cases.agc_driver_bitfield_maskexecutes 4,096 scalar/vector input pairs, checks SCC=0 and SCC=1 preservation and passes in all three optimization modes. Shader lowering is unchanged from the previously reviewed head. The updated GPU fixture has not been rerun on Linux. The earlier independent Linux/NVIDIA/RADV report applies to the previous head.Expected results come from the ISA; native RDNA hardware-oracle measurements and game compatibility remain unverified and recorded in
docs/dev/TechnicalDebt.md. Decoder coverage is unchanged.Checklist