BC6H: avoid negative zero after signed final scaling #24
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/holdmysocks--SixNG!24
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/24/head"
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?
@ifBars on GitHub · 2026-11-23 01:57 UTC · original
ifBars:fix/bc6h-signed-zero→claude/interesting-mcclintock-bff8f2· +16 −3 · 1 files · 1 commits · merged 2026-11-23 02:20 UTCFound a small edge case while checking #23 against bcdec and Microsoft's BC6H decoder rules.
finish(-1, true)returns0x8000, but scaling first should give0x0000.This moves sign selection after scaling and adds a synthetic block regression. It changes the half-float bits; the clamped PNG looks the same.
I based this on #23's branch to keep the diff small. The new test fails before the fix. With it,
cargo test --locked -p sixng-core --no-default-features --libpasses 84 tests, with one existing real-data test ignored. I also checked the adapted decoder against bcdec across 147,456 synthetic blocks for each signedness, and all 14,155,776 half values match.@holdmysocks on GitHub · 2026-11-23 02:22 UTC · original
Thanks for the fix. This PR targeted #23's branch, which had already been merged, so it was cherry-picked onto
masterase0ebb4bwith your authorship kept.