interplane.Get Omega
Read in your language

aien-train

AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.

Brought by drakestapleton

branch main Branches Tags History

aien-train / tools / verified_examples / gate.om

689 lines · 13396 bytes Raw Blame History
1text vgl0 "/good"
2text vgl1 "/"
3text vgl2 "/a"
4text vgl3 "/request.wire"
5text vgl4 "/response.json"
6text vgl5 "/candidate."
7text vgl6 "/TEST-DATA-full"
8text vgl7 "/good/attempts.txt"
9text vgl8 "/attempts.txt"
10text vgl9 "/good/om/plain/task01/a1"
11text vgl10 "/om/plain/task01/a1"
12text vgl11 "/candidate.om"
13text vgframekilled "KILLED trainer-framing mutant\n"
14text vgg0 "/command.out"
15text vgg1 "/command.err"
16text vgg2 "/usr/bin/cp"
17text vgg3 "-a"
18text vgg4 "/run.txt"
19text vgg5 "/good"
20text vgg6 "/attempts.txt"
21text vgg7 "prep"
22text vgg8 "/bench/inference_cost"
23text vgg9 "/seed/out/omc"
24text vgg10 "/build/inference_cost/bin/chat"
25text vgg11 "/mutant.om"
26text vgg12 "/mutant"
27text vgg13 "/mutant.err"
28text vgg14 "KILLED converter mutant\n"
29text vgg15 "/TEST-DATA-stale"
30text vgg16 "/bad/om/plain/task01/a1/candidate.om"
31text vgg17 "/om/plain/task01/a1/candidate.om"
32text vgg18 "/bad/om/plain/task01/a1/response.json"
33text vgg19 "/om/plain/task01/a1/response.json"
34text vgg20 "/stale-base"
35text vgg21 "/stale-mutant"
36text vgg22 "KILLED stale-verdict mutant\n"
37text vgg23 "/TEST-DATA-tamper"
38text vgg24 "/tamper-base"
39text vgg25 "/tamper-mutant"
40text vgg26 "/TEST-DATA-pin"
41text vgg27 "/pin-base"
42text vgg28 "/pin-mutant"
43text vgg29 "/TEST-DATA-digest"
44text vgg30 "/digest-base"
45text vgg31 "/digest-mutant"
46text vgg32 "/TEST-DATA-mark"
47text vgg33 "/mark-base"
48text vgg34 "/mark-mutant"
49text vgg35 "/TEST-DATA-full"
50text vgg36 "/TEST-DATA-one"
51text vgg37 "/TEST-DATA-two"
52text vgg38 "/TEST-DATA-one/examples.jsonl"
53text vgg39 "/TEST-DATA-two/examples.jsonl"
54text vgg40 "/TEST-DATA-one/manifest.json"
55text vgg41 "/TEST-DATA-two/manifest.json"
56text vgg42 "/TEST-DATA-one/stories.txt"
57text vgg43 "/TEST-DATA-two/stories.txt"
58text vgg44 "/train.bin"
59text vgg45 "/held.bin"
60text vgg46 "references"
61text vgg47 "/references"
62text vgg48 "harness"
63text vgg49 "/harness"
64
65note Gate TOOL OMEGA HARNESS HARNESS_OMC TRAINER SELFTEST_ROOT COMPOSED_SOURCE ABS_WORK
66text vgzero "0000000000000000000000000000000000000000000000000000000000000000"
67text vgmetatext "version 1\nmodel_requested fake\nomc_sha256 "
68text vgtaskline "\ntask_set_sha256 "
69text vgtest "\nTEST DATA\n"
70text vgrows "version 2\nattempts 1\ntask01 om plain 1 1 0 1 1 1 1 2\n"
71text vgconst "const vxmut ulong 0"
72text vgconstp "const vxmut ulong "
73text vgfnl "\n"
74text vgok "EXAMPLES-GATE PASS mutants=9 records=80\n"
75text vgfail "EXAMPLES-GATE failure\n"
76fn vgpath k ulong suffix view uchar * to void
77vxcopy k 27
78vxadd k suffix
79end
80fn vgsetup to void
81vxset 6 vxnull
82vgpath 7 vgg0
83vgpath 8 vgg1
84end
85fn vgcheck actual ulong expected ulong to void
86if ne actual expected
87vxwrite 1 vgfail
88put vxion 1 1
89vxoutnum actual
90vxbyte 32
91vxoutnum expected
92vxbyte 10
93vxflush
94vxfail 70
95end
96end
97fn vgput k ulong a view uchar * to void
98f = vxopen k 577
99vxwrite f a
100vxclose f
101end
102fn vgcopy src ulong dst ulong to void
103vgsetup
104vxpkinit
105vxpk vgg2
106vxpk vgg3
107vxpkpath src
108vxpkpath dst
109r = vxspawn
110vgcheck r 0
111end
112fn vgsize k ulong to ulong
113st = new uchar 128 0
114f = vxopen k 0
115r = fstat f st 0 128
116vxclose f
117if ne r 0
118vxfail 71
119end
120n = ulong 0
121for i ulong 8
122v = ulong get st add i 48
123n = or n shl v mul i 8
124end
125ret n
126end
127fn vgmeta ombad bool taskbad bool marked bool to void
128vxcopy 29 28
129vxadd 29 vgg4
130f = vxopen 29 577
131vxwrite f vgmetatext
132if ombad
133vxwrite f vgzero
134else
135vxwrite f vxsha
136end
137vxwrite f vgtaskline
138if taskbad
139vxwrite f vgzero
140else
141vxwrite f vxtasks
142end
143if marked
144vxwrite f vgtest
145else
146vxwrite f vgfnl
147end
148vxclose f
149end
150
151fn vginputfile suffix view uchar * to void
152vxcopy 29 13
153vxadd 29 suffix
154vxcopy 30 14
155vxadd 30 suffix
156vgcopy 29 30
157end
158fn vgpathboth suffix view uchar * to void
159vxadd 13 suffix
160vxadd 14 suffix
161end
162fn vginputrow b view uchar * to void
163lang = new uchar 8 0
164word = new uchar 32 0
165ln = vxword b 1 lang
166vxcopy 13 25
167vxadd 13 vgl0
168vxcopy 14 28
169vgpathboth vgl1
170vgpathboth part lang 0 ln
171vgpathboth vgl1
172n = vxword b 2 word
173vgpathboth part word 0 n
174vgpathboth vgl1
175n = vxword b 0 word
176vgpathboth part word 0 n
177vgpathboth vgl2
178att = vxnumber b 3
179vxdecimal 13 att
180vxdecimal 14 att
181vgmkdir 14
182vginputfile vgl3
183vginputfile vgl4
184vxcopy 29 13
185vxadd 29 vgl5
186vxadd 29 part lang 0 ln
187vxcopy 30 14
188vxadd 30 vgl5
189vxadd 30 part lang 0 ln
190vgcopy 29 30
191end
192fn vgfullfixture to void
193b = new uchar 4096 0
194vgpath 28 vgl6
195vgmkdir 28
196vxcopy 29 25
197vxadd 29 vgl7
198vxcopy 30 28
199vxadd 30 vgl8
200vgcopy 29 30
201fd = vxopen 29 0
202n = vxline fd b
203n = vxline fd b
204count = vxnumber part b 0 n 1
205for i ulong count bound 9223372036854775807
206n = vxline fd b
207if eq n 0
208vxfail 2
209end
210vginputrow part b 0 n
211end
212vxclose fd
213vgmeta false false true
214end
215fn vgfixture suffix view uchar * to void
216vgpath 28 suffix
217vxcopy 13 25
218vxadd 13 vgl9
219vxcopy 14 28
220vxadd 14 vgl10
221vgmkdir 14
222vginputfile vgl3
223vginputfile vgl4
224vginputfile vgl11
225vxcopy 29 28
226vxadd 29 vgl8
227vgput 29 vgrows
228vgmeta false false true
229end
230
231fn vgcall suffix view uchar * release bool prep bool to ulong
232vgsetup
233vgpath 19 suffix
234vxpkinit
235vxpkpath 20
236if prep
237vxpk vgg7
238end
239vxpkpath 28
240vxcopy 29 21
241vxadd 29 vgg8
242vxpkpath 29
243vxcopy 29 21
244vxadd 29 vgg9
245vxpkpath 29
246vxcopy 29 21
247vxadd 29 vgg10
248vxpkpath 29
249vxpkpath 19
250if release
251vxpk vxrelease
252else
253vxpk vxtest
254end
255ret vxspawn
256end
257fn vgmutation m ulong to void
258b = new uchar 4096 0
259fi = vxopen 26 0
260vgpath 29 vgg11
261fo = vxopen 29 577
262hits = ulong 0
263while true bound 9223372036854775807
264n = vxline fi b
265if eq n 0
266if vgeof fi
267break
268end
269end
270if vxequal part b 0 n vgconst
271vxwrite fo vgconstp
272put b 0 uchar add m 48
273vxwrite fo part b 0 1
274hits = add hits 1
275else
276vxwrite fo part b 0 n
277end
278vxwrite fo vgfnl
279end
280vxclose fi
281vxclose fo
282vgcheck hits 1
283vxcopy 6 29
284vgpath 7 vgg12
285vgpath 8 vgg13
286vxpkinit
287vxcopy 29 21
288vxadd 29 vgg9
289vxpkpath 29
290r = vxspawn
291vgcheck r 0
292r2 = chmod vxp mul ulong 7 4096 get vxplen 7 448
293if ne r2 0
294vxfail 71
295end
296vxcopy 20 7
297end
298fn vgeof fd int to bool
299st = new uchar 128 0
300p = fseek fd 0 1
301r = fstat fd st 0 128
302if or lt p 0 ne r 0
303vxfail 71
304end
305n = ulong 0
306for i ulong 8
307v = ulong get st add i 48
308n = or n shl v mul i 8
309end
310ret eq ulong p n
311end
312fn vgkill m ulong expected ulong suffix view uchar * to void
313release = eq m 5
314r = vgcall suffix release false
315if eq r expected
316vxfail 72
317end
318vxwrite 1 vgg14
319end
320
321text vgsepnote "\nnote <|endoftext|>\n"
322text vgfence "```omega\n"
323text vgfenceend "```"
324text vgjsonstart "{\"model\":\"control\",\"usage\":{\"prompt_tokens\":1,\"completion_tokens\":1,\"total_tokens\":2},\"choices\":[{\"message\":{\"content\":"
325text vgjsonend "}}]}\n"
326text vgcontentpath "/framing-content"
327text vgcaseframe "/TEST-DATA-framing"
328text vgcanpath "/om/plain/task01/a1/candidate.om"
329text vgresponsepath "/om/plain/task01/a1/response.json"
330text vgframebase "/framing-base"
331text vgframemutant "/framing-mutant"
332fn vgframing to void
333vgfixture vgcaseframe
334vgmeta false false false
335vxcopy 30 28
336vxadd 30 vgcanpath
337fd = vxopen 30 1025
338vxwrite fd vgsepnote
339vxclose fd
340vgpath 31 vgcontentpath
341fd = vxopen 31 577
342vxwrite fd vgfence
343vxrawfile 30 fd
344vxwrite fd vgfenceend
345vxclose fd
346vxcopy 29 28
347vxadd 29 vgresponsepath
348fd = vxopen 29 577
349put vxion 1 ulong fd
350vxout vgjsonstart
351vxqfile 31
352vxout vgjsonend
353vxflush
354vxclose fd
355r = vgcall vgframebase false true
356vgcheck r 18
357vgmutation 6
358r = vgcall vgframemutant false true
359if eq r 18
360vxfail 72
361end
362vxwrite 1 vgframekilled
363vxcopy 20 18
364end
365text vgwidefixture "/TEST-DATA-wide-attempt"
366text vgwideold "/om/plain/task01/a1"
367text vgwidenew "/om/plain/task01/a4294967296"
368text vgwideatt "/attempts.txt"
369text vgwiderows "version 2\nattempts 1\ntask01 om plain 4294967296 0 0 1 1 1 1 2\n"
370text vgwideout "/TEST-DATA-wide-positive"
371text vgwidemut "/TEST-DATA-wide-mutant"
372text vgwidekilled "KILLED artificial attempt-cap mutant\n"
373fn vgwide to void
374vgfixture vgwidefixture
375vxcopy 29 28
376vxadd 29 vgwideold
377vxcopy 30 28
378vxadd 30 vgwidenew
379vgcopy 29 30
380vxcopy 29 28
381vxadd 29 vgwideatt
382vgput 29 vgwiderows
383r = vgcall vgwideout false false
384vgcheck r 0
385vxcopy 29 19
386vxadd 29 vxt56
387n = vgcountrecords 29
388vgcheck n 1
389vgmutation 7
390r = vgcall vgwidemut false false
391if eq r 0
392vxfail 72
393end
394vxwrite 1 vgwidekilled
395vxcopy 20 18
396end
397
398text vgmaxfixture "/TEST-DATA-uint64"
399text vgmaxnew "/om/plain/task01/a18446744073709551615"
400text vgmaxrows "version 2\nattempts 1\ntask01 om plain 18446744073709551615 0 0 1 1 1 1 2\n"
401text vgoverrows "version 2\nattempts 1\ntask01 om plain 18446744073709551617 0 0 1 1 1 1 2\n"
402text vgmaxout "/TEST-DATA-uint64-positive"
403text vgoverout "/TEST-DATA-uint64-overflow"
404text vgovermut "/TEST-DATA-uint64-overflow-mutant"
405fn vgmax to void
406vgfixture vgmaxfixture
407vxcopy 29 28
408vxadd 29 vgwideold
409vxcopy 30 28
410vxadd 30 vgmaxnew
411vgcopy 29 30
412vxcopy 29 28
413vxadd 29 vgwideatt
414vgput 29 vgmaxrows
415r = vgcall vgmaxout false false
416vgcheck r 0
417vxcopy 29 19
418vxadd 29 vxt56
419n = vgcountrecords 29
420vgcheck n 1
421vxcopy 29 28
422vxadd 29 vgwideatt
423vgput 29 vgoverrows
424r = vgcall vgoverout false false
425vgcheck r 2
426vgmutation 8
427vgkill 8 2 vgovermut
428vxcopy 20 18
429end
430
431text vgpindir "/capped-referee"
432text vgpbench "/bench"
433text vgpseed "/seed/out"
434text vgpchatdir "/build/inference_cost/bin"
435text vgpbenchsource "/bench/inference_cost"
436text vgpbenchfile "/bench/inference_cost/driver.sh"
437text vgpcompiler "/seed/out/omc"
438text vgppin "/seed/out/omc.sha256"
439text vgpchat "/build/inference_cost/bin/chat"
440text vgpcomment "\n# TEST DATA: byte-mutated capped driver, not the approved referee artifact\n"
441text vgpfxture "/TEST-DATA-referee-pin"
442text vgpbase "/TEST-DATA-referee-pin-base"
443text vgpmut "/TEST-DATA-referee-pin-mutant"
444text vgpkilled "KILLED unapproved-referee mutant\n"
445text vgpmkdir "/usr/bin/mkdir"
446text vgpminus "-p"
447text vgpchild "/inference_cost"
448fn vgmkdir k ulong to void
449vgsetup
450vxpkinit
451vxpk vgpmkdir
452vxpk vgpminus
453vxpkpath k
454r = vxspawn
455vgcheck r 0
456end
457fn vgcopyrelative suffix view uchar * to void
458vxcopy 29 21
459vxadd 29 suffix
460vxcopy 30 16
461vxadd 30 suffix
462vgcopy 29 30
463end
464fn vgdriver to void
465vgfixture vgpfxture
466vgpath 16 vgpindir
467vxcopy 29 16
468vxadd 29 vgpbench
469vgmkdir 29
470vxcopy 30 21
471vxadd 30 vgpbenchsource
472vxcopy 31 29
473vxadd 31 vgpchild
474vgcopy 30 31
475vxcopy 29 16
476vxadd 29 vgpseed
477vgmkdir 29
478vgcopyrelative vgpcompiler
479vgcopyrelative vgppin
480vxcopy 29 16
481vxadd 29 vgpchatdir
482vgmkdir 29
483vgcopyrelative vgpchat
484vxcopy 29 16
485vxadd 29 vgpbenchfile
486fd = vxopen 29 1025
487vxwrite fd vgpcomment
488vxclose fd
489vxcopy 15 21
490vxcopy 21 16
491r = vgcall vgpbase false false
492vgcheck r 20
493vgmutation 9
494r = vgcall vgpmut false false
495vgcheck r 0
496vxcopy 29 19
497vxadd 29 vxt56
498n = vgcountrecords 29
499vgcheck n 1
500vxwrite 1 vgpkilled
501vxcopy 21 15
502vxcopy 20 18
503end
504fn vgcontrols to void
505note Stale verified verdict: candidate and response agree on a wrong but compiling program.
506vgfixture vgg15
507vxcopy 29 25
508vxadd 29 vgg16
509vxcopy 30 28
510vxadd 30 vgg17
511vgcopy 29 30
512vxcopy 29 25
513vxadd 29 vgg18
514vxcopy 30 28
515vxadd 30 vgg19
516vgcopy 29 30
517vgmeta false false false
518r = vgcall vgg20 false true
519vgcheck r 0
520vxcopy 29 19
521vxadd 29 vxt56
522n = vgsize 29
523vgcheck n 0
524vxcopy 29 19
525vxadd 29 vxstories
526n = vgsize 29
527vgcheck n 0
528vgmutation 1
529r = vgcall vgg21 false false
530vgcheck r 0
531vxcopy 29 19
532vxadd 29 vxt56
533n = vgsize 29
534if eq n 0
535vxfail 72
536end
537vxwrite 1 vgg22
538vxcopy 20 18
539note Candidate changed while the original response remains unchanged.
540vgfixture vgg23
541vxcopy 29 25
542vxadd 29 vgg16
543vxcopy 30 28
544vxadd 30 vgg17
545vgcopy 29 30
546vgmeta false false false
547r = vgcall vgg24 false false
548vgcheck r 15
549vgmutation 2
550vgkill 2 15 vgg25
551vxcopy 20 18
552vgfixture vgg26
553vgmeta true false false
554r = vgcall vgg27 false false
555vgcheck r 10
556vgmutation 3
557vgkill 3 10 vgg28
558vxcopy 20 18
559vgfixture vgg29
560vgmeta false true false
561r = vgcall vgg30 false false
562vgcheck r 11
563vgmutation 4
564vgkill 4 11 vgg31
565vxcopy 20 18
566vgfixture vgg32
567r = vgcall vgg33 true false
568vgcheck r 13
569vgmutation 5
570vgkill 5 13 vgg34
571vxcopy 20 18
572end
573fn vgcountrecords k ulong to ulong
574b = new uchar 65536 0
575fd = vxopen k 0
576count = ulong 0
577while true bound 9223372036854775807
578r = read fd b 0 len b
579if lt r 0
580vxfail 71
581end
582if eq r 0
583break
584end
585for i ulong ulong r
586if eq get b i 10
587count = add count 1
588end
589end
590end
591vxclose fd
592ret count
593end
594fn vgdeterminism to void
595h1 = new uchar 64 0
596h2 = new uchar 64 0
597vgfullfixture
598r = vgcall vgg36 false true
599vgcheck r 0
600r = vgcall vgg37 false true
601vgcheck r 0
602vgpath 29 vgg38
603vgpath 30 vgg39
604count = vgcountrecords 29
605vgcheck count 80
606vxhash 29 h1
607vxhash 30 h2
608if not vxequal h1 h2
609vxfail 73
610end
611vxwrite 1 h1
612vxwrite 1 vgfnl
613vgpath 29 vgg40
614vgpath 30 vgg41
615vxhash 29 h1
616vxhash 30 h2
617if not vxequal h1 h2
618vxfail 73
619end
620vxwrite 1 h1
621vxwrite 1 vgfnl
622vgpath 29 vgg42
623vgpath 30 vgg43
624vxhash 29 h1
625vxhash 30 h2
626if not vxequal h1 h2
627vxfail 73
628end
629vxwrite 1 h1
630vxwrite 1 vgfnl
631vgsetup
632vxpkinit
633vxpkpath 24
634vxpk vgg7
635vxpkpath 29
636vgpath 30 vgg44
637vxpkpath 30
638vgpath 30 vgg45
639vxpkpath 30
640r = vxspawn
641vgcheck r 0
642end
643fn vgsources mode view uchar * root ulong compiler ulong suffix view uchar * to void
644vgsetup
645vxpkinit
646vxpkpath 20
647vxpk mode
648vxpkpath root
649vxpkpath compiler
650vxcopy 29 21
651vxadd 29 vgg10
652vxpkpath 29
653vgpath 29 suffix
654vxpkpath 29
655vxpk vxrelease
656r = vxspawn
657vgcheck r 0
658end
659fn main to int
660if ne argcnt 9
661vxfail 2
662end
663for i ulong 8
664vxarg add i 1 add i 20
665end
666note Slots:20 tool,21 omega,22 harness,23 harness omc,24 trainer,25 selftest,26 source,27 work.
667vxcopy 18 20
668vxenvinit
669r = makedir vxp mul ulong 27 4096 get vxplen 27 448
670if ne r 0
671vxfail 3
672end
673vgcontrols
674vgframing
675vgwide
676vgmax
677vgdriver
678vgdeterminism
679vxcopy 29 21
680vxadd 29 vgg9
681vxcopy 17 29
682vxcopy 29 21
683vxadd 29 vgg8
684vxcopy 16 29
685vgsources vgg46 16 17 vgg47
686vgsources vgg48 22 23 vgg49
687vxwrite 1 vgok
688ret 0
689end