Shaders: fold inverse i32 and f32 bitcasts #3729
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3729"
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 Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T12:22:51Z.
When an
i32/f32bitcast immediately reverses a previous numeric bitcast, use the original value. If the intermediate value has no other readers, the existing liveness pass omits it. The regression covers both directions and an intermediate that still has a reader. LLVM bitcast semanticsOn Windows WARP with Agility, three generated shaders matched their 256 expected output words each on both exact main and this change. The fixtures combine float additions with zero, one, or sixteen bitwise moves. DXC reports:
These are emitted-code counts. Runtime GPU and title performance remain unmeasured. The bitcode suite passed 13 tests with one benchmark ignored. Strict shader Clippy and the asset policy passed.
Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T12:26:52Z.
The exact
5f57f5ehead passed Windows CI, including workspace tests and both Clippy configurations. The three generated programs matched all 768 expected output words on Windows WARP with Agility. The 16-move fixture emitted 52 instructions instead of 104, and its container shrank from 2,616 to 2,384 bytes.Next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T12:37:07Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
5f57f5ebdf6423c99b3742dabdd0b33d10513883, base/parent63bcca43c6a00a758510398fa43096ce7e4f7df0.cargo test --locked -p victory-shader --lib -- emit::bitcode::tests::inverse_i32_f32_bitcasts_reuse_the_original_values --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 305 filtered, exit 0.git grep -Ffor the test name on the base returned no match (test is new on this PR);git diff --check 63bcca4 HEADclean (1 file, +40/-0).CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2.AI-assisted (Hy4 flash).
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.