Shaders: v_mad_i64_i32 sign-extends a 32-bit literal addend #2252

Open
BastienRodz wants to merge 1 commit from upstream-pr/2254 into main
BastienRodz commented 2026-11-25 08:59:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T08:59:46Z.


What's wrong

Lower::src64 sign-extends a 32-bit literal for operations named *_i64 (#447). v_mad_i64_i32 adds a signed 64-bit S2 but its name ends in _i32, so a literal addend was zero-extended: 0 * 0 + -100 gave 0x00000000_ffffff9c. RDNA 2 ISA §6.2.1 says a 32-bit literal used as a 64-bit signed integer is "sign extended to 64 bits", and §12.12 defines V_MAD_I64_I32 as S0.i32 * S1.i32 + S2.i64.

What the fix does

The sign-extending arm in src64 also matches v_mad_i64_i32. v_mad_u64_u32 and the other unsigned and bitwise 64-bit operands keep zero-extending.

Tests

New emit::valu_tests::mad_i64_i32_sign_extends_literal_addend (next to signed_64_bit_operands_sign_extend_their_literal): the high dword of v_mad_i64_i32 with a -100 literal addend for 0 * 0, 10 * 10 and -100000 * 100000, and of v_mad_u64_u32 with the same literal (zero-extended) for 0 * 0 and 10 * 10.

Not tested

Not run on an AMD/NVIDIA GPU or through dxil.dll here. Whether title shaders use v_mad_i64_i32 with a literal addend is not measured. #171 also touches v_mad_i64_i32 (carry and clamp), not its literal; whichever lands second rebases trivially.

Fixes #2253

AI-assisted (Gemini 4 Neon found and wrote it, Claude Code reviewed and verified it). No game data used.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5488225385 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-25T08:59:46Z. --- ### What's wrong `Lower::src64` sign-extends a 32-bit literal for operations named `*_i64` (#447). `v_mad_i64_i32` adds a signed 64-bit `S2` but its name ends in `_i32`, so a literal addend was zero-extended: `0 * 0 + -100` gave `0x00000000_ffffff9c`. RDNA 2 ISA §6.2.1 says a 32-bit literal used as a 64-bit signed integer is "sign extended to 64 bits", and §12.12 defines `V_MAD_I64_I32` as `S0.i32 * S1.i32 + S2.i64`. ### What the fix does The sign-extending arm in `src64` also matches `v_mad_i64_i32`. `v_mad_u64_u32` and the other unsigned and bitwise 64-bit operands keep zero-extending. ### Tests New `emit::valu_tests::mad_i64_i32_sign_extends_literal_addend` (next to `signed_64_bit_operands_sign_extend_their_literal`): the high dword of `v_mad_i64_i32` with a `-100` literal addend for `0 * 0`, `10 * 10` and `-100000 * 100000`, and of `v_mad_u64_u32` with the same literal (zero-extended) for `0 * 0` and `10 * 10`. - On `main` (940d32f) it fails: `hardware: v_mad_i64_i32 [0, 0, 0, 0]`, `left: 0`, `right: 4294967295`. - With the fix it and `signed_64_bit_operands_sign_extend_their_literal` pass (Wine 10, vkd3d-proton 3.1 on llvmpipe). - windows-latest run on the fork: https://github.com/BastienRodz/VIctory/actions/runs/45581128573 ### Not tested Not run on an AMD/NVIDIA GPU or through `dxil.dll` here. Whether title shaders use `v_mad_i64_i32` with a literal addend is not measured. #171 also touches `v_mad_i64_i32` (carry and clamp), not its literal; whichever lands second rebases trivially. Fixes #2253 AI-assisted (Gemini 4 Neon found and wrote it, Claude Code reviewed and verified it). No game data used. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DenRakEiw commented 2026-11-25 09:02:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T09:02:22Z.

Review: APPROVED


Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, with dxil.dll validator):

  • cargo test -p victory-shader --lib mad_i64_i32_sign_extends_literal_addend — passed on both RTX 5090 hardware and VICTORY_D3D12_WARP=1
  • cargo clippy -p victory-shader --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

Clean fix sign-extending 32-bit literal addends in v_mad_i64_i32, verified end-to-end on hardware and WARP. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6054565203 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#pullrequestreview-6054565203). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T09:02:22Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`940d32f`, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, with `dxil.dll` validator): - `cargo test -p victory-shader --lib mad_i64_i32_sign_extends_literal_addend` — passed on both RTX 5090 hardware and `VICTORY_D3D12_WARP=1` - `cargo clippy -p victory-shader --all-targets` — 0 warnings - `cargo xtask policy` — ok (`183 files ok`) Clean fix sign-extending 32-bit literal addends in `v_mad_i64_i32`, verified end-to-end on hardware and WARP. Looks good. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 09:43:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T09:43:09Z.

