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
aien-train / tools / verified_examples / examples.om
| 1 | note SPDX-License-Identifier: AGPL-3.0-or-later |
| 2 | note DRA-122. Compose after omega-mv om/tls/sha2.om and seed/json/json.om. |
| 3 | note verify RUN BENCH OMC CHAT OUT release|test |
| 4 | note Fixed path arrays implement Linux PATH_MAX, not a dataset size limit. Data streams. |
| 5 | const vxmut ulong 0 |
| 6 | text vxtestlicence ",\"licence_position\":\"TEST DATA from benchmark fixtures; original source licences retained; not model-written training evidence\"}\n" |
| 7 | text vxdriverpin "219e156eb083aa70eb3ab7027d289b8df34c955c7cf469414b91264e187965e6" |
| 8 | text vxsha "a5613368f427aacd73ebeee16d46f8b3203405711d4de5b860d0cbee11ce4533" |
| 9 | text vxtasks "e14b430d58d9cb86aa264deb814ac930e1d5dae1c146ddd43af4067d707472d6" |
| 10 | text vxslash "/" |
| 11 | text vxrun "/run.txt" |
| 12 | text vxatt "/attempts.txt" |
| 13 | text vxdriver "/driver.sh" |
| 14 | text vxnull "/dev/null" |
| 15 | text vxerr "verified-examples: refused\n" |
| 16 | text vxshell "/usr/bin/sh" |
| 17 | text vxextract "exec \"$1\" resp < \"$2\" 3> \"$3\"" |
| 18 | text vxtaskdir "/tasks/" |
| 19 | text vxstories "/stories.txt" |
| 20 | text vxdochead "Task:\n" |
| 21 | text vxdocprog "\nProgram:\n" |
| 22 | text vxeot "\n<|endoftext|>\n" |
| 23 | text vxstatement "/statement.txt" |
| 24 | text vxstorysha ",\"stories_sha256\":" |
| 25 | text vxomckey "OMC=" |
| 26 | text vxseparator "<|endoftext|>" |
| 27 | text vxsdflag "--task-set-sha256" |
| 28 | text vxsourcekey ",\"source\":" |
| 29 | text vxmodelsource "model-run" |
| 30 | text vxrefsource "reference-solutions" |
| 31 | text vxharsource "harness-examples" |
| 32 | text vxarrnone "[]" |
| 33 | text vxpathkey "PATH=" |
| 34 | text vxtest "test" |
| 35 | text vxrelease "release" |
| 36 | text vxevalout "/eval/out.txt" |
| 37 | text vxhex "0123456789abcdef" |
| 38 | text vxt0 "omc_sha256" |
| 39 | text vxt1 "task_set_sha256" |
| 40 | text vxt2 "TEST" |
| 41 | text vxt3 "model_requested" |
| 42 | text vxt4 "fake" |
| 43 | text vxt5 "/TEST_DATA" |
| 44 | text vxt6 "\\u00" |
| 45 | text vxt7 "/request.wire" |
| 46 | text vxt8 "[" |
| 47 | text vxt9 "msg" |
| 48 | text vxt10 "," |
| 49 | text vxt11 "{\"role\":" |
| 50 | text vxt12 ",\"content\":\"" |
| 51 | text vxt13 "\"}" |
| 52 | text vxt14 "]" |
| 53 | text vxt15 "/response.meta" |
| 54 | text vxt16 "/response.err" |
| 55 | text vxt17 "-c" |
| 56 | text vxt18 "extract" |
| 57 | text vxt19 "/referee.txt" |
| 58 | text vxt20 "/referee.err" |
| 59 | text vxt21 "--verify-candidate" |
| 60 | text vxt22 "{\"task\":" |
| 61 | text vxt23 ",\"language\":" |
| 62 | text vxt24 ",\"arm\":" |
| 63 | text vxt25 ",\"attempt\":" |
| 64 | text vxt26 ",\"messages\":" |
| 65 | text vxt27 ",\"program\":" |
| 66 | text vxt28 ",\"omc_sha256\":" |
| 67 | text vxt29 ",\"task_set_sha256\":" |
| 68 | text vxt30 ",\"referee_output_sha256\":" |
| 69 | text vxt31 ",\"test_data\":" |
| 70 | text vxt32 "true" |
| 71 | text vxt33 "false" |
| 72 | text vxt34 "}\n" |
| 73 | text vxt35 "task" |
| 74 | text vxt36 "c" |
| 75 | text vxt37 "py" |
| 76 | text vxt38 "rs" |
| 77 | text vxt39 "om" |
| 78 | text vxt40 "plain" |
| 79 | text vxt41 "feedback" |
| 80 | text vxt42 "/a" |
| 81 | text vxt43 "/candidate." |
| 82 | text vxt44 "/extracted" |
| 83 | text vxt45 "/response.json" |
| 84 | text vxt46 "/evaluation" |
| 85 | text vxt48 "{\"format\":\"verified-programs-v1\",\"records\":" |
| 86 | text vxt49 ",\"counts\":{\"om\":" |
| 87 | text vxt50 ",\"c\":" |
| 88 | text vxt51 ",\"py\":" |
| 89 | text vxt52 ",\"rs\":" |
| 90 | text vxt53 "},\"rejected\":" |
| 91 | text vxt54 ",\"sha256\":" |
| 92 | text vxt55 ",\"licence_position\":\"model-written code, verified, from Drake's own runs; verification does not establish copyright or grant rights in third-party material\"}\n" |
| 93 | text vxt56 "/examples.jsonl" |
| 94 | text vxt57 "/manifest.json" |
| 95 | text vxt58 "version 2" |
| 96 | global vxp uchar 131072 |
| 97 | global vxplen ulong 32 |
| 98 | global vxpacket uchar 65536 |
| 99 | global vxpn ulong 2 |
| 100 | global vxstatus uchar 4 |
| 101 | global vxio uchar 65536 |
| 102 | global vxion ulong 2 |
| 103 | global vxcounts ulong 12 |
| 104 | global vxshift ulong 1 |
| 105 | global vxstoryfd long 1 |
| 106 | global vxenv uchar 4096 |
| 107 | global vxenvn ulong 1 |
| 108 | note Paths: 0 run,1 bench,2 omc,3 chat,4 output,5 driver,6 input,7 stdout,8 stderr, |
| 109 | note 9 attempt,10 candidate,11 extracted,12 response,13 evaluation work,14 JSONL,15 manifest. |
| 110 | fn vxfail n int to void |
| 111 | r = write 2 vxerr 0 len vxerr |
| 112 | exit n |
| 113 | end |
| 114 | fn vxset k ulong a view uchar * to void |
| 115 | if ge len a 4096 |
| 116 | vxfail 2 |
| 117 | end |
| 118 | for i ulong len a |
| 119 | put vxp add mul k 4096 i get a i |
| 120 | end |
| 121 | put vxplen k len a |
| 122 | end |
| 123 | fn vxcopy k ulong j ulong to void |
| 124 | ko = mul k 4096 |
| 125 | jo = mul j 4096 |
| 126 | for i ulong get vxplen j |
| 127 | v = get vxp add jo i |
| 128 | put vxp add ko i v |
| 129 | end |
| 130 | put vxplen k get vxplen j |
| 131 | end |
| 132 | fn vxadd k ulong a view uchar * to void |
| 133 | n = get vxplen k |
| 134 | if ge add n len a 4096 |
| 135 | vxfail 2 |
| 136 | end |
| 137 | for i ulong len a |
| 138 | put vxp add add mul k 4096 n i get a i |
| 139 | end |
| 140 | put vxplen k add n len a |
| 141 | end |
| 142 | fn vxdecimal k ulong n ulong to void |
| 143 | b = new uchar 20 0 |
| 144 | p = ulong 20 |
| 145 | v = n |
| 146 | while true bound 20 |
| 147 | p = sub p 1 |
| 148 | put b p uchar add rem v 10 48 |
| 149 | v = div v 10 |
| 150 | if eq v 0 |
| 151 | break |
| 152 | end |
| 153 | end |
| 154 | vxadd k part b p sub 20 p |
| 155 | end |
| 156 | fn vxarg i ulong k ulong to void |
| 157 | r = argread add i get vxshift 0 vxp mul k 4096 4095 |
| 158 | if lt r 1 |
| 159 | vxfail 2 |
| 160 | end |
| 161 | put vxplen k ulong r |
| 162 | end |
| 163 | fn vxopen k ulong flags int to int |
| 164 | r = fopen vxp mul k 4096 get vxplen k flags 384 |
| 165 | if lt r 0 |
| 166 | vxfail 3 |
| 167 | end |
| 168 | ret int r |
| 169 | end |
| 170 | fn vxclose fd int to void |
| 171 | r = fclose fd |
| 172 | if ne r 0 |
| 173 | vxfail 3 |
| 174 | end |
| 175 | end |
| 176 | fn vxwrite fd int a view uchar * to void |
| 177 | p = ulong 0 |
| 178 | while lt p len a bound 9223372036854775807 |
| 179 | r = write fd a p sub len a p |
| 180 | if le r 0 |
| 181 | vxfail 3 |
| 182 | end |
| 183 | p = add p ulong r |
| 184 | end |
| 185 | end |
| 186 | fn vxpkinit to void |
| 187 | put vxpn 0 2 |
| 188 | put vxpn 1 0 |
| 189 | end |
| 190 | fn vxpk a view uchar * to void |
| 191 | n = get vxpn 0 |
| 192 | if gt add add n 2 len a 65536 |
| 193 | vxfail 2 |
| 194 | end |
| 195 | put vxpacket n uchar and len a 255 |
| 196 | put vxpacket add n 1 uchar shr len a 8 |
| 197 | for i ulong len a |
| 198 | put vxpacket add add n 2 i get a i |
| 199 | end |
| 200 | put vxpn 0 add add n 2 len a |
| 201 | put vxpn 1 add get vxpn 1 1 |
| 202 | end |
| 203 | fn vxpkpath k ulong to void |
| 204 | b = new uchar 4096 0 |
| 205 | n = get vxplen k |
| 206 | for i ulong n |
| 207 | put b i get vxp add mul k 4096 i |
| 208 | end |
| 209 | vxpk part b 0 n |
| 210 | end |
| 211 | fn vxspawn to ulong |
| 212 | put vxpacket 0 uchar and get vxpn 1 255 |
| 213 | put vxpacket 1 uchar shr get vxpn 1 8 |
| 214 | pid = fork |
| 215 | if lt pid 0 |
| 216 | vxfail 3 |
| 217 | end |
| 218 | if eq pid 0 |
| 219 | f0 = vxopen 6 0 |
| 220 | f1 = vxopen 7 577 |
| 221 | f2 = vxopen 8 577 |
| 222 | r0 = dupfd f0 0 0 |
| 223 | r1 = dupfd f1 1 0 |
| 224 | r2 = dupfd f2 2 0 |
| 225 | if or or ne r0 0 ne r1 1 ne r2 2 |
| 226 | exit 126 |
| 227 | end |
| 228 | r = execenv vxpacket 0 get vxpn 0 vxenv 0 get vxenvn 0 |
| 229 | exit 126 |
| 230 | end |
| 231 | w = waitpid int pid vxstatus 0 4 0 |
| 232 | if ne w pid |
| 233 | vxfail 3 |
| 234 | end |
| 235 | if ne and get vxstatus 0 127 0 |
| 236 | ret add ulong 256 ulong get vxstatus 0 |
| 237 | end |
| 238 | ret ulong get vxstatus 1 |
| 239 | end |
| 240 | fn vxhash k ulong h edit uchar * to void |
| 241 | b = new uchar 65536 0 |
| 242 | c = new ulong 40 0 |
| 243 | d = new uchar 32 0 |
| 244 | fd = vxopen k 0 |
| 245 | sha256_init c |
| 246 | while true bound 9223372036854775807 |
| 247 | r = read fd b 0 len b |
| 248 | if lt r 0 |
| 249 | vxfail 3 |
| 250 | end |
| 251 | if eq r 0 |
| 252 | break |
| 253 | end |
| 254 | sha256_update c part b 0 ulong r |
| 255 | end |
| 256 | vxclose fd |
| 257 | sha256_final c d |
| 258 | for i ulong 32 |
| 259 | v = get d i |
| 260 | put h mul i 2 get vxhex ulong shr v 4 |
| 261 | put h add mul i 2 1 get vxhex ulong and v 15 |
| 262 | end |
| 263 | end |
| 264 | fn vxequal a view uchar * b view uchar * to bool |
| 265 | if ne len a len b |
| 266 | ret false |
| 267 | end |
| 268 | for i ulong len a |
| 269 | if ne get a i get b i |
| 270 | ret false |
| 271 | end |
| 272 | end |
| 273 | ret true |
| 274 | end |
| 275 | note line reader: overlong lines are protocol-invalid; payloads are byte-counted and stream separately. |
| 276 | fn vxline fd int b edit uchar * to ulong |
| 277 | one = new uchar 1 0 |
| 278 | n = ulong 0 |
| 279 | while true bound 9223372036854775807 |
| 280 | r = read fd one 0 1 |
| 281 | if lt r 0 |
| 282 | vxfail 3 |
| 283 | end |
| 284 | if eq r 0 |
| 285 | if eq n 0 |
| 286 | ret 0 |
| 287 | end |
| 288 | vxfail 2 |
| 289 | end |
| 290 | if eq get one 0 10 |
| 291 | ret n |
| 292 | end |
| 293 | if eq n len b |
| 294 | vxfail 2 |
| 295 | end |
| 296 | put b n get one 0 |
| 297 | n = add n 1 |
| 298 | end |
| 299 | ret 0 |
| 300 | end |
| 301 | fn vxfield b view uchar * k ulong to ulong |
| 302 | p = ulong 0 |
| 303 | for i ulong k |
| 304 | while lt p len b bound 9223372036854775807 |
| 305 | c = get b p |
| 306 | p = add p 1 |
| 307 | if eq c 32 |
| 308 | break |
| 309 | end |
| 310 | end |
| 311 | end |
| 312 | ret p |
| 313 | end |
| 314 | fn vxword b view uchar * k ulong a edit uchar * to ulong |
| 315 | p = vxfield b k |
| 316 | n = ulong 0 |
| 317 | while lt p len b bound 9223372036854775807 |
| 318 | c = get b p |
| 319 | if eq c 32 |
| 320 | break |
| 321 | end |
| 322 | if eq n len a |
| 323 | vxfail 2 |
| 324 | end |
| 325 | put a n c |
| 326 | p = add p 1 |
| 327 | n = add n 1 |
| 328 | end |
| 329 | ret n |
| 330 | end |
| 331 | fn vxnum b view uchar * to ulong |
| 332 | n = ulong 0 |
| 333 | if eq len b 0 |
| 334 | vxfail 2 |
| 335 | end |
| 336 | for i ulong len b |
| 337 | c = get b i |
| 338 | if or lt c 48 gt c 57 |
| 339 | vxfail 2 |
| 340 | end |
| 341 | if ne vxmut 8 |
| 342 | if gt n 1844674407370955161 |
| 343 | vxfail 2 |
| 344 | end |
| 345 | end |
| 346 | d = ulong sub c 48 |
| 347 | if ne vxmut 8 |
| 348 | if eq n 1844674407370955161 |
| 349 | if gt d 5 |
| 350 | vxfail 2 |
| 351 | end |
| 352 | end |
| 353 | end |
| 354 | n = add mul n 10 d |
| 355 | end |
| 356 | ret n |
| 357 | end |
| 358 | fn vxnumber b view uchar * k ulong to ulong |
| 359 | a = new uchar 32 0 |
| 360 | n = vxword b k a |
| 361 | ret vxnum part a 0 n |
| 362 | end |
| 363 | fn vxeof fd int to bool |
| 364 | st = new uchar 128 0 |
| 365 | p = fseek fd 0 1 |
| 366 | r = fstat fd st 0 len st |
| 367 | if or lt p 0 ne r 0 |
| 368 | vxfail 3 |
| 369 | end |
| 370 | n = ulong 0 |
| 371 | for i ulong 8 |
| 372 | v = ulong get st add i 48 |
| 373 | n = or n shl v mul i 8 |
| 374 | end |
| 375 | ret eq ulong p n |
| 376 | end |
| 377 | note Metadata admission only needs short keys and pin values. Consume unknown fields of any size. |
| 378 | fn vxmetaline fd int b edit uchar * to ulong |
| 379 | one = new uchar 1 0 |
| 380 | n = ulong 0 |
| 381 | while true bound 9223372036854775807 |
| 382 | r = read fd one 0 1 |
| 383 | if lt r 0 |
| 384 | vxfail 3 |
| 385 | end |
| 386 | if eq r 0 |
| 387 | ret n |
| 388 | end |
| 389 | if eq get one 0 10 |
| 390 | ret n |
| 391 | end |
| 392 | if lt n len b |
| 393 | put b n get one 0 |
| 394 | n = add n 1 |
| 395 | end |
| 396 | end |
| 397 | ret n |
| 398 | end |
| 399 | fn vxmeta release bool to void |
| 400 | b = new uchar 128 0 |
| 401 | a = new uchar 4096 0 |
| 402 | vxcopy 6 0 |
| 403 | vxadd 6 vxrun |
| 404 | fd = vxopen 6 0 |
| 405 | seen = ulong 0 |
| 406 | while true bound 9223372036854775807 |
| 407 | n = vxmetaline fd b |
| 408 | if eq n 0 |
| 409 | if vxeof fd |
| 410 | break |
| 411 | end |
| 412 | continue |
| 413 | end |
| 414 | k = vxword part b 0 n 0 a |
| 415 | if vxequal part a 0 k vxt0 |
| 416 | z = vxword part b 0 n 1 a |
| 417 | if ne vxmut 3 |
| 418 | if not vxequal part a 0 z vxsha |
| 419 | vxfail 10 |
| 420 | end |
| 421 | end |
| 422 | seen = or seen 1 |
| 423 | end |
| 424 | if vxequal part a 0 k vxt1 |
| 425 | z = vxword part b 0 n 1 a |
| 426 | if ne vxmut 4 |
| 427 | if not vxequal part a 0 z vxtasks |
| 428 | vxfail 11 |
| 429 | end |
| 430 | end |
| 431 | seen = or seen 2 |
| 432 | end |
| 433 | if vxequal part a 0 k vxt2 |
| 434 | put vxcounts 6 1 |
| 435 | end |
| 436 | if vxequal part a 0 k vxt3 |
| 437 | z = vxword part b 0 n 1 a |
| 438 | if vxequal part a 0 z vxt4 |
| 439 | put vxcounts 6 1 |
| 440 | end |
| 441 | end |
| 442 | end |
| 443 | vxclose fd |
| 444 | if ne seen 3 |
| 445 | vxfail 12 |
| 446 | end |
| 447 | vxcopy 6 0 |
| 448 | vxadd 6 vxt5 |
| 449 | r = faccess vxp mul ulong 6 4096 get vxplen 6 0 |
| 450 | if eq r 0 |
| 451 | put vxcounts 6 1 |
| 452 | end |
| 453 | if ne vxmut 5 |
| 454 | if and release ne get vxcounts 6 0 |
| 455 | vxfail 13 |
| 456 | end |
| 457 | end |
| 458 | end |
| 459 | fn vxflush to void |
| 460 | n = get vxion 0 |
| 461 | p = ulong 0 |
| 462 | while lt p n bound 65536 |
| 463 | r = write int get vxion 1 vxio p sub n p |
| 464 | if le r 0 |
| 465 | vxfail 3 |
| 466 | end |
| 467 | p = add p ulong r |
| 468 | end |
| 469 | put vxion 0 0 |
| 470 | end |
| 471 | fn vxbyte c uchar to void |
| 472 | n = get vxion 0 |
| 473 | put vxio n c |
| 474 | put vxion 0 add n 1 |
| 475 | if eq add n 1 65536 |
| 476 | vxflush |
| 477 | end |
| 478 | end |
| 479 | fn vxout a view uchar * to void |
| 480 | for i ulong len a bound 9223372036854775807 |
| 481 | vxbyte get a i |
| 482 | end |
| 483 | end |
| 484 | fn vxquote a view uchar * to void |
| 485 | vxbyte 34 |
| 486 | for i ulong len a bound 9223372036854775807 |
| 487 | vxescape get a i |
| 488 | end |
| 489 | vxbyte 34 |
| 490 | end |
| 491 | fn vxescape c uchar to void |
| 492 | if or eq c 34 eq c 92 |
| 493 | vxbyte 92 |
| 494 | vxbyte c |
| 495 | ret |
| 496 | end |
| 497 | if lt c 32 |
| 498 | vxout vxt6 |
| 499 | vxbyte get vxhex ulong shr c 4 |
| 500 | vxbyte get vxhex ulong and c 15 |
| 501 | ret |
| 502 | end |
| 503 | vxbyte c |
| 504 | end |
| 505 | fn vxqfile k ulong to void |
| 506 | b = new uchar 65536 0 |
| 507 | fd = vxopen k 0 |
| 508 | vxbyte 34 |
| 509 | state = ulong 0 |
| 510 | while true bound 9223372036854775807 |
| 511 | r = read fd b 0 len b |
| 512 | if lt r 0 |
| 513 | vxfail 3 |
| 514 | end |
| 515 | if eq r 0 |
| 516 | break |
| 517 | end |
| 518 | for i ulong ulong r |
| 519 | c = get b i |
| 520 | state = js_u8st state c |
| 521 | if eq state 9 |
| 522 | vxfail 2 |
| 523 | end |
| 524 | vxescape c |
| 525 | end |
| 526 | end |
| 527 | if ne state 0 |
| 528 | vxfail 2 |
| 529 | end |
| 530 | vxbyte 34 |
| 531 | vxclose fd |
| 532 | end |
| 533 | fn vxoutnum v ulong to void |
| 534 | b = new uchar 20 0 |
| 535 | p = ulong 20 |
| 536 | n = v |
| 537 | while true bound 20 |
| 538 | p = sub p 1 |
| 539 | put b p uchar add rem n 10 48 |
| 540 | n = div n 10 |
| 541 | if eq n 0 |
| 542 | break |
| 543 | end |
| 544 | end |
| 545 | vxout part b p sub 20 p |
| 546 | end |
| 547 | fn vxpayload fd int amount ulong to void |
| 548 | chunk = new uchar 65536 0 |
| 549 | left = amount |
| 550 | state = ulong 0 |
| 551 | while gt left 0 bound 9223372036854775807 |
| 552 | want = left |
| 553 | if gt want len chunk |
| 554 | want = len chunk |
| 555 | end |
| 556 | r = read fd chunk 0 want |
| 557 | if le r 0 |
| 558 | vxfail 2 |
| 559 | end |
| 560 | for j ulong ulong r |
| 561 | c = get chunk j |
| 562 | state = js_u8st state c |
| 563 | if eq state 9 |
| 564 | vxfail 2 |
| 565 | end |
| 566 | vxescape c |
| 567 | end |
| 568 | left = sub left ulong r |
| 569 | end |
| 570 | if ne state 0 |
| 571 | vxfail 2 |
| 572 | end |
| 573 | r = read fd chunk 0 1 |
| 574 | if ne r 1 |
| 575 | vxfail 2 |
| 576 | end |
| 577 | if ne get chunk 0 10 |
| 578 | vxfail 2 |
| 579 | end |
| 580 | end |
| 581 | fn vxmessages to void |
| 582 | b = new uchar 4096 0 |
| 583 | a = new uchar 64 0 |
| 584 | vxcopy 6 9 |
| 585 | vxadd 6 vxt7 |
| 586 | fd = vxopen 6 0 |
| 587 | for i ulong 4 |
| 588 | n = vxmetaline fd b |
| 589 | if eq n 0 |
| 590 | vxfail 2 |
| 591 | end |
| 592 | end |
| 593 | n = vxline fd b |
| 594 | count = vxnumber part b 0 n 1 |
| 595 | if lt count 2 |
| 596 | vxfail 2 |
| 597 | end |
| 598 | vxout vxt8 |
| 599 | for m ulong count bound 9223372036854775807 |
| 600 | n = vxline fd b |
| 601 | z = vxword part b 0 n 0 a |
| 602 | if not vxequal part a 0 z vxt9 |
| 603 | vxfail 2 |
| 604 | end |
| 605 | z = vxword part b 0 n 1 a |
| 606 | if ne m 0 |
| 607 | vxout vxt10 |
| 608 | end |
| 609 | vxout vxt11 |
| 610 | vxquote part a 0 z |
| 611 | vxout vxt12 |
| 612 | vxpayload fd vxnumber part b 0 n 2 |
| 613 | vxout vxt13 |
| 614 | end |
| 615 | vxout vxt14 |
| 616 | vxclose fd |
| 617 | end |
| 618 | fn vxextractcode to void |
| 619 | vxset 6 vxnull |
| 620 | vxcopy 7 4 |
| 621 | vxadd 7 vxt15 |
| 622 | vxcopy 8 4 |
| 623 | vxadd 8 vxt16 |
| 624 | vxpkinit |
| 625 | vxpk vxshell |
| 626 | vxpk vxt17 |
| 627 | vxpk vxextract |
| 628 | vxpk vxt18 |
| 629 | vxpkpath 3 |
| 630 | vxpkpath 12 |
| 631 | vxpkpath 11 |
| 632 | rc = vxspawn |
| 633 | if ne rc 0 |
| 634 | vxfail 14 |
| 635 | end |
| 636 | end |
| 637 | fn vxreferee lang view uchar 8 task view uchar 16 to ulong |
| 638 | vxset 6 vxnull |
| 639 | vxcopy 7 4 |
| 640 | vxadd 7 vxt19 |
| 641 | vxcopy 8 4 |
| 642 | vxadd 8 vxt20 |
| 643 | vxpkinit |
| 644 | vxpk vxshell |
| 645 | vxpkpath 5 |
| 646 | vxpk vxt21 |
| 647 | vxpk part lang 0 get vxcounts 7 |
| 648 | vxpk part task 0 6 |
| 649 | vxpkpath 10 |
| 650 | vxpkpath 13 |
| 651 | ret vxspawn |
| 652 | end |
| 653 | fn vxrecord task view uchar 16 lang view uchar 8 arm view uchar 16 att ulong rh view uchar 64 to void |
| 654 | vxout vxt22 |
| 655 | vxquote part task 0 6 |
| 656 | vxout vxt23 |
| 657 | vxquote part lang 0 get vxcounts 7 |
| 658 | vxout vxt24 |
| 659 | vxquote part arm 0 get vxcounts 8 |
| 660 | vxout vxt25 |
| 661 | vxoutnum att |
| 662 | vxout vxsourcekey |
| 663 | if eq get vxcounts 10 0 |
| 664 | vxquote vxmodelsource |
| 665 | else |
| 666 | if eq get vxcounts 10 1 |
| 667 | vxquote vxrefsource |
| 668 | else |
| 669 | vxquote vxharsource |
| 670 | end |
| 671 | end |
| 672 | vxout vxt26 |
| 673 | if eq get vxcounts 10 0 |
| 674 | vxmessages |
| 675 | else |
| 676 | vxout vxarrnone |
| 677 | end |
| 678 | vxout vxt27 |
| 679 | vxqfile 10 |
| 680 | vxout vxt28 |
| 681 | vxquote vxsha |
| 682 | vxout vxt29 |
| 683 | vxquote vxtasks |
| 684 | vxout vxt30 |
| 685 | vxquote rh |
| 686 | vxout vxt31 |
| 687 | if ne get vxcounts 6 0 |
| 688 | vxout vxt32 |
| 689 | else |
| 690 | vxout vxt33 |
| 691 | end |
| 692 | vxout vxt34 |
| 693 | end |
| 694 | fn vxattempt b view uchar * to void |
| 695 | task = new uchar 16 0 |
| 696 | lang = new uchar 8 0 |
| 697 | arm = new uchar 16 0 |
| 698 | tn = vxword b 0 task |
| 699 | ln = vxword b 1 lang |
| 700 | an = vxword b 2 arm |
| 701 | att = vxnumber b 3 |
| 702 | if ne tn 6 |
| 703 | vxfail 2 |
| 704 | end |
| 705 | if not vxequal part task 0 4 vxt35 |
| 706 | vxfail 2 |
| 707 | end |
| 708 | if or lt get task 4 48 gt get task 4 57 |
| 709 | vxfail 2 |
| 710 | end |
| 711 | if or lt get task 5 48 gt get task 5 57 |
| 712 | vxfail 2 |
| 713 | end |
| 714 | if eq att 0 |
| 715 | vxfail 2 |
| 716 | end |
| 717 | note Negative control 7 restores the former needless 32-bit attempt-number cap. |
| 718 | if eq vxmut 7 |
| 719 | if gt att 4294967295 |
| 720 | vxfail 2 |
| 721 | end |
| 722 | end |
| 723 | idx = ulong 0 |
| 724 | if vxequal part lang 0 ln vxt36 |
| 725 | idx = 1 |
| 726 | else |
| 727 | if vxequal part lang 0 ln vxt37 |
| 728 | idx = 2 |
| 729 | else |
| 730 | if vxequal part lang 0 ln vxt38 |
| 731 | idx = 3 |
| 732 | else |
| 733 | if not vxequal part lang 0 ln vxt39 |
| 734 | vxfail 2 |
| 735 | end |
| 736 | end |
| 737 | end |
| 738 | end |
| 739 | if not vxequal part arm 0 an vxt40 |
| 740 | if not vxequal part arm 0 an vxt41 |
| 741 | vxfail 2 |
| 742 | end |
| 743 | end |
| 744 | put vxcounts 7 ln |
| 745 | put vxcounts 8 an |
| 746 | vxprocess task lang arm att idx |
| 747 | end |
| 748 | fn vxrawfile k ulong fd int to void |
| 749 | b = new uchar 65536 0 |
| 750 | f = vxopen k 0 |
| 751 | while true bound 9223372036854775807 |
| 752 | r = read f b 0 len b |
| 753 | if lt r 0 |
| 754 | vxfail 3 |
| 755 | end |
| 756 | if eq r 0 |
| 757 | break |
| 758 | end |
| 759 | vxwrite fd part b 0 ulong r |
| 760 | end |
| 761 | vxclose f |
| 762 | end |
| 763 | fn vxcheckseparator to void |
| 764 | b = new uchar 65536 0 |
| 765 | fd = vxopen 10 0 |
| 766 | matched = ulong 0 |
| 767 | while true bound 9223372036854775807 |
| 768 | r = read fd b 0 len b |
| 769 | if lt r 0 |
| 770 | vxfail 3 |
| 771 | end |
| 772 | if eq r 0 |
| 773 | break |
| 774 | end |
| 775 | for i ulong ulong r |
| 776 | c = get b i |
| 777 | if eq c get vxseparator matched |
| 778 | matched = add matched 1 |
| 779 | if eq matched len vxseparator |
| 780 | vxfail 18 |
| 781 | end |
| 782 | else |
| 783 | matched = ulong 0 |
| 784 | if eq c get vxseparator 0 |
| 785 | matched = 1 |
| 786 | end |
| 787 | end |
| 788 | end |
| 789 | end |
| 790 | vxclose fd |
| 791 | end |
| 792 | fn vxstory task view uchar 16 to void |
| 793 | if eq get vxshift 0 0 |
| 794 | ret |
| 795 | end |
| 796 | if ne vxmut 6 |
| 797 | vxcheckseparator |
| 798 | end |
| 799 | fd = int get vxstoryfd 0 |
| 800 | vxcopy 6 1 |
| 801 | vxadd 6 vxtaskdir |
| 802 | vxadd 6 part task 0 6 |
| 803 | vxadd 6 vxstatement |
| 804 | vxwrite fd vxdochead |
| 805 | vxrawfile 6 fd |
| 806 | vxwrite fd vxdocprog |
| 807 | vxrawfile 10 fd |
| 808 | vxwrite fd vxeot |
| 809 | end |
| 810 | fn vxprocess task view uchar 16 lang view uchar 8 arm view uchar 16 att ulong idx ulong to void |
| 811 | h1 = new uchar 64 0 |
| 812 | h2 = new uchar 64 0 |
| 813 | vxcopy 9 0 |
| 814 | vxadd 9 vxslash |
| 815 | vxadd 9 part lang 0 get vxcounts 7 |
| 816 | vxadd 9 vxslash |
| 817 | vxadd 9 part arm 0 get vxcounts 8 |
| 818 | vxadd 9 vxslash |
| 819 | vxadd 9 part task 0 6 |
| 820 | vxadd 9 vxt42 |
| 821 | vxdecimal 9 att |
| 822 | vxcopy 10 9 |
| 823 | vxadd 10 vxt43 |
| 824 | vxadd 10 part lang 0 get vxcounts 7 |
| 825 | vxcopy 11 4 |
| 826 | vxadd 11 vxt44 |
| 827 | vxcopy 12 9 |
| 828 | vxadd 12 vxt45 |
| 829 | vxcopy 13 4 |
| 830 | vxadd 13 vxt46 |
| 831 | vxdecimal 13 get vxcounts 9 |
| 832 | put vxcounts 9 add get vxcounts 9 1 |
| 833 | vxextractcode |
| 834 | vxhash 10 h1 |
| 835 | vxhash 11 h2 |
| 836 | if ne vxmut 2 |
| 837 | if not vxequal h1 h2 |
| 838 | vxfail 15 |
| 839 | end |
| 840 | end |
| 841 | vxcopy 10 11 |
| 842 | rc = vxreferee lang task |
| 843 | if ge rc 2 |
| 844 | vxfail 16 |
| 845 | end |
| 846 | if ne vxmut 1 |
| 847 | if ne rc 0 |
| 848 | put vxcounts 5 add get vxcounts 5 1 |
| 849 | ret |
| 850 | end |
| 851 | end |
| 852 | vxcopy 6 13 |
| 853 | vxadd 6 vxevalout |
| 854 | vxhash 6 h1 |
| 855 | vxrecord task lang arm att h1 |
| 856 | vxstory task |
| 857 | put vxcounts idx add get vxcounts idx 1 |
| 858 | put vxcounts 4 add get vxcounts 4 1 |
| 859 | end |
| 860 | fn vxmanifest to void |
| 861 | h = new uchar 64 0 |
| 862 | vxhash 14 h |
| 863 | vxflush |
| 864 | vxclose int get vxion 1 |
| 865 | fd = vxopen 15 193 |
| 866 | put vxion 1 ulong fd |
| 867 | vxout vxt48 |
| 868 | vxoutnum get vxcounts 4 |
| 869 | vxout vxt49 |
| 870 | vxoutnum get vxcounts 0 |
| 871 | vxout vxt50 |
| 872 | vxoutnum get vxcounts 1 |
| 873 | vxout vxt51 |
| 874 | vxoutnum get vxcounts 2 |
| 875 | vxout vxt52 |
| 876 | vxoutnum get vxcounts 3 |
| 877 | vxout vxt53 |
| 878 | vxoutnum get vxcounts 5 |
| 879 | vxout vxt54 |
| 880 | vxquote h |
| 881 | vxout vxt28 |
| 882 | vxquote vxsha |
| 883 | vxout vxt29 |
| 884 | vxquote vxtasks |
| 885 | vxout vxt31 |
| 886 | if ne get vxcounts 6 0 |
| 887 | vxout vxt32 |
| 888 | else |
| 889 | vxout vxt33 |
| 890 | end |
| 891 | if ne get vxshift 0 0 |
| 892 | vxcopy 6 4 |
| 893 | vxadd 6 vxstories |
| 894 | vxhash 6 h |
| 895 | vxout vxstorysha |
| 896 | vxquote h |
| 897 | end |
| 898 | if ne get vxcounts 6 0 |
| 899 | vxout vxtestlicence |
| 900 | else |
| 901 | vxout vxt55 |
| 902 | end |
| 903 | vxflush |
| 904 | vxclose fd |
| 905 | end |
| 906 | fn vxcheckdriver to void |
| 907 | h = new uchar 64 0 |
| 908 | vxhash 5 h |
| 909 | if ne vxmut 9 |
| 910 | if not vxequal h vxdriverpin |
| 911 | vxfail 20 |
| 912 | end |
| 913 | end |
| 914 | end |
| 915 | fn vxchecktasks to void |
| 916 | b = new uchar 128 0 |
| 917 | vxcheckdriver |
| 918 | vxset 6 vxnull |
| 919 | vxcopy 7 4 |
| 920 | vxadd 7 vxt19 |
| 921 | vxcopy 8 4 |
| 922 | vxadd 8 vxt20 |
| 923 | vxpkinit |
| 924 | vxpk vxshell |
| 925 | vxpkpath 5 |
| 926 | vxpk vxsdflag |
| 927 | rc = vxspawn |
| 928 | if ne rc 0 |
| 929 | vxfail 11 |
| 930 | end |
| 931 | fd = vxopen 7 0 |
| 932 | n = vxline fd b |
| 933 | vxclose fd |
| 934 | if not vxequal part b 0 n vxtasks |
| 935 | vxfail 11 |
| 936 | end |
| 937 | end |
| 938 | fn vxargmode to bool |
| 939 | b = new uchar 8 0 |
| 940 | n = argread add ulong 6 get vxshift 0 b 0 len b |
| 941 | if lt n 0 |
| 942 | vxfail 2 |
| 943 | end |
| 944 | if vxequal part b 0 ulong n vxtest |
| 945 | ret false |
| 946 | end |
| 947 | if vxequal part b 0 ulong n vxrelease |
| 948 | ret true |
| 949 | end |
| 950 | vxfail 2 |
| 951 | ret true |
| 952 | end |
| 953 | fn vxenvcompiler used ulong to void |
| 954 | omlen = add get vxplen 2 4 |
| 955 | if gt add add used 2 omlen 4096 |
| 956 | vxfail 2 |
| 957 | end |
| 958 | put vxenv 0 2 |
| 959 | put vxenv used uchar and omlen 255 |
| 960 | put vxenv add used 1 uchar shr omlen 8 |
| 961 | for k ulong 4 |
| 962 | put vxenv add add used 2 k get vxomckey k |
| 963 | end |
| 964 | for k ulong get vxplen 2 |
| 965 | v = get vxp add ulong 8192 k |
| 966 | put vxenv add add used 6 k v |
| 967 | end |
| 968 | put vxenvn 0 add add used 2 omlen |
| 969 | end |
| 970 | fn vxenvinit to void |
| 971 | b = new uchar 4096 0 |
| 972 | for i ulong ulong envcnt |
| 973 | n = envread i b 0 len b |
| 974 | if ge n 5 |
| 975 | if vxequal part b 0 5 vxpathkey |
| 976 | if gt n 4090 |
| 977 | vxfail 2 |
| 978 | end |
| 979 | put vxenv 0 1 |
| 980 | put vxenv 1 0 |
| 981 | put vxenv 2 uchar and ulong n 255 |
| 982 | put vxenv 3 uchar shr ulong n 8 |
| 983 | for j ulong ulong n |
| 984 | put vxenv add j 4 get b j |
| 985 | end |
| 986 | vxenvcompiler add ulong n 4 |
| 987 | ret |
| 988 | end |
| 989 | end |
| 990 | end |
| 991 | vxfail 2 |
| 992 | end |
| 993 | fn main to int |
| 994 | h = new uchar 64 0 |
| 995 | b = new uchar 4096 0 |
| 996 | if ne argcnt add long 7 long get vxshift 0 |
| 997 | vxfail 2 |
| 998 | end |
| 999 | for i ulong 5 |
| 1000 | vxarg add i 1 i |
| 1001 | end |
| 1002 | vxarg 6 6 |
| 1003 | vxenvinit |
| 1004 | release = vxargmode |
| 1005 | vxcopy 5 1 |
| 1006 | vxadd 5 vxdriver |
| 1007 | vxhash 2 h |
| 1008 | if not vxequal h vxsha |
| 1009 | vxfail 10 |
| 1010 | end |
| 1011 | vxmeta release |
| 1012 | r = makedir vxp mul ulong 4 4096 get vxplen 4 448 |
| 1013 | if ne r 0 |
| 1014 | vxfail 3 |
| 1015 | end |
| 1016 | vxchecktasks |
| 1017 | vxcopy 14 4 |
| 1018 | vxadd 14 vxt56 |
| 1019 | vxcopy 15 4 |
| 1020 | vxadd 15 vxt57 |
| 1021 | if ne get vxshift 0 0 |
| 1022 | vxcopy 6 4 |
| 1023 | vxadd 6 vxstories |
| 1024 | fds = vxopen 6 193 |
| 1025 | put vxstoryfd 0 long fds |
| 1026 | end |
| 1027 | fdout = vxopen 14 193 |
| 1028 | put vxion 1 ulong fdout |
| 1029 | vxcopy 6 0 |
| 1030 | vxadd 6 vxatt |
| 1031 | fd = vxopen 6 0 |
| 1032 | n = vxline fd b |
| 1033 | if not vxequal part b 0 n vxt58 |
| 1034 | vxfail 2 |
| 1035 | end |
| 1036 | n = vxline fd b |
| 1037 | count = vxnumber part b 0 n 1 |
| 1038 | for i ulong count bound 9223372036854775807 |
| 1039 | n = vxline fd b |
| 1040 | if eq n 0 |
| 1041 | vxfail 2 |
| 1042 | end |
| 1043 | vxattempt part b 0 n |
| 1044 | end |
| 1045 | n = vxline fd b |
| 1046 | if ne n 0 |
| 1047 | vxfail 2 |
| 1048 | end |
| 1049 | vxclose fd |
| 1050 | vxflush |
| 1051 | vxmanifest |
| 1052 | if ne get vxshift 0 0 |
| 1053 | vxclose int get vxstoryfd 0 |
| 1054 | end |
| 1055 | ret 0 |
| 1056 | end |