GPU: the rectangle fallback's f16 narrowing keeps NaN and rounds ties to even #326
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!326
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-326"
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?
@RenzoWit35 on GitHub · 2026-11-24 23:34 UTC · original
RenzoWit35:fix/245-rect-f16-nan-and-ties→main· +120 −3 · 1 files · 1 commits · openFixes #245.
f32_to_halfin the CPU rectangle expansion sent NaN through the overflow branch (givinginfinity, 0x7c00) and rounded exact ties up (
1 + 2^-11gave 0x3c01). NaN now returns a quietNaN that keeps the sign (
sign | 0x7e00), and normal values round ties to even like thesubnormal path already did. A rounding carry still moves into the exponent, and overflow still
gives infinity.
Tests: the issue's tie and NaN corners through
expand_rects; NaN payloads, including one onlyin the dropped bits; and a hand-written ties-to-even reference compared against every half
value, every halfway point and its neighbours, and a strided f32 sweep. All failed before.
Testing
On Windows 11, MSVC Rust 1.98.1, branch alone on top of
main(2119b0e):cargo clippy --workspace --all-targets --locked -- -D warnings, the same with--all-features, andcargo test --workspace --lockedall pass. The new regression test fails onmainand passes here. All nine fix branches for #242-#250 also pass together when merged.🤖 Generated with Claude Code
@kaayzouee on GitHub · 2026-11-25 00:58 UTC · original
Duplicate of #315?
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.