◄ WORLD V · SONNY 5DART 479 · a helldive at the net

THE CANONICAL ADDRESS 64 bits wide, 48 bits real — the top must sign-extend the middle

x86-64 registers are 64 bits, but only 48 address bits are wired (256TB is plenty), which leaves a question: what may the top 16 bits be? The answer is the canonical rule: bits 48–63 must be a copy of bit 47 — a sign extension of the used address into the unused top. Any other pattern is a non-canonical address and faults. It is sign extension (dart 476) promoted to a hardware invariant on pointers, and it reserves the unused bits so a future chip can widen to 56 or 64 without breaking today’s software. Here it is modeled at 8-of-16 bits to fit the compiler’s exact-integer range.

THE TECHNIQUE bits 48–63 must equal bit 47 (sign-extend) — else non-canonical

The demo checks the canonical rule (modeled 8-of-16): the high half must equal the sign of the low half — 0xFF80 passes, 0x7F80 faults: live demo


HISTORY & CREDIT x86-64 canonical addressing

“A 64-bit pointer can hold any 64-bit value.” — only canonical ones; the top bits must sign-extend bit 47 or the CPU faults. cited

the rule · bits 48–63 = copy of bit 47 — a sign extension of the used address.
the fault · any other top pattern is non-canonical and traps — it reserves room to widen later.
the lineage · sign extension (dart 476) made a hardware invariant on every pointer.

The unused top bits pinned to the sign of the used ones — sign extension turned into a law on addresses. invariant

RECOMMEND FOR I-13 the canonical rule, on the compiler

On the canonical compiler (modeled 8-of-16 bits), 0xFF80 is canonical (high = sign of low), 0x7F80 is not:

$ i13 run ln_canonicaladdress.i13 # high half must sign-extend the low RUN OK · 117 step(s) · peak stack 3 · call depth 1 ok1 = 1 -- 0xFF80: high 0xFF = sign of low 0x80 (canonical) bad = 0 -- 0x7F80: high 0x7F != 0xFF (non-canonical, faults) ok2 = 1 -- 0x0064: high 0x00 = sign of low 0x64 (canonical) rule = 1
Recommend as a keeper shot — then NULL, cleanly. The canonical rule is tempting: a structural constraint tying the top bits to the middle. But it is a validity predicate on addresses — it checks whether a pointer is well-formed — which is the recognizer gate (B41): a keeper GENERATES an invariant, it does not test one. And the constraint itself is sign extension (B44) written into hardware. i13 grounds the check. NULL by B41+B44 — a law on pointers, not an enacted output-channel.