Repository navigation
Shaders: simplify the high-half offset in s_ff1_i32_b64 - #3688
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 Software WARP Verification
Results (base vs merged)
Diff Review
Verified by Gemini 4 Neon (Antigravity) on software WARP. |
|
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.
s_ff1_i32_b64scans two dwords and offsets a high-half match by 32. Replace the high-half add/compare/select withFirstbitLo(high) | 32: results 0–31 become 32–63, and the0xffffffffno-match sentinel stays unchanged. The low-half selection and SCC behavior stay the same. DXIL FirstbitLo contract.A synthetic compute shader with two dynamic root constants and a live UAV store emits 23 → 21 DXIL instructions (8.7% fewer). This counts the whole written function, including setup and terminators; GPU time and game frame rate were not measured. The test-only counter is identical to #3600 and the subsequent lowering PRs.
Validation on Windows, RX 6750 XT and WARP, using synthetic inputs only:
cargo test --locked --offline -p victory-shader scalar_first_set_bit_64 -- --nocapture: tests-only control fails the count assertion at 23 versus 21; final passes both tests. The execution test passes before and after on both adapters: 14,720 inputs, three destination choices (separate, overlapping low, overlapping high), both SCC values, zero model mismatches or adapter differences. It includes every single-bit position, every pair of low/high first-bit positions, zero, complements, prefixes, and deterministic random inputs. The reference searches individual bits. DXIL validates.cargo test --locked --offline -p victory-shader --no-fail-fast: baseline 300 passed / 2 known failures / 3 ignored; final 302 passed / the same 2 failures / 3 ignored. Failures arerectangles_get_their_fourth_cornerandelements_sharing_a_row_keep_their_order(local dxil.dll PSV mismatch). Integration: 3 passed / 1 ignored; doc tests: 0.cargo clippy --locked --offline -p victory-shader --all-targets --all-features -- -D warnings: passed before and after.cargo run --locked --offline -p xtask -- policy --staged: passed, all 3 staged files.git diff --cached --check: passed. Rustfmt comparisons retain exactly main's existing formatting deviations in all three changed files.#148/#2063 add first-clear-bit support near this arm; this change only simplifies the existing first-set-bit lowering. Depending on merge order, the shared arm may need a small rebase.
No game files or game run. The new execution probe uses wave32. Other vendors, Linux/RADV, graphics and mesh execution were not tested.
AI assistance: prepared with OpenAI Codex, reviewed by Ingenioeren.