omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / evidence / node-schedpol / receipt.e4a78dbb251e59babaa8182b73e1ecdca7a9b325c641fd18942e479b03bc7c13.json
| 1 | { |
| 2 | "checks": [ |
| 3 | { |
| 4 | "binary_sha256": "8bd6c1a76cfc9659357e35c9fe538b14696bedcaa072e4fbc80c123620f51808", |
| 5 | "case": "bench-gate", |
| 6 | "compile_exit": 0, |
| 7 | "expected_exit": 0, |
| 8 | "issue": "DRA-399", |
| 9 | "run_exit": 0, |
| 10 | "source_sha256": "eb1e2360de9c242233a9bfe6dc5270262ba43f2138eceffba6c8b5588c8ac7f4", |
| 11 | "stderr": "", |
| 12 | "stdout": "1127 702503 702503 903398\nbench 1 3 4 1506436 20 489474 1415 1416 54848 90624 64 0 0 0 8 412 : 10 10 200713 200713 401710 401710 602274 1204931\nbench 2 0 4 2107731 16 541494 1975 1982 55040 0 0 0 0 0 14 412 : 8 8 301447 301657 602429 604146 903439 905804 1204466\nbench 2 1 4 2110392 15 691769 1967 1974 55744 126336 0 0 0 0 14 412 : 7 7 301517 301517 602617 602668 903718 903718 1206073\nbench 2 2 4 1806113 32 580548 1573 1580 18501 101120 1088 0 5 3 14 412 : 16 16 150401 153895 451394 454407 752525 300999 906189 1053822 1207485 448256\nbench 2 3 4 1808650 16 780898 1554 1561 19137 99904 1088 0 1 1 14 412 : 8 8 150909 150402 452025 452043 753327 301267 904139 151147 1206651 1206651 300627\nbench 3 0 4 1607836 20 323586 1507 1509 7168 0 0 0 0 0 13 412 : 10 10 300752 301095 601683 603182 902605 200794 200841 401780 403922\nbench 3 1 4 1605855 25 417681 1507 1509 7104 96576 0 0 0 0 13 412 : 12 12 300178 300213 601768 601794 902845 200499 200499 401401 401530\nbench 3 2 4 1608091 16 515475 1475 1477 6469 94528 192 0 5 2 13 412 : 8 8 101366 199548 300785 501930 602919 802920 802532 1104480 1003523 1204551 1304986\nbench 3 3 4 1606120 31 562118 1504 1506 6724 96384 192 0 4 3 13 412 : 15 15 100627 200919 301079 401559 602721 703040 903738 1004483 1104462 1205103 1305089\nbench 4 0 4 4036740 1825661 1185047 3675 3676 117184 0 0 0 0 0 24 412 : 6 6 401851 401851 551524 652081 652081 1053513 1121329 1121329 1221822 1523252 1373772 1574162 1975948 1975948 2128522 2229087 2229087 2630963 2682375 2682375 2782847 3084511\nbench 4 1 4 3659838 201066 1125528 2805 2806 57366 179584 0 0 1 0 24 412 : 53 53 100772 150225 402111 250562 551382 401832 970636 821086 814495 1122666 914992 1222783 1064796 1189014 1387876 1512283 1791950 1576479 2050861 2304543 2405660 2707561\nbench 4 2 4 3714132 198443 1361484 3490 3491 85061 223424 256 0 9 3 24 412 : 8 8 100612 150007 150007 100560 502065 250625 351065 752990 851981 702286 1004940 1105215 853316 1404242 1056667 1454692 1856697 2007150 2007150 2208144 2460348 2661316\nbench 4 3 4 3616980 202424 1311099 3378 3379 74152 216256 384 0 9 5 24 412 : 11 11 100672 50226 250896 502814 51506 1931 553416 754187 453940 505033 1005062 656308 1105605 1206045 1058295 1507591 1559057 1960671 2112417 1962180 2413914 2665296\nbench 5 0 4 3013147 37 783748 2782 2783 2048 0 0 0 0 0 30 412 : 18 18 100136 301099 301117 401466 602044 602645 601389 601356 602417 601572 601598 601402 601282 601191 601677 598397 602349 601227 601857 602074 601786 601950 602378 601342 601361 602273 601481 601395\nbench 5 1 4 3014142 21 1047219 2818 2819 2176 180416 0 0 0 0 30 412 : 10 10 100571 301289 301289 401822 602024 602407 600936 600631 600898 600749 601909 601025 601204 602275 602705 601266 602475 603654 601602 601555 602226 601636 601421 601186 601409 601777 601732 601788\nbench 5 2 4 3015029 24 1235466 2773 2774 1418 177536 896 0 10 1 30 412 : 12 12 100593 200861 200876 301435 199905 200198 601660 703302 200455 1004841 1004986 299425 1003862 100070 903217 903105 501181 902920 100032 200040 1003433 99415 1003424 1105123 1104453 1002708 603441\nbench 5 3 4 3012804 31 1430239 2715 2716 1608 173824 1024 0 8 0 30 412 : 15 15 100625 100666 99082 300801 301328 199573 601796 501732 200255 903350 602444 199963 1002903 602574 199088 602593 1003334 199358 1002456 602823 199885 1002223 601761 502007 999319 401652 1001799 701894\nbench 6 0 4 3465490 302760 931799 3147 3148 18816 0 0 1 0 0 12 412 : 6 6 453058 453058 704020 854802 1307027 1658010 1909135 2059922 2512020 2863031 2650747\nbench 6 1 4 3464324 18 1049049 3184 3185 896 203840 0 1 0 0 12 412 : 9 9 150447 452308 542886 1054317 1204676 1656945 2008314 2259333 2410152 2862421 3213799\nbench 6 2 4 3642196 19 1268236 3173 3174 644 203136 128 1 4 2 12 412 : 9 9 150529 140319 652222 802391 1254184 1605960 1857185 2007854 2459234 2810871 3171533\nbench 6 3 4 3466344 23 949828 3166 3167 707 202688 128 1 3 1 12 412 : 11 11 150136 150595 39910 552583 1004861 1356097 1607094 1859082 2211120 2663098 3014291\nPASS node bench\n", |
| 13 | "stdout_has": [ |
| 14 | "PASS node bench" |
| 15 | ], |
| 16 | "verdict": "PASS", |
| 17 | "wall_ms": 306034 |
| 18 | }, |
| 19 | { |
| 20 | "binary_sha256": "9353e1bae73f33518340d205d3cbc972261c473c924f6c8211b4148f5992cd91", |
| 21 | "case": "mut399-fits-ignores-capacity", |
| 22 | "compile_exit": 0, |
| 23 | "expected_exit": 70, |
| 24 | "issue": "DRA-399", |
| 25 | "mutation": { |
| 26 | "file": "seed/node/sched.om", |
| 27 | "from": "if gt sp_need req k a\nret false\n", |
| 28 | "to": "if false\nret false\n" |
| 29 | }, |
| 30 | "run_exit": 70, |
| 31 | "source_sha256": "16adacfee91addb83bd58ae7fc35c92f1ee1627bb6ddf1478835c83a8d3b646a", |
| 32 | "stderr": "", |
| 33 | "stdout": "", |
| 34 | "verdict": "PASS", |
| 35 | "wall_ms": 1 |
| 36 | }, |
| 37 | { |
| 38 | "binary_sha256": "67ed14b29af70ff39b86a5d3213444bfe689be83410fcc870174bb13e5632d1a", |
| 39 | "case": "mut399-reserve-youngest", |
| 40 | "compile_exit": 0, |
| 41 | "expected_exit": 71, |
| 42 | "issue": "DRA-399", |
| 43 | "mutation": { |
| 44 | "file": "seed/node/sched.om", |
| 45 | "from": "if lt get sjarr j get sjarr o\no = j\n", |
| 46 | "to": "if gt get sjarr j get sjarr o\no = j\n" |
| 47 | }, |
| 48 | "run_exit": 71, |
| 49 | "source_sha256": "929743add0111b397d712e5f7443e9aa9a45b30b4f41b9bf1562b3b969232630", |
| 50 | "stderr": "", |
| 51 | "stdout": "bench 1 0 0 1507666 603073 518245 1375 1376 53248 0 0 0 0 0 8 412 : 3 603069 904488 904488 1105422 1106456 1306529 1307400\nbench 1 1 0 1305933 200897 495381 1208 1209 30396 77376 0 0 1 0 8 412 : 23 23 200843 401802 602861 803847 1105077 1105077\nbench 1 2 0 1306519 36 447204 1211 1212 30209 77568 64 0 1 0 8 412 : 18 18 201000 502547 502547 702985 703709 903971\n", |
| 52 | "verdict": "PASS", |
| 53 | "wall_ms": 4547 |
| 54 | }, |
| 55 | { |
| 56 | "binary_sha256": "7c38dc211b1ea8664010ed630131342c78ddf7daad85165fc44cef190a1ab0b8", |
| 57 | "case": "mut399-lost-no-requeue", |
| 58 | "compile_exit": 0, |
| 59 | "expected_exit": 72, |
| 60 | "issue": "DRA-399", |
| 61 | "mutation": { |
| 62 | "file": "seed/node/sched.om", |
| 63 | "from": "if ne and get sjfl j 1 0\nsp_ready j\nelse\n", |
| 64 | "to": "if false\nsp_ready j\nelse\n" |
| 65 | }, |
| 66 | "run_exit": 72, |
| 67 | "source_sha256": "1713d0f76dfcd520fe738827ddb6c2eb9d9d40af04baffe6f090432d2c3d53e9", |
| 68 | "stderr": "", |
| 69 | "stdout": "bench 1 0 0 1504708 601106 403252 1404 1405 54720 0 0 0 0 0 8 412 : 3 601103 902262 902262 1102648 1102994 1303561 1303627\nbench 1 1 0 1306251 198014 675334 1203 1204 30327 77056 0 0 1 0 8 412 : 14 14 200308 401288 602272 803265 1104406 1104406\nbench 1 2 0 1306261 16 501365 1210 1211 30081 77504 64 0 1 0 8 412 : 8 8 201265 502283 502283 703262 703396 904255\nbench 1 3 0 1507707 23 524151 1414 1415 55353 90560 64 0 2 1 8 412 : 11 11 201070 201107 402076 402076 603615 1206640\nbench 2 0 0 2108181 20 533428 1932 1939 53056 0 0 0 0 0 14 412 : 10 10 301192 319650 601956 620947 902959 921971 1203417\nbench 2 1 0 2109573 19 721559 1953 1960 55296 125440 0 0 0 0 14 412 : 9 9 301844 301844 602683 602711 904187 904339 1205707\nbench 2 2 0 1807094 44 537649 1686 1693 18757 108352 1088 0 5 3 14 412 : 22 22 150312 151139 451588 451681 752567 301154 903491 1053801 1205023 451775\nbench 2 3 0 1807236 28 500791 1697 1704 19138 109056 1088 0 2 1 14 412 : 14 14 150122 151144 451119 452065 299985 753151 902421 151528 1203956 1204744 301354\nbench 3 0 0 1606865 51 381188 1494 1496 7040 0 0 0 0 0 13 412 : 25 25 300842 300850 601867 601867 902859 200395 201036 401418 401418\nbench 3 1 0 1606016 44 543041 1499 1501 6912 96064 0 0 0 0 13 412 : 22 22 301013 301013 602450 602450 903013 200388 200450 401376 401376\nbench 3 2 0 1607100 35 447844 1504 1506 6469 96384 192 0 5 2 13 412 : 17 17 100716 200954 301329 504073 603091 806956 803322 1105079 1007549 1208490 1305338\nbench 3 3 0 1606925 20 607924 1437 1439 6724 92096 192 0 4 3 13 412 : 10 10 100592 200358 301352 401312 602982 702939 904187 1004238 1104317 1204590 1305302\nbench 4 0 0 4022167 1811716 1353627 3609 3610 115264 0 0 0 0 0 24 412 : 7 7 402167 402167 554943 655409 655409 1057401 1108375 1108375 1208896 1360056 1510261 1561049 1963078 1963078 2114395 2214831 2214831 2616738 2667766 2667766 2768301 3069654\nbench 4 1 0 3413162 201617 1190170 3167 3168 48830 202752 0 0 1 0 24 412 : 8 8 101070 150652 249681 402232 401151 552217 652653 954050 903744 853958 1405900 1255348 1506136 1307296 1556319 1458455 1707431 1807512 2209327 2059015 2359994 2460538\nbench 4 2 0 3513929 400621 1225516 3280 3281 61569 209984 256 0 9 3 24 412 : 8 8 100626 149498 149498 100536 501780 252104 352645 752353 853784 553677 704542 1105691 1206366 1005526 1406352 1155669 1657113 1507548 2058760 1758331 2210621 2460798\nbench 4 3 0 3654858 138580 1347834 3361 3362 75369 215168 384 0 9 4 24 412 : 16 16 100482 50088 250251 502256 51338 1980 552223 774343 474079 540806 1026361 1126763 1144373 1445906 1078333 1496237 1898033 1899364 2149322 1999473 2450370 2702594\nbench 5 0 0 3015933 33 1435979 2788 2789 1984 0 0 0 0 0 30 412 : 16 16 100528 302199 304937 405461 606176 607199 605120 603672 602598 600960 601881 601652 601632 601935 601235 601932 601007 600940 600891 600938 600827 600960 601664 600965 601513 600961 602019 601902\nbench 5 1 0 3015356 18 1225365 2646 2647 2048 169408 0 0 0 0 30 412 : 9 9 100319 301306 303283 401828 602758 604243 601966 601938 601590 602206 602050 601956 601851 601824 601981 601312 601398 602127 601711 600552 602046 601751 601924 601915 602077 602707 601115 601592\nbench 5 2 0 3014894 25 917492 2838 2839 1610 181696 896 0 10 1 30 412 : 12 12 100580 200965 200983 301532 199963 199816 601751 703392 199840 1004596 1004664 299590 1003702 99584 903124 902430 500207 903428 99434 201333 1001838 99497 1000834 1105459 1101959 1000230 604264\nbench 5 3 0 3014317 18 1051195 2792 2793 1608 178752 960 0 8 0 30 412 : 9 9 100441 100441 99469 301068 301078 199102 601604 501062 199115 903079 602622 199307 1002351 602034 199966 602574 1003997 199958 1002859 603230 199503 1003001 601590 501605 1002950 401367 1002719 701630\n", |
| 70 | "verdict": "PASS", |
| 71 | "wall_ms": 66755 |
| 72 | } |
| 73 | ], |
| 74 | "compiler": { |
| 75 | "path": "seed/out/omc", |
| 76 | "sha256": "5f90edea61bac241398df5036990d899361a5acd9decb37954ce088ec0f6f6df" |
| 77 | }, |
| 78 | "cpu_affinity": [ |
| 79 | 8, |
| 80 | 9 |
| 81 | ], |
| 82 | "execution": "NATIVE Linux AArch64 host CPU (DGX Spark host, no GPU opened)", |
| 83 | "hashes": { |
| 84 | "seed/node/bench-gate.om": "eb1e2360de9c242233a9bfe6dc5270262ba43f2138eceffba6c8b5588c8ac7f4", |
| 85 | "seed/node/bench-test.om": "63cc43a913ec43840489d6fe67a3c2b1548d1e0e8ada416a059954dbcd201884", |
| 86 | "seed/node/pool.om": "e7fba928bdc5c4194e7aee42109265de4f172d2b197946133d788b2dbcb30ccc", |
| 87 | "seed/node/sched.om": "ab1fa068aac2cf200460ec48a978e1e850607ed3100f62a9cc384dbba08014f9", |
| 88 | "seed/node/super.om": "d104ac8116c6df57fdc93f03791d7315e5b60875d8d6177480ef9967b6f53d5a", |
| 89 | "seed/node/transport.om": "d0dd69ef5e0b71294a2390b3526865d62ca07accd269b9ce57a028339e34f6da" |
| 90 | }, |
| 91 | "issue": "DRA-399", |
| 92 | "platform": "Linux 7.0.0-1019-nvidia aarch64 spark-b87b", |
| 93 | "project": "P-DRA-14", |
| 94 | "script": { |
| 95 | "binary_sha256": "ece552af48c3edf11e74f2bef24e1f84669d982b64a5c120e0129addd6f54a52", |
| 96 | "cases": { |
| 97 | "cases": [ |
| 98 | { |
| 99 | "case": "bench-gate", |
| 100 | "compose": [ |
| 101 | "seed/node/transport.om", |
| 102 | "seed/node/pool.om", |
| 103 | "seed/node/super.om", |
| 104 | "seed/node/sched.om", |
| 105 | "seed/node/bench-test.om" |
| 106 | ], |
| 107 | "expect": 0, |
| 108 | "gate": "seed/node/bench-gate.om", |
| 109 | "issue": "DRA-399", |
| 110 | "repeat": 1, |
| 111 | "stdout_has": [ |
| 112 | "PASS node bench" |
| 113 | ], |
| 114 | "timeout": 3000 |
| 115 | }, |
| 116 | { |
| 117 | "case": "mut399-fits-ignores-capacity", |
| 118 | "expect": 70, |
| 119 | "fragments": [ |
| 120 | "seed/node/transport.om", |
| 121 | "seed/node/pool.om", |
| 122 | "seed/node/super.om", |
| 123 | "seed/node/sched.om", |
| 124 | "seed/node/bench-test.om" |
| 125 | ], |
| 126 | "issue": "DRA-399", |
| 127 | "mutate": [ |
| 128 | "seed/node/sched.om", |
| 129 | "if gt sp_need req k a\nret false\n", |
| 130 | "if false\nret false\n" |
| 131 | ], |
| 132 | "timeout": 1800, |
| 133 | "why": "sp_fits never refuses for capacity. Scenario 1, arm 0, repetition 0: h (2 CPU) and H (4 CPU) are ready with two idle workers, so both are assigned and hold 6 of the 4 CPU; bn_inv (called at every sample) trips the capacity invariant: 70." |
| 134 | }, |
| 135 | { |
| 136 | "case": "mut399-reserve-youngest", |
| 137 | "expect": 71, |
| 138 | "fragments": [ |
| 139 | "seed/node/transport.om", |
| 140 | "seed/node/pool.om", |
| 141 | "seed/node/super.om", |
| 142 | "seed/node/sched.om", |
| 143 | "seed/node/bench-test.om" |
| 144 | ], |
| 145 | "issue": "DRA-399", |
| 146 | "mutate": [ |
| 147 | "seed/node/sched.om", |
| 148 | "if lt get sjarr j get sjarr o\no = j\n", |
| 149 | "if gt get sjarr j get sjarr o\no = j\n" |
| 150 | ], |
| 151 | "timeout": 1800, |
| 152 | "why": "The reservation goes to the youngest ready job at the bypass budget instead of the oldest. The first contested reservation (another ready job also at the budget, which bn_fair counts) picks a younger job, and bn_fair's oldest-first check trips: 71. Exits 70 and 72 are unaffected: capacity is still checked, and the reserved job still runs." |
| 153 | }, |
| 154 | { |
| 155 | "case": "mut399-lost-no-requeue", |
| 156 | "expect": 72, |
| 157 | "fragments": [ |
| 158 | "seed/node/transport.om", |
| 159 | "seed/node/pool.om", |
| 160 | "seed/node/super.om", |
| 161 | "seed/node/sched.om", |
| 162 | "seed/node/bench-test.om" |
| 163 | ], |
| 164 | "issue": "DRA-399", |
| 165 | "mutate": [ |
| 166 | "seed/node/sched.om", |
| 167 | "if ne and get sjfl j 1 0\nsp_ready j\nelse\n", |
| 168 | "if false\nsp_ready j\nelse\n" |
| 169 | ], |
| 170 | "timeout": 1800, |
| 171 | "why": "A rerunnable job on a lost worker is not put back to ready. Scenarios 1-5 lose no worker and pass; in scenario 6, arm 0, worker 0 is SIGKILLed while busy, its job is never requeued or reviewed, and the 20 s deadline check in bn_loop trips: 72." |
| 172 | } |
| 173 | ], |
| 174 | "issue": "DRA-399", |
| 175 | "statuses": { |
| 176 | "DRA-399": "IMPLEMENTED; bench EXERCISED only by this receipt; not QUALIFIED; not MERGED; not DEPLOYED", |
| 177 | "expected_exits": "derived from the check site each mutant targets (field why), before the run", |
| 178 | "gpu": "NOT_RUN (not involved)", |
| 179 | "timing": "wall times depend on the cores the run was given; they are recorded with the bench output, not claimed as speed" |
| 180 | } |
| 181 | }, |
| 182 | "cases_sha256": "80920f1077b0c874ec97245ecaa09b4da1338e122aeab52d9e16b5fbaad5e548", |
| 183 | "path": "seed/node/schedrcpt.om", |
| 184 | "sha256": "56bc2e0e36d70795195f5194172f372955e0af56ee68a41b1b3c53d2eaf9c0a4", |
| 185 | "source": "note SPDX-License-Identifier: Apache-2.0\nnote schedrcpt.om: the scheduler-policy receipt driver of seed/node (P-DRA-14 lane). It replaces\nnote ~/handoffs/hive/sched/bin/receipt.py, which produced the DRA-395/396 and DRA-397 r1 receipts,\nnote and keeps that driver's case-file format, checks, refusals and receipt layout.\nnote Build (json.om appended, it supplies the JSON reader):\nnote cat seed/node/schedrcpt.om seed/json/json.om | seed/out/omc > build/node/schedrcpt\nnote Use, from the repository root under test:\nnote DRIVER_TREE/build/node/schedrcpt CASES.json OUTDIR_REL [--write]\nnote The source hashed into the receipt is DRIVER_TREE/seed/node/schedrcpt.om, found from argv[0].\nnote Exit 0 when every case passes, 1 when one fails, 2 on a driver error, 3 on a dirty tree,\nnote 4 on a mutant whose pattern is not unique, 5 when a gate is not the concatenation of its parts.\nnote\nnote The SHA-256 functions below are copied from om/sha256/sha256-om2.om lines 21-317 at 7f4e1a44\nnote (export dropped, sha256_final's digest parameter an edit instead of an out), since omc\nnote composes one source text and json.om is the only other part.\nom2\n\nlayout shactx 104\nfield state uint 8 at 0 little\nfield count ulong at 32 little\nfield buf uchar 64 at 40 little\nend\n\nnote ======== driver state ========\nnote gv: scalar slots. gl: signed slots (0 expect, 1 compile exit, 2 last run code).\nnote lst: nine string lists of 2048 arena indices (0 fragments, 1 compose, 2 args, 3 stdout_has,\nnote 4 clean, 5 mutation files, 6 mutation patterns, 7 replacements, 8 hashed files of the receipt).\nnote hsl: hex digests (0 source, 1 binary, 2 scratch). Run codes: 0..255 exit, -N signal N,\nnote 4096 timeout, 4097 no run.\nconst VOBN ulong 0\nconst VDEP ulong 1\nconst VSAN ulong 2\nconst VSON ulong 3\nconst VLN ulong 4\nconst VKPN ulong 5\nconst VKSN ulong 6\nconst VWDN ulong 7\nconst VCWN ulong 8\nconst VPBN ulong 9\nconst VPKN ulong 10\nconst VPKC ulong 11\nconst VPASS ulong 12\nconst VFAIL ulong 13\nconst VSRCN ulong 14\nconst VFBN ulong 15\nconst VTMO ulong 32\nconst VREP ulong 33\nconst VOM2 ulong 34\nconst VCN ulong 35\nconst VGATE ulong 36\nconst VWALL ulong 37\nconst VNRUN ulong 38\nconst VFDO ulong 39\nconst VFDE ulong 40\nconst VCASP ulong 41\nconst VOUT ulong 42\nconst VDRV ulong 43\nconst VBIN ulong 44\nconst VHEAD ulong 45\nconst VTREE ulong 46\nconst VTISS ulong 47\nconst VTSTA ulong 48\nconst VTCAS ulong 49\nconst VOK ulong 50\nconst VNOUT ulong 51\nconst VPLAT ulong 52\nconst NONE ulong 4294967295\nconst CTMO long 4096\nconst CNONE long 4097\n\nglobal rb uchar 16777216\nglobal sx uchar 16777216\nglobal gsrc uchar 16777216\nglobal fb uchar 16777216\nglobal fb2 uchar 16777216\nglobal sa uchar 4194304\nglobal so ulong 65536\nglobal sl ulong 65536\nglobal lst ulong 18432\nglobal gv ulong 64\nglobal gl long 16\nglobal ctok ulong 16\nglobal kp uchar 1048576\nglobal ks ulong 196608\nglobal pb uchar 8192\nglobal rp uchar 8192\nglobal wd uchar 4096\nglobal cw uchar 4096\nglobal lb uchar 65536\nglobal nbuf uchar 32\nglobal hsl uchar 256\nglobal rcod long 65536\nglobal rmis uchar 65536\nglobal dst ulong 128\nglobal stb uchar 128\nglobal pk uchar 4096\nglobal ocod long 1024\nglobal omis uchar 1024\nglobal ocnt ulong 1024\nglobal oord ulong 1024\nglobal okb uchar 32768\nglobal okl ulong 1024\n\ntext tpref \"schedrcpt: \"\ntext tnl \"\\n\"\ntext tusage \"usage: build/node/schedrcpt CASES.json OUTDIR_REL [--write], run from the repository root\"\ntext tsuffix \"build/node/schedrcpt\"\ntext tsrcrel \"seed/node/schedrcpt.om\"\ntext tomcabs \"/seed/out/omc\"\ntext tomcrel \"seed/out/omc\"\ntext tgit \"/usr/bin/git\"\ntext tdevnull \"/dev/null\"\ntext twrite \"--write\"\ntext tmfd \"schedrcpt\"\ntext twdpre \"/tmp/schedrcpt-\"\ntext ttmppre \"/tmp/sched-receipt-\"\ntext trcpre \"receipt.\"\ntext tjson \".json\"\ntext tom2 \"om2\\n\"\ntext tbuild \"build/\"\ntext tstatus \"status\"\ntext tporc \"--porcelain\"\ntext tuntr \"--untracked-files=normal\"\ntext trevp \"rev-parse\"\ntext thead \"HEAD\"\ntext thtree \"HEAD^{tree}\"\ntext tostype \"/proc/sys/kernel/ostype\"\ntext tosrel \"/proc/sys/kernel/osrelease\"\ntext thost \"/proc/sys/kernel/hostname\"\ntext tpstat \"/proc/self/status\"\ntext tcpus \"Cpus_allowed_list:\"\ntext tmach \"aarch64\"\ntext tfull \"receipt buffer full (16 MiB)\"\ntext tarena \"string arena full\"\ntext tlist \"list longer than 2048 entries\"\ntext tschema \"case file does not match the schema (see seed/node/README.md)\"\ntext tlong \"string too long (64 KiB) or not decodable\"\ntext tdupkey \"duplicate object key in the case file\"\ntext tpath \"path longer than 4095 bytes\"\ntext targs \"argument list exceeds 64 entries or 4096 bytes\"\ntext tbig \"file larger than its buffer (16 MiB)\"\ntext tread \"read failed\"\ntext topen \"cannot open a file named by the case file or the run\"\ntext tcasesf \"cannot read the case file (at most 983039 bytes)\"\ntext tnotjson \"case file is not valid JSON\"\ntext tgitf \"git failed (run from the root of a git checkout)\"\ntext tfork \"fork failed\"\ntext twait \"waitpid failed\"\ntext tmkwork \"cannot create the work directory\"\ntext tself \"cannot locate the driver: invoke it by a path ending in build/node/schedrcpt\"\ntext twfail \"cannot write the receipt (refusing to overwrite an existing one)\"\ntext tbn \"build/node\"\ntext tbnf \"cannot create build/node in the tree under test\"\ntext tdepth \"nesting too deep\"\ntext trefd \"REFUSED: dirty tree\\n\"\ntext trefm \"REFUSED: mutant \"\ntext trefnf \" is not one of its fragments\\n\"\ntext trefpo \": pattern occurs \"\ntext treftm \" times\\n\"\ntext tref \"REFUSED: \"\ntext trefc \" is not the concatenation\\n\"\ntext tpass \"PASS\"\ntext tfailw \"FAIL\"\ntext texpe \" expect=\"\ntext tgot \" got=\"\ntext tcomp \" compile=\"\ntext truns \" runs=\"\ntext ttimeout \"timeout\"\ntext tpynone \"None\"\ntext tmiss \" missing-stdout\"\ntext tnull \"null\"\ntext ttrue \"true\"\ntext tfalse \"false\"\ntext tsumm \"summary pass=\"\ntext tsfail \" fail=\"\ntext tsdig \" receipt_sha256=\"\ntext tproj \"P-DRA-14\"\ntext texec \"NATIVE Linux AArch64 host CPU (DGX Spark host, no GPU opened)\"\ntext kcase \"case\"\ntext kissue \"issue\"\ntext kfrag \"fragments\"\ntext kgate \"gate\"\ntext kcomp \"compose\"\ntext kom2 \"om2\"\ntext kmut \"mutate\"\ntext kargs \"args\"\ntext kexp \"expect\"\ntext ktmo \"timeout\"\ntext kclean \"clean\"\ntext khas \"stdout_has\"\ntext krep \"repeat\"\ntext kstat \"statuses\"\ntext kcases \"cases\"\ntext kbsha \"binary_sha256\"\ntext kcexit \"compile_exit\"\ntext kexpx \"expected_exit\"\ntext kmutat \"mutation\"\ntext krunx \"run_exit\"\ntext ksrcsha \"source_sha256\"\ntext kstderr \"stderr\"\ntext kstdout \"stdout\"\ntext kverd \"verdict\"\ntext kwall \"wall_ms\"\ntext kouts \"outcomes\"\ntext kruns \"runs\"\ntext kfile \"file\"\ntext kfrom \"from\"\ntext kto \"to\"\ntext kchecks \"checks\"\ntext kcompil \"compiler\"\ntext kpath \"path\"\ntext ksha \"sha256\"\ntext kaffin \"cpu_affinity\"\ntext kexecu \"execution\"\ntext khashes \"hashes\"\ntext kplat \"platform\"\ntext kproj \"project\"\ntext kscript \"script\"\ntext kcsha \"cases_sha256\"\ntext ksource \"source\"\ntext kscom \"source_commit\"\ntext kstree \"source_tree\"\ntext ksumm \"summary\"\ntext kpass \"pass\"\ntext kfail \"fail\"\ntext ktime \"timestamp_utc\"\n\n\nnote K[0..63]: the first 32 bits of the fractional parts of the cube roots of the first 64 primes.\nnote Copied mechanically from seed/qualification/om2/fixtures/sha256-k.dec (tool-computed, never typed).\nfn kinit k edit uint 64 to void\nput k 0 0x428a2f98\nput k 1 0x71374491\nput k 2 0xb5c0fbcf\nput k 3 0xe9b5dba5\nput k 4 0x3956c25b\nput k 5 0x59f111f1\nput k 6 0x923f82a4\nput k 7 0xab1c5ed5\nput k 8 0xd807aa98\nput k 9 0x12835b01\nput k 10 0x243185be\nput k 11 0x550c7dc3\nput k 12 0x72be5d74\nput k 13 0x80deb1fe\nput k 14 0x9bdc06a7\nput k 15 0xc19bf174\nput k 16 0xe49b69c1\nput k 17 0xefbe4786\nput k 18 0x0fc19dc6\nput k 19 0x240ca1cc\nput k 20 0x2de92c6f\nput k 21 0x4a7484aa\nput k 22 0x5cb0a9dc\nput k 23 0x76f988da\nput k 24 0x983e5152\nput k 25 0xa831c66d\nput k 26 0xb00327c8\nput k 27 0xbf597fc7\nput k 28 0xc6e00bf3\nput k 29 0xd5a79147\nput k 30 0x06ca6351\nput k 31 0x14292967\nput k 32 0x27b70a85\nput k 33 0x2e1b2138\nput k 34 0x4d2c6dfc\nput k 35 0x53380d13\nput k 36 0x650a7354\nput k 37 0x766a0abb\nput k 38 0x81c2c92e\nput k 39 0x92722c85\nput k 40 0xa2bfe8a1\nput k 41 0xa81a664b\nput k 42 0xc24b8b70\nput k 43 0xc76c51a3\nput k 44 0xd192e819\nput k 45 0xd6990624\nput k 46 0xf40e3585\nput k 47 0x106aa070\nput k 48 0x19a4c116\nput k 49 0x1e376c08\nput k 50 0x2748774c\nput k 51 0x34b0bcb5\nput k 52 0x391c0cb3\nput k 53 0x4ed8aa4a\nput k 54 0x5b9cca4f\nput k 55 0x682e6ff3\nput k 56 0x748f82ee\nput k 57 0x78a5636f\nput k 58 0x84c87814\nput k 59 0x8cc70208\nput k 60 0x90befffa\nput k 61 0xa4506ceb\nput k 62 0xbef9a3f7\nput k 63 0xc67178f2\nend\n\nnote H(0): the first 32 bits of the fractional parts of the square roots of the first 8 primes\nnote (fixtures/sha256-iv.dec).\nfn iv s edit uint 8 to void\nput s 0 0x6a09e667\nput s 1 0xbb67ae85\nput s 2 0x3c6ef372\nput s 3 0xa54ff53a\nput s 4 0x510e527f\nput s 5 0x9b05688c\nput s 6 0x1f83d9ab\nput s 7 0x5be0cd19\nend\n\nnote Message schedule of the block m[o .. o+64). w is fresh: its incoming contents are never read.\nnote The compiler proves that every get of w reads an element written earlier in this function\nnote (error 27 otherwise): w[0..16) are the block's big-endian words, w[16..64) the FIPS recurrence.\nfn sched w edit uint 64 fresh m view uchar * o ulong to void\nq = ulong 0\nx = uint 0\ny = uint 0\nfor i ulong 16 unroll\nq = add o mul i 4\nx = uint get m q\nx = or shl x 8 uint get m add q 1\nx = or shl x 8 uint get m add q 2\nput w i or shl x 8 uint get m add q 3\nend\nfor i ulong 48 unroll\nx = get w add i 1\ny = get w add i 14\nx = add add get w i get w add i 9 xor xor rotr x 7 rotr x 18 shr x 3\nput w add i 16 add x xor xor rotr y 17 rotr y 19 shr y 10\nend\nend\n\nnote The 64 rounds on the chaining value s. One round body, emitted 64 times by unroll; i is a constant\nnote in each copy, so get kt i and get w i need no run-time check. uint arithmetic wraps mod 2^32.\nnote Ch(e,f,g) = (e and f) xor (not e and g) is written g xor (e and (f xor g)); Maj(a,b,c) =\nnote (a and b) xor (a and c) xor (b and c) is written (a and b) or (c and (a or b)). Both are bitwise\nnote identities. h first becomes T1, then T1 + T2, which is the next a; the names then shift by one.\nnote The sums are built a term per line and each Sigma in two lines through t: 12 names are live, and\nnote omc hands out 16 registers with no spilling (error 12 under compiler-s1/s2 for longer lines).\nfn rounds s edit uint 8 w view uint 64 kt view uint 64 to void\na = get s 0\nb = get s 1\nc = get s 2\nd = get s 3\ne = get s 4\nf = get s 5\ng = get s 6\nh = get s 7\nt = uint 0\nfor i ulong 64 unroll\nh = add h get kt i\nh = add h get w i\nt = xor rotr e 6 rotr e 11\nt = xor t rotr e 25\nh = add h t\nh = add h xor g and e xor f g\nd = add d h\nt = xor rotr a 2 rotr a 13\nt = xor t rotr a 22\nh = add h t\nt = and c or a b\nh = add h or and a b t\nt = h\nh = g\ng = f\nf = e\ne = d\nd = c\nc = b\nb = a\na = t\nend\nput s 0 add get s 0 a\nput s 1 add get s 1 b\nput s 2 add get s 2 c\nput s 3 add get s 3 d\nput s 4 add get s 4 e\nput s 5 add get s 5 f\nput s 6 add get s 6 g\nput s 7 add get s 7 h\nend\n\nnote One block m[o .. o+64) into s. sched and rounds stay calls: inlined, their names would share\nnote one 16-register frame with this function's parameters (no spilling, error 12).\nfn compress s edit uint 8 w edit uint 64 kt view uint 64 m view uchar * o ulong to void\nsched w m o\nrounds s w kt\nend\n\nnote The whole blocks of m (len m is a multiple of 64 and at most 2^25, so under 2^19 passes).\nfn run s edit uint 8 w edit uint 64 kt view uint 64 m view uchar * to void\nfor j ulong shr len m 6\ncompress s w kt m shl j 6\nend\nend\n\nnote The whole blocks of m (len m a multiple of 64). A rolled loop traps 4 after 1000000 passes\nnote (OMEGESE.md section 2; omc s_for), so m is cut into runs of 2^25 bytes (2^19 blocks):\nnote len m = top * 2^44 + mid * 2^25 + rest, and no loop passes 2^20 times. top reaches 1000000\nnote only above 1.7e19 bytes, which no AArch64 address space holds.\nfn blocks s edit uint 8 w edit uint 64 kt view uint 64 m view uchar * to void\nq = ulong 0\nfor a ulong shr len m 44\nfor b ulong 0x80000\nrun s w kt part m q 0x2000000\nq = add q 0x2000000\nend\nend\nfor b ulong and shr len m 25 0x7ffff\nrun s w kt part m q 0x2000000\nq = add q 0x2000000\nend\nrun s w kt part m q sub len m q\nend\n\nnote Pad the k pending bytes already in p (k < 64; p was all zero past them): 0x80, zeros, and the\nnote 64-bit big-endian bit length of the n-byte message in the last 8 bytes of one or two blocks.\nfn finish s edit uint 8 w edit uint 64 kt view uint 64 p edit uchar 128 k ulong n ulong to void\nput p k 0x80\ne = ulong 64\nif ge k 56\ne = 128\nend\nbits = shl n 3\nfor i ulong 8 unroll\nput p sub e add i 1 uchar and shr bits mul i 8 0xff\nend\ncompress s w kt view p 0\nif eq e 128\ncompress s w kt view p 64\nend\nend\n\nfn sha256_init c edit shactx to void\ns = new uint 8 0\niv s\nfor i ulong 8 unroll\nput c state i get s i\nend\nput c count 0\nend\n\nnote k bytes of d from o into the context's buffer at bi (bi + k <= 64). A function of its own: inside\nnote absorb the copy loop needs more than the 16 registers (error 12 under compiler-s4).\nfn tobuf c edit shactx bi ulong d view uchar * o ulong k ulong to void\nfor i ulong k\nput c buf add bi i get d add o i\nend\nend\n\nnote Whole blocks are hashed straight from d; the bytes that complete a pending block go through blk.\nfn absorb c edit shactx d view uchar * bi ulong to void\nn = len d\ns = new uint 8 0\nw = new uint 64 0\nkt = new uint 64 0\nblk = new uchar 64 0\nkinit kt\nfor i ulong 8 unroll\nput s i get c state i\nend\noff = ulong 0\nif gt bi 0\noff = sub 64 bi\nfor i ulong bi\nput blk i get c buf i\nend\nfor i ulong off\nput blk add bi i get d i\nend\ncompress s w kt view blk 0\nend\nnb = shr sub n off 6\nblocks s w kt part d off shl nb 6\noff = add off shl nb 6\ntobuf c 0 d off sub n off\nfor i ulong 8 unroll\nput c state i get s i\nend\nend\n\nnote Any length, including 0 and >= 2^32. lt n sub 64 bi cannot wrap (bi < 64); add bi n could.\nfn sha256_update c edit shactx d view uchar * to void\nn = len d\ncnt = get c count\nbi = and cnt 63\nput c count add cnt n\nif lt n sub 64 bi\ntobuf c bi d 0 n\nret\nend\nabsorb c d bi\nend\n\nfn sha256_final c edit shactx o edit uchar 32 to void\ns = new uint 8 0\nw = new uint 64 0\nkt = new uint 64 0\np = new uchar 128 0\nv = ulong 0\nkinit kt\nfor i ulong 8 unroll\nput s i get c state i\nend\ncnt = get c count\nk = and cnt 63\nfor i ulong k\nput p i get c buf i\nend\nfinish s w kt p k cnt\nfor i ulong 8 unroll\nv = ulong get s i\nfor j ulong 4 unroll\nput o add mul i 4 j uchar and shr v sub 24 mul j 8 0xff\nend\nend\nend\n\nnote ======== messages and the line buffer ========\n\nnote die: one line on stderr and exit (2 for driver errors)\nfn die t view uchar * code int to void\nr = write 2 tpref 0 len tpref\nr = write 2 t 0 len t\nr = write 2 tnl 0 1\nexit code\nend\n\nfn l_b c uchar to void\nn = get gv VLN\nif lt n len lb\nput lb n c\nput gv VLN add n 1\nend\nend\n\nfn l_txt t view uchar * to void\nfor i ulong len t\nl_b get t i\nend\nend\n\nfn l_sa x ulong to void\np = get so x\nfor i ulong get sl x\nl_b get sa add p i\nend\nend\n\nnote numfmt: decimal digits of v into nb; returns the length\nfn numfmt v long to ulong\nb = new uchar 24 0\nu = ulong 0\nng = false\nif lt v 0\nng = true\nu = ulong neg v\nelse\nu = ulong v\nend\nk = ulong 0\nwhile lt k 24 bound 24\nput b k uchar add 48 rem u 10\nk = add k 1\nu = div u 10\nif eq u 0\nbreak\nend\nend\nw = ulong 0\nif ng\nput nbuf 0 uchar 45\nw = 1\nend\nwhile gt k 0 bound 24\nk = sub k 1\nput nbuf w get b k\nw = add w 1\nend\nret w\nend\n\nfn l_num v long to void\nn = numfmt v\nfor i ulong n\nl_b get nbuf i\nend\nend\n\nfn l_flush fd int to void\nn = get gv VLN\nr = write fd lb 0 n\nput gv VLN 0\nend\n\nnote l_code: a run code as Python prints it (an int, timeout, or None)\nfn l_code v long to void\nif eq v CTMO\nl_txt ttimeout\nret\nend\nif eq v CNONE\nl_txt tpynone\nret\nend\nl_num v\nend\n\nnote ======== JSON output: python json.dumps(indent=2, sort_keys=True, ensure_ascii=True) ========\n\nfn ob_b c uchar to void\nn = get gv VOBN\nif ge n len rb\ndie tfull 2\nend\nput rb n c\nput gv VOBN add n 1\nend\n\nfn o_txt t view uchar * to void\nfor i ulong len t\nob_b get t i\nend\nend\n\nfn o_qtxt t view uchar * to void\nob_b uchar 34\no_txt t\nob_b uchar 34\nend\n\nfn o_num v long to void\nn = numfmt v\nfor i ulong n\nob_b get nbuf i\nend\nend\n\nfn o_open c uchar to void\nob_b c\nd = add get gv VDEP 1\nif ge d len dst\ndie tdepth 2\nend\nput dst d 0\nput gv VDEP d\nend\n\nfn o_item to void\nd = get gv VDEP\nif gt get dst d 0\nob_b uchar 44\nend\nob_b uchar 10\nfor i ulong mul d 2\nob_b uchar 32\nend\nput dst d add get dst d 1\nend\n\nfn o_close c uchar to void\nd = get gv VDEP\nif gt get dst d 0\nob_b uchar 10\nfor i ulong mul sub d 1 2\nob_b uchar 32\nend\nend\nob_b c\nput gv VDEP sub d 1\nend\n\nfn o_colon to void\nob_b uchar 58\nob_b uchar 32\nend\n\nfn o_key t view uchar * to void\no_item\no_qtxt t\no_colon\nend\n\nfn hexc h ulong to uchar\nif lt h 10\nret uchar add 48 h\nend\nret uchar add 87 h\nend\n\nfn o_hex slot ulong to void\nob_b uchar 34\nfor i ulong 64\nob_b get hsl add mul slot 64 i\nend\nob_b uchar 34\nend\n\nfn o_u4 v ulong to void\nob_b uchar 92\nob_b uchar 117\nfor i ulong 4\nob_b hexc and shr v mul sub 3 i 4 15\nend\nend\n\nfn o_bs c uchar to void\nob_b uchar 92\nob_b c\nend\n\nnote o_asc: one ASCII byte as a JSON string character (Python ensure_ascii)\nfn o_asc c ulong to void\nif eq c 34\no_bs uchar 34\nret\nend\nif eq c 92\no_bs uchar 92\nret\nend\nif eq c 10\no_bs uchar 110\nret\nend\nif eq c 13\no_bs uchar 114\nret\nend\nif eq c 9\no_bs uchar 116\nret\nend\nif eq c 8\no_bs uchar 98\nret\nend\nif eq c 12\no_bs uchar 102\nret\nend\nif or lt c 32 eq c 127\no_u4 c\nret\nend\nob_b uchar c\nend\n\nfn o_cp cp ulong to void\nif lt cp 65536\no_u4 cp\nret\nend\nv = sub cp 65536\no_u4 add 55296 shr v 10\no_u4 add 56320 and v 1023\nend\n\nnote u8dec: decode the UTF-8 sequence at sx[i] (end e). Returns the code point or U+FFFD in the\nnote low 32 bits and the bytes consumed above them; an invalid sequence consumes its maximal\nnote subpart, as Python's bytes.decode(errors='replace') does\nfn u8dec i ulong e ulong to ulong\nc = ulong get sx i\nneed = ulong 0\nlo = ulong 128\nhi = ulong 191\ncp = ulong 0\nif and ge c 194 le c 223\nneed = 1\ncp = and c 31\nend\nif and ge c 224 le c 239\nneed = 2\ncp = and c 15\nif eq c 224\nlo = 160\nend\nif eq c 237\nhi = 159\nend\nend\nif and ge c 240 le c 244\nneed = 3\ncp = and c 7\nif eq c 240\nlo = 144\nend\nif eq c 244\nhi = 143\nend\nend\nif eq need 0\nret or 65533 shl ulong 1 32\nend\nk = ulong 1\nwhile le k need bound 4\nif ge add i k e\nret or 65533 shl k 32\nend\nd = ulong get sx add i k\nif or lt d lo gt d hi\nret or 65533 shl k 32\nend\ncp = or shl cp 6 and d 63\nlo = 128\nhi = 191\nk = add k 1\nend\nret or cp shl k 32\nend\n\nnote o_esc: sx[s, s+n) as a quoted JSON string\nfn o_esc s ulong n ulong to void\nob_b uchar 34\ni = s\ne = add s n\nwhile lt i e bound 16777217\nc = ulong get sx i\nif lt c 128\no_asc c\ni = add i 1\ncontinue\nend\nr = u8dec i e\no_cp and r 4294967295\ni = add i shr r 32\nend\nob_b uchar 34\nend\n\nfn o_str_sa x ulong to void\np = get so x\nn = get sl x\nfor i ulong n\nput sx i get sa add p i\nend\no_esc 0 n\nend\n\nfn o_ksa t view uchar * x ulong to void\no_key t\no_str_sa x\nend\n\nfn o_code v long to void\nif eq v CTMO\no_qtxt ttimeout\nret\nend\nif eq v CNONE\no_txt tnull\nret\nend\no_num v\nend\n\nnote ======== string arena and lists ========\n\nfn sput b view uchar * to ulong\nn = len b\nx = get gv VSON\np = get gv VSAN\nif or ge x len so gt add p n len sa\ndie tarena 2\nend\ni = ulong 0\nwhile lt i n bound 4194305\nput sa add p i get b i\ni = add i 1\nend\nput so x p\nput sl x n\nput gv VSAN add p n\nput gv VSON add x 1\nret x\nend\n\nnote sfb: fb[s, s+n) into the arena\nfn sfb s ulong n ulong to ulong\nb = new uchar 65536 0\nif gt n 65536\ndie tlong 2\nend\nfor i ulong n\nput b i get fb add s i\nend\nret sput part b 0 n\nend\n\nfn spop x ulong to void\nput gv VSAN get so x\nput gv VSON x\nend\n\nfn saeq x ulong t view uchar * to bool\nif ne get sl x len t\nret false\nend\np = get so x\nfor i ulong len t\nif ne get sa add p i get t i\nret false\nend\nend\nret true\nend\n\nnote sacmp: bytewise order of two arena strings (-1, 0, 1)\nfn sacmp x ulong y ulong to long\npx = get so x\npy = get so y\nnx = get sl x\nny = get sl y\nm = nx\nif lt ny m\nm = ny\nend\nfor i ulong m\na = get sa add px i\nb = get sa add py i\nif lt a b\nret -1\nend\nif gt a b\nret 1\nend\nend\nif lt nx ny\nret -1\nend\nif gt nx ny\nret 1\nend\nret 0\nend\n\nfn ladd k ulong x ulong to void\nc = get gv add 16 k\nif ge c 2048\ndie tlist 2\nend\nput lst add mul k 2048 c x\nput gv add 16 k add c 1\nend\n\nfn lget k ulong i ulong to ulong\nret get lst add mul k 2048 i\nend\n\nfn lcnt k ulong to ulong\nret get gv add 16 k\nend\n\nnote ======== path and argument builders ========\n\nfn pb_clr to void\nput gv VPBN 0\nend\n\nfn pb_b c uchar to void\nn = get gv VPBN\nif ge n 4095\ndie tpath 2\nend\nput pb n c\nput gv VPBN add n 1\nend\n\nfn pb_txt t view uchar * to void\nfor i ulong len t\npb_b get t i\nend\nend\n\nfn pb_sa x ulong to void\np = get so x\nfor i ulong get sl x\npb_b get sa add p i\nend\nend\n\nfn pb_wd to void\nfor i ulong get gv VWDN\npb_b get wd i\nend\nend\n\nfn pb_cw to void\nfor i ulong get gv VCWN\npb_b get cw i\nend\nend\n\nfn pb_hex slot ulong to void\nfor i ulong 64\npb_b get hsl add mul slot 64 i\nend\nend\n\nfn pb_open flags int mode int to long\nret fopen pb 0 get gv VPBN flags mode\nend\n\nnote pb_bin: the case binary's path, work dir / case name\nfn pb_bin to void\npb_clr\npb_wd\npb_b uchar 47\npb_sa get gv VCN\nend\n\nfn pk_clr to void\nput pk 0 0\nput pk 1 0\nput gv VPKN 2\nput gv VPKC 0\nend\n\nnote pk_pb: append pb as one record of the packed argument list\nfn pk_pb to void\nn = get gv VPBN\nw = get gv VPKN\nc = add get gv VPKC 1\nif or gt c 64 gt add add w 2 n 4096\ndie targs 2\nend\nput pk w uchar and n 255\nput pk add w 1 uchar shr n 8\nfor i ulong n\nput pk add add w 2 i get pb i\nend\nput gv VPKN add add w 2 n\nput gv VPKC c\nput pk 0 uchar and c 255\nput pk 1 uchar shr c 8\nend\n\nfn pk_txt t view uchar * to void\npb_clr\npb_txt t\npk_pb\nend\n\nnote ======== files ========\n\nnote rdfb: the whole of fd (from offset 0) into fb; returns the length\nfn rdfb fd int to ulong\nn = ulong 0\nw = true\nwhile w bound 100000\nk = pread fd fb n sub len fb n long n\nif lt k 0\ndie tread 2\nend\nif eq k 0\nret n\nend\nn = add n ulong k\nif ge n len fb\ndie tbig 2\nend\nend\nret n\nend\n\nnote rdpb: the file named by pb into fb\nfn rdpb to ulong\nfd = pb_open 524288 0\nif lt fd 0\nl_txt tpref\nfor i ulong get gv VPBN\nl_b get pb i\nend\nl_flush 2\ndie topen 2\nend\nn = rdfb int fd\nr = fclose int fd\nret n\nend\n\nfn fsize fd int to ulong\nr = fstat fd stb 0 128\nif lt r 0\ndie tread 2\nend\nv = ulong 0\nfor i ulong 8\nv = or v shl ulong get stb add 48 i mul i 8\nend\nret v\nend\n\nnote wrob: ob[0, n) or gsrc[0, n) (which 0) to fd\nfn wrall fd int which ulong n ulong to void\np = ulong 0\nwhile lt p n bound 1000000\nk = long 0\nif eq which 0\nk = write fd gsrc p sub n p\nelse\nk = write fd rb p sub n p\nend\nif le k 0\ndie twfail 2\nend\np = add p ulong k\nend\nend\n\nnote ======== SHA-256 (the copied om/sha256 functions) ========\n\nfn hfin c edit shactx slot ulong to void\no = new uchar 32 0\nsha256_final c o\nfor i ulong 32\nb = ulong get o i\nq = add mul slot 64 mul i 2\nput hsl q hexc shr b 4\nput hsl add q 1 hexc and b 15\nend\nend\n\nnote hfd: digest of everything in fd into hsl slot\nfn hfd fd int slot ulong to void\nc = new uchar 104 0\nch = new uchar 1048576 0\nsha256_init c\np = long 0\nw = true\nwhile w bound 100000000\nk = pread fd ch 0 1048576 p\nif lt k 0\ndie tread 2\nend\nif eq k 0\nbreak\nend\nsha256_update c part ch 0 ulong k\np = add p k\nend\nhfin c slot\nend\n\nfn hpb slot ulong to void\nfd = pb_open 524288 0\nif lt fd 0\ndie topen 2\nend\nhfd int fd slot\nr = fclose int fd\nend\n\nnote hglob: digest of gsrc[0, n) (which 0) or ob[0, n)\nfn hglob which ulong n ulong slot ulong to void\nc = new uchar 104 0\nch = new uchar 524288 0\nsha256_init c\np = ulong 0\nwhile lt p n bound 1000000\nm = sub n p\nif gt m 524288\nm = 524288\nend\nfor i ulong m\nif eq which 0\nput ch i get gsrc add p i\nelse\nput ch i get rb add p i\nend\nend\nsha256_update c part ch 0 m\np = add p m\nend\nhfin c slot\nend\n\nnote ======== processes ========\n\nfn spawn fi int fo int fe int grp bool to long\npid = fork\nif eq pid 0\nif grp\nr = setpgid 0 0\nend\nr = dupfd fi 0 0\nr = dupfd fo 1 0\nr = dupfd fe 2 0\nr = execprog pk 0 get gv VPKN\nexit 127\nend\nif lt pid 0\ndie tfork 2\nend\nif grp\nr = setpgid int pid int pid\nend\nret pid\nend\n\nnote wcode: exit status as Python's returncode (negative signal number when killed)\nfn wcode ws view uchar 4 to long\ns = or ulong get ws 0 shl ulong get ws 1 8\nsg = and s 127\nif eq sg 0\nret long and shr s 8 255\nend\nret neg long sg\nend\n\nfn waitblk pid long to long\nws = new uchar 4 0\nfor i ulong 100000\nr = waitpid int pid ws 0 4 0\nif eq r pid\nret wcode ws\nend\nif ne r -4\ndie twait 2\nend\nend\ndie twait 2\nret 0\nend\n\nnote waitto: reap pid within tmo ns, polling every millisecond. At the deadline the child's\nnote process group gets SIGKILL and the code is CTMO; after a normal exit the group is killed\nnote too, so no grandchild outlives the run\nfn waitto pid long tmo ulong to long\nws = new uchar 4 0\ndl = add ulong monons tmo\nw = true\nwhile w bound 4000000000\nr = waitpid int pid ws 0 4 1\nif eq r pid\nq = killpid neg int pid 9\nret wcode ws\nend\nif and lt r 0 ne r -4\ndie twait 2\nend\nif ge ulong monons dl\nq = killpid neg int pid 9\nif lt q 0\nq = killpid int pid 9\nend\nc = waitblk pid\nret CTMO\nend\ns = sleepns 1000000\nend\nret CTMO\nend\n\nfn mfd to int\nr = memfd tmfd 0 len tmfd 1\nif lt r 0\ndie topen 2\nend\nret int r\nend\n\nfn devnull to int\nr = fopen tdevnull 0 len tdevnull 524288 0\nif lt r 0\ndie topen 2\nend\nret int r\nend\n\nnote gitrun: run git (0 status, 1 rev-parse HEAD, 2 rev-parse HEAD^{tree}); stdout into fb\nfn gitrun a ulong to ulong\npk_clr\npk_txt tgit\nif eq a 0\npk_txt tstatus\npk_txt tporc\npk_txt tuntr\nend\nif eq a 1\npk_txt trevp\npk_txt thead\nend\nif eq a 2\npk_txt trevp\npk_txt thtree\nend\nfi = devnull\nfo = mfd\nfe = mfd\npid = spawn fi fo fe false\ncode = waitblk pid\nif ne code 0\ndie tgitf 2\nend\nn = rdfb fo\nr = fclose fi\nr = fclose fo\nr = fclose fe\nret n\nend\n\nfn isws c uchar to bool\nret or or eq c 32 eq c 10 or eq c 13 eq c 9\nend\n\nnote stripfb: fb[0, n) without surrounding white space, into the arena\nfn stripfb n ulong to ulong\ns = ulong 0\ne = n\nwhile and lt s e isws get fb s bound 16777217\ns = add s 1\nend\nwhile gt e s bound 16777217\nif not isws get fb sub e 1\nbreak\nend\ne = sub e 1\nend\nret sfb s sub e s\nend\n\nnote dirty: Python's filter, a porcelain line whose path (line[3:]) starts with build/ is ignored\nfn dirty to void\nn = gitrun 0\ns = ulong 0\nbad = false\nl_txt trefd\nwhile lt s n bound 16777217\ne = s\nwhile and lt e n ne get fb e 10 bound 16777217\ne = add e 1\nend\nskip = false\nif ge sub e s 9\nskip = true\nfor i ulong 6\nif ne get fb add add s 3 i get tbuild i\nskip = false\nend\nend\nend\nif not skip\nif bad\nl_b uchar 10\nend\nbad = true\nfor i ulong sub e s\nl_b get fb add s i\nend\nend\ns = add e 1\nend\nif bad\nl_b uchar 10\nl_flush 2\nexit 3\nend\nput gv VLN 0\nend\n\nnote ======== recursive removal (shutil.rmtree with ignore_errors) ========\n\nfn isdirl n ulong to bool\nr = lstat rp 0 n stb 0 128\nif lt r 0\nret false\nend\nm = or ulong get stb 16 shl ulong get stb 17 8\nret eq and m 61440 16384\nend\n\nnote rment: one directory entry d[q..] (type ty) of the directory rp[0, n)\nfn rment d view uchar 8192 q ulong ty uchar n ulong dep ulong to void\nm = ulong 0\nwhile ne get d add q m 0 bound 256\nm = add m 1\nend\nif and eq m 1 eq get d q 46\nret\nend\nif and eq m 2 and eq get d q 46 eq get d add q 1 46\nret\nend\nif gt add add n m 1 4095\nret\nend\nput rp n uchar 47\nfor i ulong m\nput rp add add n 1 i get d add q i\nend\nnn = add add n m 1\nisd = eq ty 4\nif eq ty 0\nisd = isdirl nn\nend\nif isd\nrmt nn add dep 1\nelse\nr = unlink rp 0 nn\nend\nend\n\nnote rmbuf: every entry of one getdents batch d[0, k)\nfn rmbuf d view uchar 8192 k ulong n ulong dep ulong to void\np = ulong 0\nwhile lt p k bound 8192\nrl = or ulong get d add p 16 shl ulong get d add p 17 8\nrment d add p 19 get d add p 18 n dep\nif eq rl 0\nret\nend\np = add p rl\nend\nend\n\nnote rmt: remove the directory rp[0, n) and everything below it, never following a symbolic link\nfn rmt n ulong dep ulong to void\nif gt dep 64\nret\nend\nd = new uchar 8192 0\nfor pass ulong 4\nfd = fopen rp 0 n 573440 0\nif lt fd 0\nret\nend\nw = true\nwhile w bound 1000000\nk = getdnts int fd d 0 8192\nif le k 0\nbreak\nend\nrmbuf d ulong k n dep\nend\nr = fclose int fd\nr = rmdir rp 0 n\nif ge r 0\nret\nend\nend\nend\n\nnote rmpath: rmtree of arena string x (relative to the repository root, or absolute)\nfn rmpath x ulong to void\np = get so x\nn = get sl x\nif or eq n 0 gt n 4095\nret\nend\nfor i ulong n\nput rp i get sa add p i\nend\nif isdirl n\nrmt n 0\nend\nend\n\nfn rmwork to void\nn = get gv VWDN\nif eq n 0\nret\nend\nfor i ulong n\nput rp i get wd i\nend\nif isdirl n\nrmt n 0\nend\nend\n\nfn refuse code int to void\nl_flush 2\nrmwork\nexit code\nend\n\nnote ======== case file ========\n\nfn sdec src view uchar * tp view uint * t ulong to ulong\nty = js_type tp t\nif and ne ty 5 ne ty 6\ndie tschema 2\nend\nb = new uchar 65536 0\nn = js_sget src js_off tp t b\nif lt n 0\ndie tlong 2\nend\nret sput part b 0 ulong n\nend\n\nfn kid x ulong to ulong\nif saeq x kcase\nret 0\nend\nif saeq x kissue\nret 1\nend\nif saeq x kfrag\nret 2\nend\nif saeq x kgate\nret 3\nend\nif saeq x kcomp\nret 4\nend\nif saeq x kom2\nret 5\nend\nif saeq x kmut\nret 6\nend\nif saeq x kargs\nret 7\nend\nif saeq x kexp\nret 8\nend\nif saeq x ktmo\nret 9\nend\nif saeq x kclean\nret 10\nend\nif saeq x khas\nret 11\nend\nif saeq x krep\nret 12\nend\nif saeq x kstat\nret 13\nend\nif saeq x kcases\nret 14\nend\nret 99\nend\n\nnote cscan: value token of each known key of object o into ctok (NONE when absent)\nfn cscan src view uchar * tp view uint * o ulong to void\nfor i ulong 16\nput ctok i NONE\nend\nif ne js_type tp o 1\ndie tschema 2\nend\nk = js_first tp o\nwhile ne k NONE bound 1000000\nx = sdec src tp k\nid = kid x\nspop x\nif lt id 16\nif ne get ctok id NONE\ndie tdupkey 2\nend\nput ctok id add k 1\nend\nk = js_mnext tp k\nend\nend\n\nnote rdlist: a list of strings into list k (absent: nothing)\nfn rdlist src view uchar * tp view uint * t ulong k ulong to void\nif eq t NONE\nret\nend\nif ne js_type tp t 3\ndie tschema 2\nend\ne = js_first tp t\nwhile ne e NONE bound 1000000\nladd k sdec src tp e\ne = js_enext tp e\nend\nend\n\nfn mtrip src view uchar * tp view uint * a ulong to void\nif ne js_type tp a 3\ndie tschema 2\nend\ne0 = js_first tp a\nif eq e0 NONE\ndie tschema 2\nend\ne1 = js_enext tp e0\nif eq e1 NONE\ndie tschema 2\nend\ne2 = js_enext tp e1\nif eq e2 NONE\ndie tschema 2\nend\nif ne js_enext tp e2 NONE\ndie tschema 2\nend\nladd 5 sdec src tp e0\nladd 6 sdec src tp e1\nladd 7 sdec src tp e2\nend\n\nnote rdmut: mutate is one [path, old, new] or a list of them; an empty list means none\nfn rdmut src view uchar * tp view uint * t ulong to void\nif eq t NONE\nret\nend\nif ne js_type tp t 3\ndie tschema 2\nend\ne = js_first tp t\nif eq e NONE\nret\nend\nif ne js_type tp e 3\nmtrip src tp t\nret\nend\nwhile ne e NONE bound 1000000\nmtrip src tp e\ne = js_enext tp e\nend\nend\n\nfn cint src view uchar * tp view uint * t ulong dv long to long\nif eq t NONE\nret dv\nend\nif ne js_type tp t 7\ndie tschema 2\nend\no = js_off tp t\nif not js_isl src o\ndie tschema 2\nend\nret js_tol src o\nend\n\nnote ctmo: timeout seconds (a plain decimal number) as nanoseconds; default 120 s\nfn ctmo src view uchar * tp view uint * t ulong to ulong\nif eq t NONE\nret 120000000000\nend\nif ne js_type tp t 7\ndie tschema 2\nend\nret tmodec src js_off tp t js_span tp t\nend\n\nnote tmodec: the lexeme src[o, o+n) of a timeout (digits, one optional dot) in nanoseconds\nfn tmodec src view uchar * o ulong n ulong to ulong\nv = ulong 0\nfd = ulong 0\ndot = false\nfor i ulong n\nc = ulong get src add o i\nif and eq c 46 not dot\ndot = true\ncontinue\nend\nif or lt c 48 gt c 57\ndie tschema 2\nend\nif or not dot lt fd 9\nv = add mul v 10 sub c 48\nif dot\nfd = add fd 1\nend\nend\nif gt v 1000000000000000000\ndie tschema 2\nend\nend\nwhile lt fd 9 bound 10\nif gt v 1000000000000000000\ndie tschema 2\nend\nv = mul v 10\nfd = add fd 1\nend\nret v\nend\n\nnote cload: read case c into the per-case globals\nfn cload src view uchar * tp view uint * c ulong to void\ncscan src tp c\nfor k ulong 8\nput gv add 16 k 0\nend\nt = get ctok 0\nif eq t NONE\ndie tschema 2\nend\nput gv VCN sdec src tp t\nput gv VGATE NONE\nt = get ctok 3\nif ne t NONE\ng = sdec src tp t\nif gt get sl g 0\nput gv VGATE g\nend\nend\nrdlist src tp get ctok 2 0\nif eq lcnt 0 0\nif eq get gv VGATE NONE\ndie tschema 2\nend\nladd 0 get gv VGATE\nend\nrdlist src tp get ctok 4 1\nrdlist src tp get ctok 7 2\nrdlist src tp get ctok 11 3\nrdlist src tp get ctok 10 4\nrdmut src tp get ctok 6\ncload2 src tp\nend\n\nfn cload2 src view uchar * tp view uint * to void\nput gv VOM2 0\nt = get ctok 5\nif ne t NONE\nif eq js_type tp t 8\nput gv VOM2 1\nend\nend\nt = get ctok 8\nif eq t NONE\ndie tschema 2\nend\nput gl 0 cint src tp t 0\nput gv VTMO ctmo src tp get ctok 9\nr = cint src tp get ctok 12 1\nif lt r 0\nr = 0\nend\nif gt r 65536\ndie tschema 2\nend\nput gv VREP ulong r\nend\n\nnote ======== composition ========\n\nfn hfadd f ulong to void\nn = lcnt 8\nfor i ulong n\nif eq sacmp f lget 8 i 0\nret\nend\nend\nladd 8 f\nend\n\nfn mcheck to void\nfor i ulong lcnt 5\nf = lget 5 i\nfound = false\nfor j ulong lcnt 0\nif eq sacmp f lget 0 j 0\nfound = true\nend\nend\nif not found\nl_txt trefm\nl_sa get gv VCN\nl_b uchar 58\nl_b uchar 32\nl_sa f\nl_txt trefnf\nrefuse 4\nend\nend\nend\n\nnote fbat: does arena string x occur in fb at p\nfn fbat x ulong p ulong to bool\nq = get so x\nn = get sl x\nif gt add p n get gv VFBN\nret false\nend\nfor i ulong n\nif ne get fb add p i get sa add q i\nret false\nend\nend\nret true\nend\n\nnote fbcount: non-overlapping occurrences of x in fb (Python bytes.count)\nfn fbcount x ulong to ulong\nn = get gv VFBN\nm = get sl x\nif eq m 0\nret add n 1\nend\nc = ulong 0\np = ulong 0\nwhile le add p m n bound 16777217\nif fbat x p\nc = add c 1\np = add p m\nelse\np = add p 1\nend\nend\nret c\nend\n\nfn fbfind x ulong to ulong\nn = get gv VFBN\nm = get sl x\np = ulong 0\nwhile le add p m n bound 16777217\nif fbat x p\nret p\nend\np = add p 1\nend\nret NONE\nend\n\nnote mutate: apply mutation j (its pattern occurs exactly once) to the fragment in fb\nfn mutate j ulong to void\no = lget 6 j\nw = lget 7 j\nc = fbcount o\nif ne c 1\nl_txt trefm\nl_sa get gv VCN\nl_txt trefpo\nl_num long c\nl_txt treftm\nrefuse 4\nend\nsplice fbfind o get sl o w\nend\n\nnote splice: replace fb[p, p+ol) by arena string w\nfn splice p ulong ol ulong w ulong to void\nn = get gv VFBN\nm = get sl w\ne = add p ol\nnn = add add p m sub n e\nif ge nn len fb\ndie tbig 2\nend\nfbto2 0 0 p\nsato2 p w\nfbto2 e add p m sub n e\nfor i ulong nn\nput fb i get fb2 i\nend\nput gv VFBN nn\nend\n\nfn fbto2 s ulong d ulong n ulong to void\nfor i ulong n\nput fb2 add d i get fb add s i\nend\nend\n\nfn sato2 d ulong w ulong to void\nq = get so w\nfor i ulong get sl w\nput fb2 add d i get sa add q i\nend\nend\n\nfn src_b c uchar to void\nn = get gv VSRCN\nif ge n len gsrc\ndie tbig 2\nend\nput gsrc n c\nput gv VSRCN add n 1\nend\n\nfn compose to void\nput gv VSRCN 0\nif eq get gv VOM2 1\nfor i ulong len tom2\nsrc_b get tom2 i\nend\nend\nfor i ulong lcnt 0\nf = lget 0 i\nhfadd f\npb_clr\npb_sa f\nput gv VFBN rdpb\nfor j ulong lcnt 5\nif eq sacmp lget 5 j f 0\nmutate j\nend\nend\nk = ulong 0\nwhile lt k get gv VFBN bound 16777217\nsrc_b get fb k\nk = add k 1\nend\nend\nend\n\nnote ccheck: a gate case without a mutation must be exactly the concatenation of its compose list\nfn ccheck to void\nif eq get gv VGATE NONE\nret\nend\nif or gt lcnt 5 0 eq lcnt 1 0\nret\nend\npos = ulong 0\nok = true\nsn = get gv VSRCN\nfor i ulong lcnt 1\npb_clr\npb_sa lget 1 i\nn = rdpb\nif gt add pos n sn\nok = false\nbreak\nend\nk = ulong 0\nwhile lt k n bound 16777217\nif ne get fb k get gsrc add pos k\nok = false\nbreak\nend\nk = add k 1\nend\npos = add pos n\nend\nif or not ok ne pos sn\nl_txt tref\nl_sa get gv VGATE\nl_txt trefc\nrefuse 5\nend\nend\n\nnote ======== compile and run ========\n\nfn closefd x ulong to void\nif ne get gv x NONE\nr = fclose int get gv x\nput gv x NONE\nend\nend\n\nfn compile to long\nfi = mfd\nwrall fi 0 get gv VSRCN\nr = fseek fi 0 0\npb_bin\nfo = pb_open 524865 493\nif lt fo 0\ndie topen 2\nend\nfe = mfd\npk_clr\npb_clr\npb_cw\npb_txt tomcabs\npk_pb\npid = spawn fi int fo fe false\nr = fclose fi\nr = fclose int fo\ncode = waitblk pid\npb_bin\nr = chmod pb 0 get gv VPBN 493\nclosefd VFDE\nput gv VFDE ulong fe\nret code\nend\n\nnote hasall: true when every stdout_has string occurs in fd's contents\nfn hasall fd int to bool\nfor i ulong lcnt 3\nif not mhas fd lget 3 i\nret false\nend\nend\nret true\nend\n\nnote mhas: substring search over fd in windows of fb2 (each window overlaps the next by m-1)\nfn mhas fd int x ulong to bool\nm = get sl x\nif eq m 0\nret true\nend\nw = sub len fb2 65536\np = ulong 0\nfor it ulong 1000000\nk = pread fd fb2 0 add w m long p\nif lt k 0\ndie tread 2\nend\ngot = ulong k\nif lt got m\nret false\nend\nlim = add sub got m 1\nif gt lim w\nlim = w\nend\nif inwin x lim\nret true\nend\nif lt got add w m\nret false\nend\np = add p w\nend\nret false\nend\n\nfn inwin x ulong lim ulong to bool\ns = ulong 0\nwhile lt s lim bound 16777217\nif w2at s x\nret true\nend\ns = add s 1\nend\nret false\nend\n\nfn w2at s ulong x ulong to bool\nq = get so x\nfor i ulong get sl x\nif ne get fb2 add s i get sa add q i\nret false\nend\nend\nret true\nend\n\nfn runone i ulong to void\nfor j ulong lcnt 4\nrmpath lget 4 j\nend\nfi = devnull\nfo = mfd\nfe = mfd\npk_clr\npb_bin\npk_pb\nfor j ulong lcnt 2\npb_clr\npb_sa lget 2 j\npk_pb\nend\npid = spawn fi fo fe true\nr = fclose fi\ncode = waitto pid get gv VTMO\nput rcod i code\nput rmis i 0\nif not hasall fo\nput rmis i 1\nend\nput gl 2 code\nclosefd VFDO\nclosefd VFDE\nput gv VFDO ulong fo\nput gv VFDE ulong fe\nend\n\nfn runall to void\nn = get gv VREP\nput gl 2 CNONE\nt0 = ulong monons\nfor i ulong n\nrunone i\nend\nput gv VNRUN n\nput gv VWALL div sub ulong monons t0 1000000\nok = true\nfor i ulong n\nif or ne get rcod i get gl 0 ne get rmis i 0\nok = false\nend\nend\nput gv VOK 0\nif ok\nput gv VOK 1\nend\nend\n\nnote ======== outcome histogram ========\n\nfn okey j ulong to void\nb = mul j 32\nw = ulong 0\nc = get ocod j\nif eq c CTMO\nfor i ulong len ttimeout\nput okb add b i get ttimeout i\nend\nw = len ttimeout\nelse\nw = numfmt c\nfor i ulong w\nput okb add b i get nbuf i\nend\nend\nif ne get omis j 0\nfor i ulong len tmiss\nput okb add add b w i get tmiss i\nend\nw = add w len tmiss\nend\nput okl j w\nend\n\nfn ocmp x ulong y ulong to bool\nnx = get okl x\nny = get okl y\nm = nx\nif lt ny m\nm = ny\nend\nfor i ulong m\na = get okb add mul x 32 i\nb = get okb add mul y 32 i\nif ne a b\nret lt a b\nend\nend\nret lt nx ny\nend\n\nfn ofind nd ulong c long m uchar to ulong\nfor j ulong nd\nif eq get ocod j c\nif eq get omis j m\nret j\nend\nend\nend\nret NONE\nend\n\nnote hist: distinct outcomes in first-seen order (ocod, omis, ocnt); returns their number\nfn hist to ulong\nnd = ulong 0\nfor i ulong get gv VNRUN\nc = get rcod i\nm = get rmis i\nf = ofind nd c m\nif eq f NONE\nif ge nd 1024\ndie tlist 2\nend\nput ocod nd c\nput omis nd m\nput ocnt nd 0\nokey nd\nf = nd\nnd = add nd 1\nend\nput ocnt f add get ocnt f 1\nend\nret nd\nend\n\nfn o_hist nd ulong to void\nfor i ulong nd\nput oord i i\nend\nfor i ulong nd\nj = i\nwhile gt j 0 bound 1024\na = get oord sub j 1\nb = get oord j\nif not ocmp b a\nbreak\nend\nput oord sub j 1 b\nput oord j a\nj = sub j 1\nend\nend\no_open uchar 123\nfor i ulong nd\nj = get oord i\no_item\nob_b uchar 34\nfor k ulong get okl j\nob_b get okb add mul j 32 k\nend\nob_b uchar 34\no_colon\no_num long get ocnt j\nend\no_close uchar 125\nend\n\nfn l_hist nd ulong to void\nl_b uchar 123\nfor j ulong nd\nif gt j 0\nl_b uchar 44\nl_b uchar 32\nend\nl_b uchar 39\nfor k ulong get okl j\nl_b get okb add mul j 32 k\nend\nl_b uchar 39\nl_b uchar 58\nl_b uchar 32\nl_num long get ocnt j\nend\nl_b uchar 125\nend\n\nnote ======== check entries ========\n\nnote o_tail: the last cap bytes of fd's contents, cut forward to a UTF-8 boundary\nfn o_tail x ulong cap ulong to void\nif eq get gv x NONE\no_esc 0 0\nret\nend\nfd = int get gv x\nn = fsize fd\ns = ulong 0\nif gt n cap\ns = sub n cap\nend\no_tl fd s sub n s\nend\n\nnote o_tl: n bytes of fd from s, skipping up to 3 leading UTF-8 continuation bytes when s > 0\nfn o_tl fd int s ulong n ulong to void\nk = pread fd sx 0 n long s\nif lt k 0\ndie tread 2\nend\nm = ulong k\nb = ulong 0\nw = gt s 0\nwhile and w lt b 3 bound 4\nif ge b m\nbreak\nend\nif ne and get sx b 192 128\nbreak\nend\nb = add b 1\nend\no_esc b sub m b\nend\n\nfn o_full x ulong to void\nfd = int get gv x\nn = fsize fd\nif ge n len sx\ndie tbig 2\nend\nk = pread fd sx 0 n long 0\nif lt k 0\ndie tread 2\nend\no_esc 0 ulong k\nend\n\nfn o_mutobj i ulong to void\no_open uchar 123\no_ksa kfile lget 5 i\no_ksa kfrom lget 6 i\no_ksa kto lget 7 i\no_close uchar 125\nend\n\nfn o_mut to void\nn = lcnt 5\nif eq n 0\nret\nend\no_key kmutat\nif eq n 1\no_mutobj 0\nret\nend\no_open uchar 91\nfor i ulong n\no_item\no_mutobj i\nend\no_close uchar 93\nend\n\nfn o_opt src view uchar * tp view uint * t ulong to void\nif eq t NONE\no_txt tnull\nelse\no_tree src tp t\nend\nend\n\nnote o_head: the keys every check entry has before mutation\nfn o_head src view uchar * tp view uint * to void\no_ksa kcase get gv VCN\no_key kcexit\no_num get gl 1\no_key kexpx\no_num get gl 0\no_key kissue\no_opt src tp get ctok 1\no_mut\nend\n\nfn emitfail src view uchar * tp view uint * to void\no_item\no_open uchar 123\no_head src tp\no_key krunx\no_txt tnull\no_key ksrcsha\no_hex 0\no_key kstderr\no_full VFDE\no_key kverd\no_qtxt tfailw\no_close uchar 125\nput gv VFAIL add get gv VFAIL 1\nend\n\nfn emitok src view uchar * tp view uint * nd ulong to void\no_item\no_open uchar 123\no_key kbsha\no_hex 1\no_head src tp\nif gt get gv VNRUN 1\no_key krep\no_open uchar 123\no_key kouts\no_hist nd\no_key kruns\no_num long get gv VNRUN\no_close uchar 125\nend\no_key krunx\no_code get gl 2\no_key ksrcsha\no_hex 0\no_key kstderr\no_tail VFDE 2000\no_key kstdout\no_tail VFDO 4000\nif gt lcnt 3 0\no_key khas\no_tree src tp get ctok 11\nend\no_key kverd\nif eq get gv VOK 1\no_qtxt tpass\nelse\no_qtxt tfailw\nend\no_key kwall\no_num long get gv VWALL\no_close uchar 125\nend\n\nfn pline nd ulong to void\nif eq get gv VOK 1\nl_txt tpass\nput gv VPASS add get gv VPASS 1\nelse\nl_txt tfailw\nput gv VFAIL add get gv VFAIL 1\nend\nl_b uchar 32\nl_sa get gv VCN\nl_txt texpe\nl_num get gl 0\nl_txt tgot\nl_code get gl 2\nif gt get gv VNRUN 1\nl_txt truns\nl_hist nd\nend\nl_b uchar 10\nl_flush 1\nend\n\nnote A case that does not compile still gets its console line (it is a FAIL\nnote in the receipt, so the summary counts it). The Python ORACLE printed\nnote nothing for it.\nfn cfline to void\nl_txt tfailw\nl_b uchar 32\nl_sa get gv VCN\nl_txt texpe\nl_num get gl 0\nl_txt tcomp\nl_num get gl 1\nl_b uchar 10\nl_flush 1\nend\n\nfn docase src view uchar * tp view uint * c ulong to void\ncload src tp c\nmcheck\ncompose\nccheck\nhglob 0 get gv VSRCN 0\nce = compile\nput gl 1 ce\nif ne ce 0\nemitfail src tp\ncfline\nclosefd VFDE\nret\nend\nrunall\npb_bin\nhpb 1\nnd = hist\nemitok src tp nd\npline nd\nclosefd VFDO\nclosefd VFDE\nend\n\nnote ======== JSON copy of case-file values (keys sorted, duplicates refused) ========\n\nfn o_jstr src view uchar * tp view uint * t ulong to void\nb = new uchar 65536 0\nn = js_sget src js_off tp t b\nif lt n 0\ndie tlong 2\nend\nfor i ulong ulong n\nput sx i get b i\nend\no_esc 0 ulong n\nend\n\nfn kpush src view uchar * tp view uint * k ulong to void\nb = new uchar 65536 0\nn = js_sget src js_off tp k b\nif lt n 0\ndie tlong 2\nend\nkstore b ulong n k\nend\n\nfn kstore b view uchar 65536 n ulong k ulong to void\np = get gv VKPN\ns = get gv VKSN\nif or gt add p n len kp gt add s 3 len ks\ndie tarena 2\nend\nfor i ulong n\nput kp add p i get b i\nend\nput ks s p\nput ks add s 1 n\nput ks add s 2 k\nput gv VKSN add s 3\nput gv VKPN add p n\nend\n\nfn kcmp a ulong b ulong to long\npa = get ks a\nna = get ks add a 1\npb2 = get ks b\nnb2 = get ks add b 1\nm = na\nif lt nb2 m\nm = nb2\nend\nfor i ulong m\nx = get kp add pa i\ny = get kp add pb2 i\nif lt x y\nret -1\nend\nif gt x y\nret 1\nend\nend\nif lt na nb2\nret -1\nend\nif gt na nb2\nret 1\nend\nret 0\nend\n\nfn kswap x ulong y ulong to void\nfor q ulong 3\na = get ks add x q\nput ks add x q get ks add y q\nput ks add y q a\nend\nend\n\nfn ksort base ulong top ulong to void\ni = add base 3\nwhile lt i top bound 1000000\nj = i\nwhile gt j base bound 1000000\nc = kcmp sub j 3 j\nif eq c 0\ndie tdupkey 2\nend\nif lt c 0\nbreak\nend\nkswap sub j 3 j\nj = sub j 3\nend\ni = add i 3\nend\nend\n\nfn o_kp e ulong to void\np = get ks e\nn = get ks add e 1\nfor i ulong n\nput sx i get kp add p i\nend\no_esc 0 n\nend\n\nfn o_obj src view uchar * tp view uint * t ulong to void\no_open uchar 123\nbase = get gv VKSN\nkb = get gv VKPN\nk = js_first tp t\nwhile ne k NONE bound 1000000\nkpush src tp k\nk = js_mnext tp k\nend\ntop = get gv VKSN\nksort base top\ni = base\nwhile lt i top bound 1000000\no_item\no_kp i\no_colon\no_tree src tp add get ks add i 2 1\ni = add i 3\nend\nput gv VKSN base\nput gv VKPN kb\no_close uchar 125\nend\n\nfn o_arr src view uchar * tp view uint * t ulong to void\no_open uchar 91\ne = js_first tp t\nwhile ne e NONE bound 1000000\no_item\no_tree src tp e\ne = js_enext tp e\nend\no_close uchar 93\nend\n\nfn o_tree src view uchar * tp view uint * t ulong to void\nty = js_type tp t\nif eq ty 1\no_obj src tp t\nret\nend\nif eq ty 3\no_arr src tp t\nret\nend\nif or eq ty 5 eq ty 6\no_jstr src tp t\nret\nend\nif eq ty 7\no = js_off tp t\nfor i ulong js_span tp t\nob_b get src add o i\nend\nret\nend\nif eq ty 8\no_txt ttrue\nret\nend\nif eq ty 9\no_txt tfalse\nret\nend\no_txt tnull\nend\n\nnote ======== receipt fields ========\n\nnote sfile: a small text file (path text t), trimmed, into the arena\nfn sfile t view uchar * to ulong\npb_clr\npb_txt t\nret stripfb rdpb\nend\n\nnote o_plat: system release machine node, as platform.uname() gives them\nfn o_plat to void\na = sfile tostype\nb = sfile tosrel\nc = sfile thost\nn = sxsa 0 a\nput sx n 32\nn = sxsa add n 1 b\nput sx n 32\nn = add n 1\nfor i ulong len tmach\nput sx add n i get tmach i\nend\nn = add n len tmach\nput sx n 32\nn = sxsa add n 1 c\no_esc 0 n\nend\n\nnote sxsa: arena string x into sx at n; returns the end\nfn sxsa n ulong x ulong to ulong\np = get so x\nm = get sl x\nfor i ulong m\nput sx add n i get sa add p i\nend\nret add n m\nend\n\nnote pnum: a decimal number in fb at p; returns the value and moves gv VNOUT past it\nfn pnum p ulong n ulong to ulong\nv = ulong 0\nq = p\nwhile and lt q n and ge get fb q 48 le get fb q 57 bound 32\nv = add mul v 10 sub ulong get fb q 48\nq = add q 1\nend\nput gv VNOUT q\nret v\nend\n\nnote o_affin: Cpus_allowed_list of this process, expanded (os.sched_getaffinity)\nfn o_affin to void\npb_clr\npb_txt tpstat\nn = rdpb\np = ulong 0\nf = NONE\nwhile lt p n bound 16777217\nif fbtxt p tcpus\nf = add p len tcpus\nbreak\nend\nwhile and lt p n ne get fb p 10 bound 16777217\np = add p 1\nend\np = add p 1\nend\no_open uchar 91\nif eq f NONE\no_close uchar 93\nret\nend\np = f\nwhile and lt p n or eq get fb p 9 eq get fb p 32 bound 64\np = add p 1\nend\nw = true\nwhile w bound 4096\na = pnum p n\np = get gv VNOUT\nb = a\nif and lt p n eq get fb p 45\nb = pnum add p 1 n\np = get gv VNOUT\nend\nv = a\nwhile le v b bound 65536\no_item\no_num long v\nv = add v 1\nend\nif or ge p n ne get fb p 44\nbreak\nend\np = add p 1\nend\no_close uchar 93\nend\n\nfn fbtxt p ulong t view uchar * to bool\nfor i ulong len t\nif ne get fb add p i get t i\nret false\nend\nend\nret true\nend\n\nfn sxd p ulong v ulong w ulong to void\nx = v\nk = w\nwhile gt k 0 bound 8\nk = sub k 1\nput sx add p k uchar add 48 rem x 10\nx = div x 10\nend\nend\n\nnote o_time: datetime.now(timezone.utc).isoformat()\nfn o_time to void\nns = ulong realns\nsecs = div ns 1000000000\nsdate div secs 86400\no_time2 rem secs 86400 div rem ns 1000000000 1000\nend\n\nnote sdate: YYYY-MM-DDT for day number t since 1970-01-01 (civil_from_days, H. Hinnant)\nfn sdate t ulong to void\nz = add t 719468\nera = div z 146097\ndoe = sub z mul era 146097\nyoe = yoef doe\ny = add yoe mul era 400\ndoy = sub doe sub add mul 365 yoe div yoe 4 div yoe 100\nmp = div add mul 5 doy 2 153\nd = add sub doy div add mul 153 mp 2 5 1\nm = add mp 3\nif ge mp 10\nm = sub mp 9\nend\nif le m 2\ny = add y 1\nend\nsxd 0 y 4\nput sx 4 45\nsxd 5 m 2\nput sx 7 45\nsxd 8 d 2\nput sx 10 84\nend\n\nfn yoef doe ulong to ulong\na = sub doe div doe 1460\nb = add a div doe 36524\nret div sub b div doe 146096 365\nend\n\nfn o_time2 sod ulong us ulong to void\nsxd 11 div sod 3600 2\nput sx 13 58\nsxd 14 div rem sod 3600 60 2\nput sx 16 58\nsxd 17 rem sod 60 2\nn = ulong 19\nif gt us 0\nput sx 19 46\nsxd 20 us 6\nn = 26\nend\nput sx n 43\nsxd add n 1 0 2\nput sx add n 3 58\nsxd add n 4 0 2\no_esc 0 add n 6\nend\n\nfn o_hashes to void\nn = lcnt 8\nfor i ulong n\nj = i\nwhile gt j 0 bound 2048\na = lget 8 sub j 1\nb = lget 8 j\nif le sacmp a b 0\nbreak\nend\nput lst add 16384 sub j 1 b\nput lst add 16384 j a\nj = sub j 1\nend\nend\no_open uchar 123\nfor i ulong n\nf = lget 8 i\no_item\no_str_sa f\no_colon\npb_clr\npb_sa f\nhpb 2\no_hex 2\nend\no_close uchar 125\nend\n\nfn o_script src view uchar * tp view uint * to void\no_open uchar 123\no_key kbsha\npb_clr\npb_sa get gv VBIN\nhpb 2\no_hex 2\no_key kcases\no_tree src tp 0\no_key kcsha\npb_clr\npb_sa get gv VCASP\nhpb 2\no_hex 2\no_key kpath\no_qtxt tsrcrel\no_key ksha\npb_clr\npb_sa get gv VDRV\nhpb 2\no_hex 2\no_key ksource\npb_clr\npb_sa get gv VDRV\nfd = pb_open 524288 0\nif lt fd 0\ndie topen 2\nend\nput gv VFDO ulong fd\no_full VFDO\nr = fclose int fd\nput gv VFDO NONE\no_close uchar 125\nend\n\nfn o_rest src view uchar * tp view uint * to void\no_key kcompil\no_open uchar 123\no_key kpath\no_qtxt tomcrel\no_key ksha\npb_clr\npb_txt tomcrel\nhpb 2\no_hex 2\no_close uchar 125\no_key kaffin\no_affin\no_key kexecu\no_qtxt texec\no_key khashes\no_hashes\no_key kissue\no_tree src tp get gv VTISS\no_key kplat\no_plat\no_key kproj\no_qtxt tproj\no_key kscript\no_script src tp\no_ksa kscom get gv VHEAD\no_ksa kstree get gv VTREE\no_key kstat\nif eq get gv VTSTA NONE\no_open uchar 123\no_close uchar 125\nelse\no_tree src tp get gv VTSTA\nend\no_key ksumm\no_open uchar 123\no_key kfail\no_num long get gv VFAIL\no_key kpass\no_num long get gv VPASS\no_close uchar 125\no_key ktime\no_time\nend\n\nnote ======== setup ========\n\nnote argsa: argument i into the arena\nfn argsa i ulong to ulong\nb = new uchar 4096 0\nn = argread i b 0 4096\nif lt n 0\ndie tpath 2\nend\nret sput part b 0 ulong n\nend\n\nnote self: the driver binary is argv0; its source is the sibling seed/node/schedrcpt.om of the\nnote build/node/schedrcpt it was invoked as\nfn self to void\nx = argsa 0\nn = get sl x\nm = len tsuffix\nif lt n m\ndie tself 2\nend\np = get so x\nfor i ulong m\nif ne get sa add add p sub n m i get tsuffix i\ndie tself 2\nend\nend\nput gv VBIN x\nb = new uchar 4096 0\nfor i ulong sub n m\nput b i get sa add p i\nend\nk = sub n m\nfor i ulong len tsrcrel\nput b add k i get tsrcrel i\nend\nput gv VDRV sput part b 0 add k len tsrcrel\nend\n\nnote mkbuild: create build/node in the tree under test, the README's build\nnote step (mkdir -p build/node; build/ is outside the dirty check). Gates\nnote open journals and work directories below it, and jn_open creates only\nnote the last directory of its path.\nfn mkbuild to void\nr = makedir tbn 0 5 493\nif and lt r 0 ne r neg long 17\ndie tbnf 2\nend\nr = makedir tbn 0 10 493\nif and lt r 0 ne r neg long 17\ndie tbnf 2\nend\nend\n\nfn mkwork to void\nr = new uchar 8 0\nq = random r 0 8 0\nif ne q 8\ndie tmkwork 2\nend\npb_clr\npb_txt twdpre\nfor i ulong 8\nb = ulong get r i\npb_b hexc shr b 4\npb_b hexc and b 15\nend\nq = makedir pb 0 get gv VPBN 448\nif lt q 0\ndie tmkwork 2\nend\nfor i ulong get gv VPBN\nput wd i get pb i\nend\nput gv VWDN get gv VPBN\nend\n\nfn ldcases src edit uchar * to ulong\npb_clr\npb_sa get gv VCASP\nfd = pb_open 524288 0\nif lt fd 0\ndie tcasesf 2\nend\nn = ulong 0\nw = true\nwhile w bound 1000000\nk = pread int fd src n sub len src n long n\nif lt k 0\ndie tcasesf 2\nend\nif eq k 0\nbreak\nend\nn = add n ulong k\nif ge n len src\ndie tcasesf 2\nend\nend\nr = fclose int fd\nret n\nend\n\nfn wflag to bool\nf = false\nfor i ulong sub ulong argcnt 1\nx = argsa add i 1\nif saeq x twrite\nf = true\nend\nspop x\nend\nret f\nend\n\nnote save: write the receipt (ob) and print its path (--write) or put it in /tmp\nfn save wr bool to void\nn = get gv VOBN\npb_clr\nif wr\no = get gv VOUT\npb_sa o\nfor i ulong get gv VPBN\nif and gt i 0 eq get pb i 47\nr = makedir pb 0 i 493\nend\nend\nr = makedir pb 0 get gv VPBN 493\nif ne get pb sub get gv VPBN 1 47\npb_b uchar 47\nend\npb_txt trcpre\nelse\npb_txt ttmppre\nend\npb_hex 2\npb_txt tjson\nfl = int 524865\nif wr\nfl = 524481\nend\nfd = pb_open fl 420\nif lt fd 0\ndie twfail 2\nend\nwrall int fd 1 n\nr = fclose int fd\nif wr\nif ne get pb 0 47\nfor i ulong get gv VCWN\nl_b get cw i\nend\nl_b uchar 47\nend\nfor i ulong get gv VPBN\nl_b get pb i\nend\nl_b uchar 10\nl_flush 1\nend\nend\n\nfn main to int\nsrc = new uchar 983040 0\ntp = new uint 262144 0\nif lt argcnt 3\ndie tusage 2\nend\nput gv VFDO NONE\nput gv VFDE NONE\nself\nput gv VCASP argsa 1\nput gv VOUT argsa 2\nwr = wflag\nq = cwd cw 0 4096\nif lt q 2\ndie tpath 2\nend\nput gv VCWN sub ulong q 1\nn = ldcases src\nr = js_init tp 983040 48\nif lt r 0\ndie tnotjson 2\nend\nr = js_parse src tp n\nif lt r 0\ndie tnotjson 2\nend\ncscan src tp 0\nput gv VTISS get ctok 1\nput gv VTSTA get ctok 13\nput gv VTCAS get ctok 14\nif or eq get gv VTISS NONE eq get gv VTCAS NONE\ndie tschema 2\nend\nif ne js_type tp get gv VTCAS 3\ndie tschema 2\nend\ndirty\nput gv VHEAD stripfb gitrun 1\nput gv VTREE stripfb gitrun 2\nmkbuild\nmkwork\no_open uchar 123\no_key kchecks\no_open uchar 91\ne = js_first tp get gv VTCAS\nwhile ne e NONE bound 1000000\ndocase src tp e\ne = js_enext tp e\nend\no_close uchar 93\nrmwork\nput gv VWDN 0\no_rest src tp\no_close uchar 125\nob_b uchar 10\nhglob 1 get gv VOBN 2\nl_txt tsumm\nl_num long get gv VPASS\nl_txt tsfail\nl_num long get gv VFAIL\nl_txt tsdig\nfor i ulong 64\nl_b get hsl add 128 i\nend\nl_b uchar 10\nl_flush 1\nsave wr\nif eq get gv VFAIL 0\nret 0\nend\nret 1\nend\n" |
| 186 | }, |
| 187 | "source_commit": "d4f73fef4faf5f365da1fa763e63c607a6e8a878", |
| 188 | "source_tree": "98ece07fe0c634dea94d2befb7cb31e69a2b4b7c", |
| 189 | "statuses": { |
| 190 | "DRA-399": "IMPLEMENTED; bench EXERCISED only by this receipt; not QUALIFIED; not MERGED; not DEPLOYED", |
| 191 | "expected_exits": "derived from the check site each mutant targets (field why), before the run", |
| 192 | "gpu": "NOT_RUN (not involved)", |
| 193 | "timing": "wall times depend on the cores the run was given; they are recorded with the bench output, not claimed as speed" |
| 194 | }, |
| 195 | "summary": { |
| 196 | "fail": 0, |
| 197 | "pass": 4 |
| 198 | }, |
| 199 | "timestamp_utc": "2026-11-09T01:04:56.120552+00:00" |
| 200 | } |