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 / native / si19 / omexpfix.om

217 lines · 4344 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note aien-train#24 ORIG-1 FIXTURE: a seeded, resettable SYNTHETIC omexp-v1 record file for
3note tests and fixture runs. Costs come from a planted rule (which arm wins depends on core
4note class and N together) plus bounded noise; no model, teacher or measurement produces
5note them. Fixture evidence is never mixed with real-record evidence.
6note SG is not used here; the generator state is SXR. Families: 0 TRAIN grid, 1 DEV grid,
7note 2 H1 (prime shapes absent from both grids), 3 H2 (prime M, thin N), 4 H3 = H1 shapes
8note with pressure 1. Cores alternate 0 and 1.
9global SXR ulong 2
10global SXM ulong 13
11global SXN ulong 13
12global SXV ulong 7
13global SXW ulong 7
14global SXP ulong 22
15
16fn sxrand to ulong
17x = get SXR 0
18x = rem add mul x 1664525 1013904223 4294967296
19put SXR 0 x
20ret shr x 8
21end
22
23fn sxput pos ulong v ulong to void
24for i ulong 8
25put RB add pos i uchar and shr v mul i 8 255
26end
27end
28
29fn sxtable to void
30note The consumer's grids and the primes used for the held-out families.
31put SXM 0 1
32put SXM 1 4
33put SXM 2 16
34put SXM 3 64
35put SXM 4 256
36put SXM 5 1024
37put SXN 0 1
38put SXN 1 2
39put SXN 2 3
40put SXN 3 5
41put SXN 4 8
42put SXN 5 12
43put SXN 6 16
44put SXN 7 33
45put SXN 8 64
46put SXN 9 100
47put SXN 10 256
48put SXN 11 512
49put SXN 12 1024
50put SXV 0 2
51put SXV 1 8
52put SXV 2 32
53put SXV 3 128
54put SXV 4 512
55put SXW 0 4
56put SXW 1 6
57put SXW 2 10
58put SXW 3 24
59put SXW 4 48
60put SXW 5 200
61put SXW 6 700
62put SXP 0 7
63put SXP 1 11
64put SXP 2 13
65put SXP 3 17
66put SXP 4 19
67put SXP 5 23
68put SXP 6 29
69put SXP 7 31
70put SXP 8 37
71put SXP 9 41
72put SXP 10 43
73put SXP 11 47
74put SXP 12 53
75put SXP 13 59
76put SXP 14 61
77put SXP 15 67
78put SXP 16 71
79put SXP 17 73
80put SXP 18 79
81put SXP 19 83
82put SXP 20 89
83put SXP 21 97
84end
85
86fn sxpct base ulong pct ulong to ulong
87ret div mul base pct 100
88end
89
90fn sxcost core ulong n ulong a ulong base ulong to ulong
91note Planted cost of arm a: the winner depends on core and N together.
92if eq a 1
93ret sxpct base 150
94end
95if eq a 2
96if le n 8
97ret sxpct base 70
98end
99ret sxpct base 130
100end
101if eq a 3
102if eq core 1
103ret sxpct base 160
104end
105if ge n 64
106ret sxpct base 90
107end
108ret sxpct base 120
109end
110if eq a 4
111if and eq core 0 ge n 4
112ret sxpct base 60
113end
114if le n 3
115ret sxpct base 140
116end
117ret sxpct base 105
118end
119ret base
120end
121
122fn sxshape fam ulong k ulong to void
123note Shape of the k-th record of a family into SXR[1] (M) and the return path via SXV[5], SXV[6].
124if eq fam 0
125put SXV 5 get SXM rem k 6
126put SXV 6 get SXN rem div k 6 13
127end
128if eq fam 1
129put SXV 5 get SXV rem k 5
130put SXV 6 get SXW rem div k 5 7
131end
132if or eq fam 2 eq fam 4
133put SXV 5 get SXP rem k 22
134put SXV 6 get SXP rem add mul k 7 3 22
135end
136if eq fam 3
137put SXV 5 get SXP rem mul k 5 22
138put SXV 6 add 1 rem k 7
139end
140end
141
142fn sxnoise c ulong to ulong
143ret add c div mul c rem sxrand 11 100
144end
145
146fn sxarms p ulong core ulong n ulong base ulong to void
147for a ulong 5
148c = sxnoise sxcost core n a base
149sxput add p mul 8 add 16 a c
150sxput add p mul 8 add 24 a 1
151end
152end
153
154fn sxbase m ulong n ulong pr ulong core ulong to ulong
155base = add 1000 mul 37 add add mul m n m n
156if eq pr 1
157if gt mul add add mul m n m n 8 oxcache core
158base = mul base 2
159end
160end
161ret base
162end
163
164fn sxhead r ulong fam ulong core ulong to void
165p = mul r 256
166sxput p 3553143591248351811
167sxput add p 8 1
168sxput add p 16 fam
169sxput add p 24 core
170pr = ulong 0
171if eq fam 4
172pr = 1
173end
174sxput add p 32 pr
175sxput add p 80 oxcache core
176sxput add p 88 40
177sxput add p 96 31
178sxput add p 104 6
179sxput add p 112 r
180sxput add p 120 mul r 1000003
181sxput add p 240 add 11630680811171433263 r
182sxput add p 248 0
183sxput add p 168 0
184sxput add p 176 0
185sxput add p 184 0
186sxput add p 232 0
187end
188
189fn sxrecord r ulong fam ulong core ulong to void
190note Writes record r of the given family and core class into RB.
191sxshape fam div r 10
192m = get SXV 5
193n = get SXV 6
194p = mul r 256
195sxhead r fam core
196sxput add p 40 m
197sxput add p 48 n
198sxput add p 56 add 3 div 600000 add mul m n 64
199sxput add p 64 add 77 r
200sxput add p 72 mul add add mul m n m n 8
201pr = ulong 0
202if eq fam 4
203pr = 1
204end
205sxarms p core n sxbase m n pr core
206end
207
208fn sxgen seed ulong nrec ulong to ulong
209note nrec SYNTHETIC records into RB; returns the byte count. Record r: family r rem 5 cycles
210note through the families, core alternates with r/5, shape index r/10.
211sxtable
212put SXR 0 seed
213for r ulong nrec
214sxrecord r rem r 5 rem div r 5 2
215end
216ret mul nrec 256
217end