Repository navigation
Accuracy contract: stated error bounds against a math/big oracle - #114
Merged
Merged
Conversation
…for Sum and MatMul Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…og figures as stated by floats Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the accuracy contract, following the fleet rule of 2026-11-11 (model: Refs go-fft/fft#121): bit identity with NumPy was a porting step, and the contract is now a stated error bound checked against an exact oracle. This is step 1 of that order, so no behaviour changes.
accuracy_bound_test.go:TestAccuracyBoundSumchecksSumin float64 and float32 at n from 1 to 2²⁰ againstmath/bigat 1024 bits, with Higham's γ_d bound for the rounding depth of NumPy's pairwise sum.TestAccuracyBoundMatMulchecks every element ofMatMulin float64 and float32 (shapes from 1×1×1 to 256³) against the γ_k·(|A|·|B|) bound, which holds for any summation order, with or without FMA.Mutation check: with the oracle computed over
xs[1:](one element dropped),TestAccuracyBoundSumfails at all seven sizes. The input range is 2^±4, so the bound stays below the smallest element.paritycheck repo .: it FAILed on main (statements such as README "bit-identical to np.sum" with no marker) and PASSes on this branch.What follows, one PR per lever, each measured and landing only if faster and within the bound: faster default orders for
SumandDot, and FMA where it pays. The current arithmetic stays available as an option.🤖 Generated with Claude Code