Repository navigation
fgf 3.0.0-rc.1
Pre-release
Pre-release
Added
- Version-independent benchmark labels and separate absolute
benchmarks/v2/
andbenchmarks/v3/records, with matched speed factors under
benchmarks/comparison/. Released v2.1.0 replaces the generic-API baseline. - Reproducible benchmark-only v2 preparation, paired host campaigns, and a
fail-closed publisher with a raw-record cell evidence index. - Custom RS-rooted
gf16done-shot, prepared, and scalar measurements, with
no fabricated released-v2 counterpart. - Explicit binary embeddings:
Embedding<S, T>prepares the canonical
inclusion of one binary field into another whose degree is a multiple of
it, for every supported presentation — polynomial, ordered-basis, and
tower, customTowerSpecinstances included. One frozen reference per
degree (Polynomial<3>,Polynomial<0x7>,Polynomial<0x13>, the AES
field, and the Rijndael towersBinary<16, Tower<Rijndael16>>,
Binary<32, Tower<Rijndael32>>, andBinary<64, Tower<Rijndael64>>) fixes the
consecutive inclusions: the identity into degree two, smallest-raw-root
inclusions below the AES field, and low-component inclusions above it.
newreturnsEmbeddingError::IncompatibleDegreewhen the source degree
does not divide the target degree.embed,contains,restrict,
frobenius,trace, andnormapply the prepared column arrays without
allocating; equal presentation descriptions embed identically, and
Embedding<Binary<1, Polynomial<3>>, T>supplies the absolute trace and norm. - Recursive quadratic towers through degree 64. One open
TowerSpec
suppliesBase,LINEAR_COEFFICIENT,CONSTANT_COEFFICIENT, andNAME
for every quadratic tower at degrees 2, 4, 8, 16, 32, and 64 over a
supported base of half the degree;TowerGeneratorSpecoptionally pins a
multiplicative generator checked to full order against the complete prime
factors of2^N - 1at each degree. Shipped specs root at the AES field
(Rijndael16,Rijndael32,Rijndael64) or nest from GF(2) through the
Wiedemann relation (FanPaar2throughFanPaar64, the degree-two and
degree-four levels joining the ladder). Custom specs validate through the
field description: the base first, excess coefficient bits,A != 0, and
absolutetrace(B/A^2) == 1for the relationt^2 + A*t + B = 0. - Custom tower bulk operations: one dispatch implementation per degree
serves every representation, routing pinned Rijndael and Fan-Paar
descriptions to their vector kernels and every other tower to the typed
scalar fallback withbackend_forreportingScalar; degree-eight
towers join the single degree-eight dispatch. Towers at degrees 8, 16,
32, and 64 implementFieldBuffer. - Ordered-basis byte presentations:
Normal<P, E>wraps a polynomial
element into its conjugate basis (bitiselectsE^(2^i); one is all
bits set) andCantor<P, SEED>builds the chainc_(N-1) = SEED,
c_i = c_(i+1)^2 + c_(i+1)(bitiselectsc_i; validity asserts
c_0 == ONE), at degrees 2, 4, and 8. Basis rank and inverse columns are
checked by bounded enumeration; generators are the transported polynomial
generators, verified to full order. Polynomial presentations extend to
degrees two (Polynomial<0x7>) and four (Polynomial<0x13>,
Polynomial<0x19>,Polynomial<0x1F>); degrees 1, 2, and 4 are
scalar-only. Basis bulk operations run the typed scalar fallback;
polynomial arithmetic never touches basis coordinates. - Open scalar field definitions.
Fieldis implementable downstream;
PrimeCharacteristic<P>supplies a checked prime identity at anyu64
prime through deterministic Miller-Rabin, and the central validation
block — reached from every generic construction — checks the
characteristic identity, a positive degree,ORDER == CHARACTERISTIC^DEGREEwith overflow checking, and the binary degree cap
of 64. Binary fields convert throughBinaryField::to_coordinatesand
from_coordinates, which reject excess bits above the degree through
CoordinateError. just cross-checkcompiles the AArch64 and Wasm library paths, including
the explicit Wasm SIMD configuration, andjust bench-build NAMEbuilds a
portable benchmark artifact without running it.just bench-gf16-compruns an interleaved native GF(2^16) field
comparison against GF-Complete,reed-solomon-erasure,
reed-solomon-simd, and Leopard-RS 1.x; the harness validates basis maps
and region outputs against independent arithmetic, includes
duplicate-operation controls, and reports unavailable primitives
separately.bench-gf-compincludes the same harness in its shuffled
rounds.- The benchmark record is split by field family.
BENCHMARKS.mdindexes
the pages underbenchmarks/and holds the hosts, shared method, number
format, and reproduction commands; each page carries its own setup,
self-timings, and competitor tables. Every value in a table has the same
digit count, so paired Tiger Lake / Golden Cove cells line up down each
column.
Changed
-
Breaking: fields have no public type aliases;
Binary<N, R>is the
only spelling.Gf1,Gf16,Gf32,Gf64, andFanPaar2through
FanPaar64(the field aliases) are not provided: replace each with its
canonical type —Binary<1, Polynomial<3>>,
Binary<16, Tower<Rijndael16>>,Binary<32, Tower<Rijndael32>>,
Binary<64, Tower<Rijndael64>>, andBinary<N, Tower<FanPaarN>>— or
declare a local alias such as
type Gf2P16 = Binary<16, Tower<Rijndael16>>;. The Fan-Paar spec markers
are named likeRijndael16:FanPaar2SpecthroughFanPaar64Specbecome
FanPaar2throughFanPaar64, so Fan-Paar GF(2^16) is
Binary<16, Tower<FanPaar16>>. -
Breaking:
Binary<N, R>replacesGf<N, R>and explicitly names
characteristic-two fields;BinaryFieldremains the capability trait.
Polynomial<P>replacesPoly<P>, andRSreplacesREED_SOLOMON
for the unchanged0x11Dpolynomial convention. TheGf8<R>transition
alias is removed: replace it withBinary<8, R>, including associated
item paths such asBinary::<8, Polynomial<AES>>::ORDER. For example,
Elem<Gf8<Poly<REED_SOLOMON>>>becomes
Elem<Binary<8, Polynomial<RS>>>. No compatibility aliases remain. -
Breaking:
TowerSpec::LINEAR_COEFFICIENTand
TowerSpec::CONSTANT_COEFFICIENTreplaceTowerSpec::Aand
TowerSpec::B. Rename the associated constants in custom specs and their
qualified uses; values remain raw coordinates inBasefor the relation
t^2 + A*t + B = 0.TowerSpecandTowerGeneratorSpecremain separate:
arithmetic requires no selected generator. Field arithmetic, wire bytes,
selected generators, and backend routing are unchanged. - The canonical
$GF(2)$ benchmark label isgf1, denoting extension degree.
Its pages move fromgf2.mdtogf1.mdin the v2, v3, and comparison
directories; the released-v2 API mapping remainsGf2. -
Breaking: one element wrapper,
Elem<F>, replaces every concrete
element path.mersenne31::Elem,goldilocks::Elem,
quad_mersenne31::Elem, the binaryElem<N, R>spelling, the
gf16/gf32/gf64and Fan-Paar element structs, andgf2::Elemare
removed, as are the moduleGENERATORconstants (Elem::<F>::GENERATOR
replaces them all).Gf2becomesBinary<1, Polynomial<3>>, and
bits::dot_productreturnsElem<Binary<1, Polynomial<3>>>. Migrate
gf2::ElemtoElem<Binary<1, Polynomial<3>>>,mersenne31::Elemto
Elem<Mersenne31>,gf16::ElemtoElem<Binary<16, Tower<Rijndael16>>>,
fan_paar::fp16::ElemtoElem<Binary<16, Tower<FanPaar16>>>, and the
binaryElem<8, Poly<POLY>>toElem<Binary<8, Polynomial<POLY>>>;
spell elements of the wider towers and the prime families the same way.
Inherentconstarithmetic sits on theElem<F>types;ZERO,ONE,
GENERATOR, andto_raware the generic items and are not redeclared
per family.Debug
for every element is the genericNAME(raw)format; familyDisplay
formats are unchanged. The scalar-arithmetic traitfield::Elemis
renamedFieldElem(re-exported asfgf::FieldElem): replace
use fgf::field::Elem;trait imports withuse fgf::field::FieldElem;.
Wire bytes, generators, and relations are unchanged. -
Breaking:
Fieldis split into three contracts.Fieldkeeps scalar
algebra and metadata (Raw,Characteristic,NAME,DEGREE,ORDER,
ZERO_RAW,ONE_RAW,VALID, raw arithmetic);FieldBuffercarries the
byte encoding (BYTES,STORAGE_BITS,decode,encode), implemented
by binary degrees 8/16/32/64 and the prime families;HasGenerator
carries the selected generator (GENERATOR_RAW).Field::Elem,
Field::BITS,Field::CHARACTERISTIC,Field::GENERATOR, and
Field::elem_countare removed. Generic code reads the characteristic as
<F::Characteristic as PrimeIdentity>::CHARACTERISTIC, the storage width
asFieldBuffer::STORAGE_BITS, and the generator as
Elem::<F>::GENERATORunder aHasGeneratorbound.FieldKernelsand
everyopsoperation —pack,unpack, andpack_to_vecincluded —
bound onFieldBufferand takeElem<F>.FieldElemis sealed and
implemented only by the blanketimpl<F: Field> FieldElem for Elem<F>;
downstream custom fields implement the newFieldcontract and receive
the trait. The trait exponent isu128(pow(u128)), the inherent
const powon every family takesu128, andQuadMersenne31::pow_u128
is removed in its favour. -
Breaking: prime
from_rawcanonicalizes andto_rawreturns
canonical storage. In 2.x,from_rawanddecoderetained the
unreduced lane andto_rawexposed the stored bits; every safely
constructed element now holds canonical coordinates, so comparison,
hashing, and packing see the reduced lane. Packed prime operations accept
every lane bit pattern a decode accepts and emit canonical lanes on
output — accumulate, in-place, and tails included — and zero-coefficient
accumulation and unit-coefficient in-place scaling are defined no-ops
that preserve their inputs byte for byte. Migrate by deleting manual
canonicalization after construction; published canonical byte fixtures
and mathematical values are unchanged. The inherentcanonical()methods
are removed;pack/unpackround-trip canonical lanes. -
Breaking: binary representations are descriptor-backed.
Repr<N>and
ByteReprare removed in favour ofBinaryRepr<N>, which carries the
presentationNAME, an opaqueBinaryDescription, an optional
ByteLogExptable slot at degree eight, and the use-timeVALIDcheck;
BinaryFieldadds the canonical coordinate conversions and
BinaryDegree<N>pins the exact degree a generic tower row may build on.
MigrateRepr<8>/ByteReprbounds toBinaryRepr<8>and read tables
throughLOG_EXP; the kernel table banks
move with the representations. The representations live in the binary
subtree:field::binary(Binary, the coordinate surface),
field::binary::poly,field::binary::normal,field::binary::cantor,
andfield::binary::descriptionreplace the removedfield::repr,
field::poly, andfield::gf1modules. -
Breaking:
Poly<const P: u32>becomesPolynomial<const P: u128>,
and theAESand renamedRSconstants widen tou128with the same
values.PolynomialimplementsBinaryReprat degrees 1, 2, 4, and 8;
onlyPolynomial<3>is the degree-one form, giving GF(2) as
Binary<1, Polynomial<3>>. Generic flat byte fields support any
irreducible degree-eight polynomial — Data Matrix0x12Dand the CCSDS
basis0x187included — with x86 GFNI elementwise multiplication deriving
an isomorphism onto the AES field for each polynomial. Migrating from the
2.x names:Gf8B/Gf8DbecomeBinary<8, Polynomial<AES>>/
Binary<8, Polynomial<RS>>,gf8b::Elem/gf8d::Elembecome
Elem<Binary<8, Polynomial<AES>>>/Elem<Binary<8, Polynomial<RS>>>,
and other conventions spellPolynomial<0x12D>orPolynomial<0x187>
directly; import the constant (Polynomial<AES>) rather than qualifying
it (Polynomial<fgf::AES>) in const-generic position. Values, wire
encodings, and generators are unchanged. -
Breaking: the Rijndael and Fan-Paar hierarchies collapse into the
recursive tower.RijndaelToweris renamedRijndael16and joined by
Rijndael32andRijndael64: 2.xGf16,Gf32, andGf64become
Binary<16, Tower<Rijndael16>>,Binary<32, Tower<Rijndael32>>, and
Binary<64, Tower<Rijndael64>>. Thegf16,gf32, andgf64modules,
quad_tower!, the concrete Fan-Paar element and marker types, the
field::fan_paarandfield::wiedemannmodules, and their
DELTA/ALPHA/GENERATORmodule constants are removed. Migrate the
relation constants toLINEAR_COEFFICIENT/CONSTANT_COEFFICIENTin the
spec; wire bytes, generators, and relations are unchanged. The
independent Fan-Paar recurrence stays available as
field::binary::tower::{fp_multiply, fp_square, fp_invert, fp_mul_alpha}, re-exported underinternalsas
internals::field::fan_paar.TowerSpecis open:LINEAR_COEFFICIENT
andCONSTANT_COEFFICIENTareu64base-coordinate words, the base
bound becomesBinaryFieldat half the degree, and the generator moves
to the optionalTowerGeneratorSpec. The unstable
internals::kernel::fan_paardispatch
module merges intointernals::kernel::tower::{gf16, gf32, gf64}, whose
Preparedenums carry raw words and tiles;x86::fan_paarkeeps its
token-bearing entries unchanged. Path moves:field::tower→
field::binary::tower;field::wiedemann→ the recurrence functions in
field::binary::tower; thekernel::fan_paardispatch merges into
kernel::tower. - Bulk routing follows the field description. Ordered-basis byte fields,
degree-eight towers, custom tower specs, and towers over basis bases
route every bulk operation and tail through the typed scalar fallback,
withbackend_forreportingScalar; the GFNI degree-sixteen route that
served non-AES polynomial bases through the AVX2 tables kernels is
removed in favour of that fallback.backend_for::<F>()states the tier
actually servingF's bulk operations and
has_vector_elementwise::<F>()reports elementwise eligibility
separately. XOR-shaped operations — row addition, broadcast scalars, and
add/sub_assign— stay field-independent and serve basis coordinates
on the vector units. -
Breaking (unstable surface only): the direct kernels under
fgf::internals::kernelare laid out by field family, then instruction
set, with one entry per operation and ISA, representation-erased. The
GFNI and AVX-512 fixed-coefficient entries takePrepared—
unparameterized, built withPrepared::new— instead of a typed element
orPrepared<POLY>; the GFNI byte bodies select their multiply through a
const NATIVE: boolparameter (truefor the AES encoding,falsefor
the affine map).scale_table_8dandaffine_8b/affine_8dbecome
scale_tableandaffine_map. Elementwise ISA entries take the
isomorphism onto the AES field and the reduction byte as explicit
arguments (isomorphism_to_aes::<POLY>()and the polynomial's low byte)
instead of a polynomial const parameter; the GF(2^16) elementwise entries
take the relation's constant byte and the base reduction byte. The
multi-row x86, AArch64, and Wasm entries take prepared coefficients — a
Matrix<Prepared>provider such asFlatMatrix<Prepared>or a slice of
(&[Prepared], &[u8])pairs — instead of element slices; the
element-taking matrix wrappers (mul_add_matrix_gfni,
mul_into_matrix_avx512, and kin) are removed in favour of the_with
provider entries. The GF(2^16) kernel surface carries raw-erased
payloads:TowerCoeffthe raw coefficient word and the two broadcast
words,TowerTablesthe raw word and four nibble tables, both built with
new(representation inferred from the element);
internals::kernel::gf16::Preparedcarries those raw forms, with
Plain(u16)for the fallback. The scatter, gather, and matrix entries
take coefficients through provider forms — an element slice (resolved on
access), a materialized table slice, or a matrix provider such as
FlatMatrixorgf16::FlatResolved. Supported public API paths are
unchanged.