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 / osh / osh_layout.lst

118 lines · 6814 bytes Raw Blame History
1# osh workspace layout: the one list every accessor is generated from (osh_gen.sh).
2# Format: NAME VALUE (decimal; text after '#' is a comment). Cells are u64.
3# Region numbers are fixed by OSH_PLATFORM_ABI.md section 6.1 (aien-protocols PR #16, v1 DRAFT);
4# session cells 0..11 by section 6.2; 12..47 are core-internal and are assigned here.
5
6# --- ABI constants (section 3, 5, 6) ---
7ABI_MAGIC 1330858071 # 0x4F534857 "OSHW"
8ABI_VERSION 1
9WS_CELLS 11456 # exact workspace size in cells
10LINE_CAP 4096 # CAP_LINE: bytes of buffered input
11TOKEN_CAP 128 # CAP_TOKENS
12LEX_BUDGET 1024 # input bytes per lex_run call
13
14# --- regions (section 6.1) ---
15SESSION 0
16TOKENS 64
17CMDS 576
18PIPES 832
19STAGING 896
20REQUEST 1928
21OUT 3264
22
23# --- session cells (section 6.2) ---
24S_MAGIC 0
25S_VERSION 1
26S_PHASE 2 # 0 active, 255 terminal error
27S_LAST_STATUS 3 # adapter-owned ($?); the lexer never touches it
28S_ERR_CODE 4
29S_ERR_OFF 5
30S_CURSOR 6 # next input byte to lex
31S_WS_CELLS 7
32S_RESERVED 48 # 48..63 must be zero in v1
33
34# --- lexer-internal session cells (12..47) ---
35LX_STATE 12 # state machine state (osh_lex.osc.in)
36LX_WS 13 # start offset of the word or operator in progress
37LX_WFLAGS 14 # token flags gathered for the word in progress
38LX_NAMEOK 15 # word so far is a valid NAME
39LX_EQPOS 16 # offset+1 of the '=' of a NAME= word, else 0
40LX_NTOK 17 # tokens written
41LX_LINE 18 # newlines consumed (line number minus 1)
42LX_WLINE 19 # line number (1-based) where the word started
43LX_NSEG 20 # quoted segments in the word
44LX_ALLDIG 21 # word so far is all digits
45LX_MID 22 # 1 while the last byte did not complete a line
46LX_BRD 23 # open unquoted `{` count in the word (brace expansion detector)
47LX_BRM 24 # bit d set: the open brace at depth d has an unquoted `,` or `..` directly inside
48LX_PDOT 25 # the last byte was an unquoted plain `.` in the word
49LX_BRN 26 # ${...} name: 0 none/alpha start, 1 digits so far (one digit)
50LX_DONE 27 # 1 when the last lex_run returned PHASE_DONE (the parser requires it)
51S_EOI 28 # end of input: written by the host (0 or 1); 1 = no more bytes will be appended; a final `\` is then a literal
52LX_CONT 29 # 1 after a `\` that starts a backslash-newline pair; the next byte (the newline) is swallowed
53LX_PREV 30 # the last significant byte (a swallowed `\<nl>` pair does not count)
54LX_PO 31 # offset of LX_PREV
55LX_PLUS 32 # 1 when the last significant byte was a `+` right after a valid NAME (append-assignment detector)
56LX_USC 33 # offset+1 of a `_` that is the whole name after `$` or `${` (the `$_` special parameter), else 0
57
58# --- parser-internal session cells (osh_parse.osc.in) ---
59PX_STATE 34 # 0 FRESH 1 AFTER_OP 2 IN_CMD 3 NEED_TARGET 4 DONE
60PX_TOK 35 # next token index to parse
61PX_NCMD 36 # command entries written
62PX_NPIPE 37 # pipeline entries written
63PX_PCMDS 38 # commands in the open pipeline
64PX_ANYW 39 # 1 once the current command has a non-assignment word
65PX_RKIND 40 # token kind of the redirection operator awaiting its target
66
67# --- parser capacities (E-parser-design.md section 5, ABI 5.3) ---
68CAP_CMDS 32
69CAP_PIPES 16
70CAP_PIPE_LEN 8
71CAP_WORDS 32
72CAP_ASSIGNS 16
73CAP_REDIRS 8
74PARSE_BUDGET 64 # tokens per parse_run call
75
76# --- variable request cells (ABI section 6.2 cells 8..11) ---
77S_VR_KIND 8 # 1 NAME, 2 $?, 3 positional, 4 $#, 5 positional list (npos only)
78S_VR_A 9 # NAME: offset in inp; positional: k
79S_VR_LEN 10 # NAME: length
80S_VR_SEQ 11 # counts requests
81
82# --- expander capacities and constants (E-parser-design.md section 5, ABI 5.3, 7.1) ---
83CAP_FIELDS 32 # argv entries per command after splitting
84CAP_OUT 8192 # expanded bytes per pipeline
85CAP_VALUE 1024 # one variable value
86CAP_VARREQ 64 # variable requests per pipeline
87EXP_BUDGET 1024 # expander steps (one raw byte or one value byte each) per call
88REC_MAGIC 1330791761 # 0x4F524551 "OREQ"
89REQ_CMD_CELLS 164
90
91# --- expander cells (osh_expand.osc.in). 41..47 are fresh; 12..16, 18..26 and 29..33 (the lexer's continuation and
92# --- append-assignment cells) are lexer cells that are dead
93# --- once the parser has completed the list (the session is single use after that), so expand_run zeroes and reuses them.
94EX_INIT 41 # 1 after the first expand_run call zeroed the overlay cells
95EX_ST 29 # 0 pick next pipeline, 1 expanding, 2 PIPELINE_READY returned, 3 list complete
96EX_PIPE 30 # pipeline index being expanded
97EX_CMD 31 # command index inside the pipeline
98EX_TOK 32 # token cursor (the word token while a word is open)
99EX_NVREQ 33 # variable requests in this pipeline
100EX_OUT 42 # OUT bytes used
101EX_ANYW 43 # offset+1 of the first non-assignment word of this command, 0 before it
102EX_A0 44 # input offset of the word that produced argv[0]
103EX_WM 45 # word mode: 0 none, 1 argv, 2 assignment value, 3 redirection target
104EX_PH 46 # 0 raw scan, 1 copying a value, 2 waiting for the host's answer
105EX_POS 47 # raw cursor in inp
106EX_Q 12 # 0 unquoted, 1 inside '', 2 inside ""
107EX_FOPEN 13 # a field is open
108EX_FSTART 14 # OUT offset where the open field began
109EX_DQF 15 # inside "": bit 0 saw $@, bit 1 saw anything else
110EX_WNF 16 # fields closed by the redirection target word
111EX_NEXT 18 # raw cursor after the reference being resolved
112EX_VCUR 19 # absolute cell of the next value byte
113EX_VEND 20 # absolute cell after the last value byte
114EX_VM 21 # 1 split the value at IFS bytes (unquoted), 0 copy it
115EX_RK 22 # reference: 1 NAME 2 $? 3 positional 4 $# ; lists 5 split 6 joined 7 one field each
116EX_K 23 # list: positional being copied
117EX_NPOS 24 # list: positional count
118S_NOSKIP 25 # host-written before the first expand_run: 1 = emit every pipeline (no connector skipping; conformance vectors)