Shaders: honor FP32 rounding when packing a byte #1841
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!1841
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1841"
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?
@AlanQiang0418 on GitHub · 2026-11-24 23:13 UTC · original
AlanQiang0418:codex/byte-pack-round-mode→main· +110 −63 · 2 files · 2 commits · openA shader that switches FP32 rounding upward expects packing 0.5 into the low byte of 0xAABBCCDD to produce 0xAABBCC01. Main produces 0xAABBCC00 on both an RTX 5080 and WARP. The four rounding modes have been measured on RDNA2. Native hardware measurements
The existing control-flow pass now tracks the four rounding bits in MODE together. Literal bitfield writes update only the selected bits. A join keeps bits on which the incoming paths agree.
v_cvt_pk_u8_f32uses the FP32 field to round before saturating and inserting the result into the destination byte. Unknown rounding at runtime still uses nearest-even. The pack follows the translator's existing assumption of flushed FP32 inputs. Explicit denormal-preserve modes remain outside this change.Verification
cargo clippy -p victory-shader --all-targets --locked -- -D warningsand the staged asset-policy check passed.This extends the mode coverage discussed in #1804. Coordination claim. AI-assisted implementation and testing using synthetic programs.
Full-suite comparison
Both Clippy configurations passed in Actions. The new join test, the extended byte-packing test and the existing FP16 mode test passed there. The full shader suite had the same two failures as CI on the exact base commit, in the explicit-level gather and lane permute tests. The PR run had 208 passed, 2 failed and 2 ignored, compared with 207 passed, 2 failed and 2 ignored on the base. PR CI · Base CI
I also ran the full shader crate locally, serially, on both revisions. The same three tests failed on both revisions here: the two heap-buffer stride tests and the explicit-level gather test. This branch had 207 passed, 3 failed and 2 ignored. The base had 206 passed, 3 failed and 2 ignored.
@upipibi on GitHub · 2026-11-24 23:20 UTC · original
Ampere run alongside your RTX 5080 one: RTX 3070 8 GB, driver 616.56, plus WARP, Windows 11, debug,
ee2cf26(onmain70564ae).cargo test -p victory-shader --locked: 207 passed, 3 failed, 2 ignored. The new rounding cases insemantics_testspass, and the 3 failures are #1744's NVIDIA heap-cap failures onmain.AI-assisted (Claude Code). Synthetic tests only.
@Marvisak on GitHub · 2026-11-25 07:25 UTC · original · edited 2026-11-25 22:23 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.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
@sinan-cmyk on GitHub · 2026-11-25 12:14 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
ea1f55f4ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 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).
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.Merge
Merge the changes and update on Forgejo.