Review: COMMENTED


Tested locally: merged into main 940d32f69b, cargo test -p victory-shader --locked on macOS arm64 — 144 passed, 0 failed, 2 ignored (Windows-gated hardware execution tests not run here).

Note: this is the same one-line v_mad_i64_i32 literal sign-extension fix as #2261 (which additionally fixes a dump_dxil temp-file race between parallel tests and cites the RDNA2 ISA rule). Both pass locally; whichever merges second will conflict on the same lower.rs lines — suggest keeping one (I'd take #2261 for the test-infra fix).

<!-- greyfinch-sync:Marvisak/VIctory:review:6055175987 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#pullrequestreview-6055175987). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T09:43:09Z. **Review:** COMMENTED --- Tested locally: merged into main 940d32f69b, `cargo test -p victory-shader --locked` on macOS arm64 — 144 passed, 0 failed, 2 ignored (Windows-gated hardware execution tests not run here). Note: this is the same one-line `v_mad_i64_i32` literal sign-extension fix as #2261 (which additionally fixes a dump_dxil temp-file race between parallel tests and cites the RDNA2 ISA rule). Both pass locally; whichever merges second will conflict on the same lower.rs lines — suggest keeping one (I'd take #2261 for the test-infra fix).
Dathinel commented 2026-11-25 10:07:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T09:06:36Z.


Integration check with #171: 5a8a792 and d1d21f9 merged cleanly. I tested a synthetic v_mad_i64_i32 with a literal -100, then used v_cndmask_b32 to read the MAD's scalar carry mask. For 0 × 0 − 100 and 10 × 10 − 100, bit 64 of the exact signed result is 1 and 0 respectively. The combined tree returned those values on both Windows hardware and WARP. Both PRs' existing MAD regression tests also passed on that tree.

The controls distinguish the two fixes. At 5a8a792 alone, the high-dword regression passes but the new probe stops before dispatch with “a lane mask from a carry”. On the combined tree with only this PR's literal-extension predicate removed, the probe dispatches but returns 0 instead of 1 for the first case. The two changes cover complementary behavior when a shader consumes the carry. AI-assisted, synthetic inputs only.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7157887248 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#issuecomment-7157887248). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T09:06:36Z. --- Integration check with #171: 5a8a792 and d1d21f9 merged cleanly. I tested a synthetic v_mad_i64_i32 with a literal -100, then used v_cndmask_b32 to read the MAD's scalar carry mask. For 0 × 0 − 100 and 10 × 10 − 100, bit 64 of the exact signed result is 1 and 0 respectively. The combined tree returned those values on both Windows hardware and WARP. Both PRs' existing MAD regression tests also passed on that tree. The controls distinguish the two fixes. At 5a8a792 alone, the high-dword regression passes but the new probe stops before dispatch with “a lane mask from a carry”. On the combined tree with only this PR's literal-extension predicate removed, the probe dispatches but returns 0 instead of 1 for the first case. The two changes cover complementary behavior when a shader consumes the carry. AI-assisted, synthetic inputs only.
kotekompotek commented 2026-11-25 10:07:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T09:20:42Z.


Verified on real hardware: mad_i64_i32_sign_extends_literal_addend passes on a GTX 1050 running SM 6.6 through the Agility SDK (the machine's in-box runtime stops at 6.5). Both arms behave as coded — v_mad_i64_i32 sign-extends the literal addend (high dword 0xFFFFFFFF for -100), v_mad_u64_u32 zero-extends it. Matches RDNA2 ISA §6.2.1.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158204511 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#issuecomment-7158204511). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T09:20:42Z. --- Verified on real hardware: `mad_i64_i32_sign_extends_literal_addend` passes on a GTX 1050 running SM 6.6 through the Agility SDK (the machine's in-box runtime stops at 6.5). Both arms behave as coded — `v_mad_i64_i32` sign-extends the literal addend (high dword `0xFFFFFFFF` for `-100`), `v_mad_u64_u32` zero-extends it. Matches RDNA2 ISA §6.2.1.
Calvix2k commented 2026-11-25 10:07:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T09:40:16Z.


