Shaders: lower v_cmp_{f,t}_{i64,u64} constant 64-bit compares #658

Open
github-bot wants to merge 1 commit from github-bot/gh-658 into main AGit
Owner

@⁠davi713albano-coder on GitHub · 2026-11-25 04:08 UTC · original
davi713albano-coder:shader/cmp64-f-and-t → main · +40 −0 · 2 files · 1 commits · open

Summary

  • Handle "f" | "t" constant compares in the "u64" | "i64" arm of Lower::compare (crates/victory-shader/src/emit/lower.rs) before calling src64, emitting self.lane(inst, Some(op == "t")).
  • Avoids rejecting v_cmp_{f,t}_{i64,u64} and avoids setting the Int64 (0x8000) SFI0 feature bit when no 64-bit arithmetic is needed.
  • Add synthetic test v_cmp_f_and_t_64bit_match_rdna2 in crates/victory-shader/src/emit/valu_tests.rs checking DXIL validation, SFI0 & 0x8000 == 0, and D3D12 execution results for all four opcodes.

Verification

  • Verified cargo clippy --workspace --all-targets --locked -- -D warnings, --all-features, and cargo test --workspace --locked on windows-latest.

No title data used. AI-assisted.

**@⁠davi713albano-coder** on GitHub · 2026-11-25 04:08 UTC · [original](https://github.com/fxceless/victory-fork/pull/658) `davi713albano-coder:shader/cmp64-f-and-t` → `main` · +40 −0 · 2 files · 1 commits · open ### Summary - Handle `"f" | "t"` constant compares in the `"u64" | "i64"` arm of `Lower::compare` (`crates/victory-shader/src/emit/lower.rs`) before calling `src64`, emitting `self.lane(inst, Some(op == "t"))`. - Avoids rejecting `v_cmp_{f,t}_{i64,u64}` and avoids setting the `Int64` (`0x8000`) `SFI0` feature bit when no 64-bit arithmetic is needed. - Add synthetic test `v_cmp_f_and_t_64bit_match_rdna2` in `crates/victory-shader/src/emit/valu_tests.rs` checking DXIL validation, `SFI0 & 0x8000 == 0`, and D3D12 execution results for all four opcodes. ### Verification - Verified `cargo clippy --workspace --all-targets --locked -- -D warnings`, `--all-features`, and `cargo test --workspace --locked` on `windows-latest`. No title data used. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:48:23 +00:00
Author
Owner

@⁠JRamos1993 on GitHub · 2026-11-25 05:27 UTC · original

Offline check on the retail shader pack: no program of the title reaches this path. The change is neutral for it.

victory translate --validate --list over the title's full shader pack (26,084 programs) on an RTX 5090, main 310c6eb against this head merged onto it:

  • Validated: 25,382 in both, none lost.
  • DXIL: with a local hash on each validated line, 0 programs' DXIL differs (two runs of one build hash the same; the hash catches real changes).
  • Failures: none of the 507 failing programs on main fails on v_cmp_{f,t}_{i64,u64}.

So this fix doesn't change anything for this title's shaders as the batch tool translates them. It may still matter for other programs or titles.

AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.

**@⁠JRamos1993** on GitHub · 2026-11-25 05:27 UTC · [original](https://github.com/fxceless/victory-fork/pull/658#issuecomment-7153793592) **Offline check on the retail shader pack: no program of the title reaches this path. The change is neutral for it.** `victory translate --validate --list` over the title's full shader pack (26,084 programs) on an RTX 5090, `main` `310c6eb` against this head merged onto it: - **Validated:** 25,382 in both, none lost. - **DXIL:** with a local hash on each validated line, **0 programs' DXIL differs** (two runs of one build hash the same; the hash catches real changes). - **Failures:** none of the 507 failing programs on `main` fails on `v_cmp_{f,t}_{i64,u64}`. So this fix doesn't change anything for this title's shaders as the batch tool translates them. It may still matter for other programs or titles. AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.
Author
Owner

@⁠HAL9000RELOADED on GitHub · 2026-11-25 13:00 UTC · original

An AMD run of this PR's new tests. v_cmp_f_and_t_64bit_match_rdna2 passes on a Radeon RX 7900 XTX (RDNA3), Windows 10 22H2, with the Agility SDK runtime from #402. They ran on the hardware device; WARP skips on this machine. Nothing else in the workspace regresses.

The setup, and the same run for eight related shader PRs, are in one table on #637: #637

**@⁠HAL9000RELOADED** on GitHub · 2026-11-25 13:00 UTC · [original](https://github.com/fxceless/victory-fork/pull/658#issuecomment-7163155919) An AMD run of this PR's new tests. `v_cmp_f_and_t_64bit_match_rdna2` passes on a Radeon RX 7900 XTX (RDNA3), Windows 10 22H2, with the Agility SDK runtime from #402. They ran on the hardware device; WARP skips on this machine. Nothing else in the workspace regresses. The setup, and the same run for eight related shader PRs, are in one table on #637: https://git.gtahub.st/github/fxceless--victory-fork/pulls/637
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/src/emit/valu_tests.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/658/head:github-bot/gh-658'
git switch 'github-bot/gh-658'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-658'
git switch 'github-bot/gh-658'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-658'
git switch 'github-bot/gh-658'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-658'
git switch 'main'
git merge --squash 'github-bot/gh-658'
git switch 'main'
git merge --ff-only 'github-bot/gh-658'
git switch 'main'
git merge 'github-bot/gh-658'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.