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 / tests / distributed7 / mutate.om

158 lines · 2456 bytes Raw Blame History
1note Exact-source native mutation builder for distributed7 qualification only.
2note stdin: one ASCII mode0..4 followed by source. Refuse unmatched/stale source.
3text m0 "if not d7_match rank\nret 7\nend\n"
4text r0 "if not d7_tidok\nret 7\nend\n"
5text m1 "if eq get d7_state 6 get d7_state 1\n"
6text r1 "if le get d7_state 6 get d7_state 1\n"
7text m2 "if ne seq get d7_state 2\nret 4\nend\n"
8text r2 "if eq seq 0\nret 4\nend\n"
9text m3 "if ne get ED p get d7_meta p\n"
10text r3 "if ne get ED p get ED p\n"
11text m4 "if ge now get d7_state 4\n"
12text r4 "if gt now get d7_state 4\n"
13global cmd uchar 1
14global src uchar 65537
15global out uchar 65536
16global from uchar 80
17global into uchar 80
18global sizes ulong 3
19
20fn select n uchar to bool
21put sizes 2 1
22if eq n 48
23put sizes 0 len m0
24put sizes 1 len r0
25for i ulong len m0
26put from i get m0 i
27end
28for i ulong len r0
29put into i get r0 i
30end
31ret true
32end
33if eq n 49
34put sizes 0 len m1
35put sizes 1 len r1
36for i ulong len m1
37put from i get m1 i
38end
39for i ulong len r1
40put into i get r1 i
41end
42ret true
43end
44if eq n 50
45put sizes 0 len m2
46put sizes 1 len r2
47put sizes 2 4
48for i ulong len m2
49put from i get m2 i
50end
51for i ulong len r2
52put into i get r2 i
53end
54ret true
55end
56if eq n 51
57put sizes 0 len m3
58put sizes 1 len r3
59for i ulong len m3
60put from i get m3 i
61end
62for i ulong len r3
63put into i get r3 i
64end
65ret true
66end
67if eq n 52
68put sizes 0 len m4
69put sizes 1 len r4
70for i ulong len m4
71put from i get m4 i
72end
73for i ulong len r4
74put into i get r4 i
75end
76ret true
77end
78ret false
79end
80
81fn match at ulong total ulong to bool
82n = get sizes 0
83if gt n sub total at
84ret false
85end
86for i ulong n
87if ne get src add at i get from i
88ret false
89end
90end
91ret true
92end
93
94fn patch total ulong to ulong
95p = ulong 0
96q = ulong 0
97hits = ulong 0
98while lt p total
99if match p total
100hits = add hits 1
101for i ulong get sizes 1
102put out q get into i
103q = add q 1
104end
105p = add p get sizes 0
106else
107put out q get src p
108q = add q 1
109p = add p 1
110end
111end
112if ne hits get sizes 2
113ret 0
114end
115ret q
116end
117
118fn output n ulong to int
119p = ulong 0
120while lt p n
121w = write 1 out p sub n p
122if le w 0
123ret 74
124end
125p = add p ulong w
126end
127ret 0
128end
129
130fn main to int
131n = read 0 cmd 0 1
132if ne n 1
133ret 65
134end
135if not select get cmd 0
136ret 65
137end
138total = ulong 0
139more = true
140while more
141n = read 0 src total sub 65537 total
142if lt n 0
143ret 74
144end
145if eq n 0
146more = false
147end
148total = add total ulong n
149if gt total 65536
150ret 65
151end
152end
153nout = patch total
154if eq nout 0
155ret 65
156end
157ret output nout
158end