interplane.Get Omega
Read in your language

omega-helix

This project has not described itself yet.

Brought by drakestapleton

branch main Branches Tags History

omega-helix / native / pillars_cli.om

369 lines · 5588 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note Unified 8-Pillar Pure-Omega CLI (OMG pack/decode/samp + Arboris 3-layer guide).
3note Concatenated after cli.om on hosted targets (gb10, aarch64, macos, x86linux); stubbed on UEFI.
4
5fn omg_pick_neural st ulong tm ulong to ulong
6off = get og 27
7best = OMG_EOF
8bv = bitcast f64 ulong 18442240474082181120
9for c ulong 256
10if eq get omg_mask c 1
11v = get oa add off c
12if or eq best OMG_EOF gt v bv
13bv = v
14best = c
15end
16end
17end
18if or eq best OMG_EOF eq tm 0
19ret best
20end
21tau = div f64 tm 1000.0
22m = bitcast f64 ulong 18442240474082181120
23for c2 ulong 256
24if eq get omg_mask c2 1
25x = div get oa add off c2 tau
26put oa add off c2 x
27m = fmax m x
28end
29end
30sm = 0.0f64
31for c3 ulong 256
32if eq get omg_mask c3 1
33e = fexp sub get oa add off c3 m
34put oa add off c3 e
35sm = add sm e
36else
37put oa add off c3 0.0f64
38end
39end
40if le sm 0.0f64
41ret best
42end
43u = mul mul f64 shr smx st 11 1.1102230246251565e-16 sm
44acc = 0.0f64
45la = best
46for k ulong 256
47if eq get omg_mask k 1
48pk = get oa add off k
49acc = add acc pk
50if lt u acc
51ret k
52end
53if gt pk 0.0f64
54la = k
55end
56end
57end
58ret la
59end
60
61fn omg_write_dec ai ulong to ulong
62rc = omg_decode_om
63if ne rc 0
64exit 33
65end
66nd = get omg_ndec 0
67if gt nd 524288
68exit 70
69end
70ocwopen ai
71for i ulong nd
72put ock i get omg_dec i
73end
74ocwput 0 nd
75ocwend ai
76ret nd
77end
78
79text omg_p_pack "OMGPACK "
80text omg_p_dec "OMGDEC "
81text omg_p_samp "OMGSAMP "
82text arb_p_guide "ARBGUIDE "
83
84fn omg_pack_cli to void
85if ne oargc 5
86exit 2
87end
88n = odread 3
89if or eq n 0 gt n OMG_MAX_SRC
90exit 2
91end
92for i ulong n
93put omg_src i get od0 i
94end
95put omg_nsrc 0 n
96if ne omg_parse_om 0
97exit 30
98end
99nt = get omg_ntok 0
100if or eq nt 0 gt nt 524288
101exit 70
102end
103sid = omg_semantic_id
104ocwopen 4
105for j ulong nt
106put ock j uchar and ulong get omg_toks j 255
107end
108ocwput 0 nt
109ocwend 4
110omg_put_str omg_p_pack
111oputu n
112oputc 32
113oputu nt
114oputc 32
115oputx sid
116oputc 10
117oflush
118end
119
120fn omg_dec_cli to void
121if ne oargc 5
122exit 2
123end
124nt = odread 3
125if or eq nt 0 gt nt OMG_MAX_TOKS
126exit 2
127end
128for i ulong nt
129put omg_toks i ushort get od0 i
130end
131put omg_ntok 0 nt
132nd = omg_write_dec 4
133omg_put_str omg_p_dec
134oputu nt
135oputc 32
136oputu nd
137oputc 10
138oflush
139end
140
141fn omg_samp_cli to void
142if ne oargc 8
143exit 2
144end
145ockloop 3
146if ne get og 0 256
147exit 2
148end
149st = oargu 4
150budget = oargu 5
151tm = oargu 6
152if or eq budget 0 gt budget 512
153exit 2
154end
155ochipup
156omg_init_gen
157put omg_ntok 0 0
158put og 9 0
159ocpush 0
160for step ulong budget
161omg_valid_mask sub budget step
162olastf
163tok = omg_pick_neural st tm
164if ne tm 0
165st = add st 11400714819323198485
166end
167if eq tok OMG_EOF
168break
169end
170omg_emit tok
171if ne omg_step tok 0
172exit 32
173end
174ocpush tok
175if and eq get omg_st 0 0 eq get omg_st 1 0
176break
177end
178end
179nd = omg_write_dec 7
180sid = omg_semantic_id
181omg_put_str omg_p_samp
182oputu get omg_ntok 0
183oputc 32
184oputu nd
185oputc 32
186oputx sid
187oputc 10
188oflush
189end
190
191fn cmdomg_cli to void
192if lt oargc 3
193cmdomg
194ret
195end
196r = oargr 2
197if eq r 8
198if and eq get oarg 0 115 eq get oarg 1 101
199cmdomg
200ret
201end
202end
203if and eq r 4 eq get oarg 0 112
204omg_pack_cli
205ret
206end
207if and eq r 6 eq get oarg 0 100
208omg_dec_cli
209ret
210end
211if and eq r 4 and eq get oarg 0 115 eq get oarg 1 97
212omg_samp_cli
213ret
214end
215exit 2
216end
217
218fn arb_ingest_toks cn ulong to void
219arboris_clear
220if lt cn 2
221ret
222end
223w1 = new ulong 1 0
224lim1 = sub cn 1
225for i1 ulong lim1
226put w1 0 ulong get od0 i1
227ok1 = arboris_put w1 0 1 ulong get od0 add i1 1 910000
228end
229if lt cn 3
230ret
231end
232w2 = new ulong 2 0
233lim2 = sub cn 2
234for i2 ulong lim2
235put w2 0 ulong get od0 i2
236put w2 1 ulong get od0 add i2 1
237ok2 = arboris_put w2 0 2 ulong get od0 add i2 2 930000
238end
239if lt cn 4
240ret
241end
242w3 = new ulong 3 0
243lim3 = sub cn 3
244for i3 ulong lim3
245put w3 0 ulong get od0 i3
246put w3 1 ulong get od0 add i3 1
247put w3 2 ulong get od0 add i3 2
248ok3 = arboris_put w3 0 3 ulong get od0 add i3 3 960000
249end
250end
251
252fn arb_try_bypass step ulong to ulong
253ctx = new ulong 3 0
254res = new ulong 2 0
255if ge step 3
256put ctx 0 ulong get omg_toks sub step 3
257put ctx 1 ulong get omg_toks sub step 2
258put ctx 2 ulong get omg_toks sub step 1
259if arboris_probe ctx 0 3 res
260cand3 = get res 0
261if and lt cand3 256 and ge get res 1 900000 eq get omg_mask cand3 1
262ret cand3
263end
264end
265end
266if ge step 2
267put ctx 0 ulong get omg_toks sub step 2
268put ctx 1 ulong get omg_toks sub step 1
269if arboris_probe ctx 0 2 res
270cand2 = get res 0
271if and lt cand2 256 and ge get res 1 900000 eq get omg_mask cand2 1
272ret cand2
273end
274end
275end
276if ge step 1
277put ctx 0 ulong get omg_toks sub step 1
278if arboris_probe ctx 0 1 res
279cand1 = get res 0
280if and lt cand1 256 and ge get res 1 900000 eq get omg_mask cand1 1
281ret cand1
282end
283end
284end
285ret OMG_EOF
286end
287
288fn arb_guide_cli to void
289if ne oargc 9
290exit 2
291end
292cn = odread 4
293arb_ingest_toks cn
294ockloop 3
295if ne get og 0 256
296exit 2
297end
298st = oargu 5
299budget = oargu 6
300tm = oargu 7
301if or eq budget 0 gt budget 512
302exit 2
303end
304ochipup
305omg_init_gen
306put omg_ntok 0 0
307put og 9 0
308ocpush 0
309bp = ulong 0
310ltp = ulong 0
311for step ulong budget
312omg_valid_mask sub budget step
313tok = arb_try_bypass step
314if ne tok OMG_EOF
315bp = add bp 1
316else
317ltp = add ltp 1
318olastf
319tok = omg_pick_neural st tm
320if ne tm 0
321st = add st 11400714819323198485
322end
323end
324if eq tok OMG_EOF
325break
326end
327omg_emit tok
328if ne omg_step tok 0
329exit 32
330end
331ocpush tok
332if and eq get omg_st 0 0 eq get omg_st 1 0
333break
334end
335end
336nd = omg_write_dec 8
337sid = omg_semantic_id
338omg_put_str arb_p_guide
339oputu get omg_ntok 0
340oputc 32
341oputu bp
342oputc 32
343oputu ltp
344oputc 32
345oputu nd
346oputc 32
347oputx sid
348oputc 10
349oflush
350end
351
352fn cmdarboris_cli to void
353if lt oargc 3
354cmdarboris
355ret
356end
357r = oargr 2
358if eq r 8
359if and eq get oarg 0 115 eq get oarg 1 101
360cmdarboris
361ret
362end
363end
364if and eq r 5 eq get oarg 0 103
365arb_guide_cli
366ret
367end
368exit 2
369end