Documentation
¶
Overview ¶
Package paritytext reads prose and decides whether it defers or declines a performance change BECAUSE the change would break bit identity ("bit parity") with a reference implementation.
The rule is the fleet decision of 2026-11-11: bit identity with a reference is a PORTING STEP, never the contract. The contract for numeric code is "correct and as fast as possible" — a stated error bound, asserted against an extended-precision oracle, with the bit-exact arithmetic kept only as an option. A performance gap is never parked because "it would break bit-parity". The model is go-fft/fft#121; go-fft/fft#116 is the parking pattern: a faster real-input path "rounds differently", "is a contract change", so "it needs a decision, not a drive-by".
What a finding is ¶
A sentence is a finding when it has the three parts of the pattern and the text cites no measured bound:
- a PARITY cue: bit-identical, bit-exact, bit-for-bit, bit parity, bit identity, bitwise identical, "rounds differently", "differs in the last bits"...;
- a BLOCKING relation tying it to a performance change: "because", "would break", "contract change", "keep the bit-identity contract" beside an option, a decline or a deferral;
- a PERFORMANCE cue in the sentence or its neighbours (faster, SIMD, FMA, kernel, reorder, gap...).
The three are separate regular expressions, listed below, so that a finding says which rule fired and the reader can disagree with a rule rather than with a score. A sentence that only MENTIONS parity ("output unchanged, bit-identical") has no blocking relation and passes: that is the commonest sentence in a performance pull request and a gate that fired on it would be worse than none.
What is not read ¶
Fenced code, inline code, block quotes and HTML comments are blanked: a test name (`TestFFTRealBitIdenticalToPromotedFFT`) or a quoted earlier comment is not the author's statement.
The exemption and the waiver ¶
A text that cites a MEASURED error bound passes: a sentence naming an error (error, ulp, RMS, tolerance, bound...) beside a number written as a number (2.2e-16, 3 ulp, 4ε). "Within tolerance" is not a measurement. Otherwise a waiver, a REASON that is STAMPED into the published text, lets it through.
Index ¶
- Constants
- func Gate(text, waiver, flag string) (string, error)
- func GateTitle(t, flag string) error
- func HasBitIdentity(s string) bool
- func Refusal(what string, found []Finding, flag string) error
- func Stamp(reason string) string
- func Strip(text string) string
- func Window(us []Unit, i int) string
- type Finding
- type Unit
Constants ¶
const Issue = "go-fft/fft#121"
Issue is the model: the decision, with its reasons, in the tracker.
const MaxText = 1 << 20
MaxText bounds what Scan reads: a body is a page, not a corpus.
const Parked = "go-fft/fft#116"
Parked is the example of the pattern the gate catches.
const Rule = "bit identity with a reference is a porting step, never the contract (decision 2026-11-11)"
Rule names the fleet rule, quoted in every refusal.
const RuleSummary = "a performance gap is never parked because it would break bit parity"
RuleSummary is the rule in one line; a text may quote it (and only it) without being read as deferring anything.
const StampPrefix = "⚠ Published with a bit-parity waiver, by express reason: "
StampPrefix begins the line a waiver publishes; the scanner skips such a line so that a reason can say what it needs to.
Variables ¶
This section is empty.
Functions ¶
func Gate ¶
Gate returns text, with a waiver's stamp appended when one was needed, or the refusal. A text over MaxText is refused rather than half read: an unread answer is not a pass.
func GateTitle ¶
GateTitle refuses a title that defers a performance change because of bit identity. No waiver covers a title: it cannot carry the reason.
func HasBitIdentity ¶
HasBitIdentity reports whether s uses a bit-identity word, without the paraphrases the parking pattern uses.
func Refusal ¶
Refusal is what the author reads: it names the rule and the model, the sentences, and the two ways forward.
Types ¶
type Finding ¶
Finding is a sentence that defers or declines a performance change because of bit identity.