Same fix as #2261 (which I closed in favour of this one after seeing it): src64's sign-extending arm matching v_mad_i64_i32. No objection to the change.

If useful, my branch codex/shader-mad-i64-literal-2253 has two extra checks that can be lifted: the emitted DXIL for v_mad_i64_i32 with a literal addend reads add i64 %24, -100 (visible without a GPU), and a GPU case that reads the high dword of 0 * 0 + -100 (all ones) and 10 * 10 + -100 (0) with v_mad_u64_u32 as the zero-extending control. Your test plus the two hardware runs already cover the behaviour, so this is only if you want the DXIL half.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158644058 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#issuecomment-7158644058). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T09:40:16Z. --- Same fix as #2261 (which I closed in favour of this one after seeing it): `src64`'s sign-extending arm matching `v_mad_i64_i32`. No objection to the change. If useful, my branch `codex/shader-mad-i64-literal-2253` has two extra checks that can be lifted: the emitted DXIL for `v_mad_i64_i32` with a literal addend reads `add i64 %24, -100` (visible without a GPU), and a GPU case that reads the high dword of `0 * 0 + -100` (all ones) and `10 * 10 + -100` (0) with `v_mad_u64_u32` as the zero-extending control. Your test plus the two hardware runs already cover the behaviour, so this is only if you want the DXIL half.
BastienRodz commented 2026-11-25 10:07:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T09:40:32Z.


Thanks for closing #2261 in favour of this one. I'll leave the test as it is, since the GPU case and the hardware runs here cover it, but the DXIL check on your branch is a good pointer if the maintainer wants a GPU-free check too.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158649846 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#issuecomment-7158649846). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-25T09:40:32Z. --- Thanks for closing #2261 in favour of this one. I'll leave the test as it is, since the GPU case and the hardware runs here cover it, but the DXIL check on your branch is a good pointer if the maintainer wants a GPU-free check too.
BastienRodz commented 2026-11-25 10:07:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T09:44:34Z.


For the record, #2261 is already closed: Calvix2k closed it in favour of this PR (see the comment above), so there's no second change to conflict with. Its dump_dxil temp-file fix is unrelated to this one and could go in on its own.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158738982 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#issuecomment-7158738982). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-25T09:44:34Z. --- For the record, #2261 is already closed: Calvix2k closed it in favour of this PR (see the comment above), so there's no second change to conflict with. Its `dump_dxil` temp-file fix is unrelated to this one and could go in on its own.
sinan-cmyk commented 2026-11-25 11:05:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T10:33:14Z.


Offline measurement on a retail dump

Result: no count change against main.

I merged head 5a8a7929 onto main 940d32f (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: 23,918 on main, 23,918 with this PR.

No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7159854114 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#issuecomment-7159854114). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-25T10:33:14Z. --- ### Offline measurement on a retail dump **Result: no count change against `main`.** I merged head 5a8a7929 onto `main` 940d32f (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: 23,918 on `main`, 23,918 with this PR. No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 13:02:54 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Merge candidate. In crates/victory-shader/src/emit/lower.rs, the src64 arm that sign-extends a 32-bit literal for signed 64-bit operands now also matches v_mad_i64_i32, whose src2 is a signed 64-bit addend. That is the same rule the existing arm cites (LLVM's AMDGPU operand rules). v_mad_u64_u32 keeps zero extension.

The new test mad_i64_i32_sign_extends_literal_addend checks the high dword of results on the GPU, with the unsigned form as a control. A GTX 1050 run in the thread passes. Dathinel's control shows the fix also matters for the carry when combined with #171. CI check passes, the offline count is unchanged, and the branch merges cleanly. #2261 (the same fix) was already closed in favour of this one.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7162779737 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#issuecomment-7162779737). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T12:44:01Z. --- <!-- victory-triage v1 head=5a8a792961896867bab9f27e1b38397c1c5ef9b2 verdict=merge-candidate at=2026-11-25T12:49:00Z --> Automated triage for the maintainers. **Merge candidate.** In `crates/victory-shader/src/emit/lower.rs`, the `src64` arm that sign-extends a 32-bit literal for signed 64-bit operands now also matches `v_mad_i64_i32`, whose `src2` is a signed 64-bit addend. That is the same rule the existing arm cites (LLVM's AMDGPU operand rules). `v_mad_u64_u32` keeps zero extension. The new test `mad_i64_i32_sign_extends_literal_addend` checks the high dword of results on the GPU, with the unsigned form as a control. A GTX 1050 run in the thread passes. Dathinel's control shows the fix also matters for the carry when combined with #171. CI `check` passes, the offline count is unchanged, and the branch merges cleanly. #2261 (the same fix) was already closed in favour of this one. --- _Generated by [Claude Code](https://claude.ai/code)_
fyernald commented 2026-11-25 17:32:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fyernald on 2026-11-25T17:32:49Z.

