fix: lower signed 16-bit VOP3 add and subtract in VIctory #331
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!331
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-331"
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?
@mauroalvare on GitHub · 2026-11-26 03:44 UTC · original
mauroalvare:codex/victory-signed-i16→main· +81 −3 · 3 files · 1 commits · openChange
Neptune decodes
v_add_nc_i16andv_sub_nc_i16, then rejects them as unsupported before producing DXIL.tools/lancer_victory.ps1builds the runtime whose GPU pipeline callsvictory_shader::emit::translateand this VALU lowering.Lower both instructions through the existing
half_srcandwrite_halfpaths with wrapping results by default and signed saturation withclamp. For clamped results, mask the in-range value before selecting the 16-bit saturation pattern. This keeps the other VDST half intact when NVIDIA folds the arithmetic. The code adapts the signed i16 part of VIctory #2094, with upipibi's mask-before-select workaround.Verification
Base
c4c93bdc413191a9dc909998d2d53080a3f0c880, fix319c35861246d4725dc306fb9702fc2d8be3ab9e.From
third_party/victoryon Windows:lower: Unsupportedat offset 40, naming the respective instruction.cargo test --locked --offline -j 2 -p victory-shader -- --nocapture --test-threads=1cargo test --locked --offline -j 2 -p victory-loader --test load_probecargo check --locked --offline -j 2 -p victorycargo xtask policycargo build --release --locked --offline -j 2 --manifest-path rust/Cargo.tomlcargo test --release --locked --offline -j 2 --manifest-path rust/Cargo.tomlpython -m pytest -q tests/test_rdna2_exec_int16.py -k 'v_add_nc_i16 or v_sub_nc_i16'python -m pytest -rspython -m ruff check --select W605,F,E9 PrototypeScarlett tests toolsThe full shader run also reported four optional compiler-dependent skips, one WARP pipeline skip, and one hardware wave test whose pipeline the device did not accept. The two focused tests had zero skips. Pytest used Python 3.13.15,
ANYXBOXX_REQUIRE_RUNTIME=1, and the existing native runtime and TomBox binaries.Oracle and test data
The shaders are assembled from repository helpers. Each expected dword combines the untouched half of a preset destination with the exact signed sum or difference, narrowed by wrapping or saturation. The interpreter fixtures in AnyXboxX #232 independently cover these rules. Section 6.5 of the AMD RDNA 2 ISA guide defines integer clamp. LLVM 20.1.8 selects these clamped opcodes for GFX10 signed saturation. Signed add · Signed subtract
Checklist
THIRD_PARTY.mdand the commit.AI assistance by Codex for the port, regression tests, and Windows validation.
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.