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 / ecosystem5 / pack.om

180 lines · 3105 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-or-later
2note PACK5 v1 consumes L775 core84d03c55 and L776 admitd8d14c47 unchanged.
3note Trusted single-thread caller supplies tokenization; no authentication or tokenizer.
4note DPCfg schema,vocabulary size,split,padding token. DPPin expected+observed tokenizer then template SHA256 words.
5global DPCfg ulong 4
6global DPPin ulong 16
7global DPLen ulong 64
8global DPPrompt ulong 64
9global DPToken ulong 16384
10global DPOut ulong 256
11global DPLabel ulong 256
12global DPMask ulong 256
13global DPTask ulong 256
14global DPPos ulong 256
15note DPState ready,count,records. A failed call invalidates readiness and count; payload stays unchanged.
16global DPState ulong 3
17
18fn dppins to bool
19a = ulong 0
20b = ulong 0
21for i ulong 4
22a = or a get DPPin i
23b = or b get DPPin add i 8
24if ne get DPPin i get DPPin add i 4
25ret false
26end
27if ne get DPPin add i 8 get DPPin add i 12
28ret false
29end
30end
31ret and ne a 0 ne b 0
32end
33
34fn dpinput task ulong to ulong
35if ne get CFreeze add mul task 32 1 get DPCfg 2
36ret 77
37end
38count = get DPLen task
39prompt = get DPPrompt task
40if or eq count 0 gt count 256
41ret 74
42end
43if gt prompt count
44ret 74
45end
46for j ulong count
47if ge get DPToken add mul task 256 j get DPCfg 1
48ret 75
49end
50end
51ret 0
52end
53
54fn dpvalidate to ulong
55if or ne get CState 2 1 ne get LS 18 1
56ret 70
57end
58if or ne get LS 0 0 ne get LS 6 0
59ret 70
60end
61n = get LS 1
62good = get CState 0
63bad = get CState 1
64if or eq n 0 gt n 64
65ret 73
66end
67if or gt good n gt bad n
68ret 73
69end
70if ne add good bad n
71ret 73
72end
73if or ne get DPCfg 0 1 eq get DPCfg 1 0
74ret 71
75end
76if or gt get DPCfg 1 4294967296 ge get DPCfg 3 get DPCfg 1
77ret 71
78end
79if or lt get DPCfg 2 1 gt get DPCfg 2 2
80ret 71
81end
82if eq dppins false
83ret 72
84end
85total = ulong 0
86for i ulong good
87t = get CGood i
88if ge t n
89ret 73
90end
91if or ne get CSeen t 1 ne get CDiag t 0
92ret 73
93end
94for j ulong i
95if eq t get CGood j
96ret 73
97end
98end
99r = dpinput t
100if ne r 0
101ret r
102end
103count = get DPLen t
104if gt count sub 256 total
105ret 76
106end
107total = add total count
108end
109note No tokens or prompt markers may be supplied for quarantined or absent slots.
110for t ulong 64
111found = false
112for i ulong good
113if eq t get CGood i
114found = true
115end
116end
117if eq found false
118if or ne get DPLen t 0 ne get DPPrompt t 0
119ret 73
120end
121end
122end
123ret 0
124end
125
126fn dpcopy t ulong p ulong to ulong
127count = get DPLen t
128for j ulong count
129put DPOut p get DPToken add mul t 256 j
130put DPTask p t
131put DPPos p j
132next = add j 1
133if lt next count
134put DPLabel p get DPToken add mul t 256 next
135if ge next get DPPrompt t
136put DPMask p 1
137end
138end
139p = add p 1
140end
141ret p
142end
143
144fn dppack to ulong
145for i ulong 3
146put DPState i 0
147end
148r = dpvalidate
149if ne r 0
150ret r
151end
152for i ulong 256
153put DPOut i get DPCfg 3
154put DPLabel i get DPCfg 3
155put DPMask i 0
156put DPTask i 18446744073709551615
157put DPPos i 0
158end
159p = ulong 0
160for i ulong get CState 0
161p = dpcopy get CGood i p
162end
163put DPState 1 p
164put DPState 2 get CState 0
165put DPState 0 1
166ret 0
167end
168
169fn dpattend q ulong k ulong to bool
170if ne get DPState 0 1
171ret false
172end
173if or ge q get DPState 1 ge k get DPState 1
174ret false
175end
176if gt k q
177ret false
178end
179ret eq get DPTask q get DPTask k
180end