Review: APPROVED


Verified on RTX 3080 (617.42), Windows 10 (19045) plus WARP, main 67e8ae1 + #486 + #2596 (the suite crashes on NVIDIA without #2596, #2571). cargo test -p victory-shader --lib --locked -- --test-threads=1: 268 passed, 3 failed. The 3 are the #1835 failures, also on the base. mad_i64_i32_sign_extends_literal_addend passes on both adapters.

#2380 is the same fix. They behave the same: the 64-bit literal arm is only reached for 64-bit operands, which for v_mad_i64_i32 is src2 alone, so this PR's wider condition makes no difference. This one is the one to take. It came first, and its test checks the GPU's result for both the sign-extended (v_mad_i64_i32) and zero-extended (v_mad_u64_u32) addend. #2380's test only checks that the instruction lowers.

<!-- greyfinch-sync:Marvisak/VIctory:review:6062129014 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#pullrequestreview-6062129014). Originally posted by [fyernald](https://github.com/fyernald) on 2026-11-25T17:32:49Z. **Review:** APPROVED --- Verified on **RTX 3080 (617.42), Windows 10 (19045)** plus WARP, `main` `67e8ae1` + #486 + #2596 (the suite crashes on NVIDIA without #2596, #2571). `cargo test -p victory-shader --lib --locked -- --test-threads=1`: 268 passed, 3 failed. The 3 are the #1835 failures, also on the base. `mad_i64_i32_sign_extends_literal_addend` passes on both adapters. #2380 is the same fix. They behave the same: the 64-bit literal arm is only reached for 64-bit operands, which for `v_mad_i64_i32` is `src2` alone, so this PR's wider condition makes no difference. This one is the one to take. It came first, and its test checks the GPU's result for both the sign-extended (`v_mad_i64_i32`) and zero-extended (`v_mad_u64_u32`) addend. #2380's test only checks that the instruction lowers.
fuzeofficlal commented 2026-11-26 17:39:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T17:39:28Z.

Review: APPROVED


Looks good. Verified merged onto main (63bcca43) on an RTX 5090, Microsoft WARP, and Windows SDK dxil.dll:

  • Extending crates/victory-shader/src/emit/lower.rs:6150 to include "v_mad_i64_i32" cleanly fixes 32-bit literal sign-extension for the 64-bit addend without affecting v_mad_u64_u32 (whose unsigned literal stays zero-extended).
  • cargo xtask policy (191 files ok; crates/victory-shader/src/emit/lower.rs = 520,625 B < 524,288 B) and cargo clippy --locked -p victory-shader --all-targets -- -D warnings (default and --all-features) pass.
  • Both PR tests (mad_i64_i32_sign_extends_literal_addend and signed_64_bit_operands_sign_extend_their_literal) pass on RTX 5090 and WARP.
  • An additional full 64-bit (both low and high dwords checked) probe covering 135 cases across 6 literals (0, 1, 0x7FFF_FFFF, 0x8000_0000, -100, u32::MAX) x v_mad_i64_i32/v_mad_u64_u32, shared src0/src2 literal, inline -1, and NULL src2 passed 135/135 on both RTX 5090 and WARP with dxil.dll validation.
<!-- greyfinch-sync:Marvisak/VIctory:review:6078507360 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#pullrequestreview-6078507360). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T17:39:28Z. **Review:** APPROVED --- Looks good. Verified merged onto `main` (`63bcca43`) on an RTX 5090, Microsoft WARP, and Windows SDK `dxil.dll`: - Extending `crates/victory-shader/src/emit/lower.rs:6150` to include `"v_mad_i64_i32"` cleanly fixes 32-bit literal sign-extension for the 64-bit addend without affecting `v_mad_u64_u32` (whose unsigned literal stays zero-extended). - `cargo xtask policy` (`191 files ok`; `crates/victory-shader/src/emit/lower.rs` = `520,625` B `< 524,288` B) and `cargo clippy --locked -p victory-shader --all-targets -- -D warnings` (default and `--all-features`) pass. - Both PR tests (`mad_i64_i32_sign_extends_literal_addend` and `signed_64_bit_operands_sign_extend_their_literal`) pass on RTX 5090 and WARP. - An additional full 64-bit (both low and high dwords checked) probe covering 135 cases across 6 literals (`0`, `1`, `0x7FFF_FFFF`, `0x8000_0000`, `-100`, `u32::MAX`) x `v_mad_i64_i32`/`v_mad_u64_u32`, shared `src0`/`src2` literal, inline `-1`, and `NULL` `src2` passed 135/135 on both RTX 5090 and WARP with `dxil.dll` validation.
andrewpozdnakov7-jpg commented 2026-11-27 13:19:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T13:19:15Z.


