Shaders: lower s_bfe_u64, s_bfe_i64 and s_bfm_b64 #1395

Open
AnoHunted wants to merge 2 commits from upstream-pr/1395 into main
AnoHunted commented 2026-11-24 17:42:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AnoHunted on 2026-11-24T17:42:54Z.


What

The scalar 64-bit lowering path refused s_bfe_u64, s_bfe_i64 and s_bfm_b64. They now lower:

  • s_bfe_u64 / s_bfe_i64: the field is (src0 >> src1[5:0]) & ((1 << src1[22:16]) - 1); the signed form sign-extends from the field's top bit (width 0 gives 0). SCC is set to whether the result is nonzero.
  • s_bfm_b64: ((1 << src0[5:0]) - 1) << src1[5:0]. It does not write SCC, so SCC keeps its earlier value.

A width of 64 or more (and a field running past bit 63) is not defined by the ISA; it takes every bit, with shift amounts masked, so the lowering cannot go out of range. No test depends on that case. The 32-bit s_bfm_b32 is left as it is.

Why

A shader using any of these three failed to translate. They are the 64-bit counterparts of s_bfe_u32/s_bfe_i32/s_bfm_b32, which already lower.

Related PRs: #163 and #231 contained these ops but are not on main. #447 (64-bit literal sign extension) touches the same function but not these arms; this change is made on current main and does not depend on it. #166 covers different 64-bit bit ops.

Tested

Windows 11, NVIDIA GeForce RTX 5080, Rust 1.98.1 (hardware and WARP):

  • cargo test -p victory-shader --features host -- --test-threads=1: main 120 passed, 0 failed, 1 ignored; branch 123 passed, 0 failed, 1 ignored (3 new tests).
  • s_bfe_64_extracts_and_sets_scc: runs both ops on the GPU for low dword, high dword and SCC (e.g. 0xFEDCBA9876543210, offset 32, width 16 gives 0xBA98 unsigned and 0xFFFFFFFFFFFFBA98 signed; zero field gives 0 and SCC 0).
  • s_bfm_b64_builds_a_mask_and_keeps_scc: masks such as width 40 / offset 8 give 0x0000FFFFFFFFFF00, and SCC set by an s_cmp before the instruction is read back unchanged afterwards (both 0 and 1, including a nonzero mask).
  • scalar_64_bit_field_ops_lower: hand-assembled encodings lower.

AMD hardware: not tested.

Not tested

  • Widths of 64 and above, and fields past bit 63 (undefined by the ISA).
  • Real AMD hardware.

