interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / evidence / LEARN53-L777-CONTINUATION / review / omega-core.om

448 lines · 7831 bytes Raw Blame History
1note LEARN653 v1 consumer checks. No compiler, judge, signer or process supervisor.
2note Task slots are 32 ulongs; see docs/learning/benchmark-v1.md.
3global LT ulong 2048
4global LS ulong 24
5global LSeen ulong 64
6global LWon ulong 64
7global LPin ulong 16
8global LWant uchar 256
9global LGot uchar 256
10
11fn lequal a ulong b ulong n ulong to bool
12for k ulong n
13if ne get LT add a k get LT add b k
14ret false
15end
16end
17ret true
18end
19
20fn lnonzero a ulong to bool
21x = ulong 0
22for k ulong 4
23x = or x get LT add a k
24end
25ret ne x 0
26end
27
28fn lrecord a ulong to ulong
29split = get LT add a 1
30if or eq get LT a 0 or lt split 1 gt split 4
31ret 2
32end
33if or ne get LT add a 5 1 ne get LT add a 4 1
34ret 3
35end
36if eq get LT add a 3 0
37ret 4
38end
39if eq get LT add a 6 0
40ret 4
41end
42if eq get LT add a 7 0
43ret 4
44end
45note Only public train/dev records are admissible to this builder-side API.
46note Adaptive/final custody stays with the existing independent owner.
47if or gt split 2 ne get LT add a 2 1
48ret 5
49end
50for h ulong 5
51if eq lnonzero add a add 8 mul h 4 false
52ret 6
53end
54end
55if or eq get LT add a 28 0 gt get LT add a 28 256
56ret 7
57end
58if or eq get LT add a 29 0 gt get LT add a 29 256
59ret 7
60end
61if or eq get LT add a 30 0 gt get LT add a 30 1000000
62ret 7
63end
64if ne get LT add a 31 0
65ret 7
66end
67ret 0
68end
69
70fn lpair a ulong b ulong to ulong
71if eq get LT a get LT b
72ret 8
73end
74if lequal add a 8 add b 8 4
75ret 9
76end
77if lequal add a 12 add b 12 4
78ret 10
79end
80if ne get LT add a 1 get LT add b 1
81if eq get LT add a 3 get LT add b 3
82ret 15
83end
84if eq get LT add a 7 get LT add b 7
85ret 11
86end
87if lequal add a 16 add b 16 4
88ret 12
89end
90if lequal add a 20 add b 20 4
91ret 13
92end
93if lequal add a 24 add b 24 4
94ret 14
95end
96end
97ret 0
98end
99
100fn lmanifest n ulong to ulong
101if or eq n 0 gt n 64
102ret 1
103end
104for i ulong n
105a = mul i 32
106code = lrecord a
107if ne code 0
108ret code
109end
110for j ulong i
111b = mul j 32
112code = lpair a b
113if ne code 0
114ret code
115end
116end
117end
118ret 0
119end
120
121note Caller supplies independent expected bytes and actual executor observations.
122note Status 0=completed, 1=syntax,2=type,3=unsupported,4=timeout,5=resource,6=operational.
123note Result 0=correct,1..6 as above,7=wrong value,8=trap mismatch,9=empty output,10=malformed.
124fn lobserve status ulong wantcode ulong gotcode ulong wantn ulong gotn ulong to ulong
125if gt status 6
126ret 10
127end
128if ne status 0
129ret status
130end
131if or gt wantn 256 gt gotn 256
132ret 10
133end
134if ne wantcode gotcode
135ret 8
136end
137if ne wantcode 0
138note Only declared runtime traps 101..107; arbitrary exit failures never pass.
139if or lt wantcode 101 or gt wantcode 107 ne wantn 0
140ret 10
141end
142if ne gotn 0
143ret 8
144end
145ret 0
146end
147if eq wantn 0
148ret 10
149end
150if eq gotn 0
151ret 9
152end
153if ne wantn gotn
154ret 7
155end
156for i ulong wantn
157if ne get LWant i get LGot i
158ret 7
159end
160end
161ret 0
162end
163
164note Full 256-bit compiler and executable identities, expected then observed.
165note LPin[0..3] expected compiler, [4..7] observed, [8..11] expected ELF, [12..15] observed.
166fn lpins to bool
167ca = ulong 0
168ba = ulong 0
169for i ulong 4
170ca = or ca get LPin i
171ba = or ba get LPin add i 8
172if ne get LPin i get LPin add i 4
173ret false
174end
175if ne get LPin add i 8 get LPin add i 12
176ret false
177end
178end
179ret and ne ca 0 ne ba 0
180end
181
182note Each begin is one explicit fresh development run; no durable resume API exists.
183note LS: active,tasks,maxattempts,attempts,pass1,passbudget,invalid,closed,
184note generation_us,compile_us,judge_us,other_us,input_tokens,output_tokens,peak_bytes,
185note energy_uj,energy_unknown,budget_us,completed,abstained,reserved...
186fn lbegin n ulong maxtries ulong budget ulong to ulong
187if eq get LS 0 1
188ret 20
189end
190for i ulong 24
191put LS i 0
192end
193for i ulong 64
194put LSeen i 0
195put LWon i 0
196end
197code = lmanifest n
198if ne code 0
199put LS 6 code
200ret code
201end
202if or eq maxtries 0 or gt maxtries 64 or eq budget 0 gt budget 1000000000000
203put LS 6 21
204ret 21
205end
206put LS 0 1
207put LS 1 n
208put LS 2 maxtries
209put LS 17 budget
210ret 0
211end
212
213note Charge before classifying. Costs are exact integer caller measurements, never estimates.
214note Missing cost values use all-ones and invalidate the run, never become free.
215fn lcost slot ulong value ulong to ulong
216if or lt slot 8 gt slot 15
217put LS 6 22
218ret 22
219end
220if gt value 1000000000000
221put LS 6 23
222ret 23
223end
224if eq slot 14
225if gt value get LS slot
226put LS slot value
227end
228else
229if gt get LS slot sub ulong 1000000000000 value
230put LS 6 23
231ret 23
232end
233put LS slot add get LS slot value
234end
235ret 0
236end
237
238note Attempt outcomes come from lobserve or explicit abstention 11, never compiler acceptance.
239note Mandatory cost vector is supplied per attempt in LC; energy unknown is explicit.
240global LC ulong 9
241
242fn lattempt task ulong ordinal ulong outcome ulong to ulong
243if ne get LS 0 1
244ret 24
245end
246for k ulong 8
247r = lcost add k 8 get LC k
248end
249if eq get LC 8 0
250put LS 16 add get LS 16 1
251if ne get LC 7 0
252put LS 6 25
253end
254else
255if ne get LC 8 1
256put LS 6 25
257end
258end
259put LS 3 add get LS 3 1
260note At most 64 attempts across a public development run, including failed attempts.
261if gt get LS 3 64
262put LS 6 31
263ret 31
264end
265if eq lpins false
266put LS 6 26
267end
268note Invalid costs or identities can never add successful tasks.
269if ne get LS 6 0
270ret get LS 6
271end
272if or ge task get LS 1 gt outcome 11
273put LS 6 27
274ret 27
275end
276if or ne ordinal add get LSeen task 1 gt ordinal get LS 2
277put LS 6 28
278ret 28
279end
280put LSeen task ordinal
281if eq outcome 0
282if eq ordinal 1
283put LS 4 add get LS 4 1
284end
285if eq get LWon task 0
286put LWon task 1
287put LS 5 add get LS 5 1
288end
289end
290if eq outcome 11
291put LS 19 add get LS 19 1
292end
293elapsed = add get LS 8 get LS 9
294elapsed = add elapsed get LS 10
295elapsed = add elapsed get LS 11
296if gt elapsed get LS 17
297put LS 6 29
298end
299ret get LS 6
300end
301
302fn lfinish to ulong
303if ne get LS 0 1
304ret 24
305end
306put LS 0 0
307for i ulong get LS 1
308if eq get LSeen i 0
309if eq get LS 6 0
310put LS 6 30
311end
312end
313end
314if ne get LS 6 0
315ret get LS 6
316end
317put LS 18 1
318ret 0
319end
320
321note GEN-1 genjac rule reused: lowercase ASCII word-triple SET Jaccard strictly above 1/2.
322note Input contains two public prompts only; never load final or sealed text here.
323global LText uchar 512
324global LStart ulong 128
325global LLength ulong 128
326global LCount ulong 2
327
328fn llower c uchar to uchar
329if and ge c 65 le c 90
330ret add c 32
331end
332ret c
333end
334
335fn lword c uchar to bool
336d = llower c
337ret or and ge d 97 le d 122 and ge d 48 le d 57
338end
339
340fn ltokens side ulong size ulong to bool
341if or gt side 1 gt size 256
342ret false
343end
344base = mul side 256
345slots = mul side 64
346count = ulong 0
347pos = ulong 0
348while lt pos size
349if gt get LText add base pos 127
350ret false
351end
352if lword get LText add base pos
353start = pos
354scanning = true
355while and lt pos size scanning
356if lword get LText add base pos
357pos = add pos 1
358else
359scanning = false
360end
361end
362if ge count 64
363ret false
364end
365put LStart add slots count add base start
366put LLength add slots count sub pos start
367count = add count 1
368else
369pos = add pos 1
370end
371end
372put LCount side count
373ret true
374end
375
376fn lwordeq a ulong b ulong to bool
377n = get LLength a
378if ne n get LLength b
379ret false
380end
381for k ulong n
382if ne llower get LText add get LStart a k llower get LText add get LStart b k
383ret false
384end
385end
386ret true
387end
388
389fn ltriple a ulong b ulong to bool
390for k ulong 3
391if eq lwordeq add a k add b k false
392ret false
393end
394end
395ret true
396end
397
398fn lunique at ulong base ulong to bool
399j = base
400while lt j at
401if ltriple at j
402ret false
403end
404j = add j 1
405end
406ret true
407end
408
409note 0=no near match,1=above threshold,2=insufficient words,3=unsupported input.
410fn lnear an ulong bn ulong to ulong
411if eq ltokens 0 an false
412ret 3
413end
414if eq ltokens 1 bn false
415ret 3
416end
417a = get LCount 0
418b = get LCount 1
419if or lt a 3 lt b 3
420ret 2
421end
422ua = ulong 0
423ub = ulong 0
424overlap = ulong 0
425for i ulong sub a 2
426if lunique i 0
427ua = add ua 1
428hit = false
429for j ulong sub b 2
430if ltriple i add 64 j
431hit = true
432end
433end
434if hit
435overlap = add overlap 1
436end
437end
438end
439for j ulong sub b 2
440if lunique add 64 j 64
441ub = add ub 1
442end
443end
444if gt mul overlap 3 add ua ub
445ret 1
446end
447ret 0
448end