I checked this fix with #2348 and its binary64 ABS/NEG follow-up on current main 63bcca4. Combined branch 2c517b5 keeps both PR heads and Steven's original authorship on the follow-up.

With #2348 and the unchanged #2254 fixture, app-local WARP 1.0.22 returns a high dword of 0 for signed 0 * 0 + (-100), where the fixture expects 0xffffffff. The combined branch passes the signed and unsigned MAD controls and all 96 binary64 modifier cases. The float literal remains the high dword of a binary64 value. All 40 VALU tests, all-target/all-feature shader Clippy with warnings denied, and the asset check passed.

The original #2254 fix still applies in the refactored src64_operand helper. This branch is available if the two PRs are taken together.

AI-assisted with Codex. Synthetic shaders only.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7219331541 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#issuecomment-7219331541). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T13:19:15Z. --- I checked this fix with #2348 and its binary64 ABS/NEG follow-up on current main `63bcca4`. [Combined branch 2c517b5](https://github.com/andrewpozdnakov7-jpg/VIctory/tree/review/integer-and-f64-literal-expansion) keeps both PR heads and Steven's original authorship on the follow-up. With #2348 and the unchanged #2254 fixture, app-local WARP 1.0.22 returns a high dword of 0 for signed `0 * 0 + (-100)`, where the fixture expects `0xffffffff`. The combined branch passes the signed and unsigned MAD controls and all 96 binary64 modifier cases. The float literal remains the high dword of a binary64 value. All 40 VALU tests, all-target/all-feature shader Clippy with warnings denied, and the asset check passed. The original #2254 fix still applies in the refactored `src64_operand` helper. This branch is available if the two PRs are taken together. AI-assisted with Codex. Synthetic shaders only.
pablogonz12 commented 2026-11-27 17:12:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-27T17:12:25Z.


I tested 5a8a792961896867bab9f27e1b38397c1c5ef9b2 merged onto main 63bcca43c6a00a758510398fa43096ce7e4f7df0 on an RX 9070 XT, Mesa RADV 26.3.1-arch3.5, GE-Proton11-14 and bundled vkd3d-proton v3.1-83-gcae8353ed-GE-Proton(dirty)+.

mad_i64_i32_sign_extends_literal_addend passed on the hardware, including the signed cases and unsigned controls. For the control I kept the same test but restored main's lower.rs: the signed 0 * 0 + (-100) case failed, returning high dword 0x00000000 instead of 0xffffffff. WARP was unavailable and skipped.

Synthetic unit test only; I did not run a game.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7224147288 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2254#issuecomment-7224147288). Originally posted by [pablogonz12](https://github.com/pablogonz12) on 2026-11-27T17:12:25Z. --- I tested `5a8a792961896867bab9f27e1b38397c1c5ef9b2` merged onto main `63bcca43c6a00a758510398fa43096ce7e4f7df0` on an RX 9070 XT, Mesa RADV 26.3.1-arch3.5, GE-Proton11-14 and bundled vkd3d-proton `v3.1-83-gcae8353ed-GE-Proton(dirty)+`. `mad_i64_i32_sign_extends_literal_addend` passed on the hardware, including the signed cases and unsigned controls. For the control I kept the same test but restored main's `lower.rs`: the signed `0 * 0 + (-100)` case failed, returning high dword `0x00000000` instead of `0xffffffff`. WARP was unavailable and skipped. Synthetic unit test only; I did not run a game.
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/2254:upstream-pr/2254'
git switch 'upstream-pr/2254'

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/2254'
git switch 'upstream-pr/2254'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2254'
git switch 'upstream-pr/2254'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2254'
git switch 'main'
git merge --squash 'upstream-pr/2254'
git switch 'main'
git merge --ff-only 'upstream-pr/2254'
git switch 'main'
git merge 'upstream-pr/2254'
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!2252
No description provided.