interplane.Get Omega
Read in your language

benchmarks-mv

Measurement harnesses and evidence bundles for AIEN on the NVIDIA DGX Spark GB10. Speed is reported against the machine's physical limit and my own previous run. Attachment of AienOS.

Brought by drakestapleton

branch main Branches Tags History

benchmarks-mv / native / neuralese / nl7-score.om

526 lines · 8341 bytes Raw Blame History
1om2
2note NL7 independent scorer, frozen prereg benchmarks 989fb7a214d8e0d6c7ed04f5f48c45d68a43d5a3.
3note Synthetic host evidence only. CSV predictions are scored, not used as truth or codewords.
4note D, and P, printable bounded diagnostics are explicitly non-scoring records.
5const CHUNK ulong 16384
6global Buf uchar CHUNK
7global Io ulong 2
8global Row ulong 9
9global Seen ulong 65536
10global Count ulong 131072
11global Good ulong 131072
12global Refuse ulong 131072
13global Robust ulong 360
14global Rgood ulong 360
15global Rrefuse ulong 360
16global Failed ulong 1
17text BAD "NL7 INVALID\n"
18text PASS "NL7 CHECKS PASS\n"
19text FAIL "NL7 CHECKS FAIL\n"
20text HEAD "NL7SCORE1,seed,split,arm,budget,mode,scope,total,correct,refused,undetected\n"
21text TAG "S,"
22text RTAG "R,"
23text LTAG "L,"
24text LHEAD "NL7LEARN1,seed,split,fullfit,heldout,improves,no_more_undetected\n"
25text YES "NL7 LEARNED SUPPORTED\n"
26text NO "NL7 LEARNED NOT_SUPPORTED\n"
27text COMMA ","
28text LF "\n"
29fn putout a view uchar * n ulong to void
30p = ulong 0
31while lt p n
32k = write 1 a p sub n p
33if le k 0
34exit 93
35end
36p = add p ulong k
37end
38end
39fn invalid to void
40putout BAD len BAD
41exit 90
42end
43fn number n ulong to void
44b = new uchar 20 0
45p = ulong 20
46while true bound 20
47p = sub p 1
48put b p uchar add rem n 10 48
49n = div n 10
50if eq n 0
51break
52end
53end
54putout part b p sub ulong 20 p sub ulong 20 p
55end
56fn flag v bool to ulong
57if v
58ret 1
59end
60ret 0
61end
62fn sep to void
63putout COMMA 1
64end
65fn next to long
66if eq get Io 0 get Io 1
67k = read 0 Buf 0 CHUNK
68if lt k 0
69invalid
70end
71if eq k 0
72ret -1
73end
74put Io 0 0
75put Io 1 ulong k
76end
77p = get Io 0
78put Io 0 add p 1
79ret long get Buf p
80end
81fn value delim long to ulong
82v = ulong 0
83n = ulong 0
84first = long -1
85while true bound 8
86c = next
87if eq c delim
88if eq n 0
89invalid
90end
91if and gt n 1 eq first 48
92invalid
93end
94ret v
95end
96if or lt c 48 gt c 57
97invalid
98end
99if eq n 0
100first = c
101end
102if gt n 5
103invalid
104end
105v = add mul v 10 ulong sub c 48
106n = add n 1
107end
108ret 0
109end
110fn seedindex seed ulong to ulong
111if eq seed 101
112ret 0
113end
114if eq seed 211
115ret 1
116end
117if eq seed 307
118ret 2
119end
120invalid
121ret 0
122end
123fn seedvalue si ulong to ulong
124if eq si 0
125ret 101
126end
127if eq si 1
128ret 211
129end
130ret 307
131end
132fn budindex budget ulong to ulong
133if eq budget 8
134ret 0
135end
136if eq budget 24
137ret 1
138end
139if eq budget 96
140ret 2
141end
142if eq budget 192
143ret 3
144end
145invalid
146ret 0
147end
148fn budvalue bi ulong to ulong
149if eq bi 0
150ret 8
151end
152if eq bi 1
153ret 24
154end
155if eq bi 2
156ret 96
157end
158ret 192
159end
160fn group si ulong split ulong arm ulong bi ulong to ulong
161ret add mul add mul add mul si 3 split 5 arm 4 bi
162end
163fn heldout split ulong id ulong to bool
164if eq split 0
165ret false
166end
167if or eq id 0 or eq id 1 or eq id 2 or eq id 4 eq id 8
168ret false
169end
170if eq split 1
171if or eq id 3 or eq id 5 eq id 9
172ret false
173end
174else
175if or eq id 6 or eq id 10 eq id 12
176ret false
177end
178end
179ret true
180end
181fn validmode arm ulong mode ulong to bool
182if or eq arm 0 or eq arm 2 eq arm 3
183ret le mode 18
184end
185if eq mode 0
186ret true
187end
188n = ulong 8
189if eq arm 4
190n = 4
191end
192if and ge mode 100 lt mode add 100 n
193ret true
194end
195if lt mode 200
196ret false
197end
198i = div sub mode 200 8
199j = rem sub mode 200 8
200ret and lt i j lt j n
201end
202note Independent RM codeword from four coefficient bits and eight evaluation triples.
203fn codeword id ulong to ulong
204word = ulong 0
205for t ulong 8
206bit = and id 1
207for k ulong 3
208coef = and shr id add k 1 1
209coord = and shr t k 1
210bit = xor bit and coef coord
211end
212word = or word shl bit t
213end
214ret word
215end
216fn corrupt word ulong mode ulong to ulong
217if eq mode 0
218ret word
219end
220if lt mode 200
221ret xor word shl ulong 1 sub mode 100
222end
223i = div sub mode 200 8
224j = rem sub mode 200 8
225ret xor xor word shl ulong 1 i shl ulong 1 j
226end
227fn hamming a ulong b ulong to ulong
228v = xor a b
229d = ulong 0
230for k ulong 8
231d = add d and shr v k 1
232end
233ret d
234end
235fn rmdecode word ulong to ulong
236found = ulong 99
237for cand ulong 16
238if le hamming word codeword cand 1
239if ne found 99
240ret 99
241end
242found = cand
243end
244end
245ret found
246end
247fn violation to void
248put Failed 0 add get Failed 0 1
249end
250fn guarantees to void
251arm = get Row 2
252id = get Row 3
253mode = get Row 5
254pred = get Row 6
255status = get Row 7
256if eq arm 0
257must = eq mode 0
258if and ge get Row 4 96 le mode 6
259must = true
260end
261if and must or ne status 0 ne pred id
262violation
263end
264end
265if eq arm 1
266expected = rmdecode corrupt codeword id mode
267if ne pred expected
268violation
269end
270if ne status flag eq expected 99
271violation
272end
273end
274if eq arm 4
275expected = corrupt id mode
276if or ne status 0 ne pred expected
277violation
278end
279end
280end
281fn increment idx ulong good bool refused bool to void
282put Count idx add get Count idx 1
283if good
284put Good idx add get Good idx 1
285end
286if refused
287put Refuse idx add get Refuse idx 1
288end
289end
290fn rincrement idx ulong good bool refused bool to void
291put Robust idx add get Robust idx 1
292if good
293put Rgood idx add get Rgood idx 1
294end
295if refused
296put Rrefuse idx add get Rrefuse idx 1
297end
298end
299fn grade base ulong to void
300id = get Row 3
301mode = get Row 5
302idx = add mul base 256 mode
303bit = shl ulong 1 id
304if ne and get Seen idx bit 0
305invalid
306end
307put Seen idx or get Seen idx bit
308correct = and eq get Row 7 0 eq get Row 6 id
309refused = eq get Row 7 1
310increment mul idx 2 correct refused
311if ne mode 0
312rincrement mul base 2 correct refused
313end
314if heldout get Row 1 id
315increment add mul idx 2 1 correct refused
316if ne mode 0
317rincrement add mul base 2 1 correct refused
318end
319end
320guarantees
321end
322fn row to void
323for j ulong 9
324d = long 44
325if eq j 8
326d = 10
327end
328put Row j value d
329end
330si = seedindex get Row 0
331bi = budindex get Row 4
332if or gt get Row 1 2 or gt get Row 2 4 gt get Row 3 15
333invalid
334end
335if not validmode get Row 2 get Row 5
336invalid
337end
338if gt get Row 7 1
339invalid
340end
341if eq get Row 7 0
342if gt get Row 6 15
343invalid
344end
345else
346if ne get Row 6 99
347invalid
348end
349end
350payload = get Row 4
351if eq payload 8
352payload = 6
353end
354if eq get Row 2 1
355payload = 8
356end
357if eq get Row 2 4
358payload = 4
359end
360if or ne get Row 8 payload gt get Row 8 get Row 4
361invalid
362end
363grade group si get Row 1 get Row 2 bi
364end
365fn diagnostic to void
366if ne next 44
367invalid
368end
369note Diagnostics are at most 8192 printable ASCII bytes followed by LF, never EOF.
370while true bound 8193
371c = next
372if eq c 10
373ret
374end
375if or lt c 32 gt c 126
376invalid
377end
378end
379invalid
380end
381fn load to void
382while true
383c = next
384if eq c -1
385break
386end
387if eq c 78
388if ne next 44
389invalid
390end
391row
392else
393if or eq c 68 eq c 80
394diagnostic
395else
396invalid
397end
398end
399end
400end
401fn complete to void
402for base ulong 180
403arm = rem div base 4 5
404for mode ulong 256
405if validmode arm mode
406if ne get Seen add mul base 256 mode 65535
407invalid
408end
409end
410end
411end
412end
413fn counters idx ulong to void
414number get Count idx
415sep
416number get Good idx
417sep
418number get Refuse idx
419sep
420number sub sub get Count idx get Good idx get Refuse idx
421putout LF 1
422end
423fn rcounters idx ulong to void
424number get Robust idx
425sep
426number get Rgood idx
427sep
428number get Rrefuse idx
429sep
430number sub sub get Robust idx get Rgood idx get Rrefuse idx
431putout LF 1
432end
433fn identity base ulong to void
434number seedvalue div base 60
435sep
436number rem div base 20 3
437sep
438number rem div base 4 5
439sep
440number budvalue rem base 4
441sep
442end
443fn report to void
444putout HEAD len HEAD
445for base ulong 180
446arm = rem div base 4 5
447for mode ulong 256
448if validmode arm mode
449for scope ulong 2
450putout TAG len TAG
451identity base
452number mode
453sep
454number scope
455sep
456counters add mul add mul base 256 mode 2 scope
457end
458end
459end
460for scope ulong 2
461putout RTAG len RTAG
462identity base
463number 99
464sep
465number scope
466sep
467rcounters add mul base 2 scope
468end
469end
470end
471fn wrongcount idx ulong to ulong
472ret sub sub get Count idx get Good idx get Refuse idx
473end
474fn learnedone si ulong sp ulong to bool
475idx = add mul mul group si sp 2 3 256 2 1
476baseline = add mul mul group si sp 3 3 256 2 1
477fullfit = eq get Good mul mul group si 0 2 3 256 2 16
478held = eq get Good idx 8
479improve = gt get Good idx get Good baseline
480safe = le wrongcount idx wrongcount baseline
481putout LTAG len LTAG
482number seedvalue si
483sep
484number sp
485sep
486number flag fullfit
487sep
488number flag held
489sep
490number flag improve
491sep
492number flag safe
493putout LF 1
494ret and fullfit and held and improve safe
495end
496fn learned to void
497putout LHEAD len LHEAD
498support = true
499for si ulong 3
500for split ulong 2
501if not learnedone si add split 1
502support = false
503end
504end
505end
506if support
507putout YES len YES
508else
509putout NO len NO
510end
511end
512fn main to int
513if ne argcnt 1
514invalid
515end
516load
517complete
518report
519learned
520if ne get Failed 0 0
521putout FAIL len FAIL
522ret 1
523end
524putout PASS len PASS
525ret 0
526end