Shaders: lower v_cmp_{f,t}_{i64,u64} constant 64-bit compares #1685
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1685
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1685"
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?
@Calvix2k on GitHub · 2026-11-24 20:44 UTC · original
Calvix2k:codex/shader-cmp64-ft-1531→main· +39 −0 · 2 files · 1 commits · openImplements #1531.
Ports the fix from @davi713albano-coder's fork (commit 41715fc by Davi713), applied unchanged onto
ffe310e; the commit keeps its original author.Summary
The
u64 | i64arm ofemit::lower::comparefell through toErr("a 64-bit compare")for the constant-true and constant-false compares, while the 32-bit arm handled them withself.lane(inst, Some(op == "t")).v_cmp_{f,t}_{i64,u64}andv_cmpx_{f,t}_{i64,u64}now short-circuit beforesrc64, so a constant compare does not set theInt64flag (SFI0bit 0x8000) it does not need.Test
New synthetic compute test
v_cmp_f_and_t_64bit_match_rdna2coversv_cmp_f_i64,v_cmp_t_i64,v_cmp_f_u64andv_cmp_t_u64: dxil.dll validation, absence of theInt64flag, and execution on D3D12 hardware/WARP.Validation
cargo test -p victory-shader --locked -- --test-threads=1 --skip emit::valu_tests --skip emit::waterfall_tests— passed (102 tests, 1 ignored).cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings— passed.cargo xtask policy— passed (154 files).@Calvix2k on GitHub · 2026-11-24 21:40 UTC · original
Hardware run on the RX 7800 XT (RDNA3), Windows 10 x64, Agility SDK 1.616 for SM 6.6:
cargo test -p victory-shader --locked v_cmp_f_and_t_64bit_match_rdna2 -- --test-threads=1 --nocapture— 1 passed, 0 failed on the hardware backend.Int64flag on AMD hardware.@Calvix2k on GitHub · 2026-11-24 22:14 UTC · original
Rebased onto
70564ae; only the test module conflicted (upstream added more test helpers). Both sets are kept. cargo check -p victory-shader --tests --locked passes; the test itself was already verified on a Radeon RX 7800 XT before the rebase and is unchanged.@upipibi on GitHub · 2026-11-24 22:51 UTC · original
NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug,
d7536bd(onmain70564ae).v_cmp_f_and_t_64bit_match_rdna2passes on the hardware adapter.AI-assisted (Claude Code). Synthetic tests only.
@Marvisak on GitHub · 2026-11-25 03:33 UTC · original · edited 2026-11-25 22:24 UTC
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-shader/src/emit/lower.rsandcrates/victory-shader/src/emit/valu_tests.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
@StExpeditus on GitHub · 2026-11-25 09:06 UTC · original
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
d869333.cargo test --workspace --locked --no-fail-fast-> 697 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.@Calvix2k on GitHub · 2026-11-25 10:14 UTC · original
Hardware run on an RX 7800 XT (RDNA3), Windows 10 19045, SM 6.6 via the Agility runtime for the test binaries (#486):
victory-shaderlib suite 248 passed, 0 failed, 3 ignored, including the 64-bit constant-compare cases. The lowering is exercised on the card here as well as on CI's device.d8693330efto803c7f3ac0@catminou4 on GitHub · 2026-11-24 21:40 UTC · original · approved these changes
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e), cargo test -p victory-shader --locked → 96 passed, 0 failed. Hardware/valu/waterfall execution tests are #[cfg(all(test, windows))] and run only on Windows; macOS covers lowering/structure unit tests.v_cmp_f_i64/v_cmp_t_i64/v_cmp_f_u64/v_cmp_t_u64 constant 64-bit compares: 59-line diff with an RDNA2 reference test.
@Calvix2k on GitHub · 2026-11-26 13:53 UTC · original
Rebased. The
f/tearly return now runs before upstream's dword-wise comparison, so both the AMD dword order and the float predicates are handled by one path.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.