Shaders: round FP16 transcendentals to nearest in either mode #3617
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!3617
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3617"
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-27 22:23 UTC · original
andrewpozdnakov7-jpg:codex2/fp16-transcendental-rounding→main· +53 −2 · 2 files · 1 commits · openRDNA2 rounds seven FP16 transcendental instructions to nearest even under both values of the tested rounding field. The published RX 6700 XT sweep ran all input encodings with the original and round-to-zero settings, and the harness validated the MODE bits on the device. Sweep results · MODE check
Use nearest-even narrowing for
v_rcp_f16,v_sqrt_f16,v_rsq_f16,v_log_f16,v_exp_f16,v_sin_f16, andv_cos_f16. Ordinary FP16 conversions continue to use the requested rounding mode.On Windows with app-local WARP 1.0.22 and D3D12 Agility 1.620.2, the synthetic regression reports 7 mismatches out of 28 readbacks on
63bcca4, all withFP_ROUND=3. The patch passes all 28. For example,v_rcp_f16(17)changes from0x2b87to0x2b88in that mode. The existing conversion control passes all 38 inputs under both modes. Inputs are synthetic.Coordination claim: #1633
AI-assisted with OpenAI Codex.
@andrewpozdnakov7-jpg on GitHub · 2026-11-27 22:25 UTC · original
Verified
8bfad4cagainst63bcca4on Windows with app-local WARP 1.0.22 and D3D12 Agility 1.620.2. The same synthetic fixture went from 7 wrong outputs in 28 readbacks to 28 correct. The 38-input FP32-to-FP16 control still distinguishes the two rounding settings. Both strict shader Clippy configurations and the repository asset policy passed. Windows CI for this headI also ran both regressions on
4ccc63ewith #3609. It passes the seven-op fixture and the exp midpoint test, including 16 readbacks across the plain, abs, neg, and clamp variants. The two changes can be reviewed separately, with the combined branch available for an integration test.Please keep the Git author on a cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if the work is folded into another commit.AI-assisted with OpenAI Codex.
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.