Repository navigation
Recompiler: saturate packed unsigned dot8 without i64 - #2221
Open
luckyteagirl wants to merge 2 commits into
Open
luckyteagirl wants to merge 2 commits into
luckyteagirl wants to merge 2 commits into
Conversation
luckyteagirl
marked this pull request as ready for review
November 25, 2026 10:19
Member
|
|
luckyteagirl
force-pushed
the
codex/dot8-clamp-32
branch
from
November 25, 2026 11:51
4830018 to
d528390
Compare
Add Shader::dot4_add_u8_packed (dx.op.dot4AddPacked, opcode 164) and lower unclamped v_dot8_u32_u4 by splitting even and odd 4-bit nibbles into two packed byte quads and chaining two Dot4AddU8Packed calls. Leave clamped v_dot8_u32_u4 on the 64-bit saturating dot_n path. Part of xcl-dev#1269 Assisted-by: Antigravity (Gemini 4 Neon)
The unsigned four-bit dot products total at most 1800. The clamped path can accumulate that bounded sum with Dot4AddU8Packed and saturate c + sum using a 32-bit carry check. This avoids the old wide-sum DXIL that suspends the RX 6800M device in the focused GPU fixture. Add an isolated clamped overflow regression alongside the existing combined edge cases.
luckyteagirl
force-pushed
the
codex/dot8-clamp-32
branch
from
November 25, 2026 12:08
d528390 to
404cde3
Compare
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.
Part of #1269. This is stacked on #2173: rebased parent commit
5ca41ebretains Normal1919's authorship; this PR's change is404cde36a101d3502504f679db7e6528b08dc19a. Both commits are rebased onto main1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6so CI can run. The latest conflicts incrates/xcl/src/gpu/dxil/core_tests.rsandcrates/xcl/src/gpu/recomp/tests.rswere test additions; all tests are retained.On the RX 6800M, the previous clamped
v_dot8_u32_u4direct-DXIL path suspended the device at compute PSO creation, while #2173's unclamped path ran in isolation. The eight unsigned nibble products sum to at most 1,800, so the clamped form can accumulate them in 32 bits and saturate the addition to the accumulator without the old 64-bit sum.What changed
crates/xcl/src/gpu/dxil/lower_wide.rs: use packed dot calls for clamped and unclamped unsigned dot8; for clamped, add the bounded product sum tocand selectu32::MAXon unsigned overflow.crates/xcl/src/gpu/recomp/tests.rs: add an isolated clamped GPU regression for zero, exact maximum, and overflow.core_tests.rsexpects the clamped form to emit the packed calls.Tested
30.0.13002.13003; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5.cargo build --locked --workspace -j 2andcargo build --locked --release --workspace -j 2passed on the clean head.git diff --checkpassed.XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=wave64,cargo test --locked -p xcl --lib -j 2 dot8_u32_u4 -- --test-threads=1 --show-outputpassed 3/0/0, no skips, forXCL_DIRECT_DXIL=1; the same filter passed 3/0/0, no skips, forXCL_DIRECT_DXIL=0. The GPU fixtures cover native wave64 and wave32; the third test checks emitted DXIL.cargo test --locked --workspace --no-fail-fast -j 2 -- --test-threads=4 --show-output, withXCL_ADAPTER=6800M,XCL_DIRECT_DXIL=1: current main1a0bbe3had 1012 passed, 169 failed, 26 ignored in the library; this head had 1013 passed, 172 failed, 26 ignored. Both also failed the sameoffline_compute_pipeline_is_reused_by_a_second_processintegration test. Isolated Cargo targets were used. Three library failure names were added: the parent'sdot4_add_u8_packed_matches_cpuand the two dot8 GPU fixtures. All three failed atCreateComputePipelineStateafter device suspension0x887A0005, while the dot8 fixtures passed in the focused runs. This broad run is not green on this driver.CreateComputePipelineStateon this RX 6800M. With local test-only isolation, the old clamped shader failed and DXIL: lower unclamped v_dot8_u32_u4 using Dot4AddU8Packed #2173's unclamped shader passed both wave sizes. Those diagnostic edits were restored before the PR was published.Regression run
Same owned title, 12 seconds each, default translation mode, separate data/cache directories. Both completed without the external memory guard firing. The title run did not show a dot8 dispatch, so the focused GPU fixture is the direct opcode check.
Main:
This PR:
Not tested
AI use
OpenAI Codex (GPT-6; exact variant not exposed in this session) investigated the RX 6800M failure, wrote the 32-bit clamp and regression test, rebased both commits while preserving the parent author's attribution, ran the native Windows builds, GPU tests, workspace comparison and guarded smoke run, and drafted this description. No game data was committed.