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 / collective / shared_bank_p0.om

224 lines · 3653 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note aien-train#26: first native .om sparse-collective algebraic experiment.
3note ONE shared 2x3 matrix + EIGHT rank-one signed specialist differences.
4note All data and scores are synthetic. No model checkpoint is loaded.
5note This is neither a trained specialist nor a GPU/runtime dispatch implementation.
6note Seeded omc names are at most 8 characters (error 13). bscore replaces bestscore.
7note Full reference numbers independently calculated in Wolfram Language.
8
9global B long 6
10global U long 16
11global V long 24
12global X long 3
13global Shared long 2
14global Out long 2
15global Scores long 8
16global Allowed uchar 8
17global Counts ulong 2
18global Plus long 16
19global Minus long 16
20
21fn init to void
22put B 0 2
23put B 1 -1
24put B 2 3
25put B 3 1
26put B 4 0
27put B 5 -2
28put X 0 2
29put X 1 3
30put X 2 5
31put Scores 0 4
32put Scores 1 11
33put Scores 2 7
34put Scores 3 9
35put Scores 4 8
36put Scores 5 0
37put Scores 6 3
38put Scores 7 2
39for id ulong 8
40put Allowed id 1
41sid = long id
42ui = mul id 2
43vi = mul id 3
44put U ui sub sid 3
45put U add ui 1 add sid 1
46put V vi 1
47put V add vi 1 sub 3 sid
48put V add vi 2 -1
49end
50put Counts 0 0
51put Counts 1 0
52put Plus 0 -2
53put Plus 1 -2
54put Plus 2 10
55put Plus 3 -2
56put Plus 4 16
57put Plus 5 -8
58put Plus 6 16
59put Plus 7 -20
60put Plus 8 10
61put Plus 9 -38
62put Plus 10 -2
63put Plus 11 -62
64put Plus 12 -20
65put Plus 13 -92
66put Plus 14 -44
67put Plus 15 -128
68put Minus 0 34
69put Minus 1 -14
70put Minus 2 22
71put Minus 3 -14
72put Minus 4 16
73put Minus 5 -8
74put Minus 6 16
75put Minus 7 4
76put Minus 8 22
77put Minus 9 22
78put Minus 10 34
79put Minus 11 46
80put Minus 12 52
81put Minus 13 76
82put Minus 14 76
83put Minus 15 112
84end
85
86fn makebase to void
87for row ulong 2
88acc = long 0
89for col ulong 3
90idx = add mul row 3 col
91z = mul get B idx get X col
92acc = add acc z
93end
94put Shared row acc
95end
96put Counts 0 add get Counts 0 1
97end
98
99note Tiny synthetic admission only. Capability authority remains Omega/AEGIS.
100note Returns index 8 if no candidate allowed, rather than silently dispatching.
101fn pick used ulong to ulong
102best = ulong 8
103bscore = long -9999
104for id ulong 8
105if eq get Allowed id 1
106flag = and used shl ulong 1 id
107if eq flag 0
108score = get Scores id
109if gt score bscore
110bscore = score
111best = id
112end
113end
114end
115end
116ret best
117end
118
119note Status 0=success; -1=bad index; -2=refused; -3=bad phase.
120note Outputs are written only for successful calls.
121note Formula: y = B*x + phase*U[id]*(V[id]^T*x), phase in {-1,+1}.
122fn apply id ulong phase long to long
123if ge id 8
124ret -1
125end
126if ne get Allowed id 1
127ret -2
128end
129if ne phase 1
130if ne phase -1
131ret -3
132end
133end
134dot = long 0
135vi = mul id 3
136for col ulong 3
137v = get V add vi col
138dot = add dot mul v get X col
139end
140ui = mul id 2
141for row ulong 2
142diff = mul get U add ui row dot
143result = add get Shared row mul phase diff
144put Out row result
145end
146put Counts 1 add get Counts 1 1
147ret 0
148end
149
150fn main to int
151init
152makebase
153if ne get Shared 0 16
154ret 1
155end
156if ne get Shared 1 -8
157ret 2
158end
159for id ulong 8
160idx = mul id 2
161a = apply id 1
162if ne a 0
163ret 3
164end
165if ne get Out 0 get Plus idx
166ret 4
167end
168if ne get Out 1 get Plus add idx 1
169ret 5
170end
171b = apply id -1
172if ne b 0
173ret 6
174end
175if ne get Out 0 get Minus idx
176ret 7
177end
178if ne get Out 1 get Minus add idx 1
179ret 8
180end
181end
182if ne get Counts 0 1
183ret 9
184end
185if ne get Counts 1 16
186ret 10
187end
188first = pick 0
189if ne first 1
190ret 11
191end
192used = shl ulong 1 first
193second = pick used
194if ne second 3
195ret 12
196end
197put Allowed 1 0
198if ne pick 0 3
199ret 13
200end
201a = apply 1 1
202if ne a -2
203ret 14
204end
205if ne apply 8 1 -1
206ret 15
207end
208if ne apply 3 0 -3
209ret 16
210end
211for id ulong 8
212put Allowed id 0
213end
214if ne pick 0 8
215ret 17
216end
217if ne get Counts 0 1
218ret 18
219end
220if ne get Counts 1 16
221ret 19
222end
223ret 0
224end