Repository navigation
flate: avoid FMA in EstimatedBits for portable rounding - #1224
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change refactors floating-point calculations in ChangesCompression output consistency
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The changed compression path is deterministic and directly covered by the regression test; no actionable merge risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation Issue Resolution Identify and fix the remaining architecture-dependent computation that affects compressed output. Add regression coverage that verifies identical output across the supported architectures or otherwise verifies the architecture-independent result.
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1baf2fd to
48b9727
Compare
|
Let's hold off merging for a moment. I noticed that |
|
Sure, no rush. |
EstimatedBits and mFastLog2 had chained multiply-add expressions that the compiler is allowed to contract into fused multiply-adds. FMA contraction rounds differently than sequential multiply+add, so EstimatedBits previously returned a different result on architectures with hardware FMA (e.g. arm64) than on default amd64, making EstimatedBits, and the resulting compressed output, GOARCH-dependent. Fixes klauspost/pgzip#72
48b9727 to
2c13814
Compare
|
@klauspost I found more places that are affected by FMA contraction. |
|
Cool. I will check it out Monday. |
flate: avoid FMA in EstimatedBits for portable rounding EstimatedBits and mFastLog2 had chained multiply-add expressions that the compiler is allowed to contract into fused multiply-adds. FMA contraction rounds differently than sequential multiply+add, so EstimatedBits previously returned a different result on architectures with hardware FMA (e.g. arm64) than on default amd64, making EstimatedBits, and the resulting compressed output, GOARCH-dependent. See also: klauspost/compress#1224 Fixes golang#81589
flate: avoid FMA in EstimatedBits for portable rounding EstimatedBits and mFastLog2 had chained multiply-add expressions that the compiler is allowed to contract into fused multiply-adds. FMA contraction rounds differently than sequential multiply+add, so EstimatedBits previously returned a different result on architectures with hardware FMA (e.g. arm64) than on default amd64, making EstimatedBits, and the resulting compressed output, GOARCH-dependent. See also: klauspost/compress#1224 Fixes golang#81589
flate: avoid FMA in EstimatedBits for portable rounding EstimatedBits and mFastLog2 had chained multiply-add expressions that the compiler is allowed to contract into fused multiply-adds. FMA contraction rounds differently than sequential multiply+add, so EstimatedBits previously returned a different result on architectures with hardware FMA (e.g. arm64) than on default amd64, making EstimatedBits, and the resulting compressed output, GOARCH-dependent. See also: klauspost/compress#1224 Fixes golang#81589
EstimatedBits and mFastLog2 had chained multiply-add expressions that the compiler is allowed to contract into fused multiply-adds.
FMA contraction rounds differently than sequential multiply+add, so EstimatedBits previously returned a different result on architectures with hardware FMA (e.g. arm64) than on default amd64, making EstimatedBits, and the resulting compressed output, GOARCH-dependent.
Fixes klauspost/pgzip#72
Summary by CodeRabbit
Tests
Refactor