Docs/Context
What "Clean-Room" Means Here
"Clean-room" appears repeatedly in this README; it deserves an unambiguous definition.
What we do:
- Read the published references behind every numerical algorithm (papers cited below).
- Read NumPy's C source code for behavior (what inputs produce what outputs, edge cases, error paths, dtype promotion rules, RNG state schemas), but treat the C as a behavioral specification rather than as code to translate.
- Write new Rust against that specification, structured idiomatically for Rust (enums,
Result,const fn; nounsafeoutsidefnp-python). - Verify the result against NumPy's actual output via the differential oracle. The conformance gate is the proof of behavioral equivalence; the source is not the artifact.
What this implies:
- The Rust code is original. There is no line-by-line translation of NumPy's C macros, no replicated header layouts, no copied comments.
- License compatibility is straightforward: FrankenNumPy is MIT-with-rider (see
LICENSE), independent of NumPy's BSD-3-Clause. The behavioral surface is interoperable; the codebases are not. - Algorithmic correctness comes from the mathematics and the oracle, not from the original implementation. When NumPy's C has a bug, our differential test surfaces it as a divergence to be triaged on its own merits; we do not silently inherit the bug.
- A reader of
crates/fnp-*/src/lib.rsshould be able to understand each kernel from first principles without needing to consult NumPy's C. The reader of the conformance harness gets the additional guarantee that the kernel matches NumPy's observable behavior.
The legacy_numpy_code/numpy/ directory is checked into the repo as a behavioral oracle for the conformance system; it is the upstream NumPy source for differential-testing reference only.