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 / si / benchmarks / native / neuralese / nl1r / evidence / confirm-20261107 / out / checkpoint.om

302 lines · 4483 bytes Raw Blame History
1om2
2note NL6 continuation: independent strict parser, never reads producer summaries.
3const JCAP ulong 16384
4global JBuf uchar JCAP
5global JIo ulong 2
6global JC ulong 8
7global JR ulong 50
8global JP f64 83
9global JH f64 4
10global JU f64 8
11global JS f64 4
12global JB uchar 32
13global Seen ulong 15
14global Logs uchar 7680
15global Sizes ulong 240
16global Stats ulong 360
17text JBAD "NL1RJ INVALID\n"
18text JMAG "NL1RJ1,schema,unit,seed,trainmask,group,partition,total,exact,accepted_correct,wrong_accepted,abstained,feature_errors,collision_pairs,encode_ns,decode_ns\n"
19text JREC "M,"
20text JSEP ","
21text JLF "\n"
22text JEND "NL1RJ END\n"
23fn jout a view uchar * to void
24p = ulong 0
25while lt p len a
26n = write 1 a p sub len a p
27if le n 0
28exit 93
29end
30p = add p ulong n
31end
32end
33fn jinvalid to void
34n = write 2 JBAD 0 len JBAD
35exit 90
36end
37fn jnext to long
38if eq get JIo 0 get JIo 1
39n = read 0 JBuf 0 JCAP
40if lt n 0
41jinvalid
42end
43if eq n 0
44ret -1
45end
46put JIo 0 0
47put JIo 1 ulong n
48end
49p = get JIo 0
50put JIo 0 add p 1
51ret long get JBuf p
52end
53fn jexpect c long to void
54if ne jnext c
55jinvalid
56end
57end
58fn jvalue delim long to ulong
59v = ulong 0
60n = ulong 0
61first = long -1
62while true bound 21
63c = jnext
64if eq c delim
65if eq n 0
66jinvalid
67end
68if and gt n 1 eq first 48
69jinvalid
70end
71ret v
72end
73if or lt c 48 gt c 57
74jinvalid
75end
76if eq n 0
77first = c
78end
79if or gt v 1844674407370955161 and eq v 1844674407370955161 gt c 53
80jinvalid
81end
82v = add mul v 10 ulong sub c 48
83n = add n 1
84end
85ret 0
86end
87fn jnumber v ulong to void
88b = new uchar 20 0
89p = ulong 20
90while true bound 20
91p = sub p 1
92put b p uchar add rem v 10 48
93v = div v 10
94if eq v 0
95break
96end
97end
98while lt p 20 bound 20
99n = write 1 b p sub ulong 20 p
100if le n 0
101exit 93
102end
103p = add p ulong n
104end
105end
106fn jfield v ulong to void
107jnumber v
108jout JSEP
109end
110fn jparity id ulong to ulong
111ret and xor xor xor id shr id 1 shr id 2 shr id 3 1
112end
113fn jsoft x f64 to f64
114ret div x add 1.0f64 fabs x
115end
116fn jrelu x f64 to f64
117if gt x 0.0f64
118ret x
119end
120ret 0.0f64
121end
122fn jstore k ulong v ulong to void
123for b ulong 8
124put JB add mul k 8 b uchar and shr v mul b 8 255
125end
126end
127fn jload k ulong to ulong
128v = ulong 0
129for b ulong 8
130v = or v shl get JR add 3 add mul k 8 b mul b 8
131end
132ret v
133end
134fn jstat group ulong phase ulong col ulong to ulong
135ret add mul add mul group 3 phase 8 col
136end
137fn jinc group ulong phase ulong col ulong val ulong to void
138ix = jstat group phase col
139put Stats ix add get Stats ix val
140end
141note Standalone with io.om. Mode 0 packs C/P carrier; mode 1 checks actual binary then emits B/P.
142note Full C/P/R/T campaign validation remains judge.om, not this conversion tool.
143global BH ulong 8
144global BV ulong 83
145text BC "B,"
146text BP "P,"
147fn bread to ulong
148v = ulong 0
149for k ulong 8
150c = jnext
151if lt c 0
152jinvalid
153end
154v = or v shl ulong c mul k 8
155end
156ret v
157end
158fn bwrite v ulong to void
159for k ulong 8
160put JB k uchar and shr v mul k 8 255
161end
162p = ulong 0
163while lt p 8
164n = write 1 JB p sub ulong 8 p
165if le n 0
166exit 93
167end
168p = add p ulong n
169end
170end
171fn bvalid to void
172if and ne get BH 0 1 ne get BH 0 2
173jinvalid
174end
175if ne get BH 7 0
176jinvalid
177end
178arm = get BH 1
179d = ulong 3
180n = ulong 31
181if eq arm 1
182d = 4
183n = 40
184end
185if eq arm 2
186n = 83
187end
188if eq arm 3
189d = 1
190n = 0
191end
192if gt arm 3
193jinvalid
194end
195if eq get BH 0 2
196if gt arm 2
197jinvalid
198end
199d = 4
200n = 40
201end
202if or ne get BH 2 d ne get BH 3 n
203jinvalid
204end
205if or eq get BH 4 0 gt get BH 4 4294967295
206jinvalid
207end
208if or eq get BH 5 0 gt get BH 5 65535
209jinvalid
210end
211if gt get BH 6 32000
212jinvalid
213end
214end
215fn bparams to void
216for i ulong get BH 3
217if not le fabs bitcast f64 get BV i 1000000.0f64
218jinvalid
219end
220end
221end
222fn bpack to void
223jexpect 67
224jexpect 44
225for k ulong 8
226delim = long 44
227if eq k 7
228delim = 10
229end
230put JC k jvalue delim
231end
232put BH 0 get JC 0
233put BH 1 get JC 1
234put BH 2 get JC 4
235put BH 3 get JC 5
236put BH 4 get JC 2
237put BH 5 get JC 3
238put BH 6 get JC 6
239put BH 7 0
240bvalid
241for i ulong get BH 3
242jexpect 80
243jexpect 44
244if ne jvalue 44 i
245jinvalid
246end
247put BV i jvalue 10
248end
249bparams
250for i ulong 8
251bwrite get BH i
252end
253for i ulong get BH 3
254bwrite get BV i
255end
256end
257fn bunpack to void
258for i ulong 8
259put BH i bread
260end
261bvalid
262for i ulong get BH 3
263put BV i bread
264end
265if ne jnext -1
266jinvalid
267end
268bparams
269jout BC
270for i ulong 8
271jnumber get BH i
272if lt i 7
273jout JSEP
274end
275end
276jout JLF
277for i ulong get BH 3
278jout BP
279jfield i
280jnumber get BV i
281jout JLF
282end
283end
284fn main to int
285if ne argcnt 2
286jinvalid
287end
288ab = new uchar 1 0
289n = argread 1 ab 0 1
290if ne n 1
291jinvalid
292end
293if eq get ab 0 48
294bpack
295else
296if ne get ab 0 49
297jinvalid
298end
299bunpack
300end
301ret 0
302end