No game files were used.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6587865902 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1395). Originally posted by [AnoHunted](https://github.com/AnoHunted) on 2026-11-24T17:42:54Z. --- ## What The scalar 64-bit lowering path refused `s_bfe_u64`, `s_bfe_i64` and `s_bfm_b64`. They now lower: - `s_bfe_u64` / `s_bfe_i64`: the field is `(src0 >> src1[5:0]) & ((1 << src1[22:16]) - 1)`; the signed form sign-extends from the field's top bit (width 0 gives 0). SCC is set to whether the result is nonzero. - `s_bfm_b64`: `((1 << src0[5:0]) - 1) << src1[5:0]`. It does not write SCC, so SCC keeps its earlier value. A width of 64 or more (and a field running past bit 63) is not defined by the ISA; it takes every bit, with shift amounts masked, so the lowering cannot go out of range. No test depends on that case. The 32-bit `s_bfm_b32` is left as it is. ## Why A shader using any of these three failed to translate. They are the 64-bit counterparts of `s_bfe_u32`/`s_bfe_i32`/`s_bfm_b32`, which already lower. Related PRs: #163 and #231 contained these ops but are not on main. #447 (64-bit literal sign extension) touches the same function but not these arms; this change is made on current main and does not depend on it. #166 covers different 64-bit bit ops. ## Tested Windows 11, NVIDIA GeForce RTX 5080, Rust 1.98.1 (hardware and WARP): - `cargo test -p victory-shader --features host -- --test-threads=1`: main 120 passed, 0 failed, 1 ignored; branch 123 passed, 0 failed, 1 ignored (3 new tests). - `s_bfe_64_extracts_and_sets_scc`: runs both ops on the GPU for low dword, high dword and SCC (e.g. `0xFEDCBA9876543210`, offset 32, width 16 gives `0xBA98` unsigned and `0xFFFFFFFFFFFFBA98` signed; zero field gives 0 and SCC 0). - `s_bfm_b64_builds_a_mask_and_keeps_scc`: masks such as width 40 / offset 8 give `0x0000FFFFFFFFFF00`, and SCC set by an `s_cmp` before the instruction is read back unchanged afterwards (both 0 and 1, including a nonzero mask). - `scalar_64_bit_field_ops_lower`: hand-assembled encodings lower. AMD hardware: not tested. ## Not tested - Widths of 64 and above, and fields past bit 63 (undefined by the ISA). - Real AMD hardware. No game files were used.
catminou4 commented 2026-11-24 18:05:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T17:52:33Z.

Review: APPROVED


s_bfe_u64/s_bfe_i64/s_bfm_b64 lowering. The bfe packing (offset[5:0], width[22:16] with 7-bit width) matches the SOP2 encoding; width >= 64 takes the all-ones mask path, signed sign-extension is skipped for width 0/full, and SCC is set from the 64-bit nonzero — all verified by the 12-case hardware test including width-0 and sign cases. s_bfm_b64 correctly leaves SCC untouched (pinned by test). The macOS lowering test runs green. Local verification: macOS arm64, rustc 1.98.1, PR head merged into main ffe310e, cargo test -p victory-shader --locked. Shader execution tests (valu_tests/host/diff_tests) are #[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. 97 passed, 0 failed.

<!-- greyfinch-sync:Marvisak/VIctory:review:6044527744 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1395#pullrequestreview-6044527744). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T17:52:33Z. **Review:** APPROVED --- s_bfe_u64/s_bfe_i64/s_bfm_b64 lowering. The bfe packing (offset[5:0], width[22:16] with 7-bit width) matches the SOP2 encoding; width >= 64 takes the all-ones mask path, signed sign-extension is skipped for width 0/full, and SCC is set from the 64-bit nonzero — all verified by the 12-case hardware test including width-0 and sign cases. s_bfm_b64 correctly leaves SCC untouched (pinned by test). The macOS lowering test runs green. Local verification: macOS arm64, rustc 1.98.1, PR head merged into main ffe310e, `cargo test -p victory-shader --locked`. Shader execution tests (valu_tests/host/diff_tests) are `#[cfg(all(test, windows))]`, so macOS covers lowering/decode/unit tests only. 97 passed, 0 failed.
dcastell1 commented 2026-11-24 18:05:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by dcastell1 on 2026-11-24T17:51:18Z.


Verified on native Windows (no Wine): NVIDIA GeForce RTX 5090 (driver 621.24), Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build. main@ffe310e baseline on this box: 342 passed, 0 failed, 6 ignored.

cargo test --workspace
345 passed; 0 failed; 6 ignored   (exit 0)

Three more than the baseline; s_bfe_u64, s_bfe_i64 and s_bfm_b64 lowering ships its cases and they run green.

Tree restored afterwards (full diff against a clean checkout); no game data, the tests are synthetic. AI-assisted (opencode): applied the patch to a built tree, ran cargo test --workspace, reverted it.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139800626 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1395#issuecomment-7139800626). Originally posted by [dcastell1](https://github.com/dcastell1) on 2026-11-24T17:51:18Z. --- Verified on native Windows (no Wine): NVIDIA GeForce RTX 5090 (driver 621.24), Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build. `main@ffe310e` baseline on this box: **342 passed, 0 failed, 6 ignored**. ``` cargo test --workspace 345 passed; 0 failed; 6 ignored (exit 0) ``` Three more than the baseline; `s_bfe_u64`, `s_bfe_i64` and `s_bfm_b64` lowering ships its cases and they run green. Tree restored afterwards (full diff against a clean checkout); no game data, the tests are synthetic. AI-assisted (opencode): applied the patch to a built tree, ran `cargo test --workspace`, reverted it.
matheusfermiano-source commented 2026-11-24 19:04:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by matheusfermiano-source on 2026-11-24T18:08:50Z.


An AMD run, since the PR says AMD hardware was not tested; under Proton on Linux: scalar_64_bit_field_ops_lower, s_bfe_64_extracts_and_sets_scc, s_bfm_b64_builds_a_mask_and_keeps_scc pass on both GPUs.

  • Head a91e9ad. Built on Linux with llvm-mingw for x86_64-pc-windows-gnullvm (Rust 1.98.1) and run under Proton Experimental (11.0-20261027b) with its vkd3d-proton 3.1.0, one GPU at a time; dxil.dll from DXC 1.9.2609 was loaded, so the test modules were validated.
  • Radeon 660M (RDNA2, RADV Mesa 26.3.1, waves 32..64): whole victory-shader suite 122 passed, 1 failed, 1 ignored. Nothing fails that passes on main (ffe310e). The one failure, emit::tests::stub_pipeline_is_created, fails on main here too: vkd3d-proton accepts the zeroed DXIL hash that the Windows runtime refuses (one of the Wine failures listed in #1218).
  • RTX 3050 Laptop (NVIDIA 620.73.04, waves 32..32), whole suite: 122 passed, 1 failed (same failure as on main).

This is RADV, not AMD's Windows driver, so it adds to a Windows run rather than replacing it. Synthetic tests only, no game files. AI-assisted (Claude Code, Opus 5.5); every run was on this machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140225096 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1395#issuecomment-7140225096). Originally posted by [matheusfermiano-source](https://github.com/matheusfermiano-source) on 2026-11-24T18:08:50Z. --- An AMD run, since the PR says AMD hardware was not tested; under Proton on Linux: **`scalar_64_bit_field_ops_lower`, `s_bfe_64_extracts_and_sets_scc`, `s_bfm_b64_builds_a_mask_and_keeps_scc` pass** on both GPUs. - Head `a91e9ad`. Built on Linux with llvm-mingw for `x86_64-pc-windows-gnullvm` (Rust 1.98.1) and run under Proton Experimental (11.0-20261027b) with its vkd3d-proton 3.1.0, one GPU at a time; `dxil.dll` from DXC 1.9.2609 was loaded, so the test modules were validated. - **Radeon 660M** (RDNA2, RADV Mesa 26.3.1, waves 32..64): whole `victory-shader` suite 122 passed, 1 failed, 1 ignored. Nothing fails that passes on `main` (`ffe310e`). The one failure, `emit::tests::stub_pipeline_is_created`, fails on `main` here too: vkd3d-proton accepts the zeroed DXIL hash that the Windows runtime refuses (one of the Wine failures listed in #1218). - **RTX 3050 Laptop** (NVIDIA 620.73.04, waves 32..32), whole suite: 122 passed, 1 failed (same failure as on main). This is RADV, not AMD's Windows driver, so it adds to a Windows run rather than replacing it. Synthetic tests only, no game files. AI-assisted (Claude Code, Opus 5.5); every run was on this machine.
wwwwwwww3333333 commented 2026-11-24 20:03:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by wwwwwwww3333333 on 2026-11-24T19:14:51Z.


Native Windows run on AMD RDNA2: RX 6750 XT (RDNA2, gfx1031), AMD driver 32.0.21045.29003, i5-13400F, Windows 11, Rust 1.98.1 MSVC. Head a91e9ad on main ffe310e (clean merge).

cargo test -p victory-shader --lib -- --test-threads=1: 123 passed, 0 failed, 1 ignored (main alone: 120 passed). s_bfe_64_extracts_and_sets_scc, s_bfm_b64_builds_a_mask_and_keeps_scc ran on the hardware adapter and then on WARP, and passed on both. scalar_64_bit_field_ops_lower passes too. The earlier AMD run here was under Proton; this one is AMD's own D3D12 driver.

Synthetic tests only, no game files. AI-assisted (Claude picked the PRs and wrote the batch script; I ran it on my machine).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7141817465 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1395#issuecomment-7141817465). Originally posted by [wwwwwwww3333333](https://github.com/wwwwwwww3333333) on 2026-11-24T19:14:51Z. --- Native Windows run on AMD RDNA2: RX 6750 XT (RDNA2, gfx1031), AMD driver 32.0.21045.29003, i5-13400F, Windows 11, Rust 1.98.1 MSVC. Head a91e9ad on main ffe310e (clean merge). `cargo test -p victory-shader --lib -- --test-threads=1`: **123 passed, 0 failed**, 1 ignored (main alone: 120 passed). `s_bfe_64_extracts_and_sets_scc`, `s_bfm_b64_builds_a_mask_and_keeps_scc` ran on the hardware adapter and then on WARP, and passed on both. `scalar_64_bit_field_ops_lower` passes too. The earlier AMD run here was under Proton; this one is AMD's own D3D12 driver. Synthetic tests only, no game files. AI-assisted (Claude picked the PRs and wrote the batch script; I ran it on my machine).
sinan-cmyk commented 2026-11-24 21:03:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-24T20:44:13Z.


Offline measurement on a retail dump, and the shader tests on Ada

Result: no count change against main.

Offline. I merged head a91e9ad onto main ffe310e (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 21,724 on main, 21,724 with this PR.

No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on main. The count shows that the change rejects nothing. It does not show whether the output is right.

Tests: with the same merge, cargo test --locked -p victory-shader --lib passed 123, failed 0. The bitcode benchmark is ignored, as on main, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, with VICTORY_WARP unset.

No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7143988285 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1395#issuecomment-7143988285). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-24T20:44:13Z. --- ### Offline measurement on a retail dump, and the shader tests on Ada **Result: no count change against `main`.** **Offline.** I merged head a91e9ad onto `main` ffe310e (clean merge) and ran `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with `main` program by program (25,889 programs). Validated: 21,724 on `main`, 21,724 with this PR. No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on `main`. The count shows that the change rejects nothing. It does not show whether the output is right. **Tests:** with the same merge, `cargo test --locked -p victory-shader --lib` passed 123, failed 0. The bitcode benchmark is ignored, as on `main`, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, with `VICTORY_WARP` unset. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 03:03:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T02:38:01Z.


Automated triage for the maintainers. Recommended for a maintainer's look: this lowers s_bfe_u64, s_bfe_i64 and s_bfm_b64 (SOP2 0x29, 0x2a, 0x25) in the scalar 64-bit arm of lower.rs, which main refuses today. I checked the arms against the RDNA2 ISA (offset in bits 5:0, width in bits 22:16, SCC = result nonzero for s_bfe, SCC untouched by s_bfm), the hand-assembled encodings in scalar_64_bit_field_ops_lower, and the expected values in the GPU tests; contributors report the tests passing on NVIDIA and AMD (native and vkd3d-proton). CI fails only on synthetic_tests::gathers_at_a_level_match_the_hardware and permutes_read_the_lane_named_and_zero_from_lanes_left_out, which this PR does not touch and which fail the same way on other PRs against current main. Small nit: there is a doubled blank line after s_bfm_b64_builds_a_mask_and_keeps_scc in valu_tests.rs.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150976987 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1395#issuecomment-7150976987). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T02:38:01Z. --- <!-- victory-triage v1 head=a8299456fc126459f075b5ba2b5f2131544c165a verdict=merge-candidate at=2026-11-25T02:20:29Z --> Automated triage for the maintainers. Recommended for a maintainer's look: this lowers s_bfe_u64, s_bfe_i64 and s_bfm_b64 (SOP2 0x29, 0x2a, 0x25) in the scalar 64-bit arm of `lower.rs`, which main refuses today. I checked the arms against the RDNA2 ISA (offset in bits 5:0, width in bits 22:16, SCC = result nonzero for s_bfe, SCC untouched by s_bfm), the hand-assembled encodings in `scalar_64_bit_field_ops_lower`, and the expected values in the GPU tests; contributors report the tests passing on NVIDIA and AMD (native and vkd3d-proton). CI fails only on `synthetic_tests::gathers_at_a_level_match_the_hardware` and `permutes_read_the_lane_named_and_zero_from_lanes_left_out`, which this PR does not touch and which fail the same way on other PRs against current main. Small nit: there is a doubled blank line after `s_bfm_b64_builds_a_mask_and_keeps_scc` in `valu_tests.rs`. --- _Generated by [Claude Code](https://claude.ai/code)_
astrosteveo commented 2026-11-25 06:01:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by astrosteveo on 2026-11-25T05:43:55Z.

Review: APPROVED


Read the diff at a829945 and ran cargo test -p victory-shader --lib merged onto main 940d32f (no conflicts): Arch Linux, Wine 11.22, vkd3d-proton, RTX 5080, driver 620.73.04. main gives 243 passed and 4 failed there (host limits), this PR 246 passed and the same 4. The three more are scalar_64_bit_field_ops_lower, s_bfe_64_extracts_and_sets_scc and s_bfm_b64_builds_a_mask_and_keeps_scc.

The lowering matches the RDNA2 ISA as I read it: offset in bits 5:0, width in bits 22:16, SCC from the result for s_bfe and untouched by s_bfm.

The red CI looks unrelated. That run (00:50 UTC) failed only gathers_at_a_level_match_the_hardware and permutes_read_the_lane_named_and_zero_from_lanes_left_out, which main has skipped on machines without a GPU since #1911 and #1925. A push or "Update branch" should give a fresh result; a re-run keeps the old merge commit. Not checked: that Windows CI then passes.


Co-Authored-By: Claude Opus 5.5 <[email protected]>

<!-- greyfinch-sync:Marvisak/VIctory:review:6052439785 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1395#pullrequestreview-6052439785). Originally posted by [astrosteveo](https://github.com/astrosteveo) on 2026-11-25T05:43:55Z. **Review:** APPROVED --- Read the diff at `a829945` and ran `cargo test -p victory-shader --lib` merged onto `main` `940d32f` (no conflicts): Arch Linux, Wine 11.22, vkd3d-proton, RTX 5080, driver 620.73.04. `main` gives 243 passed and 4 failed there (host limits), this PR 246 passed and the same 4. The three more are `scalar_64_bit_field_ops_lower`, `s_bfe_64_extracts_and_sets_scc` and `s_bfm_b64_builds_a_mask_and_keeps_scc`. The lowering matches the RDNA2 ISA as I read it: offset in bits 5:0, width in bits 22:16, SCC from the result for `s_bfe` and untouched by `s_bfm`. The red CI looks unrelated. That run (00:50 UTC) failed only `gathers_at_a_level_match_the_hardware` and `permutes_read_the_lane_named_and_zero_from_lanes_left_out`, which `main` has skipped on machines without a GPU since #1911 and #1925. A push or "Update branch" should give a fresh result; a re-run keeps the old merge commit. Not checked: that Windows CI then passes. --- <sub>Co-Authored-By: Claude Opus 5.5 &lt;[email protected]&gt;</sub>
fuzeofficlal commented 2026-11-26 02:06:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:08:21Z.


Code review and RTX 5090 + WARP + DXIL verification at head a8299456fc12 merged onto main (63bcca43c6a0):

  • 512 KiB file-size policy blocker (xtask):
    • Code merges cleanly, but crates/victory-shader/src/emit/lower.rs reaches 526,300 bytes (+2,012 B over the 524,288-byte limit), causing cargo xtask policy to fail (rc=1). Moving these 64-bit bitfield helpers into a submodule under emit/lower/ will clear the policy check with headroom.
  • Lowering & edge-case audit (lower.rs:3816-3922):
    • s_bfe_u64/s_bfe_i64 mask off = n & 63, w = (n >> 16) & 127, handle full = w >= 64 and w == 0 cleanly (skipping sign-extension on full | (w == 0) while using AShr/LShr and (64 - w) & 63 shifts in-range), and set SCC via 64-bit nonzero(rl, rh).
    • s_bfm_b64 masks both src0[5:0] and src1[5:0] and leaves SCC untouched.
  • Verified (Windows 11, NVIDIA RTX 5090 + WARP, dxil.dll 10.0.26100.0, Rust 1.98.1):
    • cargo xtask policy: FAIL (lower.rs: 526300 bytes exceeds the 524288-byte limit)
    • cargo clippy --locked -p victory-shader --tests -- -D warnings: 0 warnings
    • scalar_64_bit_field_ops_lower s_bfe_64 s_bfm_b64: 3/3 passed across RTX 5090 (hardware) and WARP (warp + explicit VICTORY_WARP=1 2/2).

Lowering and hardware tests are solid — just needs extracting out of lower.rs to pass xtask policy.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179471319 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1395#issuecomment-7179471319). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T01:08:21Z. --- Code review and RTX 5090 + WARP + DXIL verification at head `a8299456fc12` merged onto `main` (`63bcca43c6a0`): - **512 KiB file-size policy blocker (`xtask`)**: - Code merges cleanly, but `crates/victory-shader/src/emit/lower.rs` reaches **`526,300` bytes** (`+2,012` B over the `524,288`-byte limit), causing `cargo xtask policy` to fail (`rc=1`). Moving these 64-bit bitfield helpers into a submodule under `emit/lower/` will clear the policy check with headroom. - **Lowering & edge-case audit (`lower.rs:3816-3922`)**: - `s_bfe_u64`/`s_bfe_i64` mask `off = n & 63`, `w = (n >> 16) & 127`, handle `full = w >= 64` and `w == 0` cleanly (skipping sign-extension on `full | (w == 0)` while using `AShr`/`LShr` and `(64 - w) & 63` shifts in-range), and set `SCC` via 64-bit `nonzero(rl, rh)`. - `s_bfm_b64` masks both `src0[5:0]` and `src1[5:0]` and leaves `SCC` untouched. - **Verified (Windows 11, NVIDIA RTX 5090 + WARP, `dxil.dll` 10.0.26100.0, Rust 1.98.1)**: - `cargo xtask policy`: **FAIL** (`lower.rs: 526300 bytes exceeds the 524288-byte limit`) - `cargo clippy --locked -p victory-shader --tests -- -D warnings`: 0 warnings - `scalar_64_bit_field_ops_lower s_bfe_64 s_bfm_b64`: **3/3 passed** across RTX 5090 (`hardware`) and WARP (`warp` + explicit `VICTORY_WARP=1` 2/2). Lowering and hardware tests are solid — just needs extracting out of `lower.rs` to pass `xtask policy`.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1395:upstream-pr/1395'
git switch 'upstream-pr/1395'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/1395'
git switch 'upstream-pr/1395'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1395'
git switch 'upstream-pr/1395'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1395'
git switch 'main'
git merge --squash 'upstream-pr/1395'
git switch 'main'
git merge --ff-only 'upstream-pr/1395'
git switch 'main'
git merge 'upstream-pr/1395'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1395
No description provided.