The README, as a book
Docs
Every section of the FrankenNumPy README, 61 pages in 6 parts. The README in the repository is the source; these pages are rebuilt from it with each deploy. Press / to search them.
Overview
- The ProblemNumPy is the bedrock of scientific Python. It is also 30 years of C and Cython carrying every memory bug that any of that code ever had: buffer overruns in parsers, undefined…
- The SolutionFrankenNumPy rebuilds NumPy's behavior from scratch in safe Rust with two goals:
- Who This Is ForFrankenNumPy is not trying to replace NumPy for every workload tomorrow. It targets a specific audience:
- Why FrankenNumPy?Memory safety · Buffer overflows possible · 10 of 11 implementation crates declare #![forbid(unsafe_code)] (numeric core is unsafe-free); the 11th (fnp-python, the PyO3…
- Quick ExampleFrankenNumPy's parity claims — including every bit-exactness claim — are defined against NumPy >= 2.3. Older NumPy is not a supported oracle, and the conformance harness fails…
- More Worked ExamplesUFuncArray::sliding_window_view materializes the (8, 3) result as a new array. The zero-copy form is UFuncArrayView::sliding_window_view, which shares the source buffer, is…
- Design PhilosophyParity debt, not feature cuts. Surface parity is locked at 100% of numpy.__all__. Behavioral edge cases that still drift are tracked as parity debt to be closed, never as…
- InstallationRequirements: Rust nightly nightly-2026-08-31, pinned in rust-toolchain.toml and mirrored in .github/workflows/ci.yml via the RUST_TOOLCHAIN env var (single source of truth).
- API Surface1,805 public Rust functions across the 11 library crates (rg -c '^\s*pub fn ' over crates/*/src/**/*.rs, excluding the src/bin/ binary entry-points; 2026-10-08 count), exposing…
Architecture
- Architecturefnp-python sits above the canonical chain as the Python-facing surface; it does not alter the layering below it. Facts about that layering that the diagram does not show…
- Workspace and Crate MapExternal crate dependencies are pinned at the workspace root in [workspace.dependencies]: serde 1.0.229 (3 consumer crates), serde_json 1.0.151 (3 consumers), criterion 0.8.2…
- How It Works: Per-Crate Deep DiveThe type system is the foundation everything else builds on. 18 dtype variants cover the full NumPy type hierarchy:
- Algorithm CatalogHybrid approach supporting arbitrary input lengths:
Numerics
- Numerical Stability and Precision Notes"Same answer, mostly" is not enough. A library that aspires to bit-exact or behaviorally-equivalent output has to face concrete numerical-analysis choices.
- Determinism GuaranteesDeterminism is a graded property; the README is explicit about which kind applies where.
- Complete Distribution ListRandom-generation methods available on Generator:
- Array Manipulation ToolkitFunction · What it does
- Shared Memory and ViewsUFuncArrayView provides NumPy-style shared-memory views with overlap detection:
- Float Error State MachineFrankenNumPy replicates NumPy's floating-point error handling:
- Error TaxonomyFallible operations return Result<T, E> with an explicit error type. Library code still holds panic sites outside tests: 30 .unwrap(), 48 .expect( (plus 28 in the…
- Threading and Concurrency ModelFrankenNumPy parallelizes per operation rather than globally: an op runs rayon-parallel when measurement showed a win at that size and dtype, and serial otherwise (see…
Guarantees and recipes
- Versioning and Compatibility PromisesSurface · What we promise
- Reproducibility RecipeA concrete checklist for "make my numerical pipeline bit-reproducible from a fresh checkout, on any compatible machine, today and three years from now."
- Multi-Agent Development ProcessFrankenNumPy was built and continues to evolve under a multi-agent workflow. The tooling is documented here because it is visible in the repo (.beads/, .ntm/, .claude/, etc.)…
- SCE Invariants in DetailThe Stride Calculus Engine enforces five hard contracts. fnp-ufunc, fnp-linalg, fnp-random and fnp-conformance build on them; fnp-python mostly reads NumPy's own shape /…
- NaN Semantics Cheat SheetHow each common operation handles NaN, verified against NumPy:
- Memory Footprint and Allocation PatternsThe 16 variants of pub enum ArrayStorage (in crates/fnp-dtype/src/lib.rs); the table below groups the signed/unsigned integer pairs into one row each for brevity:
- How to Investigate a Parity IssueA practical runbook for "I think FrankenNumPy and NumPy disagree on something."
- NumPy Submodule Coverage MatrixHow each numpy.* submodule is covered by fnp_python. The "Engine" column says whether the call resolves through a Rust kernel or whether it is a tier-3 identity re-export of…
- CookbookRecipes for common Rust-side tasks. These complement the Quick Example and More Worked Examples sections, focusing on idiomatic patterns rather than feature demos. There is no…
- Migrating from NumPy: A ChecklistA practical checklist for Python users moving an existing NumPy-based codebase to fnp_python.
- Common PitfallsThings that look broken but aren't, plus things that look fine but bite you later.
Evidence
- Reading the Evidence LedgerThe EvidenceLedger in fnp-runtime is the audit trail for every runtime decision. If you embed the dual-mode runtime, you get a structured record of *which* input class hit…
- Security ModelFrankenNumPy's security posture covers more than memory safety.
- Threat ModelEvery threat log entry must include: fixture_id, seed, mode, env_fingerprint, artifact_refs, reason_code.
- Phase2C Extraction PacketsThe conformance system is organized around 9 extraction packets, each covering one domain of NumPy behavior:
- Test CoverageLive counts as of 2026-10-08 (rg -c '^\s*#\[test\]' over crates/*/src and crates/*/tests; docs/planning/FEATURE_PARITY.md carries the same per-crate counts). The 9,086 count…
- Conformance Methodology Deep-DiveThe "verify with a real NumPy oracle" claim deserves to be unpacked. The conformance system has four orthogonal layers that catch different classes of bug. They are…
- CI Gate TopologyStatus (2026-10-08). CI run 37725278874 (commit 4164ba32b) passed all nine gates, G1 through G9. Its G2 reported 9,006 tests passed, 0 failed and 70 ignored over 309…
- Conformance PipelineThe oracle capture pipeline runs real NumPy, captures its output, and compares against our implementation:
- PerformanceFrankenNumPy is profile-driven: every optimization is paired with a baseline, a single targeted lever, and a proof-backed delta artifact.
- Artifact Durability (RaptorQ)Twelve artifacts carry erasure-coding sidecars (2026-10-08): the conformance bundle (artifacts/raptorq/conformance_bundle_v1.sidecar.json, covering the ufunc fixture cases, the…
- Divergence LedgerBehavioral differences vs upstream NumPy that we accept either intentionally or as tracked parity debt live in docs/DIVERGENCES.md. The ledger is machine-readable: a diagnostic…
- FuzzingThe workspace ships 8 fuzz crates with 42 fuzz targets and 561 curated seed-corpus files as of 2026-09-25: seven per-crate fuzz crates (30 targets, 261 files) and the…
- Parity Statusparity_green below means the family's conformance suites pass against NumPy; it is not a claim that no divergence remains. Known open gaps (2026-09-23), each tracked under epic…
Context
- Comparison with Other Rust Array LibrariesFrankenNumPy is not the first Rust array library. It is the only one that targets NumPy compatibility as the primary success metric. Some quick positioning:
- Repository Layout
- LimitationsWhat doesn't work today.
- Roadmap (Phase 3 streams — ADR-001 Accepted 2026-10-17)Python packaging. pyproject.toml + maturin landed 2026-09-03 (pip install . works on Linux / CPython 3.13). CI gate G9 builds the Linux wheel and checks the installed package…
- Anti-GoalsWhat FrankenNumPy explicitly will *not* try to be:
- Performance Levers Applied So FarConcrete optimization passes that have landed, paired with what they bought. Each lever follows the optimization-governance pattern in docs/planning/PROPOSED_ARCHITECTURE.md:…
- What "Clean-Room" Means Here"Clean-room" appears repeatedly in this README; it deserves an unambiguous definition.
- F-order vs C-order in PracticeNumPy supports two memory orderings, and FrankenNumPy preserves the contract:
- Reading the Source CodeIf you want to understand how FrankenNumPy works at the source level, here are the natural entry points:
- Inspirations and Prior ArtFrankenNumPy stands on the shoulders of some specific design lineages worth acknowledging.
- Algorithm References and CitationsFrankenNumPy is a clean-room port. We re-implemented the algorithms by reading the published references and NumPy's C source, then wrote new Rust against the same mathematical…
- GlossaryProject-specific vocabulary used throughout the README, docs, and code comments:
- Project Timeline at a GlanceMajor milestones in the order they landed. For the full per-commit history, see CHANGELOG.md; for the live bead trail, see .beads/issues.jsonl.
- FAQIs this a drop-in replacement for NumPy? Surface-wise yes: fnp-python exposes 100% of numpy.__all__ (499/499 names on the numpy<2.5 CI oracle), structurally locked by…
- About ContributionsPlease don't take this the wrong way, but I do not accept outside contributions for any of my projects. I simply don't have the mental bandwidth to review anything, and it's my…
- LicenseMIT with an OpenAI/Anthropic rider. See LICENSE.