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 / author / omega-upstream185.om

773 lines · 13639 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
449note Handwritten component acceptance tests; public task oracle belongs to L776.
450global Checks ulong 1
451global Digits uchar 16
452text Good "BENCHMARK_CORE_PASS\n"
453text PhraseA "Add the two input numbers and return their sum"
454text PhraseB "ADD the TWO input numbers, and return their sum."
455text PhraseC "Find a maximum element in a sorted collection"
456text HalfA "a b c"
457text HalfB "a b c d"
458text Repeat "a a a a a a"
459
460fn check actual ulong expected ulong to void
461put Checks 0 add get Checks 0 1
462if ne actual expected
463exit int add get Checks 0 40
464end
465end
466
467fn fixture to void
468for i ulong 2048
469put LT i 0
470end
471for i ulong 4
472a = mul i 32
473put LT a add i 1
474put LT add a 1 add div i 2 1
475put LT add a 2 1
476put LT add a 3 add i 1
477put LT add a 4 1
478put LT add a 5 1
479put LT add a 6 776
480put LT add a 7 add i 1
481for j ulong 20
482put LT add a add j 8 add add mul i 100 j 1
483end
484put LT add a 28 16
485put LT add a 29 16
486put LT add a 30 1000
487end
488for i ulong 4
489put LPin i add i 1
490put LPin add i 4 add i 1
491put LPin add i 8 add i 5
492put LPin add i 12 add i 5
493end
494for i ulong 9
495put LC i 0
496end
497put LC 0 10
498put LC 1 20
499put LC 2 30
500put LC 3 40
501put LC 4 50
502put LC 5 60
503put LC 6 4096
504for i ulong 24
505put LS i 0
506end
507end
508
509fn manifesttests to void
510fixture
511check lmanifest 4 0
512check lmanifest 0 1
513check lmanifest 65 1
514put LT 0 0
515check lmanifest 4 2
516fixture
517put LT 5 2
518check lmanifest 4 3
519fixture
520put LT 4 0
521check lmanifest 4 3
522fixture
523put LT 6 0
524check lmanifest 4 4
525fixture
526put LT 1 4
527check lmanifest 4 5
528fixture
529put LT 1 3
530check lmanifest 4 5
531fixture
532put LT 2 2
533check lmanifest 4 5
534fixture
535for j ulong 4
536put LT add 8 j 0
537end
538check lmanifest 4 6
539fixture
540put LT 29 257
541check lmanifest 4 7
542fixture
543put LT 32 1
544check lmanifest 4 8
545fixture
546for j ulong 4
547put LT add 40 j get LT add 8 j
548end
549check lmanifest 4 9
550fixture
551for j ulong 4
552put LT add 44 j get LT add 12 j
553end
554check lmanifest 4 10
555fixture
556put LT 71 1
557check lmanifest 4 11
558fixture
559for j ulong 4
560put LT add 80 j get LT add 16 j
561end
562check lmanifest 4 12
563fixture
564for j ulong 4
565put LT add 84 j get LT add 20 j
566end
567check lmanifest 4 13
568fixture
569for j ulong 4
570put LT add 88 j get LT add 24 j
571end
572check lmanifest 4 14
573fixture
574put LT 67 1
575check lmanifest 4 15
576fixture
577put LT 31 1
578check lmanifest 4 7
579fixture
580put LT 28 0
581check lmanifest 4 7
582fixture
583put LT 30 1000001
584check lmanifest 4 7
585end
586
587fn observationtests to void
588for i ulong 256
589put LWant i uchar and i 255
590put LGot i uchar and i 255
591end
592check lobserve 0 0 0 8 8 0
593put LGot 7 99
594check lobserve 0 0 0 8 8 7
595check lobserve 0 0 0 8 0 9
596check lobserve 0 0 0 8 7 7
597check lobserve 0 0 0 0 0 10
598check lobserve 0 102 102 0 0 0
599check lobserve 0 102 103 0 0 8
600check lobserve 0 102 102 0 1 8
601check lobserve 0 9 9 0 0 10
602check lobserve 0 0 102 8 0 8
603check lobserve 0 0 0 257 257 10
604for i ulong 6
605check lobserve add i 1 0 0 8 8 add i 1
606end
607check lobserve 7 0 0 8 8 10
608end
609
610fn accountingtests to void
611fixture
612check lbegin 4 2 1000 0
613check lbegin 4 2 1000 20
614check lattempt 0 1 7 0
615check lattempt 0 2 0 0
616check lattempt 1 1 0 0
617check lattempt 2 1 4 0
618check lattempt 3 1 11 0
619check lfinish 0
620check get LS 3 5
621check get LS 4 1
622check get LS 5 2
623check get LS 8 50
624check get LS 9 100
625check get LS 10 150
626check get LS 11 200
627check get LS 12 250
628check get LS 13 300
629check get LS 14 4096
630check get LS 16 5
631check get LS 19 1
632check lattempt 0 3 0 24
633check lfinish 24
634fixture
635check lbegin 4 2 1000 0
636check lattempt 0 1 0 0
637check lfinish 30
638check get LS 18 0
639fixture
640check lbegin 4 2 1000 0
641check lattempt 0 2 0 28
642check get LS 8 10
643check lfinish 28
644fixture
645check lbegin 4 1 1000 0
646check lattempt 0 1 7 0
647check lattempt 0 2 0 28
648check get LS 5 0
649fixture
650check lbegin 4 2 99 0
651check lattempt 0 1 0 29
652check get LS 18 0
653fixture
654check lbegin 4 2 1000 0
655put LPin 7 999
656check lattempt 0 1 0 26
657check get LS 8 10
658check get LS 5 0
659fixture
660check lbegin 4 2 1000 0
661put LPin 15 999
662check lattempt 0 1 0 26
663fixture
664check lbegin 4 2 1000 0
665put LC 0 18446744073709551615
666check lattempt 0 1 0 23
667fixture
668check lbegin 4 2 1000 0
669put LC 7 1
670check lattempt 0 1 0 25
671fixture
672check lbegin 4 2 1000 0
673put LC 7 13
674put LC 8 1
675check lattempt 0 1 0 0
676check get LS 15 13
677check get LS 16 0
678fixture
679check lbegin 4 2 1000 0
680check lattempt 64 1 0 27
681check get LS 8 10
682fixture
683check lbegin 4 0 1000 21
684fixture
685check lbegin 4 65 1000 21
686fixture
687check lbegin 4 2 0 21
688fixture
689check lbegin 4 2 1000 0
690put LC 8 2
691check lattempt 0 1 0 25
692fixture
693check lbegin 4 2 1000 0
694put LS 8 1000000000000
695check lattempt 0 1 0 23
696check get LS 18 0
697fixture
698check lbegin 1 64 100000 0
699for i ulong 64
700check lattempt 0 add i 1 7 0
701end
702check lattempt 0 65 0 31
703check get LS 3 65
704check get LS 8 650
705check get LS 5 0
706check lfinish 31
707fixture
708check lbegin 1 1 1000 0
709put LC 6 8192
710check lattempt 0 1 0 0
711check get LS 14 8192
712check lfinish 0
713end
714
715fn neartests to void
716for i ulong len PhraseA
717put LText i get PhraseA i
718end
719for i ulong len PhraseB
720put LText add 256 i get PhraseB i
721end
722check lnear len PhraseA len PhraseB 1
723for i ulong len PhraseC
724put LText add 256 i get PhraseC i
725end
726check lnear len PhraseA len PhraseC 0
727check lnear 0 0 2
728check lnear 257 1 3
729put LText 0 255
730check lnear len PhraseA len PhraseC 3
731for i ulong len HalfA
732put LText i get HalfA i
733end
734for i ulong len HalfB
735put LText add 256 i get HalfB i
736end
737check lnear len HalfA len HalfB 0
738for i ulong len Repeat
739put LText i get Repeat i
740put LText add 256 i get Repeat i
741end
742check lnear len Repeat len Repeat 1
743for i ulong 128
744put LText mul i 2 97
745put LText add mul i 2 1 32
746end
747check lnear 256 5 3
748end
749
750fn countout to void
751n = get Checks 0
752put Digits 0 uchar add div n 100 48
753put Digits 1 uchar add rem div n 10 10 48
754put Digits 2 uchar add rem n 10 48
755put Digits 3 10
756w = write 1 Digits 0 4
757if ne w 4
758exit 36
759end
760end
761
762fn main to int
763manifesttests
764observationtests
765accountingtests
766neartests
767w = write 1 Good 0 len Good
768if ne w long len Good
769ret 35
770end
771countout
772ret 0
773end