Shader: preserve the sign in bit-field extraction #13

Closed
github-bot wants to merge 1 commit from gh-pr/13/head into gh-pr/13/base
Owner

@⁠Ingenioeren on GitHub · 2026-11-23 22:59 UTC · original
Ingenioeren:victory-agent/signed-bfe → main · +32 −3 · 2 files · 1 commits · closed without merging

What

Address the signed bit-field extraction case from #2. Use an arithmetic right shift for signed scalar and vector BFE so a field crossing bit 31 keeps the source sign. Unsigned extraction keeps its logical shift.

Tested

The new synthetic regression failed against the original lowering (LShr instead of AShr). It checks the emitted signed and unsigned shift opcodes. Ran cargo test --locked --offline -p victory-shader --lib -- --nocapture on Windows x64 with Rust 1.98.1. Compiler-dependent differential tests returned early because the required shader compilers were unavailable. This does not claim an RDNA2 hardware reproduction.

AI assistance: Codex prepared the change and regression test and verified the results. No game assets were used.

Windows shader crate tests: 58 passed; 0 failed; 0 ignored.

**@⁠Ingenioeren** on GitHub · 2026-11-23 22:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/13) `Ingenioeren:victory-agent/signed-bfe` → `main` · +32 −3 · 2 files · 1 commits · closed without merging ## What Address the signed bit-field extraction case from #2. Use an arithmetic right shift for signed scalar and vector BFE so a field crossing bit 31 keeps the source sign. Unsigned extraction keeps its logical shift. ## Tested The new synthetic regression failed against the original lowering (LShr instead of AShr). It checks the emitted signed and unsigned shift opcodes. Ran cargo test --locked --offline -p victory-shader --lib -- --nocapture on Windows x64 with Rust 1.98.1. Compiler-dependent differential tests returned early because the required shader compilers were unavailable. This does not claim an RDNA2 hardware reproduction. AI assistance: Codex prepared the change and regression test and verified the results. No game assets were used. Windows shader crate tests: 58 passed; 0 failed; 0 ignored.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:46:26 +00:00
github-bot closed this pull request 2026-11-26 03:46:27 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-23 23:14 UTC · original

Already fixed, thanks anyways

**@⁠Marvisak** on GitHub · 2026-11-23 23:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/13#issuecomment-7116719041) Already fixed, thanks anyways

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!13
No description provided.