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 / examples.om

1056 lines · 18203 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-or-later
2note DRA-122. Compose after omega-mv om/tls/sha2.om and seed/json/json.om.
3note verify RUN BENCH OMC CHAT OUT release|test
4note Fixed path arrays implement Linux PATH_MAX, not a dataset size limit. Data streams.
5const vxmut ulong 0
6text vxtestlicence ",\"licence_position\":\"TEST DATA from benchmark fixtures; original source licences retained; not model-written training evidence\"}\n"
7text vxdriverpin "219e156eb083aa70eb3ab7027d289b8df34c955c7cf469414b91264e187965e6"
8text vxsha "a5613368f427aacd73ebeee16d46f8b3203405711d4de5b860d0cbee11ce4533"
9text vxtasks "e14b430d58d9cb86aa264deb814ac930e1d5dae1c146ddd43af4067d707472d6"
10text vxslash "/"
11text vxrun "/run.txt"
12text vxatt "/attempts.txt"
13text vxdriver "/driver.sh"
14text vxnull "/dev/null"
15text vxerr "verified-examples: refused\n"
16text vxshell "/usr/bin/sh"
17text vxextract "exec \"$1\" resp < \"$2\" 3> \"$3\""
18text vxtaskdir "/tasks/"
19text vxstories "/stories.txt"
20text vxdochead "Task:\n"
21text vxdocprog "\nProgram:\n"
22text vxeot "\n<|endoftext|>\n"
23text vxstatement "/statement.txt"
24text vxstorysha ",\"stories_sha256\":"
25text vxomckey "OMC="
26text vxseparator "<|endoftext|>"
27text vxsdflag "--task-set-sha256"
28text vxsourcekey ",\"source\":"
29text vxmodelsource "model-run"
30text vxrefsource "reference-solutions"
31text vxharsource "harness-examples"
32text vxarrnone "[]"
33text vxpathkey "PATH="
34text vxtest "test"
35text vxrelease "release"
36text vxevalout "/eval/out.txt"
37text vxhex "0123456789abcdef"
38text vxt0 "omc_sha256"
39text vxt1 "task_set_sha256"
40text vxt2 "TEST"
41text vxt3 "model_requested"
42text vxt4 "fake"
43text vxt5 "/TEST_DATA"
44text vxt6 "\\u00"
45text vxt7 "/request.wire"
46text vxt8 "["
47text vxt9 "msg"
48text vxt10 ","
49text vxt11 "{\"role\":"
50text vxt12 ",\"content\":\""
51text vxt13 "\"}"
52text vxt14 "]"
53text vxt15 "/response.meta"
54text vxt16 "/response.err"
55text vxt17 "-c"
56text vxt18 "extract"
57text vxt19 "/referee.txt"
58text vxt20 "/referee.err"
59text vxt21 "--verify-candidate"
60text vxt22 "{\"task\":"
61text vxt23 ",\"language\":"
62text vxt24 ",\"arm\":"
63text vxt25 ",\"attempt\":"
64text vxt26 ",\"messages\":"
65text vxt27 ",\"program\":"
66text vxt28 ",\"omc_sha256\":"
67text vxt29 ",\"task_set_sha256\":"
68text vxt30 ",\"referee_output_sha256\":"
69text vxt31 ",\"test_data\":"
70text vxt32 "true"
71text vxt33 "false"
72text vxt34 "}\n"
73text vxt35 "task"
74text vxt36 "c"
75text vxt37 "py"
76text vxt38 "rs"
77text vxt39 "om"
78text vxt40 "plain"
79text vxt41 "feedback"
80text vxt42 "/a"
81text vxt43 "/candidate."
82text vxt44 "/extracted"
83text vxt45 "/response.json"
84text vxt46 "/evaluation"
85text vxt48 "{\"format\":\"verified-programs-v1\",\"records\":"
86text vxt49 ",\"counts\":{\"om\":"
87text vxt50 ",\"c\":"
88text vxt51 ",\"py\":"
89text vxt52 ",\"rs\":"
90text vxt53 "},\"rejected\":"
91text vxt54 ",\"sha256\":"
92text vxt55 ",\"licence_position\":\"model-written code, verified, from Drake's own runs; verification does not establish copyright or grant rights in third-party material\"}\n"
93text vxt56 "/examples.jsonl"
94text vxt57 "/manifest.json"
95text vxt58 "version 2"
96global vxp uchar 131072
97global vxplen ulong 32
98global vxpacket uchar 65536
99global vxpn ulong 2
100global vxstatus uchar 4
101global vxio uchar 65536
102global vxion ulong 2
103global vxcounts ulong 12
104global vxshift ulong 1
105global vxstoryfd long 1
106global vxenv uchar 4096
107global vxenvn ulong 1
108note Paths: 0 run,1 bench,2 omc,3 chat,4 output,5 driver,6 input,7 stdout,8 stderr,
109note 9 attempt,10 candidate,11 extracted,12 response,13 evaluation work,14 JSONL,15 manifest.
110fn vxfail n int to void
111r = write 2 vxerr 0 len vxerr
112exit n
113end
114fn vxset k ulong a view uchar * to void
115if ge len a 4096
116vxfail 2
117end
118for i ulong len a
119put vxp add mul k 4096 i get a i
120end
121put vxplen k len a
122end
123fn vxcopy k ulong j ulong to void
124ko = mul k 4096
125jo = mul j 4096
126for i ulong get vxplen j
127v = get vxp add jo i
128put vxp add ko i v
129end
130put vxplen k get vxplen j
131end
132fn vxadd k ulong a view uchar * to void
133n = get vxplen k
134if ge add n len a 4096
135vxfail 2
136end
137for i ulong len a
138put vxp add add mul k 4096 n i get a i
139end
140put vxplen k add n len a
141end
142fn vxdecimal k ulong n ulong to void
143b = new uchar 20 0
144p = ulong 20
145v = n
146while true bound 20
147p = sub p 1
148put b p uchar add rem v 10 48
149v = div v 10
150if eq v 0
151break
152end
153end
154vxadd k part b p sub 20 p
155end
156fn vxarg i ulong k ulong to void
157r = argread add i get vxshift 0 vxp mul k 4096 4095
158if lt r 1
159vxfail 2
160end
161put vxplen k ulong r
162end
163fn vxopen k ulong flags int to int
164r = fopen vxp mul k 4096 get vxplen k flags 384
165if lt r 0
166vxfail 3
167end
168ret int r
169end
170fn vxclose fd int to void
171r = fclose fd
172if ne r 0
173vxfail 3
174end
175end
176fn vxwrite fd int a view uchar * to void
177p = ulong 0
178while lt p len a bound 9223372036854775807
179r = write fd a p sub len a p
180if le r 0
181vxfail 3
182end
183p = add p ulong r
184end
185end
186fn vxpkinit to void
187put vxpn 0 2
188put vxpn 1 0
189end
190fn vxpk a view uchar * to void
191n = get vxpn 0
192if gt add add n 2 len a 65536
193vxfail 2
194end
195put vxpacket n uchar and len a 255
196put vxpacket add n 1 uchar shr len a 8
197for i ulong len a
198put vxpacket add add n 2 i get a i
199end
200put vxpn 0 add add n 2 len a
201put vxpn 1 add get vxpn 1 1
202end
203fn vxpkpath k ulong to void
204b = new uchar 4096 0
205n = get vxplen k
206for i ulong n
207put b i get vxp add mul k 4096 i
208end
209vxpk part b 0 n
210end
211fn vxspawn to ulong
212put vxpacket 0 uchar and get vxpn 1 255
213put vxpacket 1 uchar shr get vxpn 1 8
214pid = fork
215if lt pid 0
216vxfail 3
217end
218if eq pid 0
219f0 = vxopen 6 0
220f1 = vxopen 7 577
221f2 = vxopen 8 577
222r0 = dupfd f0 0 0
223r1 = dupfd f1 1 0
224r2 = dupfd f2 2 0
225if or or ne r0 0 ne r1 1 ne r2 2
226exit 126
227end
228r = execenv vxpacket 0 get vxpn 0 vxenv 0 get vxenvn 0
229exit 126
230end
231w = waitpid int pid vxstatus 0 4 0
232if ne w pid
233vxfail 3
234end
235if ne and get vxstatus 0 127 0
236ret add ulong 256 ulong get vxstatus 0
237end
238ret ulong get vxstatus 1
239end
240fn vxhash k ulong h edit uchar * to void
241b = new uchar 65536 0
242c = new ulong 40 0
243d = new uchar 32 0
244fd = vxopen k 0
245sha256_init c
246while true bound 9223372036854775807
247r = read fd b 0 len b
248if lt r 0
249vxfail 3
250end
251if eq r 0
252break
253end
254sha256_update c part b 0 ulong r
255end
256vxclose fd
257sha256_final c d
258for i ulong 32
259v = get d i
260put h mul i 2 get vxhex ulong shr v 4
261put h add mul i 2 1 get vxhex ulong and v 15
262end
263end
264fn vxequal a view uchar * b view uchar * to bool
265if ne len a len b
266ret false
267end
268for i ulong len a
269if ne get a i get b i
270ret false
271end
272end
273ret true
274end
275note line reader: overlong lines are protocol-invalid; payloads are byte-counted and stream separately.
276fn vxline fd int b edit uchar * to ulong
277one = new uchar 1 0
278n = ulong 0
279while true bound 9223372036854775807
280r = read fd one 0 1
281if lt r 0
282vxfail 3
283end
284if eq r 0
285if eq n 0
286ret 0
287end
288vxfail 2
289end
290if eq get one 0 10
291ret n
292end
293if eq n len b
294vxfail 2
295end
296put b n get one 0
297n = add n 1
298end
299ret 0
300end
301fn vxfield b view uchar * k ulong to ulong
302p = ulong 0
303for i ulong k
304while lt p len b bound 9223372036854775807
305c = get b p
306p = add p 1
307if eq c 32
308break
309end
310end
311end
312ret p
313end
314fn vxword b view uchar * k ulong a edit uchar * to ulong
315p = vxfield b k
316n = ulong 0
317while lt p len b bound 9223372036854775807
318c = get b p
319if eq c 32
320break
321end
322if eq n len a
323vxfail 2
324end
325put a n c
326p = add p 1
327n = add n 1
328end
329ret n
330end
331fn vxnum b view uchar * to ulong
332n = ulong 0
333if eq len b 0
334vxfail 2
335end
336for i ulong len b
337c = get b i
338if or lt c 48 gt c 57
339vxfail 2
340end
341if ne vxmut 8
342if gt n 1844674407370955161
343vxfail 2
344end
345end
346d = ulong sub c 48
347if ne vxmut 8
348if eq n 1844674407370955161
349if gt d 5
350vxfail 2
351end
352end
353end
354n = add mul n 10 d
355end
356ret n
357end
358fn vxnumber b view uchar * k ulong to ulong
359a = new uchar 32 0
360n = vxword b k a
361ret vxnum part a 0 n
362end
363fn vxeof fd int to bool
364st = new uchar 128 0
365p = fseek fd 0 1
366r = fstat fd st 0 len st
367if or lt p 0 ne r 0
368vxfail 3
369end
370n = ulong 0
371for i ulong 8
372v = ulong get st add i 48
373n = or n shl v mul i 8
374end
375ret eq ulong p n
376end
377note Metadata admission only needs short keys and pin values. Consume unknown fields of any size.
378fn vxmetaline fd int b edit uchar * to ulong
379one = new uchar 1 0
380n = ulong 0
381while true bound 9223372036854775807
382r = read fd one 0 1
383if lt r 0
384vxfail 3
385end
386if eq r 0
387ret n
388end
389if eq get one 0 10
390ret n
391end
392if lt n len b
393put b n get one 0
394n = add n 1
395end
396end
397ret n
398end
399fn vxmeta release bool to void
400b = new uchar 128 0
401a = new uchar 4096 0
402vxcopy 6 0
403vxadd 6 vxrun
404fd = vxopen 6 0
405seen = ulong 0
406while true bound 9223372036854775807
407n = vxmetaline fd b
408if eq n 0
409if vxeof fd
410break
411end
412continue
413end
414k = vxword part b 0 n 0 a
415if vxequal part a 0 k vxt0
416z = vxword part b 0 n 1 a
417if ne vxmut 3
418if not vxequal part a 0 z vxsha
419vxfail 10
420end
421end
422seen = or seen 1
423end
424if vxequal part a 0 k vxt1
425z = vxword part b 0 n 1 a
426if ne vxmut 4
427if not vxequal part a 0 z vxtasks
428vxfail 11
429end
430end
431seen = or seen 2
432end
433if vxequal part a 0 k vxt2
434put vxcounts 6 1
435end
436if vxequal part a 0 k vxt3
437z = vxword part b 0 n 1 a
438if vxequal part a 0 z vxt4
439put vxcounts 6 1
440end
441end
442end
443vxclose fd
444if ne seen 3
445vxfail 12
446end
447vxcopy 6 0
448vxadd 6 vxt5
449r = faccess vxp mul ulong 6 4096 get vxplen 6 0
450if eq r 0
451put vxcounts 6 1
452end
453if ne vxmut 5
454if and release ne get vxcounts 6 0
455vxfail 13
456end
457end
458end
459fn vxflush to void
460n = get vxion 0
461p = ulong 0
462while lt p n bound 65536
463r = write int get vxion 1 vxio p sub n p
464if le r 0
465vxfail 3
466end
467p = add p ulong r
468end
469put vxion 0 0
470end
471fn vxbyte c uchar to void
472n = get vxion 0
473put vxio n c
474put vxion 0 add n 1
475if eq add n 1 65536
476vxflush
477end
478end
479fn vxout a view uchar * to void
480for i ulong len a bound 9223372036854775807
481vxbyte get a i
482end
483end
484fn vxquote a view uchar * to void
485vxbyte 34
486for i ulong len a bound 9223372036854775807
487vxescape get a i
488end
489vxbyte 34
490end
491fn vxescape c uchar to void
492if or eq c 34 eq c 92
493vxbyte 92
494vxbyte c
495ret
496end
497if lt c 32
498vxout vxt6
499vxbyte get vxhex ulong shr c 4
500vxbyte get vxhex ulong and c 15
501ret
502end
503vxbyte c
504end
505fn vxqfile k ulong to void
506b = new uchar 65536 0
507fd = vxopen k 0
508vxbyte 34
509state = ulong 0
510while true bound 9223372036854775807
511r = read fd b 0 len b
512if lt r 0
513vxfail 3
514end
515if eq r 0
516break
517end
518for i ulong ulong r
519c = get b i
520state = js_u8st state c
521if eq state 9
522vxfail 2
523end
524vxescape c
525end
526end
527if ne state 0
528vxfail 2
529end
530vxbyte 34
531vxclose fd
532end
533fn vxoutnum v ulong to void
534b = new uchar 20 0
535p = ulong 20
536n = v
537while true bound 20
538p = sub p 1
539put b p uchar add rem n 10 48
540n = div n 10
541if eq n 0
542break
543end
544end
545vxout part b p sub 20 p
546end
547fn vxpayload fd int amount ulong to void
548chunk = new uchar 65536 0
549left = amount
550state = ulong 0
551while gt left 0 bound 9223372036854775807
552want = left
553if gt want len chunk
554want = len chunk
555end
556r = read fd chunk 0 want
557if le r 0
558vxfail 2
559end
560for j ulong ulong r
561c = get chunk j
562state = js_u8st state c
563if eq state 9
564vxfail 2
565end
566vxescape c
567end
568left = sub left ulong r
569end
570if ne state 0
571vxfail 2
572end
573r = read fd chunk 0 1
574if ne r 1
575vxfail 2
576end
577if ne get chunk 0 10
578vxfail 2
579end
580end
581fn vxmessages to void
582b = new uchar 4096 0
583a = new uchar 64 0
584vxcopy 6 9
585vxadd 6 vxt7
586fd = vxopen 6 0
587for i ulong 4
588n = vxmetaline fd b
589if eq n 0
590vxfail 2
591end
592end
593n = vxline fd b
594count = vxnumber part b 0 n 1
595if lt count 2
596vxfail 2
597end
598vxout vxt8
599for m ulong count bound 9223372036854775807
600n = vxline fd b
601z = vxword part b 0 n 0 a
602if not vxequal part a 0 z vxt9
603vxfail 2
604end
605z = vxword part b 0 n 1 a
606if ne m 0
607vxout vxt10
608end
609vxout vxt11
610vxquote part a 0 z
611vxout vxt12
612vxpayload fd vxnumber part b 0 n 2
613vxout vxt13
614end
615vxout vxt14
616vxclose fd
617end
618fn vxextractcode to void
619vxset 6 vxnull
620vxcopy 7 4
621vxadd 7 vxt15
622vxcopy 8 4
623vxadd 8 vxt16
624vxpkinit
625vxpk vxshell
626vxpk vxt17
627vxpk vxextract
628vxpk vxt18
629vxpkpath 3
630vxpkpath 12
631vxpkpath 11
632rc = vxspawn
633if ne rc 0
634vxfail 14
635end
636end
637fn vxreferee lang view uchar 8 task view uchar 16 to ulong
638vxset 6 vxnull
639vxcopy 7 4
640vxadd 7 vxt19
641vxcopy 8 4
642vxadd 8 vxt20
643vxpkinit
644vxpk vxshell
645vxpkpath 5
646vxpk vxt21
647vxpk part lang 0 get vxcounts 7
648vxpk part task 0 6
649vxpkpath 10
650vxpkpath 13
651ret vxspawn
652end
653fn vxrecord task view uchar 16 lang view uchar 8 arm view uchar 16 att ulong rh view uchar 64 to void
654vxout vxt22
655vxquote part task 0 6
656vxout vxt23
657vxquote part lang 0 get vxcounts 7
658vxout vxt24
659vxquote part arm 0 get vxcounts 8
660vxout vxt25
661vxoutnum att
662vxout vxsourcekey
663if eq get vxcounts 10 0
664vxquote vxmodelsource
665else
666if eq get vxcounts 10 1
667vxquote vxrefsource
668else
669vxquote vxharsource
670end
671end
672vxout vxt26
673if eq get vxcounts 10 0
674vxmessages
675else
676vxout vxarrnone
677end
678vxout vxt27
679vxqfile 10
680vxout vxt28
681vxquote vxsha
682vxout vxt29
683vxquote vxtasks
684vxout vxt30
685vxquote rh
686vxout vxt31
687if ne get vxcounts 6 0
688vxout vxt32
689else
690vxout vxt33
691end
692vxout vxt34
693end
694fn vxattempt b view uchar * to void
695task = new uchar 16 0
696lang = new uchar 8 0
697arm = new uchar 16 0
698tn = vxword b 0 task
699ln = vxword b 1 lang
700an = vxword b 2 arm
701att = vxnumber b 3
702if ne tn 6
703vxfail 2
704end
705if not vxequal part task 0 4 vxt35
706vxfail 2
707end
708if or lt get task 4 48 gt get task 4 57
709vxfail 2
710end
711if or lt get task 5 48 gt get task 5 57
712vxfail 2
713end
714if eq att 0
715vxfail 2
716end
717note Negative control 7 restores the former needless 32-bit attempt-number cap.
718if eq vxmut 7
719if gt att 4294967295
720vxfail 2
721end
722end
723idx = ulong 0
724if vxequal part lang 0 ln vxt36
725idx = 1
726else
727if vxequal part lang 0 ln vxt37
728idx = 2
729else
730if vxequal part lang 0 ln vxt38
731idx = 3
732else
733if not vxequal part lang 0 ln vxt39
734vxfail 2
735end
736end
737end
738end
739if not vxequal part arm 0 an vxt40
740if not vxequal part arm 0 an vxt41
741vxfail 2
742end
743end
744put vxcounts 7 ln
745put vxcounts 8 an
746vxprocess task lang arm att idx
747end
748fn vxrawfile k ulong fd int to void
749b = new uchar 65536 0
750f = vxopen k 0
751while true bound 9223372036854775807
752r = read f b 0 len b
753if lt r 0
754vxfail 3
755end
756if eq r 0
757break
758end
759vxwrite fd part b 0 ulong r
760end
761vxclose f
762end
763fn vxcheckseparator to void
764b = new uchar 65536 0
765fd = vxopen 10 0
766matched = ulong 0
767while true bound 9223372036854775807
768r = read fd b 0 len b
769if lt r 0
770vxfail 3
771end
772if eq r 0
773break
774end
775for i ulong ulong r
776c = get b i
777if eq c get vxseparator matched
778matched = add matched 1
779if eq matched len vxseparator
780vxfail 18
781end
782else
783matched = ulong 0
784if eq c get vxseparator 0
785matched = 1
786end
787end
788end
789end
790vxclose fd
791end
792fn vxstory task view uchar 16 to void
793if eq get vxshift 0 0
794ret
795end
796if ne vxmut 6
797vxcheckseparator
798end
799fd = int get vxstoryfd 0
800vxcopy 6 1
801vxadd 6 vxtaskdir
802vxadd 6 part task 0 6
803vxadd 6 vxstatement
804vxwrite fd vxdochead
805vxrawfile 6 fd
806vxwrite fd vxdocprog
807vxrawfile 10 fd
808vxwrite fd vxeot
809end
810fn vxprocess task view uchar 16 lang view uchar 8 arm view uchar 16 att ulong idx ulong to void
811h1 = new uchar 64 0
812h2 = new uchar 64 0
813vxcopy 9 0
814vxadd 9 vxslash
815vxadd 9 part lang 0 get vxcounts 7
816vxadd 9 vxslash
817vxadd 9 part arm 0 get vxcounts 8
818vxadd 9 vxslash
819vxadd 9 part task 0 6
820vxadd 9 vxt42
821vxdecimal 9 att
822vxcopy 10 9
823vxadd 10 vxt43
824vxadd 10 part lang 0 get vxcounts 7
825vxcopy 11 4
826vxadd 11 vxt44
827vxcopy 12 9
828vxadd 12 vxt45
829vxcopy 13 4
830vxadd 13 vxt46
831vxdecimal 13 get vxcounts 9
832put vxcounts 9 add get vxcounts 9 1
833vxextractcode
834vxhash 10 h1
835vxhash 11 h2
836if ne vxmut 2
837if not vxequal h1 h2
838vxfail 15
839end
840end
841vxcopy 10 11
842rc = vxreferee lang task
843if ge rc 2
844vxfail 16
845end
846if ne vxmut 1
847if ne rc 0
848put vxcounts 5 add get vxcounts 5 1
849ret
850end
851end
852vxcopy 6 13
853vxadd 6 vxevalout
854vxhash 6 h1
855vxrecord task lang arm att h1
856vxstory task
857put vxcounts idx add get vxcounts idx 1
858put vxcounts 4 add get vxcounts 4 1
859end
860fn vxmanifest to void
861h = new uchar 64 0
862vxhash 14 h
863vxflush
864vxclose int get vxion 1
865fd = vxopen 15 193
866put vxion 1 ulong fd
867vxout vxt48
868vxoutnum get vxcounts 4
869vxout vxt49
870vxoutnum get vxcounts 0
871vxout vxt50
872vxoutnum get vxcounts 1
873vxout vxt51
874vxoutnum get vxcounts 2
875vxout vxt52
876vxoutnum get vxcounts 3
877vxout vxt53
878vxoutnum get vxcounts 5
879vxout vxt54
880vxquote h
881vxout vxt28
882vxquote vxsha
883vxout vxt29
884vxquote vxtasks
885vxout vxt31
886if ne get vxcounts 6 0
887vxout vxt32
888else
889vxout vxt33
890end
891if ne get vxshift 0 0
892vxcopy 6 4
893vxadd 6 vxstories
894vxhash 6 h
895vxout vxstorysha
896vxquote h
897end
898if ne get vxcounts 6 0
899vxout vxtestlicence
900else
901vxout vxt55
902end
903vxflush
904vxclose fd
905end
906fn vxcheckdriver to void
907h = new uchar 64 0
908vxhash 5 h
909if ne vxmut 9
910if not vxequal h vxdriverpin
911vxfail 20
912end
913end
914end
915fn vxchecktasks to void
916b = new uchar 128 0
917vxcheckdriver
918vxset 6 vxnull
919vxcopy 7 4
920vxadd 7 vxt19
921vxcopy 8 4
922vxadd 8 vxt20
923vxpkinit
924vxpk vxshell
925vxpkpath 5
926vxpk vxsdflag
927rc = vxspawn
928if ne rc 0
929vxfail 11
930end
931fd = vxopen 7 0
932n = vxline fd b
933vxclose fd
934if not vxequal part b 0 n vxtasks
935vxfail 11
936end
937end
938fn vxargmode to bool
939b = new uchar 8 0
940n = argread add ulong 6 get vxshift 0 b 0 len b
941if lt n 0
942vxfail 2
943end
944if vxequal part b 0 ulong n vxtest
945ret false
946end
947if vxequal part b 0 ulong n vxrelease
948ret true
949end
950vxfail 2
951ret true
952end
953fn vxenvcompiler used ulong to void
954omlen = add get vxplen 2 4
955if gt add add used 2 omlen 4096
956vxfail 2
957end
958put vxenv 0 2
959put vxenv used uchar and omlen 255
960put vxenv add used 1 uchar shr omlen 8
961for k ulong 4
962put vxenv add add used 2 k get vxomckey k
963end
964for k ulong get vxplen 2
965v = get vxp add ulong 8192 k
966put vxenv add add used 6 k v
967end
968put vxenvn 0 add add used 2 omlen
969end
970fn vxenvinit to void
971b = new uchar 4096 0
972for i ulong ulong envcnt
973n = envread i b 0 len b
974if ge n 5
975if vxequal part b 0 5 vxpathkey
976if gt n 4090
977vxfail 2
978end
979put vxenv 0 1
980put vxenv 1 0
981put vxenv 2 uchar and ulong n 255
982put vxenv 3 uchar shr ulong n 8
983for j ulong ulong n
984put vxenv add j 4 get b j
985end
986vxenvcompiler add ulong n 4
987ret
988end
989end
990end
991vxfail 2
992end
993fn main to int
994h = new uchar 64 0
995b = new uchar 4096 0
996if ne argcnt add long 7 long get vxshift 0
997vxfail 2
998end
999for i ulong 5
1000vxarg add i 1 i
1001end
1002vxarg 6 6
1003vxenvinit
1004release = vxargmode
1005vxcopy 5 1
1006vxadd 5 vxdriver
1007vxhash 2 h
1008if not vxequal h vxsha
1009vxfail 10
1010end
1011vxmeta release
1012r = makedir vxp mul ulong 4 4096 get vxplen 4 448
1013if ne r 0
1014vxfail 3
1015end
1016vxchecktasks
1017vxcopy 14 4
1018vxadd 14 vxt56
1019vxcopy 15 4
1020vxadd 15 vxt57
1021if ne get vxshift 0 0
1022vxcopy 6 4
1023vxadd 6 vxstories
1024fds = vxopen 6 193
1025put vxstoryfd 0 long fds
1026end
1027fdout = vxopen 14 193
1028put vxion 1 ulong fdout
1029vxcopy 6 0
1030vxadd 6 vxatt
1031fd = vxopen 6 0
1032n = vxline fd b
1033if not vxequal part b 0 n vxt58
1034vxfail 2
1035end
1036n = vxline fd b
1037count = vxnumber part b 0 n 1
1038for i ulong count bound 9223372036854775807
1039n = vxline fd b
1040if eq n 0
1041vxfail 2
1042end
1043vxattempt part b 0 n
1044end
1045n = vxline fd b
1046if ne n 0
1047vxfail 2
1048end
1049vxclose fd
1050vxflush
1051vxmanifest
1052if ne get vxshift 0 0
1053vxclose int get vxstoryfd 0
1054end
1055ret 0
1056end