fix: honor clamp on unsigned VOP3 add and subtract #327
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!327
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-327"
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:26 UTC · original
mauroalvare:codex/victory-u32-clamp→main· +170 −32 · 4 files · 1 commits · openChange
Neptune rejected unsigned VOP3 and VOP3B add/subtract with
clampasinteger output modifiersbefore it emitted DXIL. The resource tracer also treated a clamped sum relative tos_getpc_b64as an ordinary code-table address.tools/lancer_victory.ps1builds and launches the runtime that usesvictory-gpuandvictory_shader::emit::translate. These regressions exercise that translator's lowering and resource tracing.Use carry or borrow to saturate the VGPR result and preserve the lane bit written to SDST. For
v_add3_u32, overflow in either addition saturates the result. Resource tracing refuses a saturated PC-relative address with an explicit diagnostic because the lowered PC is an offset into the shader.This adapts VIctory #1398 by EatCodeSleep2 from commit
38ddebf954267e2ae46dce6f3f3dbfdb622219eeand adds Neptune-specific tests. The commit andTHIRD_PARTY.mdcredit the source.Verification
Commit
7e79fcee0443a2fff09f5b296dcb021f93553a76is based onc4c93bdc413191a9dc909998d2d53080a3f0c880.Run this from
third_party/victorywith the Windows SDK validator and cached dependencies.c4c93bdc413191a9dc909998d2d53080a3f0c880with the regression tests, all four fail. The three arithmetic tests stop in lowering at byte 36. The fourth shows the tracer returningCODE + 4with a dynamic term for the saturated sum.Additional checks on the committed tree:
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 -rspython -m ruff check --select W605,F,E9 PrototypeScarlett tests toolsThe full shader run also reported four optional console-compiler skips, one WARP pipeline skip, and one hardware wave test whose pipeline the device did not accept. The focused regression ran all 16 containers on both backends. Pytest used Python 3.13.15,
ANYXBOXX_REQUIRE_RUNTIME=1, and the existing native runtime and TomBox builds.Oracle and test data
The regression assembles one-thread synthetic compute shaders using the repository's GFX10 encoders. It compares every readback to exact integer arithmetic, using the representable range from section 6.5 of the AMD RDNA 2 ISA guide. The expected carry and borrow are based on the exact unsaturated result, as in the independently implemented interpreter and HLSL tests for the nine two-input variants in AnyXboxX #235.
Checklist
THIRD_PARTY.mdand the commit.AI assistance by Codex for porting, 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.