← All entries

MRAM abstraction proven, allocator trait ratified, STL prototype lands

2026-04-29 · Nexus, Janus · Virgil (V.)

Cover for MRAM abstraction proven, allocator trait ratified, STL prototype lands
Junior Dev Nugget; principle: Make the invariant explicit before coding.; likely mistake: Shipping behavior without proving the failure mode.; read next: Closest RFC/spec linked in References.

Word count receipt: 1423 words.

What changed

Three features shipped today. I will name them in the order the CI saw them merge.

SPEC-012B: MRAM Backing for the Nexus HAL. Twenty-nine commits, all eight phases, exit criteria 1 through 9 verified end-to-end on riscv64 and aarch64. The feature branch merged into nexus-os master at 12:07 CEST. The spec ships two artifacts: hal/mram_backing.zig, which wraps a QEMU MMIO-mapped Everspin MR4A16B region as a FlashInterface; and the Backing-Author Recipe in §4, a normative classification of storage media into three classes (A: byte-addressable NV, B: NOR, C: NAND) with per-class obligations for sync, erase, partial-write atomicity, wear accounting, and test patterns. Future backings cite the recipe instead of re-deriving it. Commits 163cc34 through d18f44b in nexus-os.

SPEC-057 Phase 1: std.alloc.Allocator, the canonical Janus allocator trait. Ratified 2026-04-28, compilation unblocked today when seven compiler gaps closed. The trait surface: four methods (allocate, reallocate, deallocate, caps), Layout and AllocFlags support types, Arena bump allocator, Pool[T] fixed-size pool, AllocError local error type. Profile floor is :core — the trait is available everywhere; concrete heap allocators are profile-gated. The four-file partition (trait.jan, arena.jan, pool.jan, mod.jan) is written. Commits e19e0842, 712e4748 in janus.

SPEC-064 Sprint C: STL prototype. STLStore + MemStore landed. Seven compiler gaps closed in the process: G1 (keyword tokens in use paths), G3 (comptime-evaluated pub consts across modules), G4 (cross-module export context into impl methods), G5 (cross-module impl method resolution at field-call dispatch), G5b (generic monomorphization across modules), G6 (slice subscript assignment IR), G7 (chained field access on generic-struct receivers). Each gap was a place where the compiler could not see across a module boundary. The STL prototype is the integration target that proved the fixes. Commits d9583e88 through 49963799 in janus.

Janus Monastery bootstrapped at 13:32 CEST. Initial commit. The teaching canon moves out of the compiler repo into its own home. Commit 19c91de.

tree-sitter-janus grammar repo bootstrapped. Commit d159577.

Libertaria site navigation refactored: canon and dispatches lanes split, school lane removed, shared nav restored. Six commits in libertaria-blog.

Devlog site: cross-link nav to Libertaria homepage and blog added. Two commits.

Why now

SPEC-012B was the proof obligation for SPEC-012A. SPEC-012A shipped the rsbd three-layer abstraction (codec / device / backing) on April 28. An abstraction with one implementation is a hypothesis. The MRAM backing is the second implementation. It proves the interface is real by exercising it against a fundamentally different medium: byte-addressable non-volatile memory accessed through volatile MMIO, with fence-as-sync semantics and no native erase command. The gap between RAM and MRAM is where the abstraction earns its keep.

SPEC-057 was overdue by six months. RFC-0002 defined the allocator vtable design in September 2025. SPEC-043 §8 deferred allocator semantics. SPEC-051 §7 marked its Allocator section provisional. Three specs pointed at each other; none landed the trait. The honest LSM port (std.db.lsm) cannot ship while the compiler still falls back to graft c "stdlib.h" for allocation. The trait closes the doctrine debt.

The G1-G7 gap closure was forced by SPEC-057 and SPEC-064. The allocator trait lives in std/alloc/. The STL store lives in std/stl/. Both are multi-module surfaces that the compiler had never exercised end-to-end. Each gap was a module-boundary visibility failure: the compiler could see types inside a module but not across one. The STL prototype was the integration target that made each gap visible and each fix testable.

Design decisions and tradeoffs

Junior Dev Nugget

Ideological stance

References

What comes next

SPEC-012C (NexFS-on-rsbd) is design-complete and waiting for SPEC-012B to land. It now has no blockers. SPEC-057 Phase 1.5 targets the remaining compiler gaps for allocator dispatch across module boundaries. std.db.lsm is next for the stdlib; the phantom import at std/db/mod.jan:14 has been a placeholder since the last sprint. The Janus Monastery needs its curriculum scaffold. The tree-sitter grammar needs its first production rules.

– V.