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 / si19 / omexp-test.om

511 lines · 11382 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note aien-train#24 ORIG-1 tests: record admission and every refusal class, the frozen
3note features, partitions and leakage check, the allow-list (authorized, synthetic, revoked,
4note absent, malformed) and the deterministic baselines, on the SYNTHETIC fixture and on
5note hand-built records. v2 (ORIG1-CONTRACT-v2.md): per-record admission with counted
6note reasons (pairing, duplicates, unsupported, range), the workload-family split, its
7note disjointness check, v2 retrieval and the two-file leakage audit.
8note Unit: deps + fixture + world + omexp + omexpfix + this file.
9global OC ulong 1
10global OK ulong 4
11text OPASS "SI19_OMEXP_TEST_PASS checks="
12text OFAIL "SI19_OMEXP_TEST_FAIL check="
13text ONL "\n"
14text LALL "16622604375676129865 AUTHORIZED owner-records-20261025\n3415637669635212362 SYNTHETIC fixture-seed7-100\n99 REVOKED withdrawn-example\n77 MALFORMED x\nabc AUTHORIZED junk\n"
15text LREV "99 REVOKED withdrawn-example\n"
16
17fn okx ok bool to void
18put OC 0 add get OC 0 1
19if not ok
20w = write 1 OFAIL 0 len OFAIL
21wnum get OC 0
22w = write 1 ONL 0 1
23exit 1
24end
25end
26
27fn tbyte pos ulong v ulong to void
28note Overwrite one little-endian record word in RB.
29for i ulong 8
30put RB add pos i uchar and shr v mul i 8 255
31end
32end
33
34fn tfresh to ulong
35note A fresh 100-record fixture file in RB; returns its byte count.
36ret sxgen 7 100
37end
38
39fn tlg16 to void
40okx eq oxlg16 0 0
41okx eq oxlg16 1 0
42okx eq oxlg16 2 16
43okx eq oxlg16 3 24
44okx eq oxlg16 4 32
45okx eq oxlg16 1024 160
46okx eq oxlg16 1000 159
47okx eq oxlg16 8192 208
48okx eq oxlg16 1099511627776 640
49end
50
51fn tload to void
52n = tfresh
53okx eq oxload n 0
54okx eq get RC 0 100
55okx eq get RC 1 n
56okx eq get RC 2 oxfnv n
57okx eq get RC 2 3415637669635212362
58for f ulong 5
59okx eq get RC add 4 f 20
60end
61okx eq oxfam 0 0
62okx eq oxfam 4 4
63okx eq oxcore 5 1
64okx eq oxpress 4 1
65okx eq oxpress 2 0
66okx eq oxseq 17 17
67end
68
69fn tword r ulong i ulong v ulong to void
70tbyte add mul r 256 mul i 8 v
71end
72
73fn trefone i ulong v ulong want int to void
74note Corrupt word i of record 3 to v; the load must refuse with want and admit nothing.
75n = tfresh
76tword 3 i v
77okx eq oxload n want
78okx eq get RC 0 0
79end
80
81fn trefuse to void
82n = tfresh
83okx eq oxload 0 -1
84okx eq oxload add n 8 -1
85okx eq oxload 524544 -1
86trefone 0 1 -2
87trefone 1 2 -2
88trefone 2 5 -3
89trefone 3 3 -3
90trefone 4 16 -3
91trefone 13 0 -3
92trefone 13 9 -3
93trefone 5 0 -4
94trefone 5 8193 -4
95trefone 6 0 -4
96trefone 7 0 -4
97trefone 12 30 -5
98trefone 12 64 -5
99trefone 16 0 -6
100trefone 20 0 -6
101trefone 24 0 -6
102trefone 28 0 -6
103trefone 31 1 -7
104trefone 31 3 -7
105trefone 14 2 -8
106trefone 14 1 -8
107trefone 10 1048576 -9
108trefone 9 7 -9
109note A record outside the file's own count is never read: word 0 of record 100 is zero.
110n = tfresh
111okx eq oxload n 0
112note An eligible bit on an unmeasured arm is refused even when the measurement is forged later.
113n = tfresh
114tword 3 12 63
115okx eq oxload n -6
116tword 3 21 500
117okx eq oxload n -6
118tword 3 29 1
119okx eq oxload n 0
120okx oxcand 3 5
121n = tfresh
122tword 3 12 47
123okx eq oxload n -6
124end
125
126fn tleak to void
127note Family-2 record 2 given the shape of family-0 record 0: contamination refused.
128n = tfresh
129tword 2 5 oxword 0 5
130tword 2 6 oxword 0 6
131tword 2 9 oxword 0 9
132okx eq oxload n -11
133okx eq get RC 0 0
134note The same shape in family 3 is the declared partial overlap, not contamination.
135n = tfresh
136tword 3 5 oxword 0 5
137tword 3 6 oxword 0 6
138tword 3 9 oxword 0 9
139okx eq oxload n 0
140end
141
142fn tsplit to void
143n = tfresh
144okx eq oxload n 0
145for r ulong 100
146f = oxfam r
147p = oxpart r
148if eq f 0
149okx eq p 0
150end
151if eq f 1
152okx eq p 1
153end
154if gt f 1
155okx eq p 2
156end
157end
158note TRAIN and DEV share no M and no N value; H1 keys are absent from both; H3 keys equal H1 keys.
159for r ulong 100
160if eq oxpart r 0
161for q ulong 100
162if eq oxpart q 1
163okx ne oxm r oxm q
164okx ne oxn r oxn q
165end
166if eq oxfam q 2
167okx not and eq oxm r oxm q eq oxn r oxn q
168end
169end
170end
171if eq oxfam r 2
172okx eq oxm add r 2 oxm r
173okx eq oxn add r 2 oxn r
174okx eq oxfam add r 2 4
175end
176end
177end
178
179fn tallow to void
180n = tfresh
181okx eq oxload n 0
182h = get RC 2
183n = len LALL
184for i ulong n
185put LB i get LALL i
186end
187okx eq oxallow n h 2
188okx eq oxallow n 16622604375676129865 1
189okx eq oxallow n 99 -12
190okx eq oxallow n 77 -13
191okx eq oxallow n 5 -13
192okx eq oxallow 0 h -13
193okx eq oxallow 10 h -13
194note A revoked entry wins over nothing else: the lookup is by exact hash only.
195n = len LREV
196for i ulong n
197put LB i get LREV i
198end
199okx eq oxallow n h -13
200okx eq oxallow n 99 -12
201end
202
203fn tfeat to void
204n = tfresh
205okx eq oxload n 0
206note Record 11: family 1, core 0, M 8, N 4, pressure 0.
207okx eq oxm 11 8
208okx eq oxn 11 4
209oxfeat 11
210okx eq get XF 0 16
211okx eq get XF 1 48
212okx eq get XF 2 32
213okx eq get XF 3 6
214okx eq get XF 4 4
215okx eq get XF 5 0
216okx eq get XF 6 0
217okx eq get XF 7 0
218okx eq get XF 8 16
219okx eq get XF 9 0
220okx eq get XF 10 0
221okx eq get XF 11 0
222note Record 8: family 3, core 1, M 7, N 1: thin, odd, A725.
223oxfeat 8
224okx eq get XF 1 44
225okx eq get XF 2 0
226okx eq get XF 5 16
227okx eq get XF 6 16
228okx eq get XF 8 0
229okx eq get XF 9 16
230note Record 9: family 4 carries pressure 1.
231oxfeat 9
232okx eq get XF 11 16
233note Overflow doublings: a 1024 x 1024 state on an A725 (524288 B cache).
234tword 9 5 1024
235tword 9 6 1024
236tword 9 9 8404992
237okx eq oxload n 0
238oxfeat 9
239okx eq get XF 7 64
240end
241
242fn tbase to void
243n = tfresh
244okx eq oxload n 0
245note Planted rule: core 0, N <= 3 -> unroll2; core 0, N >= 4 -> quad4; core 1 large N -> reference.
246okx eq oxbest 0 2
247okx eq oxbest 1 4
248okx eq oxbest 7 0
249okx eq oxrule 0 2
250okx eq oxrule 2 3
251okx eq oxt16 0 0 0
252okx lt oxt16 0 2 0
253okx gt oxt16 0 1 0
254note Retrieval returns a TRAIN record of the same core; a train record is nearest to itself.
255q = oxnear 2
256okx eq oxpart q 0
257okx eq oxcore q 0
258okx eq oxnear 0 0
259okx eq oxnear 10 10
260q = oxnear 7
261okx eq oxcore q 1
262note Best static arm on core 0 with 10 train shapes of N in 1..2 is unroll2.
263okx eq oxstatic 0 2
264okx eq oxstatic 1 2
265note An arm missing from one train record is no static candidate.
266tword 0 12 15
267tword 0 20 0
268tword 0 28 0
269okx eq oxload n 0
270okx not oxcand 0 4
271okx eq oxstatic 0 2
272end
273
274fn t2one r ulong i ulong v ulong want int to void
275note Word i of record r set to v: only record r is refused, with reason want, counted once.
276n = tfresh
277tword r i v
278okx eq oxadm2 n 0
279okx eq get RC 9 1
280okx eq get RA r long want
281okx eq get RQ ulong neg long want 1
282okx eq get RQ 0 99
283okx eq get RS r 3
284okx eq oxpart r 3
285okx eq get RC 0 100
286okx eq get RC 10 99
287end
288
289fn tadm2 to void
290n = tfresh
291okx eq oxadm2 n 0
292okx eq get RC 0 100
293okx eq get RC 1 n
294okx eq get RC 2 3415637669635212362
295okx eq get RQ 0 100
296okx eq get RC 10 100
297okx eq add add get RC 4 get RC 5 get RC 6 100
298for r ulong 100
299okx eq get RA r 0
300okx lt get RS r 3
301end
302okx eq oxadm2 0 -1
303okx eq oxadm2 add n 8 -1
304okx eq get RC 0 0
305okx eq get RC 9 0
306note v1 admission restores v1 partitions.
307n = tfresh
308okx eq oxadm2 n 0
309okx eq oxload n 0
310okx eq get RC 9 0
311okx eq oxpart 4 2
312end
313
314fn trefuse2 to void
315note Unsupported format and enumerations.
316t2one 3 0 1 -2
317t2one 3 1 2 -2
318t2one 3 2 6 -3
319t2one 3 3 2 -3
320t2one 3 4 2 -3
321t2one 3 13 5 -3
322t2one 3 13 8 -3
323note Shape and calls out of range, profile.
324t2one 3 5 0 -4
325t2one 3 6 8193 -4
326t2one 3 7 0 -4
327t2one 3 7 1048577 -4
328t2one 3 10 1048576 -9
329t2one 3 9 7 -9
330note Pairing: the complete arm set {0..4} measured and verified, arm 5 absent.
331t2one 3 12 15 -14
332t2one 3 12 63 -14
333t2one 3 18 0 -14
334t2one 3 26 0 -14
335t2one 3 21 5 -14
336t2one 3 29 1 -14
337t2one 3 22 1 -14
338t2one 3 23 1 -14
339note Out of range measurement and the mismatch word.
340t2one 3 17 1099511627776 -10
341t2one 3 31 1 -7
342note Sequence not increasing: only the regressing record is refused.
343t2one 3 14 2 -8
344note A product above 2^19 elements is out of the consumer's range.
345n = tfresh
346tword 3 5 1024
347tword 3 6 1024
348tword 3 9 8404992
349okx eq oxadm2 n 0
350okx eq get RA 3 -4
351note Two refusals are counted separately and nothing else is refused.
352n = tfresh
353tword 3 31 1
354tword 8 31 2
355okx eq oxadm2 n 0
356okx eq get RQ 7 2
357okx eq get RQ 0 98
358end
359
360fn tcopyk q ulong r ulong to void
361note Give record r the state key (M, N, state bytes) of record q.
362tword r 5 oxword q 5
363tword r 6 oxword q 6
364tword r 9 oxword q 9
365end
366
367fn tdup2 to void
368note Record 12 (family 2, core 0, pressure 0) given record 2's shape: duplicate state.
369n = tfresh
370okx eq oxdec n 100
371tcopyk 2 12
372okx eq oxadm2 n 0
373okx eq get RA 12 -15
374okx eq get RA 2 0
375okx eq get RQ 15 1
376note A different job seed is still the same decision state.
377tword 12 8 999
378okx eq oxadm2 n 0
379okx eq get RA 12 -15
380note A different pressure bucket is a different state: record 4 (H3) has record 2's shape
381note and core at pressure 1 and is admitted.
382okx eq get RA 4 0
383okx eq oxm 4 oxm 2
384okx eq oxn 4 oxn 2
385okx eq oxcore 4 oxcore 2
386okx ne oxpress 4 oxpress 2
387note A duplicate of a refused record is admitted: only admitted states count.
388tword 2 31 1
389okx eq oxadm2 n 0
390okx eq get RA 2 -7
391okx eq get RA 12 0
392note Record 22 duplicates record 12 too: two later duplicates of one state, both counted.
393tword 2 31 0
394okx eq oxdec n 100
395tcopyk 2 22
396okx eq oxadm2 n 0
397okx eq get RA 12 -15
398okx eq get RA 22 -15
399okx eq get RQ 15 2
400end
401
402fn tsplit2 to void
403note The frozen family coordinate and split, values computed outside this unit.
404okx eq oxfl 1 0
405okx eq oxfl 2 1
406okx eq oxfl 3 1
407okx eq oxfl 8191 12
408okx eq oxfl 8192 13
409okx eq oxhspl 0 0 0
410okx eq oxhspl 0 1 0
411okx eq oxhspl 0 2 2
412okx eq oxhspl 1 1 1
413okx eq oxhspl 2 4 1
414okx eq oxhspl 3 13 2
415okx eq oxhspl 13 6 1
416okx eq oxhspl 7 7 0
417okx eq oxhspl 5 5 0
418okx eq oxhspl 10 6 2
419n = tfresh
420okx eq oxadm2 n 0
421okx eq oxcell 11 50
422for r ulong 100
423okx eq oxpart r oxhspl oxfl oxm r oxfl oxn r
424end
425note No family and no shape crosses splits; held-out families are absent from TRAIN and
426note VALIDATION (checked pairwise here, independently of oxdisj).
427for r ulong 100
428for q ulong 100
429if ne oxpart q oxpart r
430okx ne oxcell q oxcell r
431okx not and eq oxm q oxm r eq oxn q oxn r
432end
433end
434end
435note H1 and H3 records (same workload, pressure 0 and 1) land in the same split.
436okx eq oxpart 2 oxpart 4
437okx eq oxdisj 100 0
438note A split assignment that separates one family is caught.
439put RS 4 uchar rem add get RS 2 1 3
440okx eq oxdisj 100 -11
441end
442
443fn tnear2 to void
444note v2 retrieval: a TRAIN record of the same core class and pressure bucket.
445n = tfresh
446okx eq oxadm2 n 0
447k = ulong 0
448for r ulong 100
449q = oxnear r
450if lt q 1048576
451k = add k 1
452okx eq oxpart q 0
453okx eq oxcore q oxcore r
454okx eq oxpress q oxpress r
455end
456end
457okx gt k 0
458note The same file under v1 admission ignores pressure (v1 rule unchanged).
459okx eq oxload n 0
460okx eq oxpart oxnear 4 0
461end
462
463fn taudit to void
464note File B = file A with record 0's job seed changed: 99 of 100 B workloads occur in A,
465note every B state key occurs in A, every matched oracle arm agrees.
466n = tfresh
467for i ulong n
468put RB add n i get RB i
469end
470tword 100 8 123456789
471okx eq oxdec mul n 2 200
472oxaudit 100 100
473okx eq get AU 0 99
474okx eq get AU 1 19
475okx eq get AU 3 20
476okx eq get AU 6 99
477okx eq get AU 7 100
478okx eq get AU 8 0
479okx eq get AU 9 0
480okx eq get AU 11 40
481okx eq get AU 12 60
482note Record 4 (family 4) given record 2's job seed: one workload under two family words
483note on each side; a state key repeated inside A is counted.
484tword 4 8 oxword 2 8
485tcopyk 0 10
486okx eq oxdec mul n 2 200
487oxaudit 100 100
488okx eq get AU 9 2
489okx eq get AU 8 1
490end
491
492fn main to int
493tlg16
494tload
495trefuse
496tleak
497tsplit
498tallow
499tfeat
500tbase
501tadm2
502trefuse2
503tdup2
504tsplit2
505tnear2
506taudit
507w = write 1 OPASS 0 len OPASS
508wnum get OC 0
509w = write 1 ONL 0 1
510ret 0
511end