FrankenNumPy

Docs/Context

Glossary

Project-specific vocabulary used throughout the README, docs, and code comments:

Term Definition
SCE Stride Calculus Engine. The single Rust subsystem (fnp-ndarray) that owns all shape-transformation rules: shape→strides, broadcast legality, reshape with -1 inference, alias-sensitive view transitions.
Strict mode Runtime mode that maximizes observable NumPy compatibility for the full legacy behavior matrix. No behavior-altering repairs.
Hardened mode Runtime mode that preserves the API contract while adding safety guards and bounded defensive recovery for malformed inputs and hostile edge cases.
Evidence ledger Append-only structured log of every runtime decision (action, class, evidence terms, posterior probability, timestamp, env fingerprint). Lives in fnp-runtime.
Override audit event A separate, narrowly-scoped record for any explicit human-requested bypass of a fail-closed gate. Always paired with an audit reference.
Parity debt A behavioral divergence from NumPy that is scheduled to be closed, not an accepted scope reduction. The parity_debt rows in docs/DIVERGENCES.md are the live tracker.
Intentional divergence A behavioral difference from NumPy that we deliberately accept. Recorded as an intentional row in docs/DIVERGENCES.md (see Divergence Ledger).
Oracle The reference implementation we compare against; almost always a real NumPy on the build host. A pure_python_fallback oracle is rejected by the G3 gate.
Witness A hard-coded expected output for a specific RNG seed or kernel input. Witness comparison catches silent algorithmic drift even when the new output is mathematically valid.
Phase2C extraction packet One of nine domain-scoped specification bundles (FNP-P2C-001 through FNP-P2C-009). Each packet ships a fixture manifest, contract table, parity gate, risk note, and parity report with RaptorQ sidecar + decode proof.
Contract schema The phase2c-contract-v1 schema that the packet readiness validator (validate_phase2c_packet) checks each packet against. A packet that is missing a required field is not_ready.
Differential A test layer that compares FrankenNumPy output to NumPy output for the same input.
Metamorphic A test layer that verifies an identity property (e.g. sum(a) == sum(sort(a))) that must hold regardless of input.
Adversarial A test layer driven by curated hostile fixtures and coverage-guided fuzzing.
Witness stability A test layer that pins exact RNG and kernel outputs as hard-coded constants, so unintended algorithmic changes show up as diffs.
G1–G9 The nine CI gates: fmt+lint, unit/property, oracle differential, adversarial+security, test contract, workflow forensics, performance budget, durability/decode (G1–G8, chained in that order), and the wheel build (G9, after G1).
RaptorQ sidecar An auxiliary file alongside an artifact bundle containing the fountain-code encoding parameters plus base64-encoded source and repair symbols.
Scrub The process of decoding all symbols, computing the payload hash, dropping a symbol, and verifying that recovery from the remaining symbols still hashes to the same value.
Decode proof A machine-checkable record asserting that scrub succeeded (recovery_success: true).
PCG64DXSM The default bit generator. 128-bit state, 128-bit increment, DXSM output function; bit-exact match for NumPy's numpy.random.PCG64DXSM.
BTPE / HRUA / PTRS Distribution-specific rejection algorithms ported from NumPy's C source. BTPE = Binomial / Triangle / Parallelogram / Exponential (Kachitvichyanukul & Schmeiser 1988); the four regions of the bounding-envelope rejection sampler. HRUA = Hypergeometric Ratio-of-Uniforms with Aliasing (Stadlober 1989). PTRS = Poisson Transformed Rejection (Hörmann 1993).
Lemire's method The bounded-integer rejection algorithm used by NumPy for random_bounded_uint64. Two-tier dispatch: 32-bit ranges use buffered next_uint32, larger ranges use 128-bit multiplication.
Bead / br An issue in the project's beads_rust tracker (br ready, br close, etc.). Used for dependency-aware work selection. As of 2026-10-08, 2,873 beads are closed.
bv Graph-aware triage on top of the bead database (PageRank, betweenness, critical-path).
MCP Agent Mail The advisory file-reservation and inter-agent messaging system used during multi-agent development on this repo. Not a runtime dependency of FrankenNumPy itself.

This section in the README on GitHub