Substrate Layout

The CortexState body is always 1024 words. The layout is fixed for the current version:

Range Words Count Purpose
Header 0-31 32 Protocol metadata, roots, counters, bundle/corpus binding
MemoryIndex 32-383 352 44 memory slots, 8 words each
RetrievalKeys 384-671 288 36 retrieval-key slots, 8 words each
Relations 672-799 128 Relation and routing entries
Temporal 800-895 96 Validity windows and revocation metadata
Codebook 896-991 96 Compression/codebook entries
Reserved 992-1023 32 Reserved for compatibility, must remain zero

Each state is Merkleized as 1024 leaves. A compact patch changes 1-4 words. Replay recomputes the new root from the parent state and the patch bytes carried by on-chain events.

What The Regions Mean

MemoryIndex slots point from compact record IDs to retrieval slots and validity metadata. RetrievalKeys hold compact, bundle-layout-compatible retrieval vectors. Relations encode useful edges between records for multi-hop retrieval. Temporal records current/stale validity. Codebook gives miners a small shared compression surface.

This is deliberately small. CoreTex is not trying to store all memory on chain. It is forcing miners to compete over which memory structure is worth preserving inside a fixed 32 KB substrate.