interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / src / synapse / syn_layout.lst

136 lines · 4967 bytes Raw Blame History
1# Synapse binary codec v2 port (ADR 0003 section 9 step 33, J1): the one list every workspace offset and
2# constant of syn_codec.osc is generated from (syn_gen.sh). Format: NAME VALUE (decimal; text after '#' is a
3# comment). Cells are u64. The specification is synapse docs/J1_OMEGA_CODEC.md and the Rust codec
4# (synapse crates/synapse-store/src/codec.rs); the corpus tests/synapse/j1-corpus/corpus.bin pins it.
5
6# --- ABI header ---
7ABI_MAGIC 1398361674 # 0x53594E4A "SYNJ"
8ABI_VERSION 1
9W_MAGIC 0
10W_VERSION 1
11W_CELLS 2 # exact workspace length in cells
12W_ENTRY 3 # 1 WAL record, 2 checkpoint content
13W_MODE 4 # 1 decode (bytes -> logical form), 2 encode (logical form -> bytes)
14W_CAP 5 # record cap (decode); a checkpoint content's cap is its own length
15W_CKSEQ 6 # checkpoint_seq (checkpoint decode and encode)
16W_ERR 7 # result: 0 accepted, else a refusal kind below
17W_ERR_AT 8
18W_ERR_X 9
19W_ERR_Y 10
20W_ERR_FIELD 11
21W_POS 12 # reader cursor (absolute input offset)
22W_END 13 # end of the region being read
23W_BASE 14 # refusal offsets are relative to this (a nested revision record)
24W_CORE 15 # depth inside embedded synapse-core encodings
25W_LF 16 # logical-form cursor (encode)
26W_LF_N 17 # logical-form length: written by decode, given to encode
27W_OUT 18 # encoded length (encode)
28W_LF_BASE 19 # logical-form region (cells)
29W_LF_CAP 20
30W_OUT_BASE 21 # output region (one byte per cell)
31W_OUT_CAP 22
32W_EMB_AT 23 # length-prefix offset of the open embedded synapse-core encoding
33W_EMB_F 24 # its refusal field id
34W_KHAS 25 # a previous map key exists (checkpoint order check)
35W_KPREV 26 # stream offset of the previous map entry
36W_HDR 32 # header cells; regions start at or after this
37
38MODE_DECODE 1
39MODE_ENCODE 2
40ENTRY_RECORD 1
41ENTRY_CHECKPOINT 2
42CODEC_V2 2
43INPUT_MAX 1000000 # LIMIT above this many input bytes or logical-form cells (loop bound)
44LOOP_MAX 1000000
45
46# --- Rust layout sizes the record decoder's reservation check uses (size_of::<T>(); corpus header) ---
47SZ_ATTACHMENT 88
48SZ_MUTATION 72
49SZ_REVIEW 64
50SZ_STRING 24
51
52# --- refusal kinds: 1..9 are CodecRefusal in declaration order ---
53R_TRUNCATED 1
54R_OVER_CAP 2
55R_TRAILING 3
56R_TAG 4
57R_UTF8 5
58R_VERSION 6
59R_NOT_CANON 7
60R_REPO 8
61R_EMBEDDED 9
62# encode refusals (the logical form is not a value the Rust types can hold)
63R_LF_TYPE 20
64R_LF_END 21
65R_LF_VALUE 22
66R_LF_UTF8 23
67R_LF_REPO 24
68R_OUT_FULL 25
69R_LF_TRAILING 26
70R_LF_ORDER 27
71R_ABI 30
72R_LIMIT 31
73R_LF_FULL 32
74# internal: a refusal inside an embedded synapse-core encoding, converted to R_EMBEDDED when it closes
75R_CORE_VERSION 98
76R_CORE 99
77C_MALFORMED 1 # EnvelopeMalformed
78C_VERSION 2 # EnvelopeVersionUnsupported
79
80# --- refusal field ids (corpus field table order) ---
81F_BOOL 1
82F_OPTION 2
83F_MUTOP 3
84F_FMODE 4
85F_KIND 5
86F_ENV2 6
87F_CHAIN 7
88F_MARKER 8
89F_CHANGESETS 9
90F_IDEM 10
91F_BLOBS 11
92F_PROJ 12
93F_CANON 13
94F_REVS 14
95F_REVKIND 15
96
97# --- logical-form token types; a token is a header cell type | len << 8, then len cells ---
98T_U16 2
99T_U64 4
100T_BOOL 5
101T_TAG 6
102T_FIX 7
103T_STR 8
104T_BYTES 9
105T_REPO 10
106T_COUNT 11
107
108# --- checkpoint key kinds (cmpkey) ---
109K_FIX32 1
110K_STR 2
111K_STRFIX 3
112K_U64 4
113
114# --- field descriptors (precomputed: OSC literals take their type from context) ---
115D_FIX16 4103 # T_FIX | 16 << 8
116D_FIX20 5127 # T_FIX | 20 << 8
117D_FIX32 8199 # T_FIX | 32 << 8
118D_FIX64 16391 # T_FIX | 64 << 8
119D_STR 8 # T_STR (WAL string, capped by W_CAP)
120D_BYTES 9 # T_BYTES
121D_PATH 524296 # T_STR, core cap 2048 (path)
122D_INTENT 1048584 # T_STR, core cap 4096 (intent summary)
123D_REPO 32778 # T_REPO, core cap 128
124D_U16 514 # T_U16, 2 bytes
125D_U64 2052 # T_U64, 8 bytes
126D_BOOL 83951617 # field 1, tags 0..1, type 5
127D_OPTION 100728834 # field 2, tags 0..1, type 6
128D_MUTOP 100794627 # field 3, tags 1..2, type 6
129D_FMODE 100860164 # field 4, tags 1..3, type 6
130D_KIND 101187845 # field 5, tags 1..8, type 6
131D_CHAIN 185598208 # field 0, tags 1..16, type 11
132H_COUNT 267 # T_COUNT | 1 << 8
133KF_REVKIND 3844 # R_TAG | F_REVKIND << 8
134EMB_CORE 0 # emb_open: the inner content length of an envelope v2 (synapse-core rules)
135EMB_REV 255 # emb_open: a checkpoint revision record (WAL byte run, offsets restart at 0)
136MASK20 1048575 # 20-bit field of an emb_open save word; syn_gen.sh refuses INPUT_MAX > MASK20