Honour directed rounding in v_mul_f16 #4805
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4805
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4804"
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-12-01 09:24 UTC · original
andrewpozdnakov7-jpg:codex2/fix/f16-mul-rounding→main· +51 −1 · 2 files · 1 commits · openWhat it changes
v_mul_f16now honours the half-precision modes that round toward positive and negative infinity. The product of two finite halves, including power-of-two output scaling, is exact in f32. The translator truncates the product to a half, widens it for comparison and advances one encoding when the truncated result is on the wrong side of the product.AMD RDNA 2 instruction and rounding modes · Original scalar implementation in VIctory #3804
How it was tested
5fabb46e, six of the 32 results differed, three in each infinity mode. The nearest-even and toward-zero cases matched.f6016ffb5f68a4abfea37ca92270379fcb7b3613, covering finite inexact products, signed underflow, overflow and exact results.emit::valu_tests::f16_multiply_respects_directed_roundingpassed on Windows/MSVC.cargo xtask policy --stagedpassed for both files.mainhas five existing Clippy errors. Main CI / check · Shared lint fix #4708Checked for overlap
Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change into another commit.AI-assisted with OpenAI Codex.
@cloph-dsp on GitHub · 2026-12-01 12:38 UTC · original
Verification of this PR (AI-assisted: Hy4 flash), source only, no game data.
Windows / rustc 1.100.0 / MSVC. Worktree at head
f6016ffb, dedicated per-worktree CARGO_TARGET_DIR (D:\Victory-Contrib\NVIDIA-Contrib\target-4804), never shared.Negative control on base
5fabb46e:git grep -F f16_multiply_respects_directed_rounding 5fabb46e -- .-> exit 1 (test is new)Whitespace:
git diff --check 5fabb46e..f6016ffb-> exit 0, clean.->
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 546 filtered out.The helper
f16_directed_productand the test are both new; the test compares against a separate reference product rather than reusing the emitter, so it is not tautological.GPU/driver: N/A (lowering/rounding test, no device).
Verdict: PASS for the new synthetic test on this host.
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.