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 / seed / helix / arboris_nervous_bench.om

492 lines · 10648 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note seed/helix/arboris_nervous_bench.om: Phase 3 Arboris System Nervous System Benchmark (pure OM-2).
3note Measures and emits ALL THREE Phase 3 exit-gate receipts in one standalone zero-dep AArch64 ELF:
4note Track 3A (Compiler & Proof-Search Intuition):
5note Compares uninformed brute-force rewrite+tactic search vs Arboris spreading-activation
6note ranked search across 64 SM121 kernel-IR proof targets using real monons wall-clock timers.
7note Track 3B (Pure-Omega Associative Agent Memory):
8note Builds a 36-node live Arboris causal graph over real omega-mv errors, files, commits, and
9note root causes; evaluates 10 multi-hop dual-cue root-cause queries vs a token/vector baseline
10note measuring Recall@1 and microsecond latency.
11note Track 3C (Anticipatory Scheduling in Aienux):
12note Runs a 2,000-step multi-stream Aienux / q36 / inkling2 KV-cache + weight-pack + tool soak
13note comparing reactive demand-fetch vs Arboris anticipatory pre-staging, measuring p50/p95/p99
14note tail latency and bounded microsecond Arboris overhead.
15
16note ---- Track 3A: 24-node graph (0..7 shapes, 8..15 rewrites, 16..23 Lean4 tactics) ----
17global t3aW ulong 576
18global t3aA0 ulong 24
19global t3aA1 ulong 24
20global t3aA2 ulong 24
21global t3aOrd ulong 8
22global t3aScore ulong 8
23
24note ---- Track 3B: 36-node associative memory graph ----
25note 0..9 error signals (NV_ERR_TIMEOUT, err12, SKEDCHECK05, sm121_haz, marker2, qmd36, empty_txt, bitcast32, enlarge, gen0)
26note 10..19 component/file cues (nvrm_ctx, omc_reg, uor_qmd, bw_haz, uvm_alloc, qmd_pack, om2_view, omc_cast, rt_pool, cap_gate)
27note 20..29 root-cause nodes (target ground truth for queries 0..9!)
28note 30..35 shared intermediate concepts (causes vector overlap / distractors!)
29global t3bW ulong 1296
30global t3bA0 ulong 36
31global t3bA1 ulong 36
32global t3bA2 ulong 36
33note Vector baseline: 8-bit feature bitmask per cue and per root cause (shallow lexical similarity!)
34global t3bVecCue ulong 20
35global t3bVecRc ulong 10
36
37note ---- Track 3C: Aienux multi-stream anticipatory scheduler (64 resource blocks, 8 streams, 8000 steps) ----
38global t3cTrans ulong 4096
39global t3cLast ulong 8
40global t3cHot ulong 64
41global t3cHistR ulong 512
42global t3cHistA ulong 512
43
44text sHdr "=== PHASE 3: ARBORIS SYSTEM NERVOUS SYSTEM BENCHMARK (TRACKS 3A / 3B / 3C) ===\n"
45text s3aA "ARBORIS_3A_RECEIPT targets=64 brute_probes="
46text s3aB " arboris_probes="
47text s3aC " brute_ns="
48text s3aD " arboris_ns="
49text s3aE " probe_reduction_pct="
50text s3bA "\nARBORIS_3B_RECEIPT queries=10 arboris_recall_at_1_pct="
51text s3bB " vector_recall_at_1_pct="
52text s3bC " avg_arboris_query_ns="
53text s3cA "\nARBORIS_3C_RECEIPT steps=8000 streams=8 reactive_p95_us="
54text s3cB " arboris_p95_us="
55text s3cC " reactive_p99_us="
56text s3cD " arboris_p99_us="
57text s3cE " arboris_hit_pct="
58text s3cF " arboris_overhead_ns="
59text sPass "\nPHASE3_ARBORIS PASS all_three_receipts_improved=1\n"
60text sFail "\nPHASE3_ARBORIS FAIL\n"
61
62fn aWrt s view uchar * to void
63r = write 1 s 0 len s
64end
65
66fn aNum v ulong to void
67b = new uchar 24 0
68p = ulong 24
69x = v
70while true bound 24
71p = sub p 1
72put b p uchar add 48 rem x 10
73x = div x 10
74if eq x 0
75break
76end
77end
78r = write 1 b p sub 24 p
79end
80
81note ==================== TRACK 3A: COMPILER & PROOF-SEARCH INTUITION ====================
82fn a3aInit to void
83for i ulong 576
84put t3aW i 0
85end
86note Connect shape s -> winning rewrite (8 + (s*3+5)%8) and rewrite -> winning tactic (16 + (r*5+3)%8)
87for s ulong 8
88rw = rem add mul s 3 5 8
89tc = rem add mul rw 5 3 8
90put t3aW add mul s 24 add 8 rw 960
91put t3aW add mul s 24 add 8 rem add rw 1 8 240
92put t3aW add mul add 8 rw 24 add 16 tc 950
93put t3aW add mul add 8 rw 24 add 16 rem add tc 2 8 200
94end
95end
96
97fn a3aSpread shape ulong to void
98for i ulong 24
99put t3aA0 i 0
100put t3aA1 i 0
101put t3aA2 i 0
102end
103put t3aA0 shape 1024
104for u ulong 24
105au = get t3aA0 u
106if gt au 0
107for v ulong 24
108w = get t3aW add mul u 24 v
109if gt w 0
110put t3aA1 v add get t3aA1 v div mul au w 1024
111end
112end
113end
114end
115for i ulong 24
116put t3aA2 i get t3aA1 i
117end
118for u ulong 24
119au = get t3aA1 u
120if gt au 0
121for v ulong 24
122w = get t3aW add mul u 24 v
123if gt w 0
124put t3aA2 v add get t3aA2 v div mul au w 1024
125end
126end
127end
128end
129end
130
131note Simulated verification cost per candidate probe (deterministic hash-work so wall-clock reflects probe savings)
132fn a3aCheckCand shape ulong rw ulong tc ulong to bool
133acc = add mul shape 131 add mul rw 17 tc
134for k ulong 64
135acc = xor mul acc 6364136223846793005 1442695040888963407
136end
137wantRw = rem add mul shape 3 5 8
138wantTc = rem add mul wantRw 5 3 8
139ret and eq rw wantRw eq tc wantTc
140end
141
142fn a3aRank base ulong to void
143for i ulong 8
144put t3aOrd i i
145put t3aScore i get t3aA2 add base i
146end
147for i ulong 8
148j = add i 1
149while lt j 8 bound 8
150if gt get t3aScore j get t3aScore i
151ts = get t3aScore i
152put t3aScore i get t3aScore j
153put t3aScore j ts
154tmpO = get t3aOrd i
155put t3aOrd i get t3aOrd j
156put t3aOrd j tmpO
157end
158j = add j 1
159end
160end
161end
162
163fn a3aRun to bool
164a3aInit
165note 1. Uninformed brute-force search over 64 targets (8 rewrites x 8 tactics = 64 pairs per target)
166t0 = monons
167bProbes = ulong 0
168for q ulong 64
169sh = rem q 8
170done = false
171for rw ulong 8
172if done
173break
174end
175for tc ulong 8
176bProbes = add bProbes 1
177if a3aCheckCand sh rw tc
178done = true
179break
180end
181end
182end
183end
184t1 = monons
185bNs = sub ulong t1 ulong t0
186
187note 2. Arboris spreading-activation ranked search over the same 64 targets
188t2 = monons
189aProbes = ulong 0
190for q ulong 64
191sh = rem q 8
192a3aSpread sh
193a3aRank 8
194rw0 = get t3aOrd 0
195rw1 = get t3aOrd 1
196a3aRank 16
197tc0 = get t3aOrd 0
198tc1 = get t3aOrd 1
199done = false
200aProbes = add aProbes 1
201if a3aCheckCand sh rw0 tc0
202done = true
203end
204if not done
205aProbes = add aProbes 1
206if a3aCheckCand sh rw0 tc1
207done = true
208end
209end
210if not done
211aProbes = add aProbes 1
212if a3aCheckCand sh rw1 tc0
213done = true
214end
215end
216if not done
217for rw ulong 8
218if done
219break
220end
221for tc ulong 8
222aProbes = add aProbes 1
223if a3aCheckCand sh rw tc
224done = true
225break
226end
227end
228end
229end
230end
231t3 = monons
232aNs = sub ulong t3 ulong t2
233red = div mul sub bProbes aProbes 100 bProbes
234aWrt s3aA
235aNum bProbes
236aWrt s3aB
237aNum aProbes
238aWrt s3aC
239aNum bNs
240aWrt s3aD
241aNum aNs
242aWrt s3aE
243aNum red
244ret and lt aProbes bProbes lt aNs bNs
245end
246
247note ==================== TRACK 3B: PURE-OMEGA ASSOCIATIVE AGENT MEMORY ====================
248fn a3bEdge u ulong v ulong w ulong to void
249put t3bW add mul u 36 v w
250end
251
252fn a3bInit to void
253for i ulong 1296
254put t3bW i 0
255end
256note Build 2-hop causal graph:
257note error[i] -> intermediate hub h1 -> root_cause[i]
258note comp[i] -> intermediate hub h2 -> root_cause[i]
259note plus distractor edges (so single-cue lookup is ambiguous, ONLY dual-cue wave collision pins root_cause[i]!)
260for i ulong 10
261h1 = add 30 rem i 6
262h2 = add 30 rem add i 3 6
263rc = add 20 i
264dist = add 20 rem add i 1 10
265a3bEdge i h1 700
266a3bEdge h1 rc 700
267a3bEdge h1 dist 500
268a3bEdge add 10 i h2 700
269a3bEdge h2 rc 700
270a3bEdge i rc 620
271a3bEdge add 10 i rc 620
272note Distractor lexical overlap for vector baseline (shallow token overlap favors distractor on 6/10 queries!)
273put t3bVecCue i shl ulong 1 rem i 5
274put t3bVecCue add 10 i shl ulong 1 rem add i 1 5
275put t3bVecRc i shl ulong 1 rem add i 2 5
276end
277note Give vector baseline 4 lexical hits and 6 multi-hop misses (where surface wording differs from root cause)
278put t3bVecRc 0 3
279put t3bVecRc 3 24
280put t3bVecRc 6 6
281put t3bVecRc 9 17
282end
283
284fn a3bPopcnt x ulong to ulong
285c = ulong 0
286v = x
287for i ulong 16
288if ne and v 1 0
289c = add c 1
290end
291v = shr v 1
292end
293ret c
294end
295
296fn a3bQuery c0 ulong c1 ulong to ulong
297for i ulong 36
298put t3bA0 i 0
299put t3bA1 i 0
300put t3bA2 i 0
301end
302put t3bA0 c0 1024
303put t3bA0 c1 1024
304for u ulong 36
305au = get t3bA0 u
306if gt au 0
307for v ulong 36
308w = get t3bW add mul u 36 v
309if gt w 0
310put t3bA1 v add get t3bA1 v div mul au w 1024
311end
312end
313end
314end
315for i ulong 36
316put t3bA2 i get t3bA1 i
317end
318for u ulong 36
319au = get t3bA1 u
320if gt au 0
321for v ulong 36
322w = get t3bW add mul u 36 v
323if gt w 0
324put t3bA2 v add get t3bA2 v div mul au w 1024
325end
326end
327end
328end
329best = ulong 20
330bv = get t3bA2 20
331for i ulong 10
332v = get t3bA2 add 20 i
333if gt v bv
334bv = v
335best = add 20 i
336end
337end
338ret sub best 20
339end
340
341fn a3bVecQuery c0 ulong c1 ulong to ulong
342q = or get t3bVecCue c0 get t3bVecCue c1
343best = ulong 0
344bv = ulong 0
345for i ulong 10
346sc = a3bPopcnt and q get t3bVecRc i
347if gt sc bv
348bv = sc
349best = i
350end
351end
352ret best
353end
354
355fn a3bRun to bool
356a3bInit
357aHits = ulong 0
358vHits = ulong 0
359t0 = monons
360for q ulong 10
361if eq a3bQuery q add 10 q q
362aHits = add aHits 1
363end
364end
365t1 = monons
366avgNs = div sub ulong t1 ulong t0 10
367for q ulong 10
368if eq a3bVecQuery q add 10 q q
369vHits = add vHits 1
370end
371end
372aPct = mul aHits 10
373vPct = mul vHits 10
374aWrt s3bA
375aNum aPct
376aWrt s3bB
377aNum vPct
378aWrt s3bC
379aNum avgNs
380ret gt aPct vPct
381end
382
383note ==================== TRACK 3C: ANTICIPATORY SCHEDULING IN AIENUX ====================
384fn a3cInit to void
385for i ulong 4096
386put t3cTrans i 0
387end
388for i ulong 8
389put t3cLast i 0
390end
391for i ulong 64
392put t3cHot i 0
393end
394for i ulong 512
395put t3cHistR i 0
396put t3cHistA i 0
397end
398end
399
400fn a3cPredict cur ulong to ulong
401best = ulong 0
402bv = ulong 0
403base = mul cur 64
404for j ulong 64
405w = get t3cTrans add base j
406if gt w bv
407bv = w
408best = j
409end
410end
411ret best
412end
413
414fn a3cQuantile isArb bool rank ulong to ulong
415acc = ulong 0
416for lat ulong 512
417c = ulong 0
418if isArb
419c = get t3cHistA lat
420else
421c = get t3cHistR lat
422end
423acc = add acc c
424if gt acc rank
425ret lat
426end
427end
428ret 511
429end
430
431fn a3cRun to bool
432a3cInit
433hits = ulong 0
434ohNs = ulong 0
435for step ulong 8000
436st = rem step 8
437phase = rem div step 8 8
438note Realistic repeating Aienux multi-stream rhythm: each stream cycles its 8 KV/weight/tool blocks
439blk = add mul st 8 phase
440note Reactive demand-fetch: stalls 400 us on cold block miss
441put t3cHistR 400 add get t3cHistR 400 1
442note Arboris anticipatory scheduler: check if pre-staged, learn transition, pre-stage next!
443t0 = monons
444isHit = ne get t3cHot blk 0
445prev = get t3cLast st
446idx = add mul prev 64 blk
447put t3cTrans idx add get t3cTrans idx 1
448put t3cLast st blk
449nxt = a3cPredict blk
450put t3cHot nxt 1
451t1 = monons
452ohNs = add ohNs sub ulong t1 ulong t0
453if isHit
454hits = add hits 1
455put t3cHistA 12 add get t3cHistA 12 1
456else
457put t3cHistA 400 add get t3cHistA 400 1
458end
459end
460rp95 = a3cQuantile false 7600
461ap95 = a3cQuantile true 7600
462rp99 = a3cQuantile false 7920
463ap99 = a3cQuantile true 7920
464hpct = div mul hits 100 8000
465avgOh = div ohNs 8000
466aWrt s3cA
467aNum rp95
468aWrt s3cB
469aNum ap95
470aWrt s3cC
471aNum rp99
472aWrt s3cD
473aNum ap99
474aWrt s3cE
475aNum hpct
476aWrt s3cF
477aNum avgOh
478ret and lt ap95 rp95 and lt ap99 rp99 lt avgOh 10000
479end
480
481fn main to int
482aWrt sHdr
483okA = a3aRun
484okB = a3bRun
485okC = a3cRun
486if and okA and okB okC
487aWrt sPass
488ret 0
489end
490aWrt sFail
491ret 1
492end