Shaders: lower v_div_scale_f64 and its lane mask #2975
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!2975
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2975"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 01:58 UTC · original
andrewpozdnakov7-jpg:codex2/div-scale-f64→main· +446 −1 · 3 files · 1 commits · openSummary
Verification
References: RDNA2 hardware observations, directed downscale measurements, and clamp/OMOD characterization.
@steven-seagull27 on GitHub · 2026-11-26 02:29 UTC · original
I ran
v_div_scale_f64fromce620efbandv_div_fixup_f64from #2953 (f0f5fb5b) in the same wave32 compute shader. The scale result supplied the first operand of fixup. Both the physical RTX 5080 and Microsoft WARP matched all 5,688 lane records per adapter.s20), at numerator-minus-denominator exponent differences −769, −768, −767, 0, 767, 768 and 769. After executing both instructions on even lanes and restoring EXEC,v_cndmask_b32read back0x55555555at both ±768 thresholds and zero at ±767. The inactive lanes retained both sentinel dwords. With full EXEC the corresponding masks were0xffffffffand zero. All 1,792 records matched, including the quotient-sign repair.0x08000001ffffffffgave0x0008000100000000for nearest-even and toward +∞, and0x00080000fffffffffor toward zero and toward −∞. Both instructions returned those bits.The rounding reference used exact rational power-of-two scaling and the adjacent binary64 values for directed rounding. For exponent field 116 I used the overflow behavior measured on the RX 6900 XT. These synthetic shaders exercise the handoff with a supplied preliminary quotient. Their DXIL validated and the containers requested neither double-precision instructions, double extensions nor int64. Related RDNA2 hardware measurement
@Marvisak on GitHub · 2026-11-26 05:26 UTC · original
Automated triage for the maintainers.
Merge candidate (recommending a look, not approving). This lowers
v_div_scale_f64(VOP3B 0x16e), whichmainrefuses, in a newcrates/victory-shader/src/emit/lower/div_scale.rs: it computes the ±128 exponent scale and the lane mask from the exponent difference (±768) and the denominator and numerator edge cases, handles zero inputs, normalizes and rounds subnormals under the f64 rounding mode, and applies clamp. I compared the cases with the ISA pseudocode. Where they differ (for example the mask on a zero denominator, or overflow below exponent 117), the newsemantics_tests.rstest pins the values the PR cites from RDNA2 hardware measurements in the AnyPS5 oracle, whichsemantics_tests.rsonmainalready cites. A commenter ran it together with #2953 (v_div_fixup_f64) and got matching results, and the two PRs only touch neighbouring lines. CIcheckpasses.Small request: the comment
As measured on RDNA2 (#663)indiv_scale_f64reads as VIctory issue #663; please write it as AnyPS5 #663, as the test does.Generated by Claude Code
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.