Shaders: lower the console's scalar bit searches (s_flbit_i32_b64, s_ff0_i32_b32/b64) #233
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/233"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from fxceless/victory-fork. Originally posted by pablogonz12 on 2026-11-24T22:52:54Z.
Setup: RX 9070 XT (RDNA4), RADV Mesa 26.3.1, Linux, GE-Proton11-14, Series X files.
The decoder names
s_flbit_i32_b64,s_ff0_i32_b32,s_ff0_i32_b64(and the dwordwidths in
gfx10/fields.rsknow their 64-bit sources), but the scalar lowering has noarms for them: they fall through to the catch-all and a shader containing one is refused
whole. This adds them in DXIL
unaryBits, as TuxBox does: the 64-bit searches test thehigh word first and continue 32 past the low word's own result, −1 for a zero pair
(
s_flbit) or an all-ones pair (s_ff0); none writes SCC.Complements #171 (GeaorgeAyvazov), which lowers
s_bcnt0_i32_b32/b64; that family isleft out here so the two changes do not both touch it.
Adapted from TuxBox (brcly/TuxBox, Apache-2.0, commit 1a50eb9 "shader: restore
s_flbit_i32_b64 and s_ff0_i32 lowering dropped by a merge", Copyright (c) 2026 the TuxBox
authors);
NOTICEadded. Not ported:s_flbit_i32_i64, which TuxBox guards but does notlower either.
On an RX 9070 XT this changes 0 of our 751 world programs and 0 of the 25,586 archive
programs (all 767 emitted DXIL containers byte-identical); it is for the console
programs that carry these instructions, which our captures do not contain. Tests: a
Windows/WARP + hardware oracle for the three against the console's answers, and a
platform-neutral test whose hand-assembled encodings decode to the three names (refused
before).
cargo clippy --workspace --all-targets [--all-features] -- -D warningsclean.AI-assisted: written and tested with an AI coding agent; the port was compared
against TuxBox's source by hand.
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T22:53:01Z.
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
We couldn’t complete this review. Comment
@codex reviewto try again.4db8615ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T22:53:03Z.
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
Imported from fxceless/victory-fork. Originally posted by HAL9000RELOADED on 2026-11-25T19:29:53Z.
RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main
d510ee4: both new tests pass on the card with this PR. With the tests alone on the base,scalar_bit_searches_match_the_consolefails (the other test is inline). No other test changed. Run table: #129 (https://github.com/fxceless/victory-fork/pull/129#issuecomment-7172358511).Imported from fxceless/victory-fork. Originally posted by pablogonz12 on 2026-11-27T10:38:47Z.
Merged main
9a9091d18in (7ba3e3d8), so the branch is mergeable again. The only conflict was the lowering tests: main moved them tolower_tests.rsand already carriesscalar_bit_tests_lowerthere, so the inline module goes andscalar_bit_searches_lowermoves next to it unchanged. The lowering itself auto-merged.On RX 9070 XT (Mesa 26.3.1 RADV, GE-Proton11-14 Wine, windows target):
victory-shaderlib 253 passed, 1 failed -emit::tests::stub_pipeline_is_created, which also fails here before this merge (this prefix has nodxil.dll, so the stub validator accepts an all-zero digest). The three scalar-bit tests pass.clippy --workspace --all-targetsis clean apart from new lints invalu_tests.rsthat main brings in unchanged.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.