Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-train/blob/main/tools/verified_examples/gate.om # aien-train AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-train / tools / verified_examples / gate.om` 689 lines ยท 13396 bytes Raw Blame History 1 text vgl0 "/good" 2 text vgl1 "/" 3 text vgl2 "/a" 4 text vgl3 "/request.wire" 5 text vgl4 "/response.json" 6 text vgl5 "/candidate." 7 text vgl6 "/TEST-DATA-full" 8 text vgl7 "/good/attempts.txt" 9 text vgl8 "/attempts.txt" 10 text vgl9 "/good/om/plain/task01/a1" 11 text vgl10 "/om/plain/task01/a1" 12 text vgl11 "/candidate.om" 13 text vgframekilled "KILLED trainer-framing mutant\n" 14 text vgg0 "/command.out" 15 text vgg1 "/command.err" 16 text vgg2 "/usr/bin/cp" 17 text vgg3 "-a" 18 text vgg4 "/run.txt" 19 text vgg5 "/good" 20 text vgg6 "/attempts.txt" 21 text vgg7 "prep" 22 text vgg8 "/bench/inference_cost" 23 text vgg9 "/seed/out/omc" 24 text vgg10 "/build/inference_cost/bin/chat" 25 text vgg11 "/mutant.om" 26 text vgg12 "/mutant" 27 text vgg13 "/mutant.err" 28 text vgg14 "KILLED converter mutant\n" 29 text vgg15 "/TEST-DATA-stale" 30 text vgg16 "/bad/om/plain/task01/a1/candidate.om" 31 text vgg17 "/om/plain/task01/a1/candidate.om" 32 text vgg18 "/bad/om/plain/task01/a1/response.json" 33 text vgg19 "/om/plain/task01/a1/response.json" 34 text vgg20 "/stale-base" 35 text vgg21 "/stale-mutant" 36 text vgg22 "KILLED stale-verdict mutant\n" 37 text vgg23 "/TEST-DATA-tamper" 38 text vgg24 "/tamper-base" 39 text vgg25 "/tamper-mutant" 40 text vgg26 "/TEST-DATA-pin" 41 text vgg27 "/pin-base" 42 text vgg28 "/pin-mutant" 43 text vgg29 "/TEST-DATA-digest" 44 text vgg30 "/digest-base" 45 text vgg31 "/digest-mutant" 46 text vgg32 "/TEST-DATA-mark" 47 text vgg33 "/mark-base" 48 text vgg34 "/mark-mutant" 49 text vgg35 "/TEST-DATA-full" 50 text vgg36 "/TEST-DATA-one" 51 text vgg37 "/TEST-DATA-two" 52 text vgg38 "/TEST-DATA-one/examples.jsonl" 53 text vgg39 "/TEST-DATA-two/examples.jsonl" 54 text vgg40 "/TEST-DATA-one/manifest.json" 55 text vgg41 "/TEST-DATA-two/manifest.json" 56 text vgg42 "/TEST-DATA-one/stories.txt" 57 text vgg43 "/TEST-DATA-two/stories.txt" 58 text vgg44 "/train.bin" 59 text vgg45 "/held.bin" 60 text vgg46 "references" 61 text vgg47 "/references" 62 text vgg48 "harness" 63 text vgg49 "/harness" 64 65 note Gate TOOL OMEGA HARNESS HARNESS_OMC TRAINER SELFTEST_ROOT COMPOSED_SOURCE ABS_WORK 66 text vgzero "`0000000000000000000000000000000000000000000000000000000000000000`" 67 text vgmetatext "version 1\nmodel_requested fake\nomc_sha256 " 68 text vgtaskline "\ntask_set_sha256 " 69 text vgtest "\nTEST DATA\n" 70 text vgrows "version 2\nattempts 1\ntask01 om plain 1 1 0 1 1 1 1 2\n" 71 text vgconst "const vxmut ulong 0" 72 text vgconstp "const vxmut ulong " 73 text vgfnl "\n" 74 text vgok "EXAMPLES-GATE PASS mutants=9 records=80\n" 75 text vgfail "EXAMPLES-GATE failure\n" 76 fn vgpath k ulong suffix view uchar * to void 77 vxcopy k 27 78 vxadd k suffix 79 end 80 fn vgsetup to void 81 vxset 6 vxnull 82 vgpath 7 vgg0 83 vgpath 8 vgg1 84 end 85 fn vgcheck actual ulong expected ulong to void 86 if ne actual expected 87 vxwrite 1 vgfail 88 put vxion 1 1 89 vxoutnum actual 90 vxbyte 32 91 vxoutnum expected 92 vxbyte 10 93 vxflush 94 vxfail 70 95 end 96 end 97 fn vgput k ulong a view uchar * to void 98 f = vxopen k 577 99 vxwrite f a 100 vxclose f 101 end 102 fn vgcopy src ulong dst ulong to void 103 vgsetup 104 vxpkinit 105 vxpk vgg2 106 vxpk vgg3 107 vxpkpath src 108 vxpkpath dst 109 r = vxspawn 110 vgcheck r 0 111 end 112 fn vgsize k ulong to ulong 113 st = new uchar 128 0 114 f = vxopen k 0 115 r = fstat f st 0 128 116 vxclose f 117 if ne r 0 118 vxfail 71 119 end 120 n = ulong 0 121 for i ulong 8 122 v = ulong get st add i 48 123 n = or n shl v mul i 8 124 end 125 ret n 126 end 127 fn vgmeta ombad bool taskbad bool marked bool to void 128 vxcopy 29 28 129 vxadd 29 vgg4 130 f = vxopen 29 577 131 vxwrite f vgmetatext 132 if ombad 133 vxwrite f vgzero 134 else 135 vxwrite f vxsha 136 end 137 vxwrite f vgtaskline 138 if taskbad 139 vxwrite f vgzero 140 else 141 vxwrite f vxtasks 142 end 143 if marked 144 vxwrite f vgtest 145 else 146 vxwrite f vgfnl 147 end 148 vxclose f 149 end 150 151 fn vginputfile suffix view uchar * to void 152 vxcopy 29 13 153 vxadd 29 suffix 154 vxcopy 30 14 155 vxadd 30 suffix 156 vgcopy 29 30 157 end 158 fn vgpathboth suffix view uchar * to void 159 vxadd 13 suffix 160 vxadd 14 suffix 161 end 162 fn vginputrow b view uchar * to void 163 lang = new uchar 8 0 164 word = new uchar 32 0 165 ln = vxword b 1 lang 166 vxcopy 13 25 167 vxadd 13 vgl0 168 vxcopy 14 28 169 vgpathboth vgl1 170 vgpathboth part lang 0 ln 171 vgpathboth vgl1 172 n = vxword b 2 word 173 vgpathboth part word 0 n 174 vgpathboth vgl1 175 n = vxword b 0 word 176 vgpathboth part word 0 n 177 vgpathboth vgl2 178 att = vxnumber b 3 179 vxdecimal 13 att 180 vxdecimal 14 att 181 vgmkdir 14 182 vginputfile vgl3 183 vginputfile vgl4 184 vxcopy 29 13 185 vxadd 29 vgl5 186 vxadd 29 part lang 0 ln 187 vxcopy 30 14 188 vxadd 30 vgl5 189 vxadd 30 part lang 0 ln 190 vgcopy 29 30 191 end 192 fn vgfullfixture to void 193 b = new uchar 4096 0 194 vgpath 28 vgl6 195 vgmkdir 28 196 vxcopy 29 25 197 vxadd 29 vgl7 198 vxcopy 30 28 199 vxadd 30 vgl8 200 vgcopy 29 30 201 fd = vxopen 29 0 202 n = vxline fd b 203 n = vxline fd b 204 count = vxnumber part b 0 n 1 205 for i ulong count bound `9223372036854775807` 206 n = vxline fd b 207 if eq n 0 208 vxfail 2 209 end 210 vginputrow part b 0 n 211 end 212 vxclose fd 213 vgmeta false false true 214 end 215 fn vgfixture suffix view uchar * to void 216 vgpath 28 suffix 217 vxcopy 13 25 218 vxadd 13 vgl9 219 vxcopy 14 28 220 vxadd 14 vgl10 221 vgmkdir 14 222 vginputfile vgl3 223 vginputfile vgl4 224 vginputfile vgl11 225 vxcopy 29 28 226 vxadd 29 vgl8 227 vgput 29 vgrows 228 vgmeta false false true 229 end 230 231 fn vgcall suffix view uchar * release bool prep bool to ulong 232 vgsetup 233 vgpath 19 suffix 234 vxpkinit 235 vxpkpath 20 236 if prep 237 vxpk vgg7 238 end 239 vxpkpath 28 240 vxcopy 29 21 241 vxadd 29 vgg8 242 vxpkpath 29 243 vxcopy 29 21 244 vxadd 29 vgg9 245 vxpkpath 29 246 vxcopy 29 21 247 vxadd 29 vgg10 248 vxpkpath 29 249 vxpkpath 19 250 if release 251 vxpk vxrelease 252 else 253 vxpk vxtest 254 end 255 ret vxspawn 256 end 257 fn vgmutation m ulong to void 258 b = new uchar 4096 0 259 fi = vxopen 26 0 260 vgpath 29 vgg11 261 fo = vxopen 29 577 262 hits = ulong 0 263 while true bound `9223372036854775807` 264 n = vxline fi b 265 if eq n 0 266 if vgeof fi 267 break 268 end 269 end 270 if vxequal part b 0 n vgconst 271 vxwrite fo vgconstp 272 put b 0 uchar add m 48 273 vxwrite fo part b 0 1 274 hits = add hits 1 275 else 276 vxwrite fo part b 0 n 277 end 278 vxwrite fo vgfnl 279 end 280 vxclose fi 281 vxclose fo 282 vgcheck hits 1 283 vxcopy 6 29 284 vgpath 7 vgg12 285 vgpath 8 vgg13 286 vxpkinit 287 vxcopy 29 21 288 vxadd 29 vgg9 289 vxpkpath 29 290 r = vxspawn 291 vgcheck r 0 292 r2 = chmod vxp mul ulong 7 4096 get vxplen 7 448 293 if ne r2 0 294 vxfail 71 295 end 296 vxcopy 20 7 297 end 298 fn vgeof fd int to bool 299 st = new uchar 128 0 300 p = fseek fd 0 1 301 r = fstat fd st 0 128 302 if or lt p 0 ne r 0 303 vxfail 71 304 end 305 n = ulong 0 306 for i ulong 8 307 v = ulong get st add i 48 308 n = or n shl v mul i 8 309 end 310 ret eq ulong p n 311 end 312 fn vgkill m ulong expected ulong suffix view uchar * to void 313 release = eq m 5 314 r = vgcall suffix release false 315 if eq r expected 316 vxfail 72 317 end 318 vxwrite 1 vgg14 319 end 320 321 text vgsepnote "\nnote <|endoftext|>\n" 322 text vgfence "```omega\n" 323 text vgfenceend "```" 324 text vgjsonstart "{\"model\":\"control\",\"usage\":{\"prompt_tokens\":1,\"completion_tokens\":1,\"total_tokens\":2},\"choices\":[{\"message\":{\"content\":" 325 text vgjsonend "}}]}\n" 326 text vgcontentpath "/framing-content" 327 text vgcaseframe "/TEST-DATA-framing" 328 text vgcanpath "/om/plain/task01/a1/candidate.om" 329 text vgresponsepath "/om/plain/task01/a1/response.json" 330 text vgframebase "/framing-base" 331 text vgframemutant "/framing-mutant" 332 fn vgframing to void 333 vgfixture vgcaseframe 334 vgmeta false false false 335 vxcopy 30 28 336 vxadd 30 vgcanpath 337 fd = vxopen 30 1025 338 vxwrite fd vgsepnote 339 vxclose fd 340 vgpath 31 vgcontentpath 341 fd = vxopen 31 577 342 vxwrite fd vgfence 343 vxrawfile 30 fd 344 vxwrite fd vgfenceend 345 vxclose fd 346 vxcopy 29 28 347 vxadd 29 vgresponsepath 348 fd = vxopen 29 577 349 put vxion 1 ulong fd 350 vxout vgjsonstart 351 vxqfile 31 352 vxout vgjsonend 353 vxflush 354 vxclose fd 355 r = vgcall vgframebase false true 356 vgcheck r 18 357 vgmutation 6 358 r = vgcall vgframemutant false true 359 if eq r 18 360 vxfail 72 361 end 362 vxwrite 1 vgframekilled 363 vxcopy 20 18 364 end 365 text vgwidefixture "/TEST-DATA-wide-attempt" 366 text vgwideold "/om/plain/task01/a1" 367 text vgwidenew "/om/plain/task01/`a4294967296`" 368 text vgwideatt "/attempts.txt" 369 text vgwiderows "version 2\nattempts 1\ntask01 om plain `4294967296` 0 0 1 1 1 1 2\n" 370 text vgwideout "/TEST-DATA-wide-positive" 371 text vgwidemut "/TEST-DATA-wide-mutant" 372 text vgwidekilled "KILLED artificial attempt-cap mutant\n" 373 fn vgwide to void 374 vgfixture vgwidefixture 375 vxcopy 29 28 376 vxadd 29 vgwideold 377 vxcopy 30 28 378 vxadd 30 vgwidenew 379 vgcopy 29 30 380 vxcopy 29 28 381 vxadd 29 vgwideatt 382 vgput 29 vgwiderows 383 r = vgcall vgwideout false false 384 vgcheck r 0 385 vxcopy 29 19 386 vxadd 29 vxt56 387 n = vgcountrecords 29 388 vgcheck n 1 389 vgmutation 7 390 r = vgcall vgwidemut false false 391 if eq r 0 392 vxfail 72 393 end 394 vxwrite 1 vgwidekilled 395 vxcopy 20 18 396 end 397 398 text vgmaxfixture "/TEST-DATA-uint64" 399 text vgmaxnew "/om/plain/task01/`a18446744073709551615`" 400 text vgmaxrows "version 2\nattempts 1\ntask01 om plain `18446744073709551615` 0 0 1 1 1 1 2\n" 401 text vgoverrows "version 2\nattempts 1\ntask01 om plain `18446744073709551617` 0 0 1 1 1 1 2\n" 402 text vgmaxout "/TEST-DATA-uint64-positive" 403 text vgoverout "/TEST-DATA-uint64-overflow" 404 text vgovermut "/TEST-DATA-uint64-overflow-mutant" 405 fn vgmax to void 406 vgfixture vgmaxfixture 407 vxcopy 29 28 408 vxadd 29 vgwideold 409 vxcopy 30 28 410 vxadd 30 vgmaxnew 411 vgcopy 29 30 412 vxcopy 29 28 413 vxadd 29 vgwideatt 414 vgput 29 vgmaxrows 415 r = vgcall vgmaxout false false 416 vgcheck r 0 417 vxcopy 29 19 418 vxadd 29 vxt56 419 n = vgcountrecords 29 420 vgcheck n 1 421 vxcopy 29 28 422 vxadd 29 vgwideatt 423 vgput 29 vgoverrows 424 r = vgcall vgoverout false false 425 vgcheck r 2 426 vgmutation 8 427 vgkill 8 2 vgovermut 428 vxcopy 20 18 429 end 430 431 text vgpindir "/capped-referee" 432 text vgpbench "/bench" 433 text vgpseed "/seed/out" 434 text vgpchatdir "/build/inference_cost/bin" 435 text vgpbenchsource "/bench/inference_cost" 436 text vgpbenchfile "/bench/inference_cost/driver.sh" 437 text vgpcompiler "/seed/out/omc" 438 text vgppin "/seed/out/omc.sha256" 439 text vgpchat "/build/inference_cost/bin/chat" 440 text vgpcomment "\n# TEST DATA: byte-mutated capped driver, not the approved referee artifact\n" 441 text vgpfxture "/TEST-DATA-referee-pin" 442 text vgpbase "/TEST-DATA-referee-pin-base" 443 text vgpmut "/TEST-DATA-referee-pin-mutant" 444 text vgpkilled "KILLED unapproved-referee mutant\n" 445 text vgpmkdir "/usr/bin/mkdir" 446 text vgpminus "-p" 447 text vgpchild "/inference_cost" 448 fn vgmkdir k ulong to void 449 vgsetup 450 vxpkinit 451 vxpk vgpmkdir 452 vxpk vgpminus 453 vxpkpath k 454 r = vxspawn 455 vgcheck r 0 456 end 457 fn vgcopyrelative suffix view uchar * to void 458 vxcopy 29 21 459 vxadd 29 suffix 460 vxcopy 30 16 461 vxadd 30 suffix 462 vgcopy 29 30 463 end 464 fn vgdriver to void 465 vgfixture vgpfxture 466 vgpath 16 vgpindir 467 vxcopy 29 16 468 vxadd 29 vgpbench 469 vgmkdir 29 470 vxcopy 30 21 471 vxadd 30 vgpbenchsource 472 vxcopy 31 29 473 vxadd 31 vgpchild 474 vgcopy 30 31 475 vxcopy 29 16 476 vxadd 29 vgpseed 477 vgmkdir 29 478 vgcopyrelative vgpcompiler 479 vgcopyrelative vgppin 480 vxcopy 29 16 481 vxadd 29 vgpchatdir 482 vgmkdir 29 483 vgcopyrelative vgpchat 484 vxcopy 29 16 485 vxadd 29 vgpbenchfile 486 fd = vxopen 29 1025 487 vxwrite fd vgpcomment 488 vxclose fd 489 vxcopy 15 21 490 vxcopy 21 16 491 r = vgcall vgpbase false false 492 vgcheck r 20 493 vgmutation 9 494 r = vgcall vgpmut false false 495 vgcheck r 0 496 vxcopy 29 19 497 vxadd 29 vxt56 498 n = vgcountrecords 29 499 vgcheck n 1 500 vxwrite 1 vgpkilled 501 vxcopy 21 15 502 vxcopy 20 18 503 end 504 fn vgcontrols to void 505 note Stale verified verdict: candidate and response agree on a wrong but compiling program. 506 vgfixture vgg15 507 vxcopy 29 25 508 vxadd 29 vgg16 509 vxcopy 30 28 510 vxadd 30 vgg17 511 vgcopy 29 30 512 vxcopy 29 25 513 vxadd 29 vgg18 514 vxcopy 30 28 515 vxadd 30 vgg19 516 vgcopy 29 30 517 vgmeta false false false 518 r = vgcall vgg20 false true 519 vgcheck r 0 520 vxcopy 29 19 521 vxadd 29 vxt56 522 n = vgsize 29 523 vgcheck n 0 524 vxcopy 29 19 525 vxadd 29 vxstories 526 n = vgsize 29 527 vgcheck n 0 528 vgmutation 1 529 r = vgcall vgg21 false false 530 vgcheck r 0 531 vxcopy 29 19 532 vxadd 29 vxt56 533 n = vgsize 29 534 if eq n 0 535 vxfail 72 536 end 537 vxwrite 1 vgg22 538 vxcopy 20 18 539 note Candidate changed while the original response remains unchanged. 540 vgfixture vgg23 541 vxcopy 29 25 542 vxadd 29 vgg16 543 vxcopy 30 28 544 vxadd 30 vgg17 545 vgcopy 29 30 546 vgmeta false false false 547 r = vgcall vgg24 false false 548 vgcheck r 15 549 vgmutation 2 550 vgkill 2 15 vgg25 551 vxcopy 20 18 552 vgfixture vgg26 553 vgmeta true false false 554 r = vgcall vgg27 false false 555 vgcheck r 10 556 vgmutation 3 557 vgkill 3 10 vgg28 558 vxcopy 20 18 559 vgfixture vgg29 560 vgmeta false true false 561 r = vgcall vgg30 false false 562 vgcheck r 11 563 vgmutation 4 564 vgkill 4 11 vgg31 565 vxcopy 20 18 566 vgfixture vgg32 567 r = vgcall vgg33 true false 568 vgcheck r 13 569 vgmutation 5 570 vgkill 5 13 vgg34 571 vxcopy 20 18 572 end 573 fn vgcountrecords k ulong to ulong 574 b = new uchar 65536 0 575 fd = vxopen k 0 576 count = ulong 0 577 while true bound `9223372036854775807` 578 r = read fd b 0 len b 579 if lt r 0 580 vxfail 71 581 end 582 if eq r 0 583 break 584 end 585 for i ulong ulong r 586 if eq get b i 10 587 count = add count 1 588 end 589 end 590 end 591 vxclose fd 592 ret count 593 end 594 fn vgdeterminism to void 595 h1 = new uchar 64 0 596 h2 = new uchar 64 0 597 vgfullfixture 598 r = vgcall vgg36 false true 599 vgcheck r 0 600 r = vgcall vgg37 false true 601 vgcheck r 0 602 vgpath 29 vgg38 603 vgpath 30 vgg39 604 count = vgcountrecords 29 605 vgcheck count 80 606 vxhash 29 h1 607 vxhash 30 h2 608 if not vxequal h1 h2 609 vxfail 73 610 end 611 vxwrite 1 h1 612 vxwrite 1 vgfnl 613 vgpath 29 vgg40 614 vgpath 30 vgg41 615 vxhash 29 h1 616 vxhash 30 h2 617 if not vxequal h1 h2 618 vxfail 73 619 end 620 vxwrite 1 h1 621 vxwrite 1 vgfnl 622 vgpath 29 vgg42 623 vgpath 30 vgg43 624 vxhash 29 h1 625 vxhash 30 h2 626 if not vxequal h1 h2 627 vxfail 73 628 end 629 vxwrite 1 h1 630 vxwrite 1 vgfnl 631 vgsetup 632 vxpkinit 633 vxpkpath 24 634 vxpk vgg7 635 vxpkpath 29 636 vgpath 30 vgg44 637 vxpkpath 30 638 vgpath 30 vgg45 639 vxpkpath 30 640 r = vxspawn 641 vgcheck r 0 642 end 643 fn vgsources mode view uchar * root ulong compiler ulong suffix view uchar * to void 644 vgsetup 645 vxpkinit 646 vxpkpath 20 647 vxpk mode 648 vxpkpath root 649 vxpkpath compiler 650 vxcopy 29 21 651 vxadd 29 vgg10 652 vxpkpath 29 653 vgpath 29 suffix 654 vxpkpath 29 655 vxpk vxrelease 656 r = vxspawn 657 vgcheck r 0 658 end 659 fn main to int 660 if ne argcnt 9 661 vxfail 2 662 end 663 for i ulong 8 664 vxarg add i 1 add i 20 665 end 666 note Slots:20 tool,21 omega,22 harness,23 harness omc,24 trainer,25 selftest,26 source,27 work. 667 vxcopy 18 20 668 vxenvinit 669 r = makedir vxp mul ulong 27 4096 get vxplen 27 448 670 if ne r 0 671 vxfail 3 672 end 673 vgcontrols 674 vgframing 675 vgwide 676 vgmax 677 vgdriver 678 vgdeterminism 679 vxcopy 29 21 680 vxadd 29 vgg9 681 vxcopy 17 29 682 vxcopy 29 21 683 vxadd 29 vgg8 684 vxcopy 16 29 685 vgsources vgg46 16 17 vgg47 686 vgsources vgg48 22 23 vgg49 687 vxwrite 1 vgok 688 ret 0 689 end