babel
aien-dev/babel
Brought by drakestapleton
| 1 | note babel 60-report: REPORT.md, report.json, omega/manifest.json, progress and the terminal summary. |
| 2 | global Cnt ulong 8 |
| 3 | global Ah0 ulong 1 |
| 4 | global Ahn ulong 1 |
| 5 | global Ar0 ulong 1 |
| 6 | global Arn ulong 1 |
| 7 | global Tty ulong 1 |
| 8 | text Ver "0.1.0" |
| 9 | text Prof "S1 c17-uint64-pure-v1" |
| 10 | text LnC "c" |
| 11 | text LnRs "rust" |
| 12 | text LnPy "python" |
| 13 | text LnGo "go" |
| 14 | text LnZig "zig" |
| 15 | text LnCpp "cpp" |
| 16 | text LnOth "other" |
| 17 | text VTr "TRANSLATED" |
| 18 | text VUn "UNSUPPORTED(" |
| 19 | text VMi "MISSING_IMPLEMENTATION" |
| 20 | text VFa "FAIL" |
| 21 | text VNr "NOT_RUN" |
| 22 | text VAb "ABSORBED" |
| 23 | text VPe "PENDING" |
| 24 | text VEx "EXPORTED" |
| 25 | text KFn "function" |
| 26 | text KDe "declaration" |
| 27 | text KPp "preprocessor" |
| 28 | text KEof "unterminated" |
| 29 | text KFi "file" |
| 30 | text KAb "header" |
| 31 | text SgSplit "split" |
| 32 | text SgImp "import" |
| 33 | text SgLow "lower" |
| 34 | text SgOmc "omega-check" |
| 35 | text SgExp "export" |
| 36 | text SgBld "build" |
| 37 | text SgDif "differential" |
| 38 | text SgOrc "oracle" |
| 39 | text CGrn "[32m" |
| 40 | text CRed "[31m" |
| 41 | text CYel "[33m" |
| 42 | text CMag "[35m" |
| 43 | text CDim "[2m" |
| 44 | text CBold "[1m" |
| 45 | text COff "[0m" |
| 46 | text CEl "[K" |
| 47 | text Unk "unknown" |
| 48 | text MAbs " absorbed" |
| 49 | |
| 50 | note ---------- small vocabulary ---------- |
| 51 | fn blang g ulong to void |
| 52 | if eq g 1 |
| 53 | bs LnC |
| 54 | ret |
| 55 | end |
| 56 | if eq g 2 |
| 57 | bs LnRs |
| 58 | ret |
| 59 | end |
| 60 | if eq g 3 |
| 61 | bs LnPy |
| 62 | ret |
| 63 | end |
| 64 | if eq g 4 |
| 65 | bs LnGo |
| 66 | ret |
| 67 | end |
| 68 | if eq g 5 |
| 69 | bs LnZig |
| 70 | ret |
| 71 | end |
| 72 | if eq g 6 |
| 73 | bs LnCpp |
| 74 | ret |
| 75 | end |
| 76 | bs LnOth |
| 77 | end |
| 78 | |
| 79 | fn bverdict u ulong to void |
| 80 | s = get Ust u |
| 81 | if eq s 1 |
| 82 | bs VTr |
| 83 | ret |
| 84 | end |
| 85 | if eq s 2 |
| 86 | bs VUn |
| 87 | bu get Urc u |
| 88 | bc 41 |
| 89 | ret |
| 90 | end |
| 91 | if eq s 3 |
| 92 | bs VMi |
| 93 | ret |
| 94 | end |
| 95 | if eq s 4 |
| 96 | bs VFa |
| 97 | ret |
| 98 | end |
| 99 | if eq s 5 |
| 100 | bs VNr |
| 101 | ret |
| 102 | end |
| 103 | if eq s 6 |
| 104 | bs VAb |
| 105 | ret |
| 106 | end |
| 107 | if eq s 7 |
| 108 | bs VEx |
| 109 | ret |
| 110 | end |
| 111 | bs VPe |
| 112 | end |
| 113 | |
| 114 | fn bkind u ulong to void |
| 115 | k = get Ukd u |
| 116 | if eq k 1 |
| 117 | bs KFn |
| 118 | ret |
| 119 | end |
| 120 | if eq k 2 |
| 121 | bs KDe |
| 122 | ret |
| 123 | end |
| 124 | if eq k 3 |
| 125 | bs KPp |
| 126 | ret |
| 127 | end |
| 128 | if eq k 4 |
| 129 | bs KEof |
| 130 | ret |
| 131 | end |
| 132 | if eq k 5 |
| 133 | bs KFi |
| 134 | ret |
| 135 | end |
| 136 | bs KAb |
| 137 | end |
| 138 | |
| 139 | fn bstage u ulong to void |
| 140 | g = get Usg u |
| 141 | if eq g 1 |
| 142 | bs SgSplit |
| 143 | ret |
| 144 | end |
| 145 | if eq g 2 |
| 146 | bs SgImp |
| 147 | ret |
| 148 | end |
| 149 | if eq g 3 |
| 150 | bs SgLow |
| 151 | ret |
| 152 | end |
| 153 | if eq g 4 |
| 154 | bs SgOmc |
| 155 | ret |
| 156 | end |
| 157 | if eq g 5 |
| 158 | bs SgExp |
| 159 | ret |
| 160 | end |
| 161 | if eq g 6 |
| 162 | bs SgBld |
| 163 | ret |
| 164 | end |
| 165 | if eq g 7 |
| 166 | bs SgDif |
| 167 | ret |
| 168 | end |
| 169 | bs SgOrc |
| 170 | end |
| 171 | |
| 172 | note "path:l0-l1" of unit u |
| 173 | fn bloc u ulong to void |
| 174 | fi = get Ufi u |
| 175 | bpl get F0 fi get Fl fi |
| 176 | bc 58 |
| 177 | bu get Ul0 u |
| 178 | if ne get Ul1 u get Ul0 u |
| 179 | bc 45 |
| 180 | bu get Ul1 u |
| 181 | end |
| 182 | end |
| 183 | |
| 184 | note display name: the function name, or the latest identifier, or "-" |
| 185 | fn bdisp u ulong to void |
| 186 | if eq get Unn u 0 |
| 187 | bc 45 |
| 188 | ret |
| 189 | end |
| 190 | bname u |
| 191 | end |
| 192 | |
| 193 | fn counts to void |
| 194 | for i ulong 8 |
| 195 | put Cnt i 0 |
| 196 | end |
| 197 | for u ulong get Nu 0 |
| 198 | s = get Ust u |
| 199 | if lt s 8 |
| 200 | put Cnt s add get Cnt s 1 |
| 201 | end |
| 202 | end |
| 203 | end |
| 204 | |
| 205 | fn colon to bool |
| 206 | ret eq get Col 0 1 |
| 207 | end |
| 208 | |
| 209 | note ANSI escape: ESC then s |
| 210 | fn besc s view uchar * to void |
| 211 | bc 27 |
| 212 | bs s |
| 213 | end |
| 214 | |
| 215 | fn bcol u ulong to void |
| 216 | if not colon |
| 217 | ret |
| 218 | end |
| 219 | s = get Ust u |
| 220 | if eq s 1 |
| 221 | besc CGrn |
| 222 | end |
| 223 | if eq s 2 |
| 224 | besc CYel |
| 225 | end |
| 226 | if eq s 3 |
| 227 | besc CMag |
| 228 | end |
| 229 | if eq s 4 |
| 230 | besc CRed |
| 231 | end |
| 232 | if ge s 5 |
| 233 | besc CDim |
| 234 | end |
| 235 | end |
| 236 | |
| 237 | fn boff to void |
| 238 | if colon |
| 239 | besc COff |
| 240 | end |
| 241 | end |
| 242 | |
| 243 | fn bbold to void |
| 244 | if colon |
| 245 | besc CBold |
| 246 | end |
| 247 | end |
| 248 | |
| 249 | note write Ob[m, mark) to fd and reset |
| 250 | fn flush fd int m ulong to void |
| 251 | w = write fd Ob m sub mark m |
| 252 | reset m |
| 253 | end |
| 254 | |
| 255 | note the text width of Ob[m, mark) in UTF-8 code points (continuation bytes are not counted) |
| 256 | fn width m ulong to ulong |
| 257 | c = ulong 0 |
| 258 | for i ulong sub mark m |
| 259 | b = get Ob add m i |
| 260 | if ne and b 192 128 |
| 261 | c = add c 1 |
| 262 | end |
| 263 | end |
| 264 | ret c |
| 265 | end |
| 266 | |
| 267 | note pad the cell started at m to w columns |
| 268 | fn pad m ulong w ulong to void |
| 269 | k = width m |
| 270 | if lt k w |
| 271 | bsp sub w k |
| 272 | end |
| 273 | bc 32 |
| 274 | bc 32 |
| 275 | end |
| 276 | |
| 277 | note ---------- progress (stderr, only on a terminal) ---------- |
| 278 | note carriage return, erase line |
| 279 | fn bcr to void |
| 280 | bc 13 |
| 281 | besc CEl |
| 282 | end |
| 283 | text PrB " " |
| 284 | fn progress u ulong to void |
| 285 | if eq get Tty 0 0 |
| 286 | ret |
| 287 | end |
| 288 | m = mark |
| 289 | bcr |
| 290 | bc 32 |
| 291 | bc 32 |
| 292 | bc 91 |
| 293 | bu add u 1 |
| 294 | bc 47 |
| 295 | bu get Nu 0 |
| 296 | bc 93 |
| 297 | bc 32 |
| 298 | bdisp u |
| 299 | bs PrB |
| 300 | bloc u |
| 301 | flush 2 m |
| 302 | end |
| 303 | |
| 304 | note end of progress: clear the line |
| 305 | fn progend to void |
| 306 | if eq get Tty 0 0 |
| 307 | ret |
| 308 | end |
| 309 | m = mark |
| 310 | bcr |
| 311 | flush 2 m |
| 312 | end |
| 313 | |
| 314 | note ---------- terminal summary ---------- |
| 315 | text THead "babel " |
| 316 | text TArr " -> " |
| 317 | text TIn " input " |
| 318 | text TOut " output " |
| 319 | text TAd " adapters omega-mv " |
| 320 | text TAdP " (profile " |
| 321 | text TFiles " files, " |
| 322 | text TUnits " units\n\n" |
| 323 | text TH1 "VERDICT" |
| 324 | text TH2 "UNIT" |
| 325 | text TH3 "WHERE" |
| 326 | text TH4 "DETAIL" |
| 327 | text TSum1 " translated " |
| 328 | text TSum2 " unsupported " |
| 329 | text TSum3 " missing implementation " |
| 330 | text TSum4 " fail " |
| 331 | text TSum5 " not run " |
| 332 | text TSum6 " absorbed\n" |
| 333 | text TRep " report " |
| 334 | text TRepF "/REPORT.md\n" |
| 335 | text TTst " tests " |
| 336 | text TTP "PASS (generated tests ran over the oracle outputs: diff/test.log)\n" |
| 337 | text TTF "FAIL (see diff/test.log)\n" |
| 338 | text TTN "NOT_RUN (no generated test harness for this target)\n" |
| 339 | text TOk "translated = adapter exit 0, Omega check exit 0, and C / Omega / target outputs byte-identical on every vector\n" |
| 340 | |
| 341 | fn summary to void |
| 342 | m = mark |
| 343 | bbold |
| 344 | bs THead |
| 345 | bs Ver |
| 346 | boff |
| 347 | bc 32 |
| 348 | bc 32 |
| 349 | bpl get Rt0 0 get Rtn 0 |
| 350 | bs TArr |
| 351 | blang get Lg 0 |
| 352 | bs NL |
| 353 | bs TOut |
| 354 | bout |
| 355 | bs NL |
| 356 | bs TAd |
| 357 | bpl get Ah0 0 get Ahn 0 |
| 358 | bs TAdP |
| 359 | bs Prof |
| 360 | bc 41 |
| 361 | bs NL |
| 362 | bs TIn |
| 363 | bu get Nf 0 |
| 364 | bs TFiles |
| 365 | bu get Nu 0 |
| 366 | bs TUnits |
| 367 | flush 1 m |
| 368 | table |
| 369 | m = mark |
| 370 | bs NL |
| 371 | bc 32 |
| 372 | bc 32 |
| 373 | counts |
| 374 | scount 1 TSum1 |
| 375 | scount 2 TSum2 |
| 376 | scount 3 TSum3 |
| 377 | scount 4 TSum4 |
| 378 | scount 5 TSum5 |
| 379 | scount 6 TSum6 |
| 380 | tstline |
| 381 | csline |
| 382 | bs TRep |
| 383 | bout |
| 384 | bs TRepF |
| 385 | bc 32 |
| 386 | bc 32 |
| 387 | bs TOk |
| 388 | flush 1 m |
| 389 | end |
| 390 | |
| 391 | fn scount s ulong t view uchar * to void |
| 392 | bu get Cnt s |
| 393 | bs t |
| 394 | end |
| 395 | |
| 396 | fn tstline to void |
| 397 | t = get Tsr 0 |
| 398 | bs TTst |
| 399 | if eq t 0 |
| 400 | bs TTP |
| 401 | ret |
| 402 | end |
| 403 | if eq t 999 |
| 404 | bs TTN |
| 405 | ret |
| 406 | end |
| 407 | bs TTF |
| 408 | end |
| 409 | |
| 410 | note column widths from the data, capped |
| 411 | fn table to void |
| 412 | w1 = ulong len TH1 |
| 413 | w2 = ulong len TH2 |
| 414 | w3 = ulong len TH3 |
| 415 | for u ulong get Nu 0 |
| 416 | m = mark |
| 417 | bverdict u |
| 418 | w1 = umax w1 width m |
| 419 | reset m |
| 420 | bdisp u |
| 421 | w2 = umax w2 width m |
| 422 | reset m |
| 423 | bloc u |
| 424 | w3 = umax w3 width m |
| 425 | reset m |
| 426 | end |
| 427 | w2 = umin w2 28 |
| 428 | w3 = umin w3 36 |
| 429 | m = mark |
| 430 | bc 32 |
| 431 | bc 32 |
| 432 | c = mark |
| 433 | bs TH1 |
| 434 | pad c w1 |
| 435 | c = mark |
| 436 | bs TH2 |
| 437 | pad c w2 |
| 438 | c = mark |
| 439 | bs TH3 |
| 440 | pad c w3 |
| 441 | bs TH4 |
| 442 | bs NL |
| 443 | flush 1 m |
| 444 | for u ulong get Nu 0 |
| 445 | trow u w1 w2 w3 |
| 446 | end |
| 447 | end |
| 448 | |
| 449 | fn umax a ulong b ulong to ulong |
| 450 | if gt a b |
| 451 | ret a |
| 452 | end |
| 453 | ret b |
| 454 | end |
| 455 | |
| 456 | fn umin a ulong b ulong to ulong |
| 457 | if lt a b |
| 458 | ret a |
| 459 | end |
| 460 | ret b |
| 461 | end |
| 462 | |
| 463 | fn trow u ulong w1 ulong w2 ulong w3 ulong to void |
| 464 | m = mark |
| 465 | bc 32 |
| 466 | bc 32 |
| 467 | bcol u |
| 468 | c = mark |
| 469 | bverdict u |
| 470 | pad c w1 |
| 471 | boff |
| 472 | c = mark |
| 473 | bdisp u |
| 474 | pad c w2 |
| 475 | c = mark |
| 476 | bloc u |
| 477 | pad c w3 |
| 478 | bdetail u 96 |
| 479 | bs NL |
| 480 | flush 1 m |
| 481 | end |
| 482 | |
| 483 | note one-line detail: the reason, or the vector count for TRANSLATED, cut at w code points |
| 484 | text DTr1 " vectors identical: original C, Omega, " |
| 485 | fn bdetail u ulong w ulong to void |
| 486 | c = mark |
| 487 | if eq get Ust u 1 |
| 488 | bu get Unv u |
| 489 | bs DTr1 |
| 490 | blang get Lg 0 |
| 491 | else |
| 492 | bmd get Ur0 u get Urn u |
| 493 | end |
| 494 | cut c w |
| 495 | end |
| 496 | |
| 497 | fn cut c ulong w ulong to void |
| 498 | k = ulong 0 |
| 499 | i = c |
| 500 | e = mark |
| 501 | while lt i e bound 999999 |
| 502 | b = get Ob i |
| 503 | if ne and b 192 128 |
| 504 | if eq k w |
| 505 | put Ol 0 i |
| 506 | bc 46 |
| 507 | bc 46 |
| 508 | bc 46 |
| 509 | ret |
| 510 | end |
| 511 | k = add k 1 |
| 512 | end |
| 513 | i = add i 1 |
| 514 | end |
| 515 | end |
| 516 | |
| 517 | note ---------- report.json ---------- |
| 518 | text JA "{\n \"schema\": \"babel.report.v1\",\n \"babel\": \"" |
| 519 | text JB "\",\n \"input\": " |
| 520 | text JC ",\n \"output\": " |
| 521 | text JD ",\n \"target\": \"" |
| 522 | text JE "\",\n \"profile\": \"" |
| 523 | text JF "\",\n \"adapters\": {\"repo\": \"aien-dev/omega-mv\", \"head\": " |
| 524 | text JG ", \"ref\": " |
| 525 | text JH ", \"native_omc_sha256\": \"" |
| 526 | text JI "\"},\n \"verdict_rule\": \"TRANSLATED = adapter exit 0, Omega check exit 0, and original C / Omega / target outputs byte-identical on every vector\",\n \"toolchains\": {" |
| 527 | text JJ "},\n \"summary\": {" |
| 528 | text JK "},\n \"generated_tests\": \"" |
| 529 | text JL "\",\n \"completion\": " |
| 530 | text JL2 ",\n \"files\": [" |
| 531 | text JM "\n ],\n \"units\": [" |
| 532 | text JN "\n ]\n}\n" |
| 533 | text JQ "\": " |
| 534 | text JCm ", " |
| 535 | text JNl "\n " |
| 536 | text JT0 "\"" |
| 537 | text JTn "null" |
| 538 | text JS1 "\"translated\": " |
| 539 | text JS2 ", \"unsupported\": " |
| 540 | text JS3 ", \"missing_implementation\": " |
| 541 | text JS4 ", \"fail\": " |
| 542 | text JS5 ", \"not_run\": " |
| 543 | text JS6 ", \"absorbed\": " |
| 544 | text JF1 "{\"path\": " |
| 545 | text JF2 ", \"sha256\": \"" |
| 546 | text JF3 "\", \"bytes\": " |
| 547 | text JF4 ", \"language\": \"" |
| 548 | text JF5 "\"}" |
| 549 | text JU1 "{\"file\": " |
| 550 | text JU2 ", \"line_start\": " |
| 551 | text JU3 ", \"line_end\": " |
| 552 | text JU4 ", \"kind\": \"" |
| 553 | text JU5 "\", \"name\": " |
| 554 | text JU6 ", \"verdict\": \"" |
| 555 | text JU7 "\", \"stage\": \"" |
| 556 | text JU8 "\", \"exit_code\": " |
| 557 | text JU9 ", \"reason\": " |
| 558 | text JUa ", \"adapter_name\": " |
| 559 | text JUb ", \"omega_name\": " |
| 560 | text JUc ", \"vectors\": " |
| 561 | text JUd ", \"omega_mismatches\": " |
| 562 | text JUe ", \"target_mismatches\": " |
| 563 | text JUf "}" |
| 564 | text TlNm0 "cc" |
| 565 | text TlNm1 "cargo" |
| 566 | text TlNm2 "python3" |
| 567 | text TlNm3 "c++" |
| 568 | text TlNm4 "zig" |
| 569 | text TlNm5 "go" |
| 570 | text TsP "PASS" |
| 571 | text TsF "FAIL" |
| 572 | text TsN "NOT_RUN" |
| 573 | |
| 574 | fn bqpl o ulong n ulong to void |
| 575 | bjq o n |
| 576 | end |
| 577 | |
| 578 | fn bqnull o ulong n ulong to void |
| 579 | if eq n 0 |
| 580 | bs JTn |
| 581 | ret |
| 582 | end |
| 583 | bjq o n |
| 584 | end |
| 585 | |
| 586 | fn btsr to void |
| 587 | t = get Tsr 0 |
| 588 | if eq t 0 |
| 589 | bs TsP |
| 590 | ret |
| 591 | end |
| 592 | if eq t 999 |
| 593 | bs TsN |
| 594 | ret |
| 595 | end |
| 596 | bs TsF |
| 597 | end |
| 598 | |
| 599 | fn jtool s ulong nm view uchar * to void |
| 600 | if gt s 0 |
| 601 | bs JCm |
| 602 | end |
| 603 | bs JT0 |
| 604 | bs nm |
| 605 | bs JQ |
| 606 | if eq get Tok s 1 |
| 607 | bjq get Tv0 s get Tvn s |
| 608 | else |
| 609 | bs JTn |
| 610 | end |
| 611 | end |
| 612 | |
| 613 | fn jhead to void |
| 614 | bs JA |
| 615 | bs Ver |
| 616 | bs JB |
| 617 | bqpl get Rt0 0 get Rtn 0 |
| 618 | bs JC |
| 619 | m = mark |
| 620 | bout |
| 621 | o = psave m sub mark m |
| 622 | n = sub mark m |
| 623 | reset m |
| 624 | bqpl o n |
| 625 | bs JD |
| 626 | blang get Lg 0 |
| 627 | bs JE |
| 628 | bs Prof |
| 629 | bs JF |
| 630 | bqnull get Ah0 0 get Ahn 0 |
| 631 | bs JG |
| 632 | bqnull get Ar0 0 get Arn 0 |
| 633 | bs JH |
| 634 | bs OmcPin |
| 635 | bs JI |
| 636 | jtool 0 TlNm0 |
| 637 | jtool 1 TlNm1 |
| 638 | jtool 2 TlNm2 |
| 639 | jtool 3 TlNm3 |
| 640 | jtool 4 TlNm4 |
| 641 | jtool 5 TlNm5 |
| 642 | bs JJ |
| 643 | counts |
| 644 | bs JS1 |
| 645 | bu get Cnt 1 |
| 646 | bs JS2 |
| 647 | bu get Cnt 2 |
| 648 | bs JS3 |
| 649 | bu get Cnt 3 |
| 650 | bs JS4 |
| 651 | bu get Cnt 4 |
| 652 | bs JS5 |
| 653 | bu get Cnt 5 |
| 654 | bs JS6 |
| 655 | bu get Cnt 6 |
| 656 | bs JK |
| 657 | btsr |
| 658 | bs JL |
| 659 | cjson |
| 660 | bs JL2 |
| 661 | end |
| 662 | |
| 663 | fn jfile f ulong to void |
| 664 | if gt f 0 |
| 665 | bc 44 |
| 666 | end |
| 667 | bs JNl |
| 668 | bs JF1 |
| 669 | bqpl get F0 f get Fl f |
| 670 | bs JF2 |
| 671 | bpl get Fh0 f 64 |
| 672 | bs JF3 |
| 673 | bu get Fsz f |
| 674 | bs JF4 |
| 675 | blang get Flg f |
| 676 | bs JF5 |
| 677 | end |
| 678 | |
| 679 | fn junit u ulong to void |
| 680 | if gt u 0 |
| 681 | bc 44 |
| 682 | end |
| 683 | bs JNl |
| 684 | bs JU1 |
| 685 | fi = get Ufi u |
| 686 | bqpl get F0 fi get Fl fi |
| 687 | bs JU2 |
| 688 | bu get Ul0 u |
| 689 | bs JU3 |
| 690 | bu get Ul1 u |
| 691 | bs JU4 |
| 692 | bkind u |
| 693 | bs JU5 |
| 694 | bqnull get Un0 u get Unn u |
| 695 | bs JU6 |
| 696 | bverdict u |
| 697 | bs JU7 |
| 698 | bstage u |
| 699 | bs JU8 |
| 700 | bu get Urc u |
| 701 | bs JU9 |
| 702 | bqnull get Ur0 u get Urn u |
| 703 | junit2 u |
| 704 | end |
| 705 | |
| 706 | fn junit2 u ulong to void |
| 707 | bs JUa |
| 708 | bqnull get Ua0 u get Uan u |
| 709 | bs JUb |
| 710 | bqnull get Uw0 u get Uwn u |
| 711 | bs JUc |
| 712 | bu get Unv u |
| 713 | bs JUd |
| 714 | bu get Umo u |
| 715 | bs JUe |
| 716 | bu get Umt u |
| 717 | bs JUf |
| 718 | end |
| 719 | |
| 720 | note report.json is built in the arena from m; the caller writes it to a file and/or stdout |
| 721 | fn bjson to void |
| 722 | jhead |
| 723 | for f ulong get Nf 0 |
| 724 | jfile f |
| 725 | end |
| 726 | bs JM |
| 727 | for u ulong get Nu 0 |
| 728 | junit u |
| 729 | end |
| 730 | bs JN |
| 731 | end |
| 732 | |
| 733 | text PJson "report.json" |
| 734 | text PMd "REPORT.md" |
| 735 | text PMan "omega/manifest.json" |
| 736 | |
| 737 | note ---------- REPORT.md ---------- |
| 738 | text MA "# babel report\n\nGenerated by babel " |
| 739 | text MB ". Every verdict below comes from a tool that ran in this pass; nothing is copied from a previous run.\n\n| | |\n|---|---|\n| input | `" |
| 740 | text MC "` |\n| output | `" |
| 741 | text MD "` |\n| target | " |
| 742 | text ME " |\n| profile | " |
| 743 | text MF " (pure functions of 0-6 `uint64_t` inputs: `+ - *` modulo 2^64, one return expression, at most 4096 bytes) |\n| adapters | aien-dev/omega-mv `" |
| 744 | text MG "` (`" |
| 745 | text MH "`), native omc sha256 `" |
| 746 | text MI "` |\n| generated tests | " |
| 747 | text MJ " |\n" |
| 748 | text MTl "| " |
| 749 | text MTm " | " |
| 750 | text MTn " |\n" |
| 751 | text MNo "not found" |
| 752 | text MK "\n## Result\n\n" |
| 753 | text ML "\n\n**Verdicts.** TRANSLATED: the adapters exited 0, the lowered unit passed the pinned omc, and the original C function, the Omega unit and the generated target printed byte-identical results on every test vector. UNSUPPORTED(rc): an adapter refused the unit with exit code rc; the first line of its stderr is the detail. MISSING_IMPLEMENTATION: no adapter exists for this construct, file or language yet. FAIL: a tool broke or two legs disagreed. NOT_RUN: a required tool was missing, so no verdict was reached. ABSORBED: the `#include <stdint.h>` line, which babel supplies to every unit.\n\n**Renames.** The S1 adapters accept only the function names `calc` or `omega_*`. babel hands every other function to them as `omega_<name>` and packages the result under the original name; the adapter name of each unit is listed in report.json (`adapter_name`).\n\n**Vectors.** Every unit runs on the 9 boundary values {0, 1, 2, 2^32-1, 2^32, 2^63-1, 2^63, 2^64-2, 2^64-1} (all combinations up to 3 inputs, 81 rows above that) plus 64 splitmix64 vectors from seed 20261026. The inputs and all three outputs are kept under `diff/<name>/`.\n\n## Units\n\n| verdict | unit | where | kind | stage | detail |\n|---|---|---|---|---|---|\n" |
| 754 | text MM "\n## Input files\n\n`input/` is a byte copy of these files; each sha256 below was computed while copying.\n\n| file | language | bytes | sha256 |\n|---|---|---|---|\n" |
| 755 | text MN "\n## Not walked\n\nDot entries (`.git`, `.cache`, ...), symbolic links, other non-regular files, `*.babel` folders and unreadable directories are neither copied nor translated. Each one is counted in the completion record below and listed there as SKIPPED.\n" |
| 756 | |
| 757 | fn mtool s ulong nm view uchar * to void |
| 758 | bs MTl |
| 759 | bs nm |
| 760 | bs MTm |
| 761 | if eq get Tok s 1 |
| 762 | bmd get Tv0 s get Tvn s |
| 763 | else |
| 764 | bs MNo |
| 765 | end |
| 766 | bs MTn |
| 767 | end |
| 768 | |
| 769 | fn mdhead to void |
| 770 | bs MA |
| 771 | bs Ver |
| 772 | bs MB |
| 773 | bpl get Rt0 0 get Rtn 0 |
| 774 | bs MC |
| 775 | bout |
| 776 | bs MD |
| 777 | blang get Lg 0 |
| 778 | bs ME |
| 779 | bs Prof |
| 780 | bs MF |
| 781 | if eq get Ahn 0 0 |
| 782 | bs Unk |
| 783 | else |
| 784 | bpl get Ah0 0 get Ahn 0 |
| 785 | end |
| 786 | bs MG |
| 787 | bpl get Ar0 0 get Arn 0 |
| 788 | bs MH |
| 789 | bs OmcPin |
| 790 | bs MI |
| 791 | btsr |
| 792 | bs MJ |
| 793 | mtool 0 TlNm0 |
| 794 | mtool 1 TlNm1 |
| 795 | mtool 2 TlNm2 |
| 796 | mtool 3 TlNm3 |
| 797 | mtool 4 TlNm4 |
| 798 | mtool 5 TlNm5 |
| 799 | bs MK |
| 800 | counts |
| 801 | scount 1 TSum1 |
| 802 | scount 2 TSum2 |
| 803 | scount 3 TSum3 |
| 804 | scount 4 TSum4 |
| 805 | scount 5 TSum5 |
| 806 | bu get Cnt 6 |
| 807 | bs MAbs |
| 808 | bs ML |
| 809 | end |
| 810 | |
| 811 | fn mdunit u ulong to void |
| 812 | bs MTl |
| 813 | bverdict u |
| 814 | bs MTm |
| 815 | bc 96 |
| 816 | bdisp u |
| 817 | bc 96 |
| 818 | bs MTm |
| 819 | bloc u |
| 820 | bs MTm |
| 821 | bkind u |
| 822 | bs MTm |
| 823 | bstage u |
| 824 | bs MTm |
| 825 | if eq get Ust u 1 |
| 826 | bu get Unv u |
| 827 | bs DTr1 |
| 828 | blang get Lg 0 |
| 829 | else |
| 830 | bmd get Ur0 u get Urn u |
| 831 | end |
| 832 | bs MTn |
| 833 | end |
| 834 | |
| 835 | fn mdfile f ulong to void |
| 836 | bs MTl |
| 837 | bmd get F0 f get Fl f |
| 838 | bs MTm |
| 839 | blang get Flg f |
| 840 | bs MTm |
| 841 | bu get Fsz f |
| 842 | bs MTm |
| 843 | bpl get Fh0 f 64 |
| 844 | bs MTn |
| 845 | end |
| 846 | |
| 847 | fn bmdrep to void |
| 848 | mdhead |
| 849 | for u ulong get Nu 0 |
| 850 | mdunit u |
| 851 | end |
| 852 | bs MM |
| 853 | for f ulong get Nf 0 |
| 854 | mdfile f |
| 855 | end |
| 856 | bs MN |
| 857 | cmdsec |
| 858 | end |
| 859 | |
| 860 | note ---------- omega/manifest.json ---------- |
| 861 | text OA "{\n \"schema\": \"babel.omega-manifest.v1\",\n \"profile\": \"" |
| 862 | text OB "\",\n \"adapters_head\": " |
| 863 | text OC ",\n \"units\": [" |
| 864 | text OD "\n ]\n}\n" |
| 865 | text OE "{\"name\": " |
| 866 | text OF ", \"source\": " |
| 867 | text OG ", \"c\": \"omega/" |
| 868 | text OH ".c\", \"omsa\": \"omega/" |
| 869 | text OI ".omsa\", \"om\": " |
| 870 | text OJ ", \"om_sha256\": " |
| 871 | text OK "}" |
| 872 | |
| 873 | fn bmanifest to void |
| 874 | bs OA |
| 875 | bs Prof |
| 876 | bs OB |
| 877 | bqnull get Ah0 0 get Ahn 0 |
| 878 | bs OC |
| 879 | k = ulong 0 |
| 880 | for u ulong get Nu 0 |
| 881 | if ne get Ukd u 1 |
| 882 | continue |
| 883 | end |
| 884 | if lt get Usg u 3 |
| 885 | continue |
| 886 | end |
| 887 | if gt k 0 |
| 888 | bc 44 |
| 889 | end |
| 890 | k = add k 1 |
| 891 | bs JNl |
| 892 | manunit u |
| 893 | end |
| 894 | bs OD |
| 895 | end |
| 896 | |
| 897 | text OmNone "null" |
| 898 | fn manunit u ulong to void |
| 899 | bs OE |
| 900 | c = mark |
| 901 | bname u |
| 902 | bjqob c |
| 903 | bs OF |
| 904 | c = mark |
| 905 | bloc u |
| 906 | bjqob c |
| 907 | bs OG |
| 908 | bname u |
| 909 | bs OH |
| 910 | bname u |
| 911 | bs OI |
| 912 | c = mark |
| 913 | bouts DOmega |
| 914 | bname u |
| 915 | bs ExOm |
| 916 | e = mark |
| 917 | r = hfile c e |
| 918 | reset c |
| 919 | if lt r 0 |
| 920 | bs OmNone |
| 921 | bs OJ |
| 922 | bs OmNone |
| 923 | else |
| 924 | bc 34 |
| 925 | bs DOmega |
| 926 | bname u |
| 927 | bs ExOm |
| 928 | bc 34 |
| 929 | bs OJ |
| 930 | bc 34 |
| 931 | bhash |
| 932 | bc 34 |
| 933 | end |
| 934 | bs OK |
| 935 | end |
| 936 | |
| 937 | note quote the arena bytes from c as a JSON string (moves them through the pool) |
| 938 | fn bjqob c ulong to void |
| 939 | n = sub mark c |
| 940 | p = psave c n |
| 941 | reset c |
| 942 | bjq p n |
| 943 | end |
| 944 | |
| 945 | note write REPORT.md, report.json and omega/manifest.json |
| 946 | fn reports to void |
| 947 | m = mark |
| 948 | bmdrep |
| 949 | w = wout m PMd |
| 950 | bjson |
| 951 | w = wout m PJson |
| 952 | bmanifest |
| 953 | w = wout m PMan |
| 954 | end |
| 955 | |
| 956 | note --json: report.json on stdout |
| 957 | fn jsonout to void |
| 958 | m = mark |
| 959 | bjson |
| 960 | flush 1 m |
| 961 | end |