Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/evidence/LEARN53-L777-CONTINUATION/author/mutant-omit-task.om # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / evidence / LEARN53-L777-CONTINUATION / author / mutant-omit-task.om` 1401 lines · 21025 bytes Raw Blame History 1 note LEARN653 v1 consumer checks. No compiler, judge, signer or process supervisor. 2 note Task slots are 32 ulongs; see docs/learning/benchmark-v1.md. 3 global LT ulong 2048 4 global LS ulong 24 5 global LSeen ulong 64 6 global LWon ulong 64 7 global LPin ulong 16 8 global LWant uchar 256 9 global LGot uchar 256 10 11 fn lequal a ulong b ulong n ulong to bool 12 for k ulong n 13 if ne get LT add a k get LT add b k 14 ret false 15 end 16 end 17 ret true 18 end 19 20 fn lnonzero a ulong to bool 21 x = ulong 0 22 for k ulong 4 23 x = or x get LT add a k 24 end 25 ret ne x 0 26 end 27 28 fn lrecord a ulong to ulong 29 split = get LT add a 1 30 if or eq get LT a 0 or lt split 1 gt split 4 31 ret 2 32 end 33 if or ne get LT add a 5 1 ne get LT add a 4 1 34 ret 3 35 end 36 if eq get LT add a 3 0 37 ret 4 38 end 39 if eq get LT add a 6 0 40 ret 4 41 end 42 if eq get LT add a 7 0 43 ret 4 44 end 45 note Only public train/dev records are admissible to this builder-side API. 46 note Adaptive/final custody stays with the existing independent owner. 47 if or gt split 2 ne get LT add a 2 1 48 ret 5 49 end 50 for h ulong 5 51 if eq lnonzero add a add 8 mul h 4 false 52 ret 6 53 end 54 end 55 if or eq get LT add a 28 0 gt get LT add a 28 256 56 ret 7 57 end 58 if or eq get LT add a 29 0 gt get LT add a 29 256 59 ret 7 60 end 61 if or eq get LT add a 30 0 gt get LT add a 30 `1000000` 62 ret 7 63 end 64 if ne get LT add a 31 0 65 ret 7 66 end 67 ret 0 68 end 69 70 fn lpair a ulong b ulong to ulong 71 if eq get LT a get LT b 72 ret 8 73 end 74 if lequal add a 8 add b 8 4 75 ret 9 76 end 77 if lequal add a 12 add b 12 4 78 ret 10 79 end 80 if ne get LT add a 1 get LT add b 1 81 if eq get LT add a 3 get LT add b 3 82 ret 15 83 end 84 if eq get LT add a 7 get LT add b 7 85 ret 11 86 end 87 if lequal add a 16 add b 16 4 88 ret 12 89 end 90 if lequal add a 20 add b 20 4 91 ret 13 92 end 93 if lequal add a 24 add b 24 4 94 ret 14 95 end 96 end 97 ret 0 98 end 99 100 fn lmanifest n ulong to ulong 101 if or eq n 0 gt n 64 102 ret 1 103 end 104 for i ulong n 105 a = mul i 32 106 code = lrecord a 107 if ne code 0 108 ret code 109 end 110 for j ulong i 111 b = mul j 32 112 code = lpair a b 113 if ne code 0 114 ret code 115 end 116 end 117 end 118 ret 0 119 end 120 121 note Caller supplies independent expected bytes and actual executor observations. 122 note Status 0=completed, 1=syntax,2=type,3=unsupported,4=timeout,5=resource,6=operational. 123 note Result 0=correct,1..6 as above,7=wrong value,8=trap mismatch,9=empty output,10=malformed. 124 fn lobserve status ulong wantcode ulong gotcode ulong wantn ulong gotn ulong to ulong 125 if gt status 6 126 ret 10 127 end 128 if ne status 0 129 ret status 130 end 131 if or gt wantn 256 gt gotn 256 132 ret 10 133 end 134 if ne wantcode gotcode 135 ret 8 136 end 137 if ne wantcode 0 138 note Only declared runtime traps 101..107; arbitrary exit failures never pass. 139 if or lt wantcode 101 or gt wantcode 107 ne wantn 0 140 ret 10 141 end 142 if ne gotn 0 143 ret 8 144 end 145 ret 0 146 end 147 if eq wantn 0 148 ret 10 149 end 150 if eq gotn 0 151 ret 9 152 end 153 if ne wantn gotn 154 ret 7 155 end 156 for i ulong wantn 157 if ne get LWant i get LGot i 158 ret 7 159 end 160 end 161 ret 0 162 end 163 164 note Full 256-bit compiler and executable identities, expected then observed. 165 note LPin[0..3] expected compiler, [4..7] observed, [8..11] expected ELF, [12..15] observed. 166 fn lpins to bool 167 ca = ulong 0 168 ba = ulong 0 169 for i ulong 4 170 ca = or ca get LPin i 171 ba = or ba get LPin add i 8 172 if ne get LPin i get LPin add i 4 173 ret false 174 end 175 if ne get LPin add i 8 get LPin add i 12 176 ret false 177 end 178 end 179 ret and ne ca 0 ne ba 0 180 end 181 182 note Each begin is one explicit fresh development run; no durable resume API exists. 183 note LS: active,tasks,maxattempts,attempts,pass1,passbudget,invalid,closed, 184 note generation_us,compile_us,judge_us,other_us,input_tokens,output_tokens,peak_bytes, 185 note energy_uj,energy_unknown,budget_us,completed,abstained,reserved... 186 fn lbegin n ulong maxtries ulong budget ulong to ulong 187 if eq get LS 0 1 188 ret 20 189 end 190 for i ulong 24 191 put LS i 0 192 end 193 for i ulong 64 194 put LSeen i 0 195 put LWon i 0 196 end 197 code = lmanifest n 198 if ne code 0 199 put LS 6 code 200 ret code 201 end 202 if or eq maxtries 0 or gt maxtries 64 or eq budget 0 gt budget `1000000000000` 203 put LS 6 21 204 ret 21 205 end 206 put LS 0 1 207 put LS 1 n 208 put LS 2 maxtries 209 put LS 17 budget 210 ret 0 211 end 212 213 note Charge before classifying. Costs are exact integer caller measurements, never estimates. 214 note Missing cost values use all-ones and invalidate the run, never become free. 215 fn lcost slot ulong value ulong to ulong 216 if or lt slot 8 gt slot 15 217 put LS 6 22 218 ret 22 219 end 220 if gt value `1000000000000` 221 put LS 6 23 222 ret 23 223 end 224 if eq slot 14 225 if gt value get LS slot 226 put LS slot value 227 end 228 else 229 if gt get LS slot sub ulong `1000000000000` value 230 put LS 6 23 231 ret 23 232 end 233 put LS slot add get LS slot value 234 end 235 ret 0 236 end 237 238 note Attempt outcomes come from lobserve or explicit abstention 11, never compiler acceptance. 239 note Mandatory cost vector is supplied per attempt in LC; energy unknown is explicit. 240 global LC ulong 9 241 242 fn lattempt task ulong ordinal ulong outcome ulong to ulong 243 if ne get LS 0 1 244 ret 24 245 end 246 for k ulong 8 247 r = lcost add k 8 get LC k 248 end 249 if eq get LC 8 0 250 put LS 16 add get LS 16 1 251 if ne get LC 7 0 252 put LS 6 25 253 end 254 else 255 if ne get LC 8 1 256 put LS 6 25 257 end 258 end 259 put LS 3 add get LS 3 1 260 note At most 64 attempts across a public development run, including failed attempts. 261 if gt get LS 3 64 262 put LS 6 31 263 ret 31 264 end 265 if eq lpins false 266 put LS 6 26 267 end 268 note Invalid costs or identities can never add successful tasks. 269 if ne get LS 6 0 270 ret get LS 6 271 end 272 if or ge task get LS 1 gt outcome 11 273 put LS 6 27 274 ret 27 275 end 276 if or ne ordinal add get LSeen task 1 gt ordinal get LS 2 277 put LS 6 28 278 ret 28 279 end 280 put LSeen task ordinal 281 if eq outcome 0 282 if eq ordinal 1 283 put LS 4 add get LS 4 1 284 end 285 if eq get LWon task 0 286 put LWon task 1 287 put LS 5 add get LS 5 1 288 end 289 end 290 if eq outcome 11 291 put LS 19 add get LS 19 1 292 end 293 elapsed = add get LS 8 get LS 9 294 elapsed = add elapsed get LS 10 295 elapsed = add elapsed get LS 11 296 if gt elapsed get LS 17 297 put LS 6 29 298 end 299 ret get LS 6 300 end 301 302 fn lfinish to ulong 303 if ne get LS 0 1 304 ret 24 305 end 306 put LS 0 0 307 for i ulong get LS 1 308 if eq get LSeen i 0 309 if eq get LS 6 0 310 put LS 6 30 311 end 312 end 313 end 314 if ne get LS 6 0 315 ret get LS 6 316 end 317 put LS 18 1 318 ret 0 319 end 320 321 note GEN-1 genjac rule reused: lowercase ASCII word-triple SET Jaccard strictly above 1/2. 322 note Input contains two public prompts only; never load final or sealed text here. 323 global LText uchar 512 324 global LStart ulong 128 325 global LLength ulong 128 326 global LCount ulong 2 327 328 fn llower c uchar to uchar 329 if and ge c 65 le c 90 330 ret add c 32 331 end 332 ret c 333 end 334 335 fn lword c uchar to bool 336 d = llower c 337 ret or and ge d 97 le d 122 and ge d 48 le d 57 338 end 339 340 fn ltokens side ulong size ulong to bool 341 if or gt side 1 gt size 256 342 ret false 343 end 344 base = mul side 256 345 slots = mul side 64 346 count = ulong 0 347 pos = ulong 0 348 while lt pos size 349 if gt get LText add base pos 127 350 ret false 351 end 352 if lword get LText add base pos 353 start = pos 354 scanning = true 355 while and lt pos size scanning 356 if lword get LText add base pos 357 pos = add pos 1 358 else 359 scanning = false 360 end 361 end 362 if ge count 64 363 ret false 364 end 365 put LStart add slots count add base start 366 put LLength add slots count sub pos start 367 count = add count 1 368 else 369 pos = add pos 1 370 end 371 end 372 put LCount side count 373 ret true 374 end 375 376 fn lwordeq a ulong b ulong to bool 377 n = get LLength a 378 if ne n get LLength b 379 ret false 380 end 381 for k ulong n 382 if ne llower get LText add get LStart a k llower get LText add get LStart b k 383 ret false 384 end 385 end 386 ret true 387 end 388 389 fn ltriple a ulong b ulong to bool 390 for k ulong 3 391 if eq lwordeq add a k add b k false 392 ret false 393 end 394 end 395 ret true 396 end 397 398 fn lunique at ulong base ulong to bool 399 j = base 400 while lt j at 401 if ltriple at j 402 ret false 403 end 404 j = add j 1 405 end 406 ret true 407 end 408 409 note 0=no near match,1=above threshold,2=insufficient words,3=unsupported input. 410 fn lnear an ulong bn ulong to ulong 411 if eq ltokens 0 an false 412 ret 3 413 end 414 if eq ltokens 1 bn false 415 ret 3 416 end 417 a = get LCount 0 418 b = get LCount 1 419 if or lt a 3 lt b 3 420 ret 2 421 end 422 ua = ulong 0 423 ub = ulong 0 424 overlap = ulong 0 425 for i ulong sub a 2 426 if lunique i 0 427 ua = add ua 1 428 hit = false 429 for j ulong sub b 2 430 if ltriple i add 64 j 431 hit = true 432 end 433 end 434 if hit 435 overlap = add overlap 1 436 end 437 end 438 end 439 for j ulong sub b 2 440 if lunique add 64 j 64 441 ub = add ub 1 442 end 443 end 444 if gt mul overlap 3 add ua ub 445 ret 1 446 end 447 ret 0 448 end 449 note SPDX-License-Identifier: AGPL-3.0-only 450 note CUL1 public domain adapter. See docs/learn53/CONTRACT.md. 451 note Caller owns/pins kt; only ko contains candidate observations. No code execution. 452 global kt uchar 4096 453 global ko uchar 1032 454 fn kw i ulong to ulong 455 v = ulong 0 456 for j ulong 4 457 v = or v shl ulong get kt add mul i 4 j mul j 8 458 end 459 ret v 460 end 461 fn kc i ulong to ulong 462 v = ulong 0 463 for j ulong 4 464 v = or v shl ulong get ko add mul i 4 j mul j 8 465 end 466 ret v 467 end 468 fn kshape to ulong 469 op = kw 2 470 m = kw 5 471 n = kw 6 472 k = kw 7 473 if eq op 3 474 if eq m 2 475 if eq n 3 476 if eq k 2 477 ret 301 478 end 479 end 480 end 481 if eq m 3 482 if eq n 2 483 if eq k 3 484 ret 302 485 end 486 end 487 end 488 ret 0 489 end 490 if ne n 1 491 ret 0 492 end 493 if ne k 1 494 ret 0 495 end 496 base = mul op 100 497 if eq m 3 498 ret add base 1 499 end 500 if eq m 8 501 ret add base 2 502 end 503 if eq m 17 504 ret add base 3 505 end 506 ret 0 507 end 508 fn kextent rows ulong cols ulong stride ulong to ulong 509 ret add mul sub rows 1 stride cols 510 end 511 fn kstrides to int 512 op = kw 2 513 m = kw 5 514 if eq op 3 515 if lt kw 8 kw 7 516 ret 65 517 end 518 if lt kw 9 kw 6 519 ret 65 520 end 521 if lt kw 10 kw 6 522 ret 65 523 end 524 if ne kw 11 kextent m kw 7 kw 8 525 ret 65 526 end 527 if ne kw 12 kextent kw 7 kw 6 kw 9 528 ret 65 529 end 530 if ne kw 13 kextent m kw 6 kw 10 531 ret 65 532 end 533 ret 0 534 end 535 if eq kw 8 0 536 ret 65 537 end 538 if ne kw 11 kextent m 1 kw 8 539 ret 65 540 end 541 if eq op 2 542 if ne kw 9 0 543 ret 65 544 end 545 if ne kw 12 0 546 ret 65 547 end 548 if ne kw 10 1 549 ret 65 550 end 551 if ne kw 13 1 552 ret 65 553 end 554 ret 0 555 end 556 if eq kw 9 0 557 ret 65 558 end 559 if eq kw 10 0 560 ret 65 561 end 562 if ne kw 12 kextent m 1 kw 9 563 ret 65 564 end 565 if ne kw 13 kextent m 1 kw 10 566 ret 65 567 end 568 ret 0 569 end 570 fn kvalid n ulong to int 571 note All variable reads follow size/count validation. Bounds precede arithmetic. 572 if lt n 96 573 ret 65 574 end 575 if gt n 4096 576 ret 65 577 end 578 if ne kw 0 `827086147` 579 ret 65 580 end 581 if ne kw 1 1 582 ret 69 583 end 584 if gt kw 11 256 585 ret 65 586 end 587 if gt kw 12 256 588 ret 65 589 end 590 if eq kw 13 0 591 ret 65 592 end 593 if gt kw 13 256 594 ret 65 595 end 596 if ne n add 96 mul 4 add kw 11 kw 12 597 ret 65 598 end 599 if ne kw 23 0 600 ret 65 601 end 602 if eq kw 16 0 603 ret 65 604 end 605 if ne kw 21 0 606 ret 65 607 end 608 if ne kw 22 0 609 ret 65 610 end 611 if lt kw 2 1 612 ret 69 613 end 614 if gt kw 2 3 615 ret 69 616 end 617 if ne kw 3 1 618 ret 69 619 end 620 if ne kw 4 0 621 ret 69 622 end 623 if ne kw 17 1 624 ret 69 625 end 626 if ne kw 18 0 627 ret 69 628 end 629 if ne kw 19 1 630 ret 69 631 end 632 if ne kw 20 1 633 ret 69 634 end 635 if eq kw 14 0 636 ret 65 637 end 638 if gt kw 14 3 639 ret 65 640 end 641 if ne kw 14 1 642 ret 77 643 end 644 family = kshape 645 if eq family 0 646 ret 69 647 end 648 if ne kw 15 family 649 ret 65 650 end 651 for i ulong 3 652 if gt kw add i 8 32 653 ret 65 654 end 655 end 656 ret kstrides 657 end 658 fn ksum to ulong 659 v = ulong 0 660 for i ulong kw 5 661 v = and add v kw add 24 mul i kw 8 `4294967295` 662 end 663 ret v 664 end 665 fn kdot row ulong col ulong to ulong 666 v = ulong 0 667 for i ulong kw 7 668 a = kw add 24 add mul row kw 8 i 669 b = kw add add 24 kw 11 add mul i kw 9 col 670 v = and add v mul a b `4294967295` 671 end 672 ret v 673 end 674 fn kexpect pos ulong to ulong 675 op = kw 2 676 if eq op 2 677 ret ksum 678 end 679 stride = kw 10 680 row = div pos stride 681 col = rem pos stride 682 if eq op 3 683 if ge col kw 6 684 ret `2779096485` 685 end 686 ret kdot row col 687 end 688 if ne col 0 689 ret `2779096485` 690 end 691 a = kw add 24 mul row kw 8 692 b = kw add add 24 kw 11 mul row kw 9 693 ret and add a b `4294967295` 694 end 695 fn keval n ulong c ulong to int 696 status = kvalid n 697 if ne status 0 698 ret status 699 end 700 note Candidate result length is not trusted. No caller-supplied PASS or tolerance. 701 if ne c mul 4 add kw 13 2 702 ret 65 703 end 704 if ne kc 0 `2779096485` 705 ret 1 706 end 707 if ne kc add kw 13 1 `2779096485` 708 ret 1 709 end 710 for i ulong kw 13 711 if ne kc add i 1 kexpect i 712 ret 1 713 end 714 end 715 ret 0 716 end 717 note SPDX-License-Identifier: AGPL-3.0-only 718 note Eight fixed public development tasks. Not a sealed pool or a process runner. 719 fn kput p ulong v ulong to void 720 for i ulong 4 721 put kt add mul p 4 i uchar and shr v mul i 8 255 722 end 723 end 724 fn kbase id ulong to void 725 for i ulong 4096 726 put kt i 0 727 end 728 kput 0 `827086147` 729 kput 1 1 730 kput 3 1 731 kput 5 3 732 kput 6 1 733 kput 7 1 734 kput 8 2 735 kput 9 2 736 kput 10 2 737 kput 11 5 738 kput 12 5 739 kput 13 5 740 kput 14 1 741 kput 16 id 742 kput 17 1 743 kput 19 1 744 kput 20 1 745 end 746 fn klinear id ulong to void 747 if eq id 1 748 kput 2 1 749 kput 15 101 750 kput 24 `4294967295` 751 kput 25 111 752 kput 26 7 753 kput 27 222 754 kput 28 9 755 kput 29 1 756 kput 30 333 757 kput 31 4 758 kput 32 444 759 kput 33 6 760 ret 761 end 762 if eq id 4 763 kput 2 2 764 kput 15 201 765 kput 9 0 766 kput 10 1 767 kput 12 0 768 kput 13 1 769 kput 24 `4294967295` 770 kput 25 111 771 kput 26 2 772 kput 27 222 773 kput 28 3 774 ret 775 end 776 n = ulong 8 777 if or eq id 3 eq id 6 778 n = 17 779 end 780 kput 5 n 781 kput 8 1 782 kput 10 1 783 kput 11 n 784 if le id 3 785 kput 2 1 786 kput 9 1 787 kput 12 n 788 kput 13 n 789 kput 15 add 100 id 790 a = ulong 7 791 b = ulong 9 792 if eq id 3 793 a = `4294967295` 794 b = 3 795 end 796 for i ulong n 797 kput add 24 i a 798 kput add add 24 n i b 799 end 800 else 801 kput 2 2 802 kput 9 0 803 kput 12 0 804 kput 13 1 805 kput 15 add 197 id 806 for i ulong n 807 kput add 24 i `4294967295` 808 end 809 end 810 end 811 fn kmatrix id ulong to void 812 kput 2 3 813 if eq id 7 814 kput 5 2 815 kput 6 3 816 kput 7 2 817 kput 8 3 818 kput 9 4 819 kput 10 4 820 kput 11 5 821 kput 12 7 822 kput 13 7 823 kput 15 301 824 kput 24 1 825 kput 25 2 826 kput 26 999 827 kput 27 3 828 kput 28 4 829 kput 29 5 830 kput 30 6 831 kput 31 7 832 kput 32 999 833 kput 33 8 834 kput 34 9 835 kput 35 10 836 else 837 kput 5 3 838 kput 6 2 839 kput 7 3 840 kput 8 3 841 kput 9 2 842 kput 10 2 843 kput 11 9 844 kput 12 6 845 kput 13 6 846 kput 15 302 847 for i ulong 9 848 kput add 24 i add i 1 849 end 850 for i ulong 6 851 kput add 33 i add i 1 852 end 853 end 854 end 855 fn kload id ulong to ulong 856 note Reject before modifying either caller buffer. Valid loads never touch ko. 857 if or eq id 0 gt id 8 858 ret 0 859 end 860 kbase id 861 if le id 6 862 klinear id 863 else 864 kmatrix id 865 end 866 ret add 96 mul 4 add kw 11 kw 12 867 end 868 note SPDX-License-Identifier: AGPL-3.0-only 869 note Compose with exact omega653.lock core. No fork, runner, signer or cost collector. 870 note LT/LPin/LC/status/exit are trusted executor inputs, not candidate claims. 871 fn aword p ulong v ulong to void 872 for i ulong 4 873 put LWant add mul p 4 i uchar and shr v mul i 8 255 874 end 875 end 876 fn aobserve id ulong status ulong code ulong n ulong to ulong 877 tn = kload id 878 if eq tn 0 879 ret 10 880 end 881 if ne kvalid tn 0 882 ret 10 883 end 884 for i ulong 256 885 put LWant i 0 886 end 887 aword 0 `2779096485` 888 for i ulong kw 13 889 aword add i 1 kexpect i 890 end 891 aword add kw 13 1 `2779096485` 892 want = mul 4 add kw 13 2 893 ret lobserve status 0 code want n 894 end 895 fn afields to bool 896 for i ulong 8 897 a = mul i 32 898 id = add i 1 899 n = kload id 900 if ne get LT a id 901 ret false 902 end 903 if ne get LT add a 1 2 904 ret false 905 end 906 if ne get LT add a 2 1 907 ret false 908 end 909 if ne get LT add a 3 kw 2 910 ret false 911 end 912 if ne get LT add a 4 1 913 ret false 914 end 915 if ne get LT add a 5 1 916 ret false 917 end 918 if ne get LT add a 6 53 919 ret false 920 end 921 if ne get LT add a 7 1 922 ret false 923 end 924 if ne get LT add a 28 n 925 ret false 926 end 927 if ne get LT add a 29 mul 4 add kw 13 2 928 ret false 929 end 930 if ne get LT add a 30 `1000000` 931 ret false 932 end 933 if ne get LT add a 31 0 934 ret false 935 end 936 end 937 ret true 938 end 939 fn abegin budget ulong to ulong 940 note Canonical active-run refusal preserves the existing run. 941 if eq get LS 0 1 942 ret 20 943 end 944 if eq afields false 945 note Invalid count invokes canonical fresh-run invalidation, including stale scores. 946 ret lbegin 0 1 budget 947 end 948 ret lbegin 7 1 budget 949 end 950 fn aattempt idx ulong ordinal ulong status ulong code ulong n ulong to ulong 951 outcome = aobserve add idx 1 status code n 952 ret lattempt idx ordinal outcome 953 end 954 note SPDX-License-Identifier: AGPL-3.0-only 955 note Public fixtures, never sealed evaluation. Expected literals independently checked with Wolfram. 956 text okmsg "PASS " 957 text badmsg "FAIL " 958 global nums uchar 32 959 global tally ulong 2 960 global saved uchar 4096 961 fn digit n ulong to void 962 if ge n 10 963 digit div n 10 964 end 965 put nums 0 uchar add 48 rem n 10 966 w = write 1 nums 0 1 967 end 968 fn check yes bool to void 969 put tally 0 add get tally 0 1 970 if yes 971 w = write 1 okmsg 0 len okmsg 972 else 973 w = write 1 badmsg 0 len badmsg 974 put tally 1 add get tally 1 1 975 end 976 digit get tally 0 977 put nums 0 10 978 w = write 1 nums 0 1 979 end 980 fn tw p ulong v ulong to void 981 for i ulong 4 982 put kt add mul p 4 i uchar and shr v mul i 8 255 983 end 984 end 985 fn cw p ulong v ulong to void 986 for i ulong 4 987 put ko add mul p 4 i uchar and shr v mul i 8 255 988 end 989 end 990 fn header op ulong to void 991 for i ulong 4096 992 put kt i 0 993 end 994 for i ulong 258 995 cw i `2779096485` 996 end 997 tw 0 `827086147` 998 tw 1 1 999 tw 2 op 1000 tw 3 1 1001 tw 5 3 1002 tw 6 1 1003 tw 7 1 1004 tw 8 2 1005 tw 9 2 1006 tw 10 2 1007 tw 11 5 1008 tw 12 5 1009 tw 13 5 1010 tw 14 1 1011 tw 15 add mul op 100 1 1012 tw 16 1 1013 tw 17 1 1014 tw 19 1 1015 tw 20 1 1016 end 1017 fn vec to void 1018 header 1 1019 tw 24 `4294967295` 1020 tw 25 111 1021 tw 26 7 1022 tw 27 222 1023 tw 28 9 1024 tw 29 1 1025 tw 30 333 1026 tw 31 4 1027 tw 32 444 1028 tw 33 6 1029 cw 1 0 1030 cw 3 11 1031 cw 5 15 1032 end 1033 fn red to void 1034 header 2 1035 tw 9 0 1036 tw 10 1 1037 tw 12 0 1038 tw 13 1 1039 tw 24 `4294967295` 1040 tw 25 111 1041 tw 26 2 1042 tw 27 222 1043 tw 28 3 1044 cw 1 4 1045 end 1046 fn mat to void 1047 header 3 1048 tw 5 2 1049 tw 6 3 1050 tw 7 2 1051 tw 8 3 1052 tw 9 4 1053 tw 10 4 1054 tw 11 5 1055 tw 12 7 1056 tw 13 7 1057 tw 24 1 1058 tw 25 2 1059 tw 26 999 1060 tw 27 3 1061 tw 28 4 1062 tw 29 5 1063 tw 30 6 1064 tw 31 7 1065 tw 32 999 1066 tw 33 8 1067 tw 34 9 1068 tw 35 10 1069 cw 1 21 1070 cw 2 24 1071 cw 3 27 1072 cw 5 47 1073 cw 6 54 1074 cw 7 61 1075 end 1076 note SPDX-License-Identifier: AGPL-3.0-only 1077 note Literal output oracle only. No kexpect/keval calls construct expected values. 1078 fn csize id ulong to ulong 1079 if eq id 1 1080 ret 136 1081 end 1082 if eq id 2 1083 ret 160 1084 end 1085 if eq id 3 1086 ret 232 1087 end 1088 if eq id 4 1089 ret 116 1090 end 1091 if eq id 5 1092 ret 128 1093 end 1094 if eq id 6 1095 ret 164 1096 end 1097 if eq id 7 1098 ret 144 1099 end 1100 if eq id 8 1101 ret 156 1102 end 1103 ret 0 1104 end 1105 fn coutn id ulong to ulong 1106 if eq id 1 1107 ret 28 1108 end 1109 if eq id 2 1110 ret 40 1111 end 1112 if eq id 3 1113 ret 76 1114 end 1115 if and ge id 4 le id 6 1116 ret 12 1117 end 1118 if eq id 7 1119 ret 36 1120 end 1121 if eq id 8 1122 ret 32 1123 end 1124 ret 0 1125 end 1126 fn cvalues id ulong to void 1127 for i ulong 258 1128 cw i `2779096485` 1129 end 1130 if eq id 1 1131 cw 1 0 1132 cw 3 11 1133 cw 5 15 1134 end 1135 if eq id 2 1136 for i ulong 8 1137 cw add i 1 16 1138 end 1139 end 1140 if eq id 3 1141 for i ulong 17 1142 cw add i 1 2 1143 end 1144 end 1145 if eq id 4 1146 cw 1 4 1147 end 1148 if eq id 5 1149 cw 1 `4294967288` 1150 end 1151 if eq id 6 1152 cw 1 `4294967279` 1153 end 1154 if eq id 7 1155 cw 1 21 1156 cw 2 24 1157 cw 3 27 1158 cw 5 47 1159 cw 6 54 1160 cw 7 61 1161 end 1162 if eq id 8 1163 cw 1 22 1164 cw 2 28 1165 cw 3 49 1166 cw 4 64 1167 cw 5 76 1168 cw 6 100 1169 end 1170 end 1171 note SPDX-License-Identifier: AGPL-3.0-only 1172 note SYNTHETIC unit metadata, pins and costs, NEVER a real benchmark record. 1173 fn afix to void 1174 for i ulong 2048 1175 put LT i 0 1176 end 1177 for i ulong 24 1178 put LS i 0 1179 end 1180 for i ulong 8 1181 id = add i 1 1182 a = mul i 32 1183 n = kload id 1184 put LT a id 1185 put LT add a 1 2 1186 put LT add a 2 1 1187 put LT add a 3 kw 2 1188 put LT add a 4 1 1189 put LT add a 5 1 1190 put LT add a 6 53 1191 put LT add a 7 1 1192 for j ulong 20 1193 put LT add a add 8 j add add mul i 100 j 1 1194 end 1195 put LT add a 28 csize id 1196 put LT add a 29 coutn id 1197 put LT add a 30 `1000000` 1198 end 1199 for i ulong 4 1200 put LPin i add i 1 1201 put LPin add i 4 add i 1 1202 put LPin add i 8 add i 5 1203 put LPin add i 12 add i 5 1204 end 1205 for i ulong 9 1206 put LC i 0 1207 end 1208 put LC 0 10 1209 put LC 1 20 1210 put LC 2 30 1211 put LC 3 40 1212 put LC 4 50 1213 put LC 5 60 1214 put LC 6 4096 1215 end 1216 fn agood id ulong to void 1217 cvalues id 1218 for i ulong 256 1219 put LGot i get ko i 1220 end 1221 end 1222 fn aobs to void 1223 for i ulong 8 1224 id = add i 1 1225 agood id 1226 check eq aobserve id 0 0 coutn id 0 1227 put LGot sub coutn id 1 0 1228 check eq aobserve id 0 0 coutn id 7 1229 end 1230 agood 1 1231 check eq aobserve 0 0 0 28 10 1232 check eq aobserve 9 0 0 28 10 1233 check eq aobserve `18446744073709551615` 0 0 28 10 1234 check eq aobserve 1 0 0 0 9 1235 check eq aobserve 1 0 0 27 7 1236 check eq aobserve 1 0 0 257 10 1237 check eq aobserve 1 0 0 `18446744073709551615` 10 1238 check eq aobserve 1 0 101 0 8 1239 check eq aobserve 1 7 0 28 10 1240 for i ulong 6 1241 check eq aobserve 1 add i 1 0 28 add i 1 1242 end 1243 note A task mutation is discarded; correct output for weakened task is wrong. 1244 n = kload 1 1245 tw 28 0 1246 tw 21 1 1247 tw 22 99 1248 tw 14 3 1249 check eq aobserve 1 0 0 28 0 1250 check eq kw 28 9 1251 check eq kw 21 0 1252 check eq kw 22 0 1253 check eq kw 14 1 1254 cw 5 6 1255 for i ulong 28 1256 put LGot i get ko i 1257 end 1258 check eq aobserve 1 0 0 28 7 1259 note Wrong logical output, skipped write, dense stride, PASS spoof, wrong task. 1260 for i ulong 4 1261 agood 1 1262 if eq i 0 1263 cw 3 12 1264 end 1265 if eq i 1 1266 cw 5 `2779096485` 1267 end 1268 if eq i 2 1269 cw 2 11 1270 cw 3 15 1271 cw 5 `2779096485` 1272 end 1273 if eq i 3 1274 cw 1 `1397965136` 1275 end 1276 for j ulong 28 1277 put LGot j get ko j 1278 end 1279 check eq aobserve 1 0 0 28 7 1280 end 1281 agood 1 1282 check eq aobserve 2 0 0 28 7 1283 end 1284 fn aall to void 1285 afix 1286 check eq abegin 1000 0 1287 check eq abegin 1000 20 1288 for i ulong 8 1289 id = add i 1 1290 agood id 1291 check eq aattempt i 1 0 0 coutn id 0 1292 end 1293 check eq lfinish 0 1294 check eq get LS 18 1 1295 check eq get LS 4 8 1296 check eq get LS 5 8 1297 check eq get LS 3 8 1298 check eq get LS 16 8 1299 check eq get LS 14 4096 1300 note A subsequent invalid begin clears old completed-valid state. 1301 put LT 1 3 1302 check eq abegin 1000 1 1303 check eq get LS 18 0 1304 end 1305 fn amissing to void 1306 afix 1307 check eq abegin 1000 0 1308 for i ulong 7 1309 id = add i 1 1310 agood id 1311 check eq aattempt i 1 0 0 coutn id 0 1312 end 1313 check eq lfinish 30 1314 check eq get LS 18 0 1315 afix 1316 check eq abegin 1000 0 1317 agood 1 1318 check eq aattempt 0 1 0 0 28 0 1319 check eq aattempt 0 1 0 0 28 28 1320 check eq lfinish 28 1321 check eq get LS 18 0 1322 afix 1323 check eq abegin 1000 0 1324 check eq aattempt 8 1 0 0 28 27 1325 check eq lfinish 27 1326 end 1327 fn abad to void 1328 afix 1329 check eq abegin 1000 0 1330 for i ulong 8 1331 id = add i 1 1332 agood id 1333 if eq id 8 1334 put LGot 4 0 1335 end 1336 check eq aattempt i 1 0 0 coutn id 0 1337 end 1338 check eq lfinish 0 1339 check eq get LS 18 1 1340 check eq get LS 4 7 1341 check eq get LS 5 7 1342 note A valid experiment can report failure, never silently drop that task. 1343 check eq get LS 1 8 1344 check eq get LS 3 8 1345 end 1346 fn apins to void 1347 for i ulong 8 1348 afix 1349 check eq abegin 1000 0 1350 p = add i 4 1351 if ge i 4 1352 p = add i 8 1353 end 1354 put LPin p 999 1355 agood 1 1356 check eq aattempt 0 1 0 0 28 26 1357 check eq get LS 4 0 1358 check eq lfinish 26 1359 end 1360 afix 1361 check eq abegin 1000 0 1362 put LC 0 `18446744073709551615` 1363 agood 1 1364 check eq aattempt 0 1 0 0 28 23 1365 check eq get LS 4 0 1366 check eq lfinish 23 1367 afix 1368 check eq abegin 1 0 1369 agood 1 1370 check eq aattempt 0 1 0 0 28 29 1371 check eq lfinish 29 1372 check eq get LS 18 0 1373 end 1374 fn ameta to void 1375 for i ulong 32 1376 if or lt i 8 ge i 28 1377 afix 1378 put LT i 999 1379 check eq abegin 1000 1 1380 check eq get LS 18 0 1381 end 1382 end 1383 afix 1384 for i ulong 4 1385 put LT add i 8 0 1386 end 1387 check eq abegin 1000 6 1388 check eq get LS 18 0 1389 end 1390 fn main to int 1391 aobs 1392 aall 1393 amissing 1394 abad 1395 apins 1396 ameta 1397 if ne get tally 1 0 1398 ret 1 1399 end 1400 ret 0 1401 end