paritytext

package
v0.182.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const Issue = "go-fft/fft#121"

Issue is the model: the decision, with its reasons, in the tracker.

View Source
const MaxText = 1 << 20

MaxText bounds what Scan reads: a body is a page, not a corpus.

View Source
const Parked = "go-fft/fft#116"

Parked is the example of the pattern the gate catches.

View Source
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.

View Source
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.

View Source
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

func Gate(text, waiver, flag string) (string, error)

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

func GateTitle(t, flag string) error

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

func HasBitIdentity(s string) bool

HasBitIdentity reports whether s uses a bit-identity word, without the paraphrases the parking pattern uses.

func Refusal

func Refusal(what string, found []Finding, flag string) error

Refusal is what the author reads: it names the rule and the model, the sentences, and the two ways forward.

func Stamp

func Stamp(reason string) string

Stamp is the line a waiver publishes beside the text it excused.

func Strip

func Strip(text string) string

Strip blanks what is not the author's statement, keeping every newline so that line numbers survive.

func Window

func Window(us []Unit, i int) string

Window is a cue's reach: the sentence and its neighbours in the paragraph.

Types

type Finding

type Finding struct {
	Rule     string // which pattern fired
	Sentence string
	Line     int
}

Finding is a sentence that defers or declines a performance change because of bit identity.

func Scan

func Scan(text string) []Finding

Scan returns the sentences of text that defer or decline a performance change because of bit identity. It reads at most MaxText bytes; the rest is not looked at, which the caller must say (see Gate).

func (Finding) String

func (f Finding) String() string

type Unit

type Unit struct {
	Text string
	Line int // 1-based
	// contains filtered or unexported fields
}

Unit is one sentence and where it starts.

func Units

func Units(text string) []Unit

Units splits stripped prose into sentences with their line numbers. A blank line, a list item, a heading or a table row begins a new paragraph.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL