decisions.md raw

Design record: what is implemented, what is proposed, what is red

Status: living. This is the document that stops the tree working at cross purposes: a design note in this repository is not a description of the tree unless it is listed here as implemented.

Precedence, when two documents disagree:

  1. axioms.md - the axioms and the pentalogue/octalogue are the

authority. A design that violates one is wrong even if the code does it.

  1. memory.md, language.md, concurrency.md,

restrictions.md - the implemented language and runtime.

  1. architecture.md, patterns.md - how programs

are built out of the language.

  1. Everything else - measurements, plans, packaging.

claude.md is the working rule sheet for agents and holds the same normative content as 1-3 in condensed form; where it disagrees with 2 or 3, the docs are the record and claude.md is the bug.

Implemented

areastatereference
arena stack (root, function, manual phase, sovereign)implementedmemory.md §1
codec return protocol (encode, pop, decode)implemented, both compilersmemory.md §3
sovereign groups, borrow, stable registration, compaction drainimplementedmemory.md §4
codec dispatch: raw extent / custom codec / structuralimplementedmemory.md §3
one-slot and :N channels, select frame encoding, breakersimplementedconcurrency.md
spawn as a thread in one process, copied values, shared handlesimplementedconcurrency.md
push growth for any arity including spreadimplementedmemory.md §5
compiler per-package arena, disk cache (.mxh export, .bc object)implementedcompiler.md
wasm domain hub protocolimplemented (round 386)concurrency.md §wasm

Removed from the record (was a proposal, never the tree)

These were written as if implemented and are not. Do not design against them.

proposalvocabulary it usedwhy it is gone
memory-model.md revision 3MAIN, SHELF, shelf T, %fn_base, identity (epoch<<40)\|counter, handle tablesa target design for offset-addressed arenas; the tree has address-based arenas and codec relocation
memory.md revision 3"MAIN is the process region", "SHELF is the only compacted region"same
Reloc three-pass mark-compactRelocInit/Mark/Forward/Compact/FixupAllno caller in either compiler; the codec is the protocol
pipe capability syntax (<-pipe[...]{:4096:"/path"})capabilities-as-declarationsnever built; the implemented primitive is chan T{:N:bytes}
kernel target with preemptive scheduler and MMU page tablesscheduler, ring transitionscontradicts L1 (no preemption within a domain); the kernel work is not started
moxiefmtmechanical formatterno such tool in the tree; style.md is a specification
moxieport as shipped toolingGo→Moxie transformerits own notes cite sysroot/runtime.bc, os.runtime_args and //go:linkname, none of which exist under those names

Known red (open defects, as of this record)

#defectevidencenext step
R1The type checker can name a different Object for a use than the one a declaration was bound under, so buildIdent's exact lookup misses and falls through to a nil constantin errors.is, err == nil was emitted as %ne = extractvalue {i64, ptr} null, 0; clang rejects it (null must be a pointer type). Instrumenting the compare path printed lt={i64, ptr} x=nil y=nil op=16 fn=isinstrument fb.vars at the use (object identity, number of same-named bindings, scope id) and fix object identity at the declaration site; preferring info.Uses first was tried and breaks the tree, so Defs and Uses do not share identity today
R2Bootstrap fixpoint has not been re-verified since the arena workcompiler-disk-cache.md recorded "pre-existing red: any compiler built by a stage4 compiler panics at start-up in codecDecodeValue"run the four-generation chain in building.md and record the first generation that reproduces itself
R3The compiler build requires -no-main-arena and the flag is easy to omitwithout it, every self-mutating emitter method holds a sovereign arena that cannot be compacted while it runs; math and strconv exhausted 3.2 GBthe flag is now in building.md; the build scripts should pass it
R4mxutil.Ensure/Reserve still have ~1300 call siteseach returns a pointer-bearing slice, so each call deep-copiesfinish the sweep: drop the call where the next statement is a push

Measurements of record

Numbers that decisions were made on, kept because a number you cannot trust is worse than no number. The detail lives in compiler.md.

findingnumber
math emit peak before the arena work1159 MB, then 3.2 GB death in strconv
math emit peak after (free emitFunction, presized lists, no per-node sovereign group)1039 MB entry, 1107 MB whole emit
strconv + runtime under -no-main-arenaruntime 581 functions, 1840 MB peak
reusable encode bufferRSS 673 → 577 MB
adopted seen tables577 → 352 MB
app build, 8 packages before the emit fixesnow reaches the app's own bitcode

How to change this record

A new design note is not a rule. It becomes one by: landing in both compilers (wood law) or being marked stage4-only with a reason, being added to Implemented here, and having the document it supersedes deleted - not left beside it.