Repository navigation
Shaders: lower signed nibble offsets through Ibfe - #3725
Open
Ingenioeren wants to merge 1 commit into
Open
Ingenioeren wants to merge 1 commit into
Ingenioeren wants to merge 1 commit into
Conversation
|
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
AI-assisted (Hy4 flash). |
|
Hardware run: RX 5700 XT (Navi 10, RDNA1, 32–64 lanes, driver 32.0.21045.29003, Windows 11 26200), head
AI use: Claude Code (Claude Opus 5.5). |
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.
v_cvt_off_f32_i4currently sign-extends its low nibble with two shifts. Use DXILIbfe(4, 0, src)instead, keeping the conversion to f32, division by 16, output modifiers and EXEC handling. The conversion expression falls from four instructions to three; both dynamic-input synthetic VOP1/VOP3 shaders fall from 19 written DXIL instructions to 18 (5.3%). This measures emitted code, with no GPU-time or frame-rate claim.Ibfe sign-extends the selected field, so all upper input bits remain ignored and the sixteen signed fractions remain exact. This optimizes the implementation introduced by #1391. Searches across all 1,804 open PR titles/bodies and targeted open/closed searches found no competing offset-conversion optimization; the signed-nibble dot-product and BCPack-test PRs concern different operations.
The execution regression checks 10,112 inputs across 36 forms: both encodings, every output-scale/clamp combination, separate and overlapping destinations, and full/partial EXEC. A wide-integer arithmetic reference supplies exact f32 bit patterns and checks inactive destination preservation. All 364,032 cases per adapter matched on RX 6750 XT and WARP before and after, with zero adapter differences; the emitted shaders validate with dxil.dll.
Validation on fresh
origin/main63bcca4, Windows x64, Rust 1.98.1:cargo test --locked --offline -p victory-shader nibble_offset_ -- --nocapture --test-threads=1fails the count assertion at[19, 19]versus[18, 18]; the behavior regression passes. Both pass after the lowering change.cargo test --locked --offline -p victory-shader --lib -- --test-threads=1: baseline 300 passed / 2 failed / 3 ignored.cargo test --locked --offline -p victory-shader --no-fail-fast -- --test-threads=1: branch 302 passed / the same 2 failed / 3 ignored; integration 3 passed / 1 ignored; doc tests 0. The existing failures arerectangles_get_their_fourth_cornerandelements_sharing_a_row_keep_their_order, both local Pipeline State Validation mismatches.cargo clippy --locked --offline -p victory-shader --all-targets --all-features -- -D warnings: passes on clean baseline and branch.cargo run --locked --offline -p xtask -- policy --staged: passes (3 changed files).git diff --checkpasses; changed files retain exactly main's existing formatting deviations.The instruction counter is the same test-only helper used in #3722 and the preceding lowering PRs; keep one copy when integrating. No game files, extracted shaders or game execution were used. No new graphics/mesh, wave64, RADV/vkd3d runtime or frame-time validation; this does not resolve the separate RADV compiler-hang hold on #3027.
AI assistance: prepared with OpenAI Codex, reviewed by Ingenioeren.