decisions DECIDED

136. A mature foreign implementation earns its place as an oracle, not as a dependency

calef, 2026-08-30. Decided for ext4 in milestone 190 (ext4, read and write: a Rust implementation with libext2fs as the host-side oracle) and generalized here at his direction, because the position is not about filesystems and was discoverable only by reading one. (Section number provisional until the merge queue lands it.)

What is being decided

When a mature implementation of a format or protocol exists in a language or under a license this project would not ship, what role it may take. The same question holds for one that falls short of the bar in §46 (thin primitives or whole subsystems; we write everything in between).

The rule: it runs on the host, outside the shipping graph, as the reference our implementation is differentially tested against. It is a tool, not a dependency.

An oracle stays an oracle. Meeting §46's bar is what turns a foreign implementation into a dependency: a Rust crate that meets it is a candidate under §46 like any other, and an architect rules on it there. One that cannot meet it, because it is C, needs a libc, or carries a license nife does not link, serves only as an oracle. One that falls short only for now serves as an oracle while we contribute upstream to bring it to the bar.

The axis §46 and §83 leave open

§46 (thin primitives or whole subsystems; we write everything in between) decides write versus take. §83 (when the same thing exists in C and in Rust, take the Rust one) decides which implementation when both languages offer one. Neither says what to do with the implementation you did not take, and the default answer has been nothing.

That default throws away the one thing the mature implementation is unambiguously best at. §46's own rule 4 is the argument: prefer depending where correctness is won by exposure rather than by reading a specification. A mature implementation is that exposure, accumulated. Using it as an oracle captures the exposure without taking the dependency, which is the trade §46 was reaching for and could not express, because it only had "write" and "take" as verbs.

The tree already does this and never named it

Which is §46's own diagnosis about itself, one level over: the practice was unanimous in effect and written down nowhere.

What it dissolves

The objections that make a mature C implementation unusable are objections to shipping it, and every one of them evaporates on the host.

For ext4 that is the worked example: libext2fs is LGPLv2, needs a libc, and is C in the storage path, which §34 (RedoxFS is the primary filesystem) refused for littlefs on exactly those grounds. As a host tool in tools/, none of the three is true. What survives is thirty years of exposure to real images, which is the half worth having.

What this does not license

It is not a way to take a dependency by calling it a test. The oracle lives outside the workspace, like tools/redoxfs_host, and nothing in kernel/, crates/ or user/ may depend on it. If it is in the shipping graph it is a dependency and §46, §83 and deny.toml govern it unchanged.

It is not a reason to write our own where §46 says take. An oracle makes writing safer; it does not make writing right. Writing still needs §46's stated reason, and this section is downstream of it.

It does not apply where no mature implementation exists, which is most of this tree.

And it is not free. An oracle is a second thing to build, pin, and keep working, and a pinned foreign tool that stops building is a gate that stops asking its question. tools/redoxfs_host is the precedent for the cost as well as for the shape.

BUGS