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 / core / sovereign-core / om / golden / ollm / drive.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note om/golden/ollm/drive.om: the DRA-52 golden-token gate drivers (Core #853, PR #926). Replaces the |
| 3 | note former build.sh, record.sh, gate.sh, core-gate.sh and check.sh; every sequencing step and every |
| 4 | note judgment of the drivers is made here, the comparisons themselves stay in gate.om. |
| 5 | note Build (from the repository root): OMC=<omc bf54b19f> bash om/golden/build.sh OUT om/golden/ollm/drive.om |
| 6 | note Run from the repository root (repo files are read relative to it). Modes: |
| 7 | note drive build OMC TRAIN REV OUT [NEGCTL] |
| 8 | note fetches the aien-train clone TRAIN's HEAD, heads, tags and remotes (never refs/replace) |
| 9 | note into a private bare repository OUT/src.git made without templates, resolves REV there to |
| 10 | note one commit and snapshots it with git archive from there, so TRAIN's working tree, index |
| 11 | note flags, untracked files, replace refs, info/grafts, info/attributes and config never reach |
| 12 | note the build; every git child runs as /usr/bin/env GIT_CONFIG_NOSYSTEM=1 |
| 13 | note GIT_CONFIG_GLOBAL=/dev/null GIT_ATTR_NOSYSTEM=1 git --no-replace-objects. The commit's own |
| 14 | note .gitattributes (export-ignore, export-subst) is part of the commit and applies. Builds |
| 15 | note it with the snapshot's own tests/omegallm/build.sh (TARGET=gb10, OMC pinned omega-mv |
| 16 | note e5b32567), appends gdec.om, optionally applies one NEGCTL (.neg) perturbation, compiles |
| 17 | note OUT/ollm-golden. Prints BUILD_OK sha path source_sha256 sha commit sha. |
| 18 | note drive record TRAIN REV CK MERGES PROMPTS OUT [LABEL] (env OMC_TRAIN, OMC_GATE) |
| 19 | note drive gate TRAIN REV REF CK MERGES PROMPTS OUT (env OMC_TRAIN, OMC_GATE, hold) |
| 20 | note resolves REV once (as build does) to a commit id, pins OUT/src.git HEAD to it; candidate and |
| 21 | note negctl build that id from OUT/src.git, and each build's commit must equal it (else BROKEN) |
| 22 | note drive core (tests/gates/run.sh gb10-golden-tokens; env AIEN_*) |
| 23 | note drive check (host arms; env OMC_GATE, optional OMC_TRAIN and TRAIN) |
| 24 | note Child programs run through execprog with an empty environment; every child path is absolute. |
| 25 | note Exit: build 0 ok, 1 build failure, 3 compiler not pinned, 4 composition refused, 2 usage; |
| 26 | note gate 0 PASS, 1 FAIL, 3 NOT_RUN, 4 BROKEN; core 0 PASS, 1 FAIL or BROKEN, 77 NOT_RUN. |
| 27 | |
| 28 | const SCAP ulong 4096 |
| 29 | const BCAP ulong 4194304 |
| 30 | const SM ulong 0 |
| 31 | const SOMC ulong 1 |
| 32 | const STRN ulong 2 |
| 33 | const SREV ulong 3 |
| 34 | const SOUT ulong 4 |
| 35 | const SNEG ulong 5 |
| 36 | const SP ulong 6 |
| 37 | const SQ ulong 7 |
| 38 | const SHEX ulong 8 |
| 39 | const SOMG ulong 9 |
| 40 | const SREF ulong 10 |
| 41 | const SCK ulong 11 |
| 42 | const SMG ulong 12 |
| 43 | const SPR ulong 13 |
| 44 | const SSHA ulong 14 |
| 45 | const SNB ulong 15 |
| 46 | const SNF ulong 16 |
| 47 | const SNT ulong 17 |
| 48 | const SV ulong 18 |
| 49 | const SCWD ulong 19 |
| 50 | const SCORE ulong 20 |
| 51 | const SLAB ulong 21 |
| 52 | const ST ulong 22 |
| 53 | const SG ulong 23 |
| 54 | const SX ulong 24 |
| 55 | const SY ulong 25 |
| 56 | const SZ ulong 26 |
| 57 | const SA ulong 27 |
| 58 | const SB ulong 28 |
| 59 | const SH2 ulong 29 |
| 60 | const SE ulong 30 |
| 61 | const SLK ulong 31 |
| 62 | const SGD ulong 32 |
| 63 | const SF1 ulong 33 |
| 64 | const SF2 ulong 34 |
| 65 | const SF3 ulong 35 |
| 66 | const SR ulong 36 |
| 67 | const SC2 ulong 37 |
| 68 | const SNW ulong 38 |
| 69 | const SW ulong 39 |
| 70 | const SLST ulong 40 |
| 71 | const SD ulong 41 |
| 72 | const SFX ulong 42 |
| 73 | const SMX ulong 43 |
| 74 | const SK ulong 44 |
| 75 | const SBLK ulong 45 |
| 76 | const SEND ulong 46 |
| 77 | const SPRB ulong 48 |
| 78 | const NPMAX ulong 64 |
| 79 | |
| 80 | global gs uchar 524288 |
| 81 | global gsl ulong 128 |
| 82 | global gb uchar 4194304 |
| 83 | global gbn ulong 1 |
| 84 | global gc uchar 4194304 |
| 85 | global gcn ulong 1 |
| 86 | global gav uchar 65536 |
| 87 | global gap ulong 2 |
| 88 | global gwst uchar 8 |
| 89 | global gio uchar 65536 |
| 90 | global gstb uchar 256 |
| 91 | global gxs ulong 2 |
| 92 | global gk ulong 8 |
| 93 | |
| 94 | text tlong "drive: string too long\n" |
| 95 | text tuse "usage: drive build OMC TRAIN REV OUT [NEGCTL] | record TRAIN REV CK MERGES PROMPTS OUT [LABEL] | gate TRAIN REV REF CK MERGES PROMPTS OUT | core | check" |
| 96 | text tbuild "build" |
| 97 | text trecord "record" |
| 98 | text tgate "gate" |
| 99 | text tcore "core" |
| 100 | text tcheck "check" |
| 101 | text tself "/proc/self/exe" |
| 102 | text tgit "/usr/bin/git" |
| 103 | text tnorep "--no-replace-objects" |
| 104 | text trepl "replace" |
| 105 | text thead1 "HEAD~1" |
| 106 | text tb7 "b7" |
| 107 | text treplA "snapshot-replace-ref" |
| 108 | text tbrp "build-under-replace-ref" |
| 109 | text trpok "build-ignores-replace-ref (refs/replace/<rev> planted: source_sha256 stays clean)" |
| 110 | text trpbad "build-ignores-replace-ref: a replace ref changed the built source" |
| 111 | text tgenv1 "GIT_CONFIG_NOSYSTEM=1" |
| 112 | text tgenv2 "GIT_CONFIG_GLOBAL=/dev/null" |
| 113 | text tgenv3 "GIT_ATTR_NOSYSTEM=1" |
| 114 | text tgenv4 "GIT_GRAFT_FILE=/dev/null" |
| 115 | text tupk "--upload-pack=/usr/bin/env GIT_GRAFT_FILE=/dev/null GIT_NO_REPLACE_OBJECTS=1 /usr/bin/git upload-pack" |
| 116 | text tprv "src.git" |
| 117 | text tinit "init" |
| 118 | text tbare "--bare" |
| 119 | text ttmpl "--template=" |
| 120 | text tfetch "fetch" |
| 121 | text tnotags "--no-tags" |
| 122 | text tnogc "--no-auto-gc" |
| 123 | text tnofh "--no-write-fetch-head" |
| 124 | text trs1 "+HEAD:refs/golden/HEAD" |
| 125 | text trs2 "+refs/heads/*:refs/heads/*" |
| 126 | text trs3 "+refs/tags/*:refs/tags/*" |
| 127 | text trs4 "+refs/remotes/*:refs/remotes/*" |
| 128 | text tupref "update-ref" |
| 129 | text tnoderef "--no-deref" |
| 130 | text tghead "refs/golden/HEAD" |
| 131 | text thead2 "HEAD~2" |
| 132 | text trvo "rev.txt" |
| 133 | text tgrf ".git/info/grafts" |
| 134 | text tatf ".git/info/attributes" |
| 135 | text texig " export-ignore\n" |
| 136 | text tb8 "b8" |
| 137 | text tb9 "b9" |
| 138 | text tbgr "build-under-info-grafts" |
| 139 | text tgrok "build-ignores-info-grafts (HEAD grafted onto HEAD~2: HEAD~1 still builds its real commit's source_sha256)" |
| 140 | text tallowe "--allow-empty" |
| 141 | text tgrbase "snapshot-graft-base-commit" |
| 142 | text tgrbad "build-ignores-info-grafts: a graft changed the resolved commit or the built source" |
| 143 | text tbat "build-under-info-attributes" |
| 144 | text tatok "build-ignores-info-attributes (export-ignore planted for a composed file: source_sha256 unchanged)" |
| 145 | text tatbad "build-ignores-info-attributes: an info/attributes line changed the built source" |
| 146 | text tfixbad "fixture step failed: " |
| 147 | text tbres "BROKEN REV resolve rc=" |
| 148 | text tbidc "BROKEN cand build is not the commit REV resolved to" |
| 149 | text tbidn "BROKEN neg build is not the commit REV resolved to" |
| 150 | text th8 "== gate REV freeze (review finding 2): both builds are the commit REV resolved to once" |
| 151 | text ttg "tg" |
| 152 | text tgout "gout" |
| 153 | text tnoref "noref" |
| 154 | text tgmv "gmove" |
| 155 | text tco "checkout" |
| 156 | text tdb "-b" |
| 157 | text tmvl1 "/usr/bin/git --no-replace-objects -C " |
| 158 | text tmvl2 " update-ref refs/heads/gmove refs/heads/gmove~1" |
| 159 | text theld1 "AIEN_GB10_LOCK_HELD=1" |
| 160 | text tprocp "/proc/" |
| 161 | text texe "/exe" |
| 162 | text tgfa "gate-under-moving-branch" |
| 163 | text tgnomx "GOLDEN-GATE NOT_RUN record has no max_tokens line" |
| 164 | text tgfok "gate-freezes-rev (the branch moved during the builds: cand and negctl both built the commit REV named at gate start)" |
| 165 | text tgfbad "gate-freezes-rev: a build is not the commit REV named at gate start" |
| 166 | text tgmok "gate-freeze-branch-moved (the fixture's build.sh moved the branch: the arm is not vacuous)" |
| 167 | text tgmbad "gate-freeze-branch-moved: the branch did not move, the arm is vacuous" |
| 168 | text tcinfra ": infrastructure failure, not a kill (exit " |
| 169 | text tgfx1 "gate-freeze-fixture-branch" |
| 170 | text tgfx2 "gate-freeze-fixture-commit" |
| 171 | text ttar "/usr/bin/tar" |
| 172 | text tenv "/usr/bin/env" |
| 173 | text tsh "/bin/sh" |
| 174 | text trm "/bin/rm" |
| 175 | text tdash "-C" |
| 176 | text trevp "rev-parse" |
| 177 | text tverify "--verify" |
| 178 | text tcommit "^{commit}" |
| 179 | text tarch "archive" |
| 180 | text tfmtt "--format=tar" |
| 181 | text tdo "-o" |
| 182 | text tdx "-x" |
| 183 | text tdf "-f" |
| 184 | text tdrf "-rf" |
| 185 | text tpath "PATH=/usr/bin:/bin" |
| 186 | text ttgt "TARGET=gb10" |
| 187 | text tomceq "OMC=" |
| 188 | text touteq "OUT=" |
| 189 | text tcoreq "CORE=" |
| 190 | text tpintr "2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f" |
| 191 | text tpingt "62775d2a391cfef7cde64e387655caa9809a267093112910ec76bfa568f3712b" |
| 192 | text tgdec "om/golden/ollm/gdec.om" |
| 193 | text tgateom "om/golden/ollm/gate.om" |
| 194 | text tjson "om/vendor/json.om" |
| 195 | text tshaom "om/vendor/sha256.om" |
| 196 | text tom2 "om2\n" |
| 197 | text tsl "/" |
| 198 | text tsp " " |
| 199 | text tnl "\n" |
| 200 | text tnl0 "" |
| 201 | text tsrc "src" |
| 202 | text tsrctar "src.tar" |
| 203 | text tbsh "tests/omegallm/build.sh" |
| 204 | text ttrain "train" |
| 205 | text tlog "train.log" |
| 206 | text tollm "ollm-gb10.om" |
| 207 | text tgold "ollm-golden.om" |
| 208 | text tgoldb "ollm-golden" |
| 209 | text terr ".err" |
| 210 | text tdotom ".om" |
| 211 | text tcmt "commit" |
| 212 | text tcmterr "commit.err" |
| 213 | text tsltrain "/train" |
| 214 | text tslbsh "/tests/omegallm/build.sh" |
| 215 | text tslollm "train/ollm.om" |
| 216 | text tgoldtmp "ollm-golden.tmp" |
| 217 | text tomcerr "omc.err" |
| 218 | text tcoreq0 "CORE" |
| 219 | text tmain "fn main to int" |
| 220 | text toggm "fn oggmain to int" |
| 221 | text tendl "end" |
| 222 | text twant "want " |
| 223 | text tblock "block " |
| 224 | text tfrom "from " |
| 225 | text tto "to " |
| 226 | text tcpus "Cpus_allowed_list:" |
| 227 | text tstatus "/proc/self/status" |
| 228 | text thostf "/proc/sys/kernel/hostname" |
| 229 | text tnrtr "NOT_RUN: set OMC to omega-mv e5b32567 seed/out/omc" |
| 230 | text tnrgt "NOT_RUN: set OMC to omega-mv bf54b19f seed/out/omc" |
| 231 | text tnrsha "NOT_RUN: omc sha256 " |
| 232 | text tpinned ", pinned " |
| 233 | text tbfail "BUILD_FAIL aien-train build.sh: " |
| 234 | text tsfail "BUILD_FAIL snapshot: " |
| 235 | text tbfomc "BUILD_FAIL omc rc=" |
| 236 | text tmcount "MAIN_COUNT " |
| 237 | text twant1 ", want 1" |
| 238 | text tnowant "PERTURB_NO_WANT " |
| 239 | text tpchg "PERTURB_CHANGED " |
| 240 | text tlines " lines, want " |
| 241 | text tbok "BUILD_OK " |
| 242 | text tsrcsha " source_sha256 " |
| 243 | text tcmtsp " commit " |
| 244 | text tcompile "compile " |
| 245 | text tcolon ": " |
| 246 | text tnoroot "drive: run from the repository root (om/golden/ollm/gate.om not found)" |
| 247 | text tbuildf ".build" |
| 248 | text tgdecr "rc=" |
| 249 | text tgtcpu "gtcpu" |
| 250 | text tgtgpu "gtgpu" |
| 251 | text tcand "cand" |
| 252 | text tnegd "negctl" |
| 253 | text tnegf "om/golden/ollm/negctl/softmax-log2e.neg" |
| 254 | text tgateb "gate" |
| 255 | text tcmp "cmp" |
| 256 | text trec "rec" |
| 257 | text tref "ref.txt" |
| 258 | text tout ".out" |
| 259 | text tcmpx ".cmp" |
| 260 | text thost "SPARK_WINDOW" |
| 261 | text theld "AIEN_GB10_LOCK_HELD" |
| 262 | text tone "1" |
| 263 | text tomctr "OMC_TRAIN" |
| 264 | text tomcgt "OMC_GATE" |
| 265 | text tnohold "GOLDEN-GATE NOT_RUN no GB10 hold (run inside spark-window run, or with AIEN_GB10_LOCK_HELD=1)" |
| 266 | text tngate "NOT_RUN gate compiler not pinned" |
| 267 | text tndec "NOT_RUN decoder compiler not pinned" |
| 268 | text tbroken "BROKEN " |
| 269 | text tbrc " build rc=" |
| 270 | text tbgate "BROKEN gate.om build rc=" |
| 271 | text tnomx "NOT_RUN record has no max_tokens line" |
| 272 | text tnocmp "NOT_RUN record not comparable with CK/MERGES/PROMPTS" |
| 273 | text tmaxtok "max_tokens " |
| 274 | text tgrc " gtgpu rc=" |
| 275 | text tcrc " gtcpu rc=" |
| 276 | text tpass "PASS candidate matches; negative control blocked" |
| 277 | text tbneg "BROKEN negative control rc=" |
| 278 | text tbneg2 ", must be 1 (blocked)" |
| 279 | text tfailv "FAIL candidate diverges from the golden record" |
| 280 | text tbcmp "BROKEN candidate cmp rc=" |
| 281 | text texists "drive: OUT exists: " |
| 282 | text tmkd "drive: cannot create " |
| 283 | text trecok "RECORD_OK " |
| 284 | text trecbad "RECORD_FAIL gate rec rc=" |
| 285 | text treal "REAL" |
| 286 | text tmx "48" |
| 287 | text tfl "7812500" |
| 288 | text tdr "1953125" |
| 289 | text tsrcp "aien-dev/aien-train@" |
| 290 | text tobs "AIEN-OBS " |
| 291 | text tnrr "not_run_reason" |
| 292 | text tq "\"" |
| 293 | text tgtrain "AIEN_GOLDEN_TRAIN" |
| 294 | text tgdir "AIEN_GOLDEN_DIR" |
| 295 | text tmdir "AIEN_MODELS_DIR" |
| 296 | text thome "HOME" |
| 297 | text tmodels "/models" |
| 298 | text tolg "/omega-llm-golden" |
| 299 | text taomctr "AIEN_OMC_TRAIN" |
| 300 | text taomcgt "AIEN_OMC_GATE" |
| 301 | text tlock "om/golden/ollm/aien-train.lock" |
| 302 | text trefp "om/golden/ollm/ref/r10-ck60000.ref" |
| 303 | text tprp "om/golden/ollm/ref/prompts.txt" |
| 304 | text tckk "ckpt_sha256 " |
| 305 | text tmgk "merges_sha256 " |
| 306 | text ttm "train_missing" |
| 307 | text ttmw "set AIEN_GOLDEN_TRAIN to aien-train at " |
| 308 | text ttu "train_unpinned" |
| 309 | text ttuw "aien-train has no commit " |
| 310 | text tmm "model_missing" |
| 311 | text tmmw "missing " |
| 312 | text tcatf "cat-file" |
| 313 | text tdash_e "-e" |
| 314 | text tgcore "/tmp/golden-core-" |
| 315 | text tgrec "golden_record" |
| 316 | text tgpass "golden_pass" |
| 317 | text tgneg "negctl_blocked" |
| 318 | text ttrue "true" |
| 319 | text tfalse "false" |
| 320 | text tgnrun "golden gate not run" |
| 321 | text tbrk "BROKEN golden gate rc=" |
| 322 | text tcpass "PASS " |
| 323 | text tcfail "FAIL " |
| 324 | text tcexit " (exit " |
| 325 | text tcwant ", want " |
| 326 | text tcend ")" |
| 327 | text tcbad "golden-ollm check: FAILED" |
| 328 | text tcgood "golden-ollm check: all arms as expected" |
| 329 | text tcnor "NOT_RUN aien-train arms (set TRAIN and OMC_TRAIN)" |
| 330 | text tgchk "/tmp/golden-check-" |
| 331 | text tfx "om/golden/ollm/fixtures/" |
| 332 | text tfck "ck.bin" |
| 333 | text tfmg "merges.bin" |
| 334 | text tfpr "prompts.txt" |
| 335 | text tfill "fixture-host" |
| 336 | text tfutc "2026-01-01T00:00:00Z" |
| 337 | text tsyn "SYNTHETIC" |
| 338 | text t8 "8" |
| 339 | text tfsrc "aien-dev/aien-train@0000000000000000000000000000000000000000" |
| 340 | text thead "HEAD" |
| 341 | text tdc "-c" |
| 342 | text tun "user.name=golden" |
| 343 | text tue "user.email=golden@invalid" |
| 344 | text tclone "clone" |
| 345 | text tq0 "-q" |
| 346 | text tnohl "--no-hardlinks" |
| 347 | text tgrpath "native/omegallm/gpu/gr.om" |
| 348 | text tmodel "native/omegallm/model.om" |
| 349 | text ttamp "note tampered\n" |
| 350 | text tupidx "update-index" |
| 351 | text tskip "--skip-worktree" |
| 352 | text tdasha "-a" |
| 353 | text tdashm "-m" |
| 354 | text ttamper "tamper" |
| 355 | text ttmd "tm" |
| 356 | text tclonea "snapshot-scratch-clone" |
| 357 | text tskipa "snapshot-skip-worktree-flag" |
| 358 | text tbwt "build-snapshot-dirty-tree" |
| 359 | text twtok "build-ignores-worktree (tracked edit and skip-worktree edit left out: source_sha256 " |
| 360 | text twtbad "build-ignores-worktree: the dirty clone built a different source" |
| 361 | text tcommita "snapshot-commit-tamper" |
| 362 | text tbcm "build-snapshot-committed-tamper" |
| 363 | text tcmok "build-sees-commit (the committed edit changes source_sha256; negative control)" |
| 364 | text tcmbad "build-sees-commit: the committed edit did not change the source" |
| 365 | text th1 "== recorder (gate.om rec) on the synthetic decoder run fixtures/cpu.out" |
| 366 | text th2 "== comparator (gate.om cmp) against the record" |
| 367 | text th4 "== record bounds (review finding 2): header limits and row coverage" |
| 368 | text th5 "== negative controls: one-line mutants of gate.om must fail their arm" |
| 369 | text th6 "== decoder composition from TRAIN (host only)" |
| 370 | text th7 "== source identity (review finding 1): the build is the resolved commit" |
| 371 | text tcrefx "ref.expect" |
| 372 | text tcpuo "cpu.out" |
| 373 | text tcrr "rec-record (exit 0, byte-equal: hashes = sha256, prompt 0 ends at id 0, prompt 1 cut at the step-5 margin 0.005 < 2^-7)" |
| 374 | text tcrrb "rec-record: not byte-equal to the expected record" |
| 375 | text tamb "amb.out" |
| 376 | text tl1 "T 1 1 21 9100000000 600000000" |
| 377 | text tl1a "T 1 1 21 9100000000 7812499" |
| 378 | text tl1b "T 1 1 21 9100000000 7812500" |
| 379 | text tpamb "golden-ollm: refused ambiguous-prompt" |
| 380 | text trecamb "rec-ambiguous-prompt" |
| 381 | text tflo "flo.out" |
| 382 | text tpflo "P 1 5 20 21 22 23 24" |
| 383 | text trecflo "rec-floor-inclusive" |
| 384 | text tgar "gpu-as-ref.out" |
| 385 | text tgtec "GTE cpu " |
| 386 | text tgteg "GTE gpu " |
| 387 | text tpfmt "golden-ollm: refused format" |
| 388 | text trecgpu "rec-refuses-gpu-run" |
| 389 | text t9 "9" |
| 390 | text trecsh "rec-refuses-short-run" |
| 391 | text tord "order.out" |
| 392 | text tt12 "T 1 2 22 " |
| 393 | text tt13 "T 1 3 22 " |
| 394 | text trecso "rec-refuses-step-order" |
| 395 | text tnogte "nogte.out" |
| 396 | text trecng "rec-refuses-missing-summary" |
| 397 | text tmaybe "MAYBE" |
| 398 | text tpbarg "golden-ollm: refused bad-argument" |
| 399 | text treclab "rec-refuses-bad-label" |
| 400 | text trecuse "rec-usage" |
| 401 | text tgm "gpu-match.out" |
| 402 | text tpm1 "golden-ollm cmp prompts=2 compared=11 match=2 diverge=0 drift=0 maxdrift_e9=1953125" |
| 403 | text tcm1 "cmp-match" |
| 404 | text tpm2 "MATCH 1 n=5 maxdrift_e9=1953" |
| 405 | text tcm2 "cmp-match-ignores-dropped-steps" |
| 406 | text tdiv "div.out" |
| 407 | text tt13x "T 1 3 23 " |
| 408 | text tt13y "T 1 3 33 " |
| 409 | text tpdiv "DIVERGE 1 index=3 ref=23 cand=33" |
| 410 | text tcdiv "cmp-diverge" |
| 411 | text tt04 "T 0 4 " |
| 412 | text tt05 "T 0 5 " |
| 413 | text tg214 "GTE gpu 2 14 " |
| 414 | text tg212 "GTE gpu 2 12 " |
| 415 | text tshort "short.out" |
| 416 | text tpshort "DIVERGE 0 index=4 ref=9 cand=end" |
| 417 | text tcshort "cmp-candidate-ends-early" |
| 418 | text tdrift "drift.out" |
| 419 | text tt02 "T 0 2 7 11999999000 " |
| 420 | text tt02d "T 0 2 7 12001953126 " |
| 421 | text tpdrift "DRIFT 0 index=2 ref=12000000000 cand=12001953126" |
| 422 | text tcdrift "cmp-drift" |
| 423 | text tck2 "ck2.bin" |
| 424 | text tck2t "SYNTHETIC another checkpoint" |
| 425 | text tpnck "NOTCOMPARABLE ckpt_sha256" |
| 426 | text tcock "cmp-other-checkpoint" |
| 427 | text tpnmg "NOTCOMPARABLE merges_sha256" |
| 428 | text tcomg "cmp-other-merges" |
| 429 | text tpnpr "NOTCOMPARABLE prompts_sha256" |
| 430 | text tcopr "cmp-other-prompts" |
| 431 | text tt1 "T 1 " |
| 432 | text tg16 "GTE gpu 1 6 " |
| 433 | text tone0 "one.out" |
| 434 | text tpnp "NOTCOMPARABLE prompts" |
| 435 | text tccount "cmp-prompt-count" |
| 436 | text tccpu "cmp-refuses-cpu-run" |
| 437 | text tbadref "badref.txt" |
| 438 | text trdg "ref_decoder gtcpu" |
| 439 | text trdgg "ref_decoder gtgpu" |
| 440 | text tcbadref "cmp-refuses-bad-record" |
| 441 | text tlenref "lenref.txt" |
| 442 | text tp15 "P 1 5 20 21 22 23 24" |
| 443 | text tp14 "P 1 4 20 21 22 23" |
| 444 | text tclen "cmp-refuses-row-lengths" |
| 445 | text tcuse "cmp-usage" |
| 446 | text tf2a "rmin.txt" |
| 447 | text tp13 "P 1 3 20 21 22" |
| 448 | text tl15 "L 1 5 9000000000 9100000000 9200000000 9300000000 -9400000000" |
| 449 | text tl13 "L 1 3 9000000000 9100000000 9200000000" |
| 450 | text tm15 "M 1 5 500000000 600000000 700000000 800000000 900000000" |
| 451 | text tm13 "M 1 3 500000000 600000000 700000000" |
| 452 | text tcrmin "cmp-refuses-short-coverage" |
| 453 | text tf2b "floor.txt" |
| 454 | text tm06 "M 0 6 2000000000 1500000000 900000000 800000000 3000000000 4000000000" |
| 455 | text tm06b "M 0 6 2000000000 1500000000 900000000 7812499 3000000000 4000000000" |
| 456 | text tcfloor "cmp-refuses-margin-below-floor" |
| 457 | text tf2c "mx0.txt" |
| 458 | text tmx8 "max_tokens 8" |
| 459 | text tmx0 "max_tokens 0" |
| 460 | text tcmx0 "cmp-refuses-max-tokens-0" |
| 461 | text tf2d "mx5.txt" |
| 462 | text tmx5 "max_tokens 5" |
| 463 | text tcmx5 "cmp-refuses-row-over-max-tokens" |
| 464 | text tf2e "mxbig.txt" |
| 465 | text tmx4097 "max_tokens 4097" |
| 466 | text tcmxbig "cmp-refuses-max-tokens-over-4096" |
| 467 | text tf2f "dr0.txt" |
| 468 | text tdr0a "drift_bound_e9 1953125" |
| 469 | text tdr0b "drift_bound_e9 0" |
| 470 | text tcdr0 "cmp-refuses-drift-0" |
| 471 | text tf2g "fl0.txt" |
| 472 | text tfl0a "margin_floor_e9 7812500" |
| 473 | text tfl0b "margin_floor_e9 0" |
| 474 | text tcfl0 "cmp-refuses-floor-0" |
| 475 | text tm1 "M1-no-id-compare" |
| 476 | text tm1a "if ne get gid o get grid o" |
| 477 | text tm1b "if ne get gid o get gid o" |
| 478 | text tm2 "M2-no-drift-check" |
| 479 | text tm2a "if gt d dr" |
| 480 | text tm2b "if gt d add dr 1000000" |
| 481 | text tm3 "M3-no-identity" |
| 482 | text tm3a "if eq get ghd 4 0" |
| 483 | text tm3b "if eq get ghd 4 7" |
| 484 | text tm4 "M4-no-floor" |
| 485 | text tm4a "if lt get gmar o f" |
| 486 | text tm4b "if lt get gmar o neg f" |
| 487 | text tm5 "M5-early-end-accepted" |
| 488 | text tm5a "if ge s get gcnt k" |
| 489 | text tm5b "if gt s 99999" |
| 490 | text tm6 "M6-no-margin-floor-check" |
| 491 | text tm6a "if lt nl long get ghd 2" |
| 492 | text tm6b "if lt nl -1000000000000000000" |
| 493 | text tm7 "M7-no-coverage-floor" |
| 494 | text tm7a "if or lt n RMIN gt n get ghd 1" |
| 495 | text tm7b "if gt n get ghd 1" |
| 496 | text tb0 "b0" |
| 497 | text tb1 "b1" |
| 498 | text tb2 "b2" |
| 499 | text tb3 "b3" |
| 500 | text tb4 "b4" |
| 501 | text tb5 "b5" |
| 502 | text tb6 "b6" |
| 503 | text tbdec "build-decoder" |
| 504 | text tbone "build-one-main (oggmain 1, main 1)" |
| 505 | text tbnegc "build-negctl" |
| 506 | text tnegl "gkmovi 28 grf 1.8033688011112043f64" |
| 507 | text tnegok "negctl-one-kernel-constant ('> " |
| 508 | text tcq2 "')" |
| 509 | text tnegbad "negctl-one-kernel-constant: " |
| 510 | text tnegsame "negctl-binary-differs: same binary" |
| 511 | text tnegdiff "negctl-binary-differs" |
| 512 | text ttwo "two.neg" |
| 513 | text ttwot "want 1\nfrom gkmovi 28 grf 1.4426950408889634f64\nto gkmovi 28 grf 1.5f64" |
| 514 | text tpchg2 "PERTURB_CHANGED 2 lines, want 1" |
| 515 | text tbwrong "build-refuses-wrong-line-count" |
| 516 | text ttrue0 "/bin/true" |
| 517 | text tbother "build-refuses-other-omc" |
| 518 | text tzrev "0000000000000000000000000000000000000000" |
| 519 | text tbrev "build-refuses-unknown-rev" |
| 520 | text tg0 "g0" |
| 521 | text tgnohold "gate-refuses-without-gb10" |
| 522 | text ttrainv "TRAIN" |
| 523 | text tcout "out" |
| 524 | text tcex "exit " |
| 525 | text tcnol ": no line '" |
| 526 | text tcin "' in: " |
| 527 | text tcq1 ", '" |
| 528 | text tcl1 ": line '" |
| 529 | text tcnu "' not unique" |
| 530 | text tsrcom ".bin" |
| 531 | text tcmdb ": mutant did not build" |
| 532 | text tcsurv ": mutant survived" |
| 533 | text tckill " killed" |
| 534 | text tmout "mout" |
| 535 | text tschem "aien-golden-ollm/1" |
| 536 | text tlsyn "label SYNTHETIC" |
| 537 | text tprk "prompts_sha256 " |
| 538 | text tref2 "prompts 2\nmax_tokens 8\nmargin_floor_e9 7812500\ndrift_bound_e9 1953125\nref_decoder gtcpu\nref_engine_sha256 " |
| 539 | text tref3 "ref_source " |
| 540 | text tref4 "host_id fixture-host\nutc 2026-01-01T00:00:00Z\nP 0 6 5 6 7 8 9 0\nL 0 6 10000000000 11000000000 12000000000 13000000000 14000000000 15000000000\nM 0 6 2000000000 1500000000 900000000 800000000 3000000000 4000000000\nP 1 5 20 21 22 23 24\nL 1 5 9000000000 9100000000 9200000000 9300000000 -9400000000\nM 1 5 500000000 600000000 700000000 800000000 900000000\nend\n" |
| 541 | text tgateb0 "GOLDEN-GATE " |
| 542 | text tsl0 "" |
| 543 | text tsp0 "" |
| 544 | text terr0 ".err" |
| 545 | text tbcand "BROKEN cand build rc=" |
| 546 | text tbnegb "BROKEN neg build rc=" |
| 547 | text tnoprm "BROKEN prompt file unreadable or over 64 prompts" |
| 548 | text tcpuout "cpu.out" |
| 549 | text treftmp "ref.tmp" |
| 550 | text tnrhdr "golden-tokens gate: NOT_RUN " |
| 551 | text tgg "g" |
| 552 | text tgnr "gate_not_run" |
| 553 | text tgnr3 "gate exit 3" |
| 554 | |
| 555 | note ---- string slots: slot s holds gsl[s] bytes at gs[s*SCAP ..] |
| 556 | |
| 557 | fn sb s ulong c uchar to void |
| 558 | n = get gsl s |
| 559 | if ge n SCAP |
| 560 | w = write 2 tlong 0 len tlong |
| 561 | exit 2 |
| 562 | end |
| 563 | put gs add mul s SCAP n c |
| 564 | put gsl s add n 1 |
| 565 | end |
| 566 | |
| 567 | fn sclr s ulong to void |
| 568 | put gsl s 0 |
| 569 | end |
| 570 | |
| 571 | fn sx s ulong t view uchar * to void |
| 572 | for i ulong len t |
| 573 | sb s get t i |
| 574 | end |
| 575 | end |
| 576 | |
| 577 | fn sset s ulong t view uchar * to void |
| 578 | sclr s |
| 579 | sx s t |
| 580 | end |
| 581 | |
| 582 | fn sc s ulong i ulong to uchar |
| 583 | ret get gs add mul s SCAP i |
| 584 | end |
| 585 | |
| 586 | fn ss s ulong r ulong to void |
| 587 | for i ulong get gsl r |
| 588 | sb s sc r i |
| 589 | end |
| 590 | end |
| 591 | |
| 592 | fn scp s ulong r ulong to void |
| 593 | sclr s |
| 594 | ss s r |
| 595 | end |
| 596 | |
| 597 | fn sn s ulong v ulong to void |
| 598 | d = new uchar 24 0 |
| 599 | n = ulong 0 |
| 600 | x = v |
| 601 | while true bound 21 |
| 602 | put d n uchar add rem x 10 48 |
| 603 | n = add n 1 |
| 604 | x = div x 10 |
| 605 | if eq x 0 |
| 606 | break |
| 607 | end |
| 608 | end |
| 609 | for i ulong n |
| 610 | sb s get d sub sub n 1 i |
| 611 | end |
| 612 | end |
| 613 | |
| 614 | fn sn2 s ulong v ulong to void |
| 615 | if lt v 10 |
| 616 | sb s 48 |
| 617 | end |
| 618 | sn s v |
| 619 | end |
| 620 | |
| 621 | fn seqt s ulong t view uchar * to bool |
| 622 | if ne get gsl s len t |
| 623 | ret false |
| 624 | end |
| 625 | for i ulong len t |
| 626 | if ne sc s i get t i |
| 627 | ret false |
| 628 | end |
| 629 | end |
| 630 | ret true |
| 631 | end |
| 632 | |
| 633 | fn seqs a ulong b ulong to bool |
| 634 | if ne get gsl a get gsl b |
| 635 | ret false |
| 636 | end |
| 637 | for i ulong get gsl a |
| 638 | if ne sc a i sc b i |
| 639 | ret false |
| 640 | end |
| 641 | end |
| 642 | ret true |
| 643 | end |
| 644 | |
| 645 | fn sarg s ulong i ulong to bool |
| 646 | r = argread i gs mul s SCAP SCAP |
| 647 | if lt r 0 |
| 648 | ret false |
| 649 | end |
| 650 | put gsl s ulong r |
| 651 | ret true |
| 652 | end |
| 653 | |
| 654 | fn envhas t view uchar * r ulong to bool |
| 655 | if le r len t |
| 656 | ret false |
| 657 | end |
| 658 | for i ulong len t |
| 659 | if ne get gio i get t i |
| 660 | ret false |
| 661 | end |
| 662 | end |
| 663 | ret eq get gio len t 61 |
| 664 | end |
| 665 | |
| 666 | note slot s = value of environment entry t; false when absent or empty |
| 667 | fn senv s ulong t view uchar * to bool |
| 668 | sclr s |
| 669 | n = envcnt |
| 670 | if le n 0 |
| 671 | ret false |
| 672 | end |
| 673 | for i ulong ulong n |
| 674 | r = envread i gio 0 65536 |
| 675 | if gt r 0 |
| 676 | if envhas t ulong r |
| 677 | k = add len t 1 |
| 678 | m = sub ulong r k |
| 679 | for j ulong m |
| 680 | sb s get gio add k j |
| 681 | end |
| 682 | ret gt get gsl s 0 |
| 683 | end |
| 684 | end |
| 685 | end |
| 686 | ret false |
| 687 | end |
| 688 | |
| 689 | note slot s made absolute against the current directory |
| 690 | fn sabs s ulong to void |
| 691 | if eq get gsl s 0 |
| 692 | ret |
| 693 | end |
| 694 | if eq sc s 0 47 |
| 695 | ret |
| 696 | end |
| 697 | r = cwd gio 0 65536 |
| 698 | if le r 1 |
| 699 | exit 2 |
| 700 | end |
| 701 | sclr SCWD |
| 702 | for i ulong sub ulong r 1 |
| 703 | sb SCWD get gio i |
| 704 | end |
| 705 | sb SCWD 47 |
| 706 | ss SCWD s |
| 707 | scp s SCWD |
| 708 | end |
| 709 | |
| 710 | note ---- output: slot s and a newline to fd |
| 711 | |
| 712 | fn wslot fd int s ulong to void |
| 713 | n = get gsl s |
| 714 | o = mul s SCAP |
| 715 | p = ulong 0 |
| 716 | while lt p n bound 9999 |
| 717 | w = write fd gs add o p sub n p |
| 718 | if le w 0 |
| 719 | ret |
| 720 | end |
| 721 | p = add p ulong w |
| 722 | end |
| 723 | end |
| 724 | |
| 725 | fn say fd int s ulong to void |
| 726 | sb s 10 |
| 727 | wslot fd s |
| 728 | put gsl s sub get gsl s 1 |
| 729 | end |
| 730 | |
| 731 | fn sayt fd int t view uchar * to void |
| 732 | sset SM t |
| 733 | say fd SM |
| 734 | end |
| 735 | |
| 736 | note ---- files named by slots |
| 737 | |
| 738 | fn fopf s ulong fl int to int |
| 739 | r = fopen gs mul s SCAP get gsl s fl 420 |
| 740 | if lt r 0 |
| 741 | ret -1 |
| 742 | end |
| 743 | ret int r |
| 744 | end |
| 745 | |
| 746 | fn fcls fd int to void |
| 747 | if ge fd 3 |
| 748 | r = fclose fd |
| 749 | end |
| 750 | end |
| 751 | |
| 752 | fn there s ulong to bool |
| 753 | r = stat gs mul s SCAP get gsl s gstb 0 256 |
| 754 | ret ge r 0 |
| 755 | end |
| 756 | |
| 757 | fn isexe s ulong to bool |
| 758 | if eq get gsl s 0 |
| 759 | ret false |
| 760 | end |
| 761 | r = faccess gs mul s SCAP get gsl s 1 |
| 762 | ret eq r 0 |
| 763 | end |
| 764 | |
| 765 | fn mkd s ulong to bool |
| 766 | r = makedir gs mul s SCAP get gsl s 493 |
| 767 | ret eq r 0 |
| 768 | end |
| 769 | |
| 770 | fn mkp s ulong to bool |
| 771 | n = get gsl s |
| 772 | sclr SCWD |
| 773 | for i ulong n |
| 774 | c = sc s i |
| 775 | if and eq c 47 gt i 0 |
| 776 | r = makedir gs mul SCWD SCAP get gsl SCWD 493 |
| 777 | end |
| 778 | sb SCWD c |
| 779 | end |
| 780 | r = makedir gs mul s SCAP n 493 |
| 781 | if eq r 0 |
| 782 | ret true |
| 783 | end |
| 784 | ret eq r -17 |
| 785 | end |
| 786 | |
| 787 | fn rmf s ulong to void |
| 788 | r = unlink gs mul s SCAP get gsl s |
| 789 | end |
| 790 | |
| 791 | note load slot s's file into gb |
| 792 | fn fload s ulong to bool |
| 793 | fd = fopf s 0 |
| 794 | if lt fd 0 |
| 795 | ret false |
| 796 | end |
| 797 | t = ulong 0 |
| 798 | while true bound 99999 |
| 799 | if ge t BCAP |
| 800 | fcls fd |
| 801 | ret false |
| 802 | end |
| 803 | k = read fd gb t sub BCAP t |
| 804 | if lt k 0 |
| 805 | fcls fd |
| 806 | ret false |
| 807 | end |
| 808 | if eq k 0 |
| 809 | break |
| 810 | end |
| 811 | t = add t ulong k |
| 812 | end |
| 813 | fcls fd |
| 814 | put gbn 0 t |
| 815 | ret true |
| 816 | end |
| 817 | |
| 818 | fn floadc s ulong to bool |
| 819 | fd = fopf s 0 |
| 820 | if lt fd 0 |
| 821 | ret false |
| 822 | end |
| 823 | t = ulong 0 |
| 824 | while true bound 99999 |
| 825 | if ge t BCAP |
| 826 | fcls fd |
| 827 | ret false |
| 828 | end |
| 829 | k = read fd gc t sub BCAP t |
| 830 | if lt k 0 |
| 831 | fcls fd |
| 832 | ret false |
| 833 | end |
| 834 | if eq k 0 |
| 835 | break |
| 836 | end |
| 837 | t = add t ulong k |
| 838 | end |
| 839 | fcls fd |
| 840 | put gcn 0 t |
| 841 | ret true |
| 842 | end |
| 843 | |
| 844 | fn wgb fd int to bool |
| 845 | n = get gbn 0 |
| 846 | p = ulong 0 |
| 847 | while lt p n bound 99999 |
| 848 | w = write fd gb p sub n p |
| 849 | if le w 0 |
| 850 | ret false |
| 851 | end |
| 852 | p = add p ulong w |
| 853 | end |
| 854 | ret true |
| 855 | end |
| 856 | |
| 857 | fn wgc fd int to bool |
| 858 | n = get gcn 0 |
| 859 | p = ulong 0 |
| 860 | while lt p n bound 99999 |
| 861 | w = write fd gc p sub n p |
| 862 | if le w 0 |
| 863 | ret false |
| 864 | end |
| 865 | p = add p ulong w |
| 866 | end |
| 867 | ret true |
| 868 | end |
| 869 | |
| 870 | fn fsavb s ulong to bool |
| 871 | fd = fopf s 577 |
| 872 | if lt fd 0 |
| 873 | ret false |
| 874 | end |
| 875 | ok = wgb fd |
| 876 | fcls fd |
| 877 | ret ok |
| 878 | end |
| 879 | |
| 880 | fn fsavc s ulong to bool |
| 881 | fd = fopf s 577 |
| 882 | if lt fd 0 |
| 883 | ret false |
| 884 | end |
| 885 | ok = wgc fd |
| 886 | fcls fd |
| 887 | ret ok |
| 888 | end |
| 889 | |
| 890 | fn fsavs s ulong v ulong to bool |
| 891 | fd = fopf s 577 |
| 892 | if lt fd 0 |
| 893 | ret false |
| 894 | end |
| 895 | wslot fd v |
| 896 | fcls fd |
| 897 | ret true |
| 898 | end |
| 899 | |
| 900 | note copy slot s's file to fd d |
| 901 | fn fcat d int s ulong to bool |
| 902 | fd = fopf s 0 |
| 903 | if lt fd 0 |
| 904 | ret false |
| 905 | end |
| 906 | while true bound 99999 |
| 907 | k = read fd gio 0 65536 |
| 908 | if lt k 0 |
| 909 | fcls fd |
| 910 | ret false |
| 911 | end |
| 912 | if eq k 0 |
| 913 | break |
| 914 | end |
| 915 | p = ulong 0 |
| 916 | while lt p ulong k bound 99999 |
| 917 | w = write d gio p sub ulong k p |
| 918 | if le w 0 |
| 919 | fcls fd |
| 920 | ret false |
| 921 | end |
| 922 | p = add p ulong w |
| 923 | end |
| 924 | end |
| 925 | fcls fd |
| 926 | ret true |
| 927 | end |
| 928 | |
| 929 | note slot d = lowercase sha256 hex of slot s's file |
| 930 | fn fsha s ulong d ulong to bool |
| 931 | fd = fopf s 0 |
| 932 | if lt fd 0 |
| 933 | ret false |
| 934 | end |
| 935 | hreset |
| 936 | while true bound 999999 |
| 937 | k = read fd gio 0 65536 |
| 938 | if lt k 0 |
| 939 | fcls fd |
| 940 | ret false |
| 941 | end |
| 942 | if eq k 0 |
| 943 | break |
| 944 | end |
| 945 | for i ulong ulong k |
| 946 | hok = hpush get gio i |
| 947 | end |
| 948 | end |
| 949 | fcls fd |
| 950 | ok = hfinal |
| 951 | sclr d |
| 952 | for j ulong 64 |
| 953 | sb d get hd j |
| 954 | end |
| 955 | ret ok |
| 956 | end |
| 957 | |
| 958 | note ---- children: packed argv in gav, execprog with an empty environment |
| 959 | |
| 960 | fn aclr to void |
| 961 | put gap 0 2 |
| 962 | put gap 1 0 |
| 963 | end |
| 964 | |
| 965 | fn apb c uchar to void |
| 966 | p = get gap 0 |
| 967 | put gav p c |
| 968 | put gap 0 add p 1 |
| 969 | end |
| 970 | |
| 971 | fn aps s ulong to void |
| 972 | n = get gsl s |
| 973 | apb uchar and n 255 |
| 974 | apb uchar shr n 8 |
| 975 | for i ulong n |
| 976 | apb sc s i |
| 977 | end |
| 978 | put gap 1 add get gap 1 1 |
| 979 | end |
| 980 | |
| 981 | fn apt t view uchar * to void |
| 982 | sset SA t |
| 983 | aps SA |
| 984 | end |
| 985 | |
| 986 | fn redir s int d int to void |
| 987 | if lt s 0 |
| 988 | ret |
| 989 | end |
| 990 | if eq s d |
| 991 | ret |
| 992 | end |
| 993 | r = dupfd s d 0 |
| 994 | if ne r long d |
| 995 | exit 127 |
| 996 | end |
| 997 | end |
| 998 | |
| 999 | note run gav with fds fi fo fe (-1 inherits); the exit status, 256+signal, or 1000 on spawn failure |
| 1000 | fn apfin to void |
| 1001 | n = get gap 1 |
| 1002 | put gav 0 uchar and n 255 |
| 1003 | put gav 1 uchar shr n 8 |
| 1004 | end |
| 1005 | |
| 1006 | fn spawn fi int fo int fe int to ulong |
| 1007 | apfin |
| 1008 | pid = fork |
| 1009 | if lt pid 0 |
| 1010 | ret 1000 |
| 1011 | end |
| 1012 | if eq pid 0 |
| 1013 | redir fi 0 |
| 1014 | redir fo 1 |
| 1015 | redir fe 2 |
| 1016 | r = execprog gav 0 get gap 0 |
| 1017 | exit 127 |
| 1018 | end |
| 1019 | r = waitpid int pid gwst 0 4 0 |
| 1020 | if ne r pid |
| 1021 | ret 1000 |
| 1022 | end |
| 1023 | if ne get gwst 0 0 |
| 1024 | ret add 256 ulong and get gwst 0 127 |
| 1025 | end |
| 1026 | ret ulong get gwst 1 |
| 1027 | end |
| 1028 | |
| 1029 | note spawn with stdout and stderr to slot s's file (truncated) |
| 1030 | fn spawnf s ulong to ulong |
| 1031 | fd = fopf s 577 |
| 1032 | if lt fd 0 |
| 1033 | ret 1000 |
| 1034 | end |
| 1035 | rc = spawn -1 fd fd |
| 1036 | fcls fd |
| 1037 | ret rc |
| 1038 | end |
| 1039 | |
| 1040 | fn rmrf s ulong to void |
| 1041 | aclr |
| 1042 | apt trm |
| 1043 | apt tdrf |
| 1044 | aps s |
| 1045 | rc = spawn -1 -1 -1 |
| 1046 | end |
| 1047 | |
| 1048 | note ---- line transforms over gb into gc |
| 1049 | |
| 1050 | fn leol p ulong to ulong |
| 1051 | n = get gbn 0 |
| 1052 | q = p |
| 1053 | while lt q n bound 999999 |
| 1054 | if eq get gb q 10 |
| 1055 | ret q |
| 1056 | end |
| 1057 | q = add q 1 |
| 1058 | end |
| 1059 | ret n |
| 1060 | end |
| 1061 | |
| 1062 | fn lis p ulong e ulong s ulong to bool |
| 1063 | if ne sub e p get gsl s |
| 1064 | ret false |
| 1065 | end |
| 1066 | for i ulong sub e p |
| 1067 | if ne get gb add p i sc s i |
| 1068 | ret false |
| 1069 | end |
| 1070 | end |
| 1071 | ret true |
| 1072 | end |
| 1073 | |
| 1074 | fn lpre p ulong e ulong s ulong to bool |
| 1075 | if lt sub e p get gsl s |
| 1076 | ret false |
| 1077 | end |
| 1078 | for i ulong get gsl s |
| 1079 | if ne get gb add p i sc s i |
| 1080 | ret false |
| 1081 | end |
| 1082 | end |
| 1083 | ret true |
| 1084 | end |
| 1085 | |
| 1086 | fn cput c uchar to void |
| 1087 | n = get gcn 0 |
| 1088 | if ge n BCAP |
| 1089 | w = write 2 tlong 0 len tlong |
| 1090 | exit 2 |
| 1091 | end |
| 1092 | put gc n c |
| 1093 | put gcn 0 add n 1 |
| 1094 | end |
| 1095 | |
| 1096 | fn crng p ulong e ulong to void |
| 1097 | for i ulong sub e p |
| 1098 | cput get gb add p i |
| 1099 | end |
| 1100 | end |
| 1101 | |
| 1102 | fn cslot s ulong to void |
| 1103 | for i ulong get gsl s |
| 1104 | cput sc s i |
| 1105 | end |
| 1106 | end |
| 1107 | |
| 1108 | note one line gb[p..e): mode 0 exact a -> b (inside block blk when blk is not empty), 1 prefix a -> b, |
| 1109 | note 2 delete lines starting with a |
| 1110 | fn xl mode ulong a ulong b ulong blk ulong p ulong e ulong to void |
| 1111 | nl = lt e get gbn 0 |
| 1112 | hit = false |
| 1113 | if eq mode 2 |
| 1114 | hit = lpre p e a |
| 1115 | if not hit |
| 1116 | crng p e |
| 1117 | end |
| 1118 | end |
| 1119 | if eq mode 1 |
| 1120 | hit = lpre p e a |
| 1121 | if hit |
| 1122 | cslot b |
| 1123 | crng add p get gsl a e |
| 1124 | else |
| 1125 | crng p e |
| 1126 | end |
| 1127 | end |
| 1128 | if eq mode 0 |
| 1129 | inr = true |
| 1130 | if gt get gsl blk 0 |
| 1131 | inr = false |
| 1132 | if eq get gxs 0 1 |
| 1133 | inr = true |
| 1134 | sset SEND tendl |
| 1135 | if lis p e SEND |
| 1136 | put gxs 0 0 |
| 1137 | end |
| 1138 | else |
| 1139 | if lis p e blk |
| 1140 | inr = true |
| 1141 | put gxs 0 1 |
| 1142 | end |
| 1143 | end |
| 1144 | end |
| 1145 | if inr |
| 1146 | hit = lis p e a |
| 1147 | end |
| 1148 | if hit |
| 1149 | cslot b |
| 1150 | else |
| 1151 | crng p e |
| 1152 | end |
| 1153 | end |
| 1154 | if hit |
| 1155 | put gxs 1 add get gxs 1 1 |
| 1156 | end |
| 1157 | keep = true |
| 1158 | if and hit eq mode 2 |
| 1159 | keep = false |
| 1160 | end |
| 1161 | if and nl keep |
| 1162 | cput 10 |
| 1163 | end |
| 1164 | end |
| 1165 | |
| 1166 | fn xf mode ulong a ulong b ulong blk ulong to ulong |
| 1167 | put gcn 0 0 |
| 1168 | put gxs 0 0 |
| 1169 | put gxs 1 0 |
| 1170 | p = ulong 0 |
| 1171 | n = get gbn 0 |
| 1172 | while lt p n bound 999999 |
| 1173 | e = leol p |
| 1174 | xl mode a b blk p e |
| 1175 | p = add e 1 |
| 1176 | end |
| 1177 | ret get gxs 1 |
| 1178 | end |
| 1179 | |
| 1180 | note gc = gb without its last line |
| 1181 | fn xlast to void |
| 1182 | q = get gbn 0 |
| 1183 | if gt q 0 |
| 1184 | if eq get gb sub q 1 10 |
| 1185 | q = sub q 1 |
| 1186 | end |
| 1187 | end |
| 1188 | s = ulong 0 |
| 1189 | i = q |
| 1190 | while gt i 0 bound 999999 |
| 1191 | if eq get gb sub i 1 10 |
| 1192 | s = i |
| 1193 | break |
| 1194 | end |
| 1195 | i = sub i 1 |
| 1196 | end |
| 1197 | put gcn 0 0 |
| 1198 | crng 0 s |
| 1199 | end |
| 1200 | |
| 1201 | fn cback to void |
| 1202 | n = get gcn 0 |
| 1203 | for i ulong n |
| 1204 | put gb i get gc i |
| 1205 | end |
| 1206 | put gbn 0 n |
| 1207 | end |
| 1208 | |
| 1209 | note gb[p..e) into slot s |
| 1210 | fn lslot s ulong p ulong e ulong to void |
| 1211 | sclr s |
| 1212 | for i ulong sub e p |
| 1213 | sb s get gb add p i |
| 1214 | end |
| 1215 | end |
| 1216 | |
| 1217 | note ---- compilers |
| 1218 | |
| 1219 | note slot SHEX = sha of compiler slot o; 0 pinned, 3 not pinned (message on stderr) |
| 1220 | fn opin o ulong pin view uchar * nr view uchar * to ulong |
| 1221 | if not isexe o |
| 1222 | sayt 2 nr |
| 1223 | ret 3 |
| 1224 | end |
| 1225 | ok = fsha o SHEX |
| 1226 | if not seqt SHEX pin |
| 1227 | sset SM tnrsha |
| 1228 | ss SM SHEX |
| 1229 | sx SM tpinned |
| 1230 | sx SM pin |
| 1231 | say 2 SM |
| 1232 | ret 3 |
| 1233 | end |
| 1234 | ret 0 |
| 1235 | end |
| 1236 | |
| 1237 | note om/golden/build.sh in Omega: compile om2 + json + sha256 + slot src into slot out with bf54b19f |
| 1238 | fn gcomp o ulong src ulong dst ulong to ulong |
| 1239 | rc = opin o tpingt tnrgt |
| 1240 | if ne rc 0 |
| 1241 | ret rc |
| 1242 | end |
| 1243 | scp SX dst |
| 1244 | sx SX tdotom |
| 1245 | scp SY dst |
| 1246 | sx SY terr |
| 1247 | fd = fopf SX 577 |
| 1248 | if lt fd 0 |
| 1249 | ret 1 |
| 1250 | end |
| 1251 | w = write fd tom2 0 len tom2 |
| 1252 | sset SZ tjson |
| 1253 | ok = fcat fd SZ |
| 1254 | sset SZ tshaom |
| 1255 | if ok |
| 1256 | ok = fcat fd SZ |
| 1257 | end |
| 1258 | if ok |
| 1259 | ok = fcat fd src |
| 1260 | end |
| 1261 | fcls fd |
| 1262 | fi = fopf SX 0 |
| 1263 | fo = fopf dst 577 |
| 1264 | fe = fopf SY 577 |
| 1265 | aclr |
| 1266 | aps o |
| 1267 | rc = spawn fi fo fe |
| 1268 | fcls fi |
| 1269 | fcls fo |
| 1270 | fcls fe |
| 1271 | rmf SX |
| 1272 | if or ne rc 0 not ok |
| 1273 | ok = fload SY |
| 1274 | sset SM tcompile |
| 1275 | ss SM src |
| 1276 | sx SM tcolon |
| 1277 | wslot 2 SM |
| 1278 | trimnl |
| 1279 | ok = wgb 2 |
| 1280 | sayt 2 tnl0 |
| 1281 | rmf dst |
| 1282 | rmf SY |
| 1283 | ret 1 |
| 1284 | end |
| 1285 | rmf SY |
| 1286 | r = chmod gs mul dst SCAP get gsl dst 448 |
| 1287 | ret 0 |
| 1288 | end |
| 1289 | |
| 1290 | fn trimnl to void |
| 1291 | n = get gbn 0 |
| 1292 | while gt n 0 bound 999999 |
| 1293 | if ne get gb sub n 1 10 |
| 1294 | break |
| 1295 | end |
| 1296 | n = sub n 1 |
| 1297 | end |
| 1298 | put gbn 0 n |
| 1299 | end |
| 1300 | |
| 1301 | fn rnm a ulong b ulong to bool |
| 1302 | aclr |
| 1303 | aps a |
| 1304 | aps b |
| 1305 | apfin |
| 1306 | r = renames gav 0 get gap 0 0 |
| 1307 | ret eq r 0 |
| 1308 | end |
| 1309 | |
| 1310 | note slot d = slot a + "/" + text t |
| 1311 | fn sjoin d ulong a ulong t view uchar * to void |
| 1312 | scp d a |
| 1313 | sb d 47 |
| 1314 | sx d t |
| 1315 | end |
| 1316 | |
| 1317 | fn sdec s ulong to ulong |
| 1318 | v = ulong 0 |
| 1319 | if eq get gsl s 0 |
| 1320 | ret 18446744073709551615 |
| 1321 | end |
| 1322 | for i ulong get gsl s |
| 1323 | c = sc s i |
| 1324 | if or lt c 48 gt c 57 |
| 1325 | ret 18446744073709551615 |
| 1326 | end |
| 1327 | v = add mul v 10 ulong sub c 48 |
| 1328 | end |
| 1329 | ret v |
| 1330 | end |
| 1331 | |
| 1332 | note last line of slot s's file into slot SM (after prefix t) |
| 1333 | fn lastln s ulong t view uchar * to void |
| 1334 | sset SM t |
| 1335 | ok = fload s |
| 1336 | if not ok |
| 1337 | ret |
| 1338 | end |
| 1339 | trimnl |
| 1340 | n = get gbn 0 |
| 1341 | i = n |
| 1342 | while gt i 0 bound 999999 |
| 1343 | if eq get gb sub i 1 10 |
| 1344 | break |
| 1345 | end |
| 1346 | i = sub i 1 |
| 1347 | end |
| 1348 | for j ulong sub n i |
| 1349 | sb SM get gb add i j |
| 1350 | end |
| 1351 | end |
| 1352 | |
| 1353 | note ---- the negative-control file (.neg): want N, block LINE, from LINE, to LINE; '#' comments |
| 1354 | fn negld s ulong to bool |
| 1355 | sclr SNW |
| 1356 | sclr SNB |
| 1357 | sclr SNF |
| 1358 | sclr SNT |
| 1359 | ok = fload s |
| 1360 | if not ok |
| 1361 | ret false |
| 1362 | end |
| 1363 | p = ulong 0 |
| 1364 | n = get gbn 0 |
| 1365 | while lt p n bound 99999 |
| 1366 | e = leol p |
| 1367 | sset SK twant |
| 1368 | if lpre p e SK |
| 1369 | lslot SNW add p 5 e |
| 1370 | end |
| 1371 | sset SK tblock |
| 1372 | if lpre p e SK |
| 1373 | lslot SNB add p 6 e |
| 1374 | end |
| 1375 | sset SK tfrom |
| 1376 | if lpre p e SK |
| 1377 | lslot SNF add p 5 e |
| 1378 | end |
| 1379 | sset SK tto |
| 1380 | if lpre p e SK |
| 1381 | lslot SNT add p 3 e |
| 1382 | end |
| 1383 | p = add e 1 |
| 1384 | end |
| 1385 | ret true |
| 1386 | end |
| 1387 | |
| 1388 | note ---- CORE: env CORE, else this process's Cpus_allowed_list |
| 1389 | fn score to void |
| 1390 | if senv SCORE tcoreq0 |
| 1391 | ret |
| 1392 | end |
| 1393 | sclr SCORE |
| 1394 | sset SP tstatus |
| 1395 | ok = fload SP |
| 1396 | if not ok |
| 1397 | ret |
| 1398 | end |
| 1399 | sset SK tcpus |
| 1400 | p = ulong 0 |
| 1401 | n = get gbn 0 |
| 1402 | while lt p n bound 99999 |
| 1403 | e = leol p |
| 1404 | if lpre p e SK |
| 1405 | q = add p get gsl SK |
| 1406 | while lt q e bound 99999 |
| 1407 | c = get gb q |
| 1408 | if and ne c 9 ne c 32 |
| 1409 | sb SCORE c |
| 1410 | end |
| 1411 | q = add q 1 |
| 1412 | end |
| 1413 | ret |
| 1414 | end |
| 1415 | p = add e 1 |
| 1416 | end |
| 1417 | end |
| 1418 | |
| 1419 | fn bfail t view uchar * rc ulong to ulong |
| 1420 | sset SM tsfail |
| 1421 | sx SM t |
| 1422 | sx SM tgdecr |
| 1423 | sn SM rc |
| 1424 | say 2 SM |
| 1425 | ret 1 |
| 1426 | end |
| 1427 | |
| 1428 | note git child: /usr/bin/env drops the system and global config and attributes files and the graft |
| 1429 | note file, and --no-replace-objects drops refs/replace (the child environment is otherwise empty) |
| 1430 | fn agit to void |
| 1431 | aclr |
| 1432 | apt tenv |
| 1433 | apt tgenv1 |
| 1434 | apt tgenv2 |
| 1435 | apt tgenv3 |
| 1436 | apt tgenv4 |
| 1437 | apt tgit |
| 1438 | apt tnorep |
| 1439 | end |
| 1440 | |
| 1441 | note private object-only repository SZ = SOUT/src.git: a bare repository made with no templates |
| 1442 | note (no hooks, no info/grafts, no info/attributes, no alternates), fetched from TRAIN's HEAD, |
| 1443 | note heads, tags and remotes (never refs/replace; fetched objects are hash-checked by index-pack). |
| 1444 | note TRAIN's side of the fetch is an upload-pack run with GIT_GRAFT_FILE=/dev/null and |
| 1445 | note GIT_NO_REPLACE_OBJECTS=1 (git clears repo-local variables for a local upload-pack, so they are |
| 1446 | note set in its command), so it walks and sends the true history. REV resolves in SZ, never in TRAIN, |
| 1447 | note so TRAIN's info/grafts, info/attributes, replace refs and config overlays cannot select the |
| 1448 | note commit or shape the snapshot. Slot SSHA = the commit id; SOUT/commit holds it; returns 0 or the |
| 1449 | note bfail code |
| 1450 | fn rslv to ulong |
| 1451 | sjoin SZ SOUT tprv |
| 1452 | rmrf SZ |
| 1453 | sjoin SP SOUT tcmt |
| 1454 | sjoin SQ SOUT tcmterr |
| 1455 | agit |
| 1456 | apt tinit |
| 1457 | apt tq0 |
| 1458 | apt tbare |
| 1459 | apt ttmpl |
| 1460 | aps SZ |
| 1461 | rc = spawnf SQ |
| 1462 | if ne rc 0 |
| 1463 | ret bfail tinit rc |
| 1464 | end |
| 1465 | agit |
| 1466 | apt tdash |
| 1467 | aps SZ |
| 1468 | apt tfetch |
| 1469 | apt tq0 |
| 1470 | apt tnotags |
| 1471 | apt tnogc |
| 1472 | apt tnofh |
| 1473 | apt tupk |
| 1474 | aps STRN |
| 1475 | apt trs1 |
| 1476 | apt trs2 |
| 1477 | apt trs3 |
| 1478 | apt trs4 |
| 1479 | rc = spawnf SQ |
| 1480 | if ne rc 0 |
| 1481 | ret bfail tfetch rc |
| 1482 | end |
| 1483 | agit |
| 1484 | apt tdash |
| 1485 | aps SZ |
| 1486 | apt tupref |
| 1487 | apt tnoderef |
| 1488 | apt thead |
| 1489 | apt tghead |
| 1490 | rc = spawnf SQ |
| 1491 | if ne rc 0 |
| 1492 | ret bfail tupref rc |
| 1493 | end |
| 1494 | agit |
| 1495 | apt tdash |
| 1496 | aps SZ |
| 1497 | apt trevp |
| 1498 | apt tverify |
| 1499 | scp SV SREV |
| 1500 | sx SV tcommit |
| 1501 | aps SV |
| 1502 | fo = fopf SP 577 |
| 1503 | fe = fopf SQ 577 |
| 1504 | rc = spawn -1 fo fe |
| 1505 | fcls fo |
| 1506 | fcls fe |
| 1507 | if ne rc 0 |
| 1508 | ret bfail trevp rc |
| 1509 | end |
| 1510 | ok = fload SP |
| 1511 | trimnl |
| 1512 | if ne get gbn 0 40 |
| 1513 | ret bfail trevp 1000 |
| 1514 | end |
| 1515 | lslot SSHA 0 40 |
| 1516 | ret 0 |
| 1517 | end |
| 1518 | |
| 1519 | note ---- drive build: slots SOMC STRN SREV SOUT SNEG (absolute); returns the exit code |
| 1520 | fn dbuild to ulong |
| 1521 | rc = opin SOMC tpintr tnrtr |
| 1522 | if ne rc 0 |
| 1523 | ret rc |
| 1524 | end |
| 1525 | if gt get gsl SNEG 0 |
| 1526 | ok = negld SNEG |
| 1527 | if or not ok eq get gsl SNW 0 |
| 1528 | sset SM tnowant |
| 1529 | ss SM SNEG |
| 1530 | say 2 SM |
| 1531 | ret 4 |
| 1532 | end |
| 1533 | end |
| 1534 | ok = mkp SOUT |
| 1535 | if not ok |
| 1536 | sset SM tmkd |
| 1537 | ss SM SOUT |
| 1538 | say 2 SM |
| 1539 | ret 1 |
| 1540 | end |
| 1541 | note resolve REV to one commit in the private repository SZ |
| 1542 | rc = rslv |
| 1543 | if ne rc 0 |
| 1544 | ret rc |
| 1545 | end |
| 1546 | note snapshot that commit |
| 1547 | sjoin SX SOUT tsrc |
| 1548 | rmrf SX |
| 1549 | ok = mkd SX |
| 1550 | sjoin SY SOUT tsrctar |
| 1551 | agit |
| 1552 | apt tdash |
| 1553 | aps SZ |
| 1554 | apt tarch |
| 1555 | apt tfmtt |
| 1556 | apt tdo |
| 1557 | aps SY |
| 1558 | aps SSHA |
| 1559 | rc = spawnf SQ |
| 1560 | if ne rc 0 |
| 1561 | ret bfail tarch rc |
| 1562 | end |
| 1563 | rmrf SZ |
| 1564 | aclr |
| 1565 | apt ttar |
| 1566 | apt tdx |
| 1567 | apt tdf |
| 1568 | aps SY |
| 1569 | apt tdash |
| 1570 | aps SX |
| 1571 | rc = spawnf SQ |
| 1572 | if ne rc 0 |
| 1573 | ret bfail ttar rc |
| 1574 | end |
| 1575 | rmf SY |
| 1576 | rmf SQ |
| 1577 | note the snapshot's own build.sh |
| 1578 | score |
| 1579 | aclr |
| 1580 | apt tenv |
| 1581 | apt tpath |
| 1582 | apt ttgt |
| 1583 | sset SV tomceq |
| 1584 | ss SV SOMC |
| 1585 | aps SV |
| 1586 | sset SV touteq |
| 1587 | ss SV SOUT |
| 1588 | sx SV tsltrain |
| 1589 | aps SV |
| 1590 | sset SV tcoreq |
| 1591 | ss SV SCORE |
| 1592 | aps SV |
| 1593 | apt tsh |
| 1594 | scp SV SX |
| 1595 | sx SV tslbsh |
| 1596 | aps SV |
| 1597 | sjoin SP SOUT tlog |
| 1598 | rc = spawnf SP |
| 1599 | rmrf SX |
| 1600 | if ne rc 0 |
| 1601 | lastln SP tbfail |
| 1602 | say 2 SM |
| 1603 | ret 1 |
| 1604 | end |
| 1605 | sjoin SP SOUT tslollm |
| 1606 | ok = fload SP |
| 1607 | if not ok |
| 1608 | lastln SP tbfail |
| 1609 | say 2 SM |
| 1610 | ret 1 |
| 1611 | end |
| 1612 | sset SA tmain |
| 1613 | sclr SZ |
| 1614 | nm = xf 0 SA SA SZ |
| 1615 | if ne nm 1 |
| 1616 | sset SM tmcount |
| 1617 | sn SM nm |
| 1618 | sx SM twant1 |
| 1619 | say 2 SM |
| 1620 | ret 4 |
| 1621 | end |
| 1622 | sset SB tmain |
| 1623 | sset SV toggm |
| 1624 | sclr SZ |
| 1625 | nm = xf 0 SB SV SZ |
| 1626 | cback |
| 1627 | if gt get gsl SNEG 0 |
| 1628 | w = sdec SNW |
| 1629 | c = xf 0 SNF SNT SNB |
| 1630 | if ne c w |
| 1631 | sset SM tpchg |
| 1632 | sn SM c |
| 1633 | sx SM tlines |
| 1634 | ss SM SNW |
| 1635 | say 2 SM |
| 1636 | ret 4 |
| 1637 | end |
| 1638 | cback |
| 1639 | end |
| 1640 | sjoin SP SOUT tgold |
| 1641 | fd = fopf SP 577 |
| 1642 | if lt fd 0 |
| 1643 | ret 1 |
| 1644 | end |
| 1645 | ok = wgb fd |
| 1646 | sset SQ tgdec |
| 1647 | ok2 = fcat fd SQ |
| 1648 | fcls fd |
| 1649 | sjoin SX SOUT tgoldtmp |
| 1650 | sjoin SY SOUT tomcerr |
| 1651 | fi = fopf SP 0 |
| 1652 | fo = fopf SX 577 |
| 1653 | fe = fopf SY 577 |
| 1654 | aclr |
| 1655 | aps SOMC |
| 1656 | rc = spawn fi fo fe |
| 1657 | fcls fi |
| 1658 | fcls fo |
| 1659 | fcls fe |
| 1660 | if or ne rc 0 not and ok ok2 |
| 1661 | rmf SX |
| 1662 | sset SM tbfomc |
| 1663 | sn SM rc |
| 1664 | sx SM tsp |
| 1665 | wslot 2 SM |
| 1666 | ok = fload SY |
| 1667 | trimnl |
| 1668 | ok = wgb 2 |
| 1669 | sayt 2 tnl0 |
| 1670 | ret 1 |
| 1671 | end |
| 1672 | rmf SY |
| 1673 | r = chmod gs mul SX SCAP get gsl SX 493 |
| 1674 | sjoin SZ SOUT tgoldb |
| 1675 | ok = rnm SX SZ |
| 1676 | sjoin SP SOUT tcmt |
| 1677 | sclr SV |
| 1678 | ss SV SSHA |
| 1679 | ok = fsavs SP SV |
| 1680 | sset SM tbok |
| 1681 | ok = fsha SZ SHEX |
| 1682 | ss SM SHEX |
| 1683 | sx SM tsp |
| 1684 | ss SM SZ |
| 1685 | sx SM tsrcsha |
| 1686 | sjoin SP SOUT tgold |
| 1687 | ok = fsha SP SHEX |
| 1688 | ss SM SHEX |
| 1689 | sx SM tcmtsp |
| 1690 | ss SM SSHA |
| 1691 | say 1 SM |
| 1692 | ret 0 |
| 1693 | end |
| 1694 | |
| 1695 | note ---- prompts: one per line (a final unterminated line counts when not empty) into slots SPRB.. |
| 1696 | fn pld s ulong to bool |
| 1697 | put gk 0 0 |
| 1698 | ok = fload s |
| 1699 | if not ok |
| 1700 | ret false |
| 1701 | end |
| 1702 | p = ulong 0 |
| 1703 | n = get gbn 0 |
| 1704 | k = ulong 0 |
| 1705 | while lt p n bound 99999 |
| 1706 | e = leol p |
| 1707 | if ge k NPMAX |
| 1708 | ret false |
| 1709 | end |
| 1710 | if gt sub e p SCAP |
| 1711 | ret false |
| 1712 | end |
| 1713 | lslot add SPRB k p e |
| 1714 | k = add k 1 |
| 1715 | p = add e 1 |
| 1716 | end |
| 1717 | put gk 0 k |
| 1718 | ret true |
| 1719 | end |
| 1720 | |
| 1721 | fn apprm to void |
| 1722 | for k ulong get gk 0 |
| 1723 | aps add SPRB k |
| 1724 | end |
| 1725 | end |
| 1726 | |
| 1727 | note slot SV = digits of the record's max_tokens line; false when absent |
| 1728 | fn rmaxt s ulong to bool |
| 1729 | sclr SV |
| 1730 | ok = fload s |
| 1731 | if not ok |
| 1732 | ret false |
| 1733 | end |
| 1734 | sset SK tmaxtok |
| 1735 | p = ulong 0 |
| 1736 | n = get gbn 0 |
| 1737 | while lt p n bound 999999 |
| 1738 | e = leol p |
| 1739 | if lpre p e SK |
| 1740 | lslot SV add p get gsl SK e |
| 1741 | if ne sdec SV 18446744073709551615 |
| 1742 | ret true |
| 1743 | end |
| 1744 | end |
| 1745 | p = add e 1 |
| 1746 | end |
| 1747 | sclr SV |
| 1748 | ret false |
| 1749 | end |
| 1750 | |
| 1751 | fn hold to bool |
| 1752 | if senv SV thost |
| 1753 | ret true |
| 1754 | end |
| 1755 | sclr SV |
| 1756 | ok = senv SV theld |
| 1757 | ret seqt SV tone |
| 1758 | end |
| 1759 | |
| 1760 | fn verd t view uchar * c ulong to ulong |
| 1761 | sset SM tgateb0 |
| 1762 | sx SM t |
| 1763 | say 1 SM |
| 1764 | ret c |
| 1765 | end |
| 1766 | |
| 1767 | fn verdn t view uchar * v ulong u view uchar * c ulong to ulong |
| 1768 | sset SM tgateb0 |
| 1769 | sx SM t |
| 1770 | sn SM v |
| 1771 | sx SM u |
| 1772 | say 1 SM |
| 1773 | ret c |
| 1774 | end |
| 1775 | |
| 1776 | note print each line of slot s's file to fd 1 with prefix text t |
| 1777 | fn catpre s ulong t view uchar * to void |
| 1778 | ok = fload s |
| 1779 | if not ok |
| 1780 | ret |
| 1781 | end |
| 1782 | p = ulong 0 |
| 1783 | n = get gbn 0 |
| 1784 | while lt p n bound 999999 |
| 1785 | e = leol p |
| 1786 | lslot SM p e |
| 1787 | sset SK t |
| 1788 | sx SK tcolon |
| 1789 | ss SK SM |
| 1790 | say 1 SK |
| 1791 | p = add e 1 |
| 1792 | end |
| 1793 | end |
| 1794 | |
| 1795 | fn catf s ulong to void |
| 1796 | ok = fcat 1 s |
| 1797 | end |
| 1798 | |
| 1799 | note drive build of arm (cand or neg) as a child; prints its transcript; the child's code |
| 1800 | fn gbarm am view uchar * isn bool to ulong |
| 1801 | aclr |
| 1802 | apt tself |
| 1803 | apt tbuild |
| 1804 | aps SOMC |
| 1805 | aps STRN |
| 1806 | aps SREV |
| 1807 | sset SX tsl0 |
| 1808 | ss SX SOUT |
| 1809 | sb SX 47 |
| 1810 | sx SX am |
| 1811 | aps SX |
| 1812 | if isn |
| 1813 | sset SY tnegf |
| 1814 | sabs SY |
| 1815 | aps SY |
| 1816 | end |
| 1817 | sx SX tbuildf |
| 1818 | rc = spawnf SX |
| 1819 | catf SX |
| 1820 | ret rc |
| 1821 | end |
| 1822 | |
| 1823 | note gtgpu of an arm and gate cmp; returns cmp's code |
| 1824 | fn grarm am view uchar * to ulong |
| 1825 | sset SX tsl0 |
| 1826 | ss SX SOUT |
| 1827 | sb SX 47 |
| 1828 | sx SX am |
| 1829 | scp SY SX |
| 1830 | sb SY 47 |
| 1831 | sx SY tgoldb |
| 1832 | aclr |
| 1833 | aps SY |
| 1834 | apt tgtgpu |
| 1835 | aps SCK |
| 1836 | aps SMG |
| 1837 | aps SMX |
| 1838 | apprm |
| 1839 | scp SP SX |
| 1840 | sx SP tout |
| 1841 | scp SQ SX |
| 1842 | sx SQ terr0 |
| 1843 | fo = fopf SP 577 |
| 1844 | fe = fopf SQ 577 |
| 1845 | rc = spawn -1 fo fe |
| 1846 | fcls fo |
| 1847 | fcls fe |
| 1848 | sset SW tsp0 |
| 1849 | sx SW am |
| 1850 | sx SW tgrc |
| 1851 | sn SW rc |
| 1852 | sx SW tsp |
| 1853 | lastln SP tnl0 |
| 1854 | ss SW SM |
| 1855 | say 1 SW |
| 1856 | aclr |
| 1857 | aps SG |
| 1858 | apt tcmp |
| 1859 | aps SREF |
| 1860 | aps SP |
| 1861 | aps SCK |
| 1862 | aps SMG |
| 1863 | aps SPR |
| 1864 | scp SQ SX |
| 1865 | sx SQ tcmpx |
| 1866 | c = spawnf SQ |
| 1867 | catpre SQ am |
| 1868 | ret c |
| 1869 | end |
| 1870 | |
| 1871 | note true when OUT/am/commit holds exactly the commit id in slot SREV |
| 1872 | fn gbid am view uchar * to bool |
| 1873 | sset SX tsl0 |
| 1874 | ss SX SOUT |
| 1875 | sb SX 47 |
| 1876 | sx SX am |
| 1877 | sb SX 47 |
| 1878 | sx SX tcmt |
| 1879 | ok = fload SX |
| 1880 | if not ok |
| 1881 | ret false |
| 1882 | end |
| 1883 | trimnl |
| 1884 | lslot SV 0 get gbn 0 |
| 1885 | ret seqs SV SREV |
| 1886 | end |
| 1887 | |
| 1888 | note drive gate: slots SOMC SOMG STRN SREV SREF SCK SMG SPR SOUT |
| 1889 | fn dgate to ulong |
| 1890 | if not hold |
| 1891 | sayt 1 tnohold |
| 1892 | ret 3 |
| 1893 | end |
| 1894 | if there SOUT |
| 1895 | sset SM texists |
| 1896 | ss SM SOUT |
| 1897 | say 2 SM |
| 1898 | ret 2 |
| 1899 | end |
| 1900 | ok = mkp SOUT |
| 1901 | note REV resolves once, through the private repository OUT/src.git, to a full commit id. That |
| 1902 | note repository's HEAD is pinned to the id and both builds fetch from it, not from TRAIN, so a branch |
| 1903 | note moved (or a ref deleted) in TRAIN between the builds cannot split them; each build's commit |
| 1904 | note must still equal the id |
| 1905 | rc = rslv |
| 1906 | if ne rc 0 |
| 1907 | ret verdn tbres rc tnl0 4 |
| 1908 | end |
| 1909 | agit |
| 1910 | apt tdash |
| 1911 | aps SZ |
| 1912 | apt tupref |
| 1913 | apt tnoderef |
| 1914 | apt thead |
| 1915 | aps SSHA |
| 1916 | rc = spawnf SQ |
| 1917 | if ne rc 0 |
| 1918 | ret verdn tbres rc tnl0 4 |
| 1919 | end |
| 1920 | scp STRN SZ |
| 1921 | scp SREV SSHA |
| 1922 | sjoin SG SOUT tgateb |
| 1923 | sset SP tgateom |
| 1924 | rc = gcomp SOMG SP SG |
| 1925 | if eq rc 3 |
| 1926 | ret verd tngate 3 |
| 1927 | end |
| 1928 | if ne rc 0 |
| 1929 | ret verdn tbgate rc tnl0 4 |
| 1930 | end |
| 1931 | rc = gbarm tcand false |
| 1932 | if eq rc 3 |
| 1933 | ret verd tndec 3 |
| 1934 | end |
| 1935 | if ne rc 0 |
| 1936 | ret verdn tbcand rc tnl0 4 |
| 1937 | end |
| 1938 | if not gbid tcand |
| 1939 | ret verd tbidc 4 |
| 1940 | end |
| 1941 | rc = gbarm tnegd true |
| 1942 | if eq rc 3 |
| 1943 | ret verd tndec 3 |
| 1944 | end |
| 1945 | if ne rc 0 |
| 1946 | ret verdn tbnegb rc tnl0 4 |
| 1947 | end |
| 1948 | if not gbid tnegd |
| 1949 | ret verd tbidn 4 |
| 1950 | end |
| 1951 | if not rmaxt SREF |
| 1952 | ret verd tnomx 3 |
| 1953 | end |
| 1954 | scp SMX SV |
| 1955 | ok = pld SPR |
| 1956 | if not ok |
| 1957 | ret verd tnoprm 4 |
| 1958 | end |
| 1959 | c = grarm tcand |
| 1960 | nc = grarm tnegd |
| 1961 | if eq c 3 |
| 1962 | ret verd tnocmp 3 |
| 1963 | end |
| 1964 | if ne nc 1 |
| 1965 | ret verdn tbneg nc tbneg2 4 |
| 1966 | end |
| 1967 | if eq c 0 |
| 1968 | ret verd tpass 0 |
| 1969 | end |
| 1970 | if eq c 1 |
| 1971 | ret verd tfailv 1 |
| 1972 | end |
| 1973 | ret verdn tbcmp c tnl0 4 |
| 1974 | end |
| 1975 | |
| 1976 | note ---- record |
| 1977 | |
| 1978 | fn sutc s ulong to void |
| 1979 | ns = realns |
| 1980 | sec = div ulong ns 1000000000 |
| 1981 | rs = rem sec 86400 |
| 1982 | sdate s div sec 86400 |
| 1983 | sn2 s div rs 3600 |
| 1984 | sb s 58 |
| 1985 | sn2 s div rem rs 3600 60 |
| 1986 | sb s 58 |
| 1987 | sn2 s rem rs 60 |
| 1988 | sb s 90 |
| 1989 | end |
| 1990 | |
| 1991 | fn sdate s ulong days ulong to void |
| 1992 | z = add days 719468 |
| 1993 | era = div z 146097 |
| 1994 | doe = sub z mul era 146097 |
| 1995 | a = sub doe div doe 1460 |
| 1996 | a = add a div doe 36524 |
| 1997 | a = sub a div doe 146096 |
| 1998 | yoe = div a 365 |
| 1999 | y = add yoe mul era 400 |
| 2000 | a = mul 365 yoe |
| 2001 | a = add a div yoe 4 |
| 2002 | a = sub a div yoe 100 |
| 2003 | doy = sub doe a |
| 2004 | mp = div add mul 5 doy 2 153 |
| 2005 | a = div add mul 153 mp 2 5 |
| 2006 | d = add sub doy a 1 |
| 2007 | m = add mp 3 |
| 2008 | if ge mp 10 |
| 2009 | m = sub mp 9 |
| 2010 | end |
| 2011 | if le m 2 |
| 2012 | y = add y 1 |
| 2013 | end |
| 2014 | sn s y |
| 2015 | sb s 45 |
| 2016 | sn2 s m |
| 2017 | sb s 45 |
| 2018 | sn2 s d |
| 2019 | sb s 84 |
| 2020 | end |
| 2021 | |
| 2022 | fn shost s ulong to void |
| 2023 | sclr s |
| 2024 | sset SP thostf |
| 2025 | ok = fload SP |
| 2026 | if not ok |
| 2027 | ret |
| 2028 | end |
| 2029 | for i ulong get gbn 0 |
| 2030 | c = get gb i |
| 2031 | if or eq c 46 eq c 10 |
| 2032 | ret |
| 2033 | end |
| 2034 | sb s c |
| 2035 | end |
| 2036 | end |
| 2037 | |
| 2038 | note drive record: slots SOMC SOMG STRN SREV SCK SMG SPR SOUT SLAB |
| 2039 | fn drec to ulong |
| 2040 | if there SOUT |
| 2041 | sset SM texists |
| 2042 | ss SM SOUT |
| 2043 | say 2 SM |
| 2044 | ret 2 |
| 2045 | end |
| 2046 | ok = mkp SOUT |
| 2047 | aclr |
| 2048 | apt tself |
| 2049 | apt tbuild |
| 2050 | aps SOMC |
| 2051 | aps STRN |
| 2052 | aps SREV |
| 2053 | sjoin SX SOUT tbuild |
| 2054 | aps SX |
| 2055 | rc = spawn -1 -1 -1 |
| 2056 | if ne rc 0 |
| 2057 | ret rc |
| 2058 | end |
| 2059 | sjoin SG SOUT tgateb |
| 2060 | sset SP tgateom |
| 2061 | rc = gcomp SOMG SP SG |
| 2062 | if ne rc 0 |
| 2063 | ret rc |
| 2064 | end |
| 2065 | ok = pld SPR |
| 2066 | if not ok |
| 2067 | ret 4 |
| 2068 | end |
| 2069 | sjoin SX SOUT tbuild |
| 2070 | sjoin SY SX tgoldb |
| 2071 | ok = fsha SY SH2 |
| 2072 | sjoin SP SX tcmt |
| 2073 | ok = fload SP |
| 2074 | trimnl |
| 2075 | sset SC2 tsrcp |
| 2076 | for i ulong get gbn 0 |
| 2077 | sb SC2 get gb i |
| 2078 | end |
| 2079 | sjoin SP SOUT tcpuout |
| 2080 | aclr |
| 2081 | aps SY |
| 2082 | apt tgtcpu |
| 2083 | aps SCK |
| 2084 | aps SMG |
| 2085 | apt tmx |
| 2086 | apprm |
| 2087 | fo = fopf SP 577 |
| 2088 | rc = spawn -1 fo -1 |
| 2089 | fcls fo |
| 2090 | if ne rc 0 |
| 2091 | ret rc |
| 2092 | end |
| 2093 | shost SE |
| 2094 | sclr SZ |
| 2095 | sutc SZ |
| 2096 | sjoin SP SOUT tcpuout |
| 2097 | aclr |
| 2098 | aps SG |
| 2099 | apt trec |
| 2100 | aps SP |
| 2101 | aps SCK |
| 2102 | aps SMG |
| 2103 | aps SPR |
| 2104 | apt tmx |
| 2105 | apt tfl |
| 2106 | apt tdr |
| 2107 | aps SH2 |
| 2108 | aps SC2 |
| 2109 | aps SE |
| 2110 | aps SZ |
| 2111 | aps SLAB |
| 2112 | sjoin SQ SOUT treftmp |
| 2113 | fo = fopf SQ 577 |
| 2114 | rc = spawn -1 fo -1 |
| 2115 | fcls fo |
| 2116 | if ne rc 0 |
| 2117 | ret rc |
| 2118 | end |
| 2119 | sjoin SR SOUT tref |
| 2120 | ok = rnm SQ SR |
| 2121 | sset SM trecok |
| 2122 | ok = fsha SR SHEX |
| 2123 | ss SM SHEX |
| 2124 | sx SM tsp |
| 2125 | ss SM SR |
| 2126 | say 1 SM |
| 2127 | ret 0 |
| 2128 | end |
| 2129 | |
| 2130 | note ---- core: tests/gates/run.sh gb10-golden-tokens |
| 2131 | |
| 2132 | fn obs k view uchar * v view uchar * q bool to void |
| 2133 | sset SM tobs |
| 2134 | sx SM k |
| 2135 | sx SM tsp |
| 2136 | if q |
| 2137 | sx SM tq |
| 2138 | end |
| 2139 | sx SM v |
| 2140 | if q |
| 2141 | sx SM tq |
| 2142 | end |
| 2143 | say 1 SM |
| 2144 | end |
| 2145 | |
| 2146 | fn notrun r view uchar * d ulong to ulong |
| 2147 | sset SM tnrhdr |
| 2148 | sx SM r |
| 2149 | sx SM tcolon |
| 2150 | ss SM d |
| 2151 | say 2 SM |
| 2152 | sset SM tobs |
| 2153 | sx SM tnrr |
| 2154 | sx SM tsp |
| 2155 | sx SM tq |
| 2156 | sx SM r |
| 2157 | sx SM tq |
| 2158 | say 1 SM |
| 2159 | ret 77 |
| 2160 | end |
| 2161 | |
| 2162 | note slot d = the record line value after key t of slot SREF's file |
| 2163 | fn refval d ulong t view uchar * to bool |
| 2164 | sclr d |
| 2165 | ok = fload SREF |
| 2166 | if not ok |
| 2167 | ret false |
| 2168 | end |
| 2169 | sset SK t |
| 2170 | p = ulong 0 |
| 2171 | n = get gbn 0 |
| 2172 | while lt p n bound 999999 |
| 2173 | e = leol p |
| 2174 | if lpre p e SK |
| 2175 | lslot d add p get gsl SK e |
| 2176 | ret true |
| 2177 | end |
| 2178 | p = add e 1 |
| 2179 | end |
| 2180 | ret false |
| 2181 | end |
| 2182 | |
| 2183 | fn dcore to ulong |
| 2184 | sset SREF trefp |
| 2185 | sabs SREF |
| 2186 | sset SPR tprp |
| 2187 | sabs SPR |
| 2188 | sset SP tlock |
| 2189 | ok = fload SP |
| 2190 | sclr SLK |
| 2191 | for i ulong get gbn 0 |
| 2192 | c = get gb i |
| 2193 | if and ne c 10 and ne c 32 and ne c 9 ne c 13 |
| 2194 | sb SLK c |
| 2195 | end |
| 2196 | end |
| 2197 | ok = senv STRN tgtrain |
| 2198 | if ok |
| 2199 | sjoin SP STRN tbsh |
| 2200 | ok = there SP |
| 2201 | end |
| 2202 | if not ok |
| 2203 | sset SD ttmw |
| 2204 | ss SD SLK |
| 2205 | ret notrun ttm SD |
| 2206 | end |
| 2207 | agit |
| 2208 | apt tdash |
| 2209 | aps STRN |
| 2210 | apt tcatf |
| 2211 | apt tdash_e |
| 2212 | scp SV SLK |
| 2213 | sx SV tcommit |
| 2214 | aps SV |
| 2215 | rc = spawn -1 -1 -1 |
| 2216 | if ne rc 0 |
| 2217 | sset SD ttuw |
| 2218 | ss SD SLK |
| 2219 | ret notrun ttu SD |
| 2220 | end |
| 2221 | scp SREV SLK |
| 2222 | if not senv SGD tgdir |
| 2223 | if senv SGD tmdir |
| 2224 | sx SGD tolg |
| 2225 | else |
| 2226 | ok = senv SGD thome |
| 2227 | sx SGD tmodels |
| 2228 | sx SGD tolg |
| 2229 | end |
| 2230 | end |
| 2231 | ok = refval SV tckk |
| 2232 | sjoin SCK SGD tnl0 |
| 2233 | ss SCK SV |
| 2234 | ok = refval SV tmgk |
| 2235 | sjoin SMG SGD tnl0 |
| 2236 | ss SMG SV |
| 2237 | if not there SCK |
| 2238 | ret notrun tmm SCK |
| 2239 | end |
| 2240 | if not there SMG |
| 2241 | ret notrun tmm SMG |
| 2242 | end |
| 2243 | ok = senv SOMC taomctr |
| 2244 | ok = senv SOMG taomcgt |
| 2245 | sset ST tgcore |
| 2246 | sn ST ulong getpid |
| 2247 | ok = mkd ST |
| 2248 | sjoin SOUT ST tgg |
| 2249 | ok = fsha SREF SHEX |
| 2250 | sset SM tobs |
| 2251 | sx SM tgrec |
| 2252 | sx SM tsp |
| 2253 | sx SM tq |
| 2254 | ss SM SHEX |
| 2255 | sx SM tq |
| 2256 | say 1 SM |
| 2257 | rc = dgate |
| 2258 | rmrf ST |
| 2259 | if eq rc 0 |
| 2260 | obs tgpass ttrue false |
| 2261 | obs tgneg ttrue false |
| 2262 | ret 0 |
| 2263 | end |
| 2264 | if eq rc 1 |
| 2265 | obs tgpass tfalse false |
| 2266 | obs tgneg ttrue false |
| 2267 | ret 1 |
| 2268 | end |
| 2269 | if eq rc 3 |
| 2270 | sset SD tgnr3 |
| 2271 | ret notrun tgnr SD |
| 2272 | end |
| 2273 | obs tgpass tfalse false |
| 2274 | obs tgneg tfalse false |
| 2275 | ret 1 |
| 2276 | end |
| 2277 | |
| 2278 | note ---- check: host arms (port of the former check.sh, plus the review-finding arms) |
| 2279 | |
| 2280 | fn ctmp d ulong t view uchar * to void |
| 2281 | sjoin d ST t |
| 2282 | end |
| 2283 | |
| 2284 | fn cfx d ulong t view uchar * to void |
| 2285 | sset d tfx |
| 2286 | sx d t |
| 2287 | sabs d |
| 2288 | end |
| 2289 | |
| 2290 | fn cbad to void |
| 2291 | put gk 1 1 |
| 2292 | end |
| 2293 | |
| 2294 | note first 600 bytes of slot s's file, trailing newlines dropped, appended to SM |
| 2295 | fn chead s ulong to void |
| 2296 | ok = fload s |
| 2297 | if gt get gbn 0 600 |
| 2298 | put gbn 0 600 |
| 2299 | end |
| 2300 | trimnl |
| 2301 | for i ulong get gbn 0 |
| 2302 | sb SM get gb i |
| 2303 | end |
| 2304 | end |
| 2305 | |
| 2306 | note does slot s's file hold a line equal to slot l |
| 2307 | fn hasln s ulong l ulong to bool |
| 2308 | ok = fload s |
| 2309 | if not ok |
| 2310 | ret false |
| 2311 | end |
| 2312 | p = ulong 0 |
| 2313 | n = get gbn 0 |
| 2314 | while lt p n bound 999999 |
| 2315 | e = leol p |
| 2316 | if lis p e l |
| 2317 | ret true |
| 2318 | end |
| 2319 | p = add e 1 |
| 2320 | end |
| 2321 | ret false |
| 2322 | end |
| 2323 | |
| 2324 | note run gav into ST/out; judge exit want and (when slot SW is not empty) the line SW |
| 2325 | fn arm nm view uchar * want ulong to void |
| 2326 | ctmp SD tcout |
| 2327 | rc = spawnf SD |
| 2328 | if ne rc want |
| 2329 | sset SM tcfail |
| 2330 | sx SM nm |
| 2331 | sx SM tcolon |
| 2332 | sx SM tcex |
| 2333 | sn SM rc |
| 2334 | sx SM tcwant |
| 2335 | sn SM want |
| 2336 | sx SM tcolon |
| 2337 | chead SD |
| 2338 | say 1 SM |
| 2339 | cbad |
| 2340 | ret |
| 2341 | end |
| 2342 | if gt get gsl SW 0 |
| 2343 | if not hasln SD SW |
| 2344 | sset SM tcfail |
| 2345 | sx SM nm |
| 2346 | sx SM tcnol |
| 2347 | ss SM SW |
| 2348 | sx SM tcin |
| 2349 | chead SD |
| 2350 | say 1 SM |
| 2351 | cbad |
| 2352 | ret |
| 2353 | end |
| 2354 | end |
| 2355 | sset SM tcpass |
| 2356 | sx SM nm |
| 2357 | sx SM tcexit |
| 2358 | sn SM rc |
| 2359 | if gt get gsl SW 0 |
| 2360 | sx SM tcq1 |
| 2361 | ss SM SW |
| 2362 | sb SM 39 |
| 2363 | end |
| 2364 | sx SM tcend |
| 2365 | say 1 SM |
| 2366 | end |
| 2367 | |
| 2368 | fn pat t view uchar * to void |
| 2369 | sset SW t |
| 2370 | end |
| 2371 | |
| 2372 | fn cg to void |
| 2373 | aclr |
| 2374 | aps SG |
| 2375 | end |
| 2376 | |
| 2377 | fn cF to void |
| 2378 | aps SF1 |
| 2379 | aps SF2 |
| 2380 | aps SF3 |
| 2381 | end |
| 2382 | |
| 2383 | note gate rec FILE F 8|mx ... label |
| 2384 | fn crec f ulong mx view uchar * lab view uchar * to void |
| 2385 | cg |
| 2386 | apt trec |
| 2387 | aps f |
| 2388 | cF |
| 2389 | apt mx |
| 2390 | apt tfl |
| 2391 | apt tdr |
| 2392 | aps SE |
| 2393 | aps SC2 |
| 2394 | apt tfill |
| 2395 | apt tfutc |
| 2396 | apt lab |
| 2397 | end |
| 2398 | |
| 2399 | fn ccmp f ulong to void |
| 2400 | cg |
| 2401 | apt tcmp |
| 2402 | aps SR |
| 2403 | aps f |
| 2404 | cF |
| 2405 | end |
| 2406 | |
| 2407 | note fixture transform: gc = xf(mode, a -> b) of slot in's file, saved to ST/outn |
| 2408 | fn fxo fin ulong outn view uchar * to void |
| 2409 | put gk 2 fin |
| 2410 | ctmp SD outn |
| 2411 | end |
| 2412 | |
| 2413 | fn fx mode ulong a view uchar * b view uchar * to void |
| 2414 | ok = fload get gk 2 |
| 2415 | sset SA a |
| 2416 | sset SB b |
| 2417 | sclr SBLK |
| 2418 | c = xf mode SA SB SBLK |
| 2419 | ok = fsavc SD |
| 2420 | end |
| 2421 | |
| 2422 | note mutant: gate.om with exactly one line replaced, compiled to ST/nm; true when built |
| 2423 | fn mutant nm view uchar * a view uchar * b view uchar * to bool |
| 2424 | sset SP tgateom |
| 2425 | ok = fload SP |
| 2426 | sset SA a |
| 2427 | sset SB b |
| 2428 | sclr SBLK |
| 2429 | c = xf 0 SA SB SBLK |
| 2430 | if ne c 1 |
| 2431 | sset SM tcfail |
| 2432 | sx SM nm |
| 2433 | sx SM tcl1 |
| 2434 | sx SM a |
| 2435 | sx SM tcnu |
| 2436 | say 1 SM |
| 2437 | cbad |
| 2438 | ret false |
| 2439 | end |
| 2440 | ctmp SD nm |
| 2441 | sx SD tdotom |
| 2442 | ok = fsavc SD |
| 2443 | ctmp SH2 nm |
| 2444 | sx SH2 tsrcom |
| 2445 | rc = gcomp SOMG SD SH2 |
| 2446 | if ne rc 0 |
| 2447 | sset SM tcfail |
| 2448 | sx SM nm |
| 2449 | sx SM tcmdb |
| 2450 | say 1 SM |
| 2451 | cbad |
| 2452 | ret false |
| 2453 | end |
| 2454 | scp SLST SH2 |
| 2455 | ret true |
| 2456 | end |
| 2457 | |
| 2458 | note a kill is the mutant's own verdict code want; any other exit (spawn failure 1000, signal |
| 2459 | note 256+n, exec failure 127, an unrelated refusal) is an infrastructure failure, never a kill |
| 2460 | fn mres nm view uchar * survived bool rc ulong want ulong to void |
| 2461 | if survived |
| 2462 | sset SM tcfail |
| 2463 | sx SM nm |
| 2464 | sx SM tcsurv |
| 2465 | say 1 SM |
| 2466 | cbad |
| 2467 | ret |
| 2468 | end |
| 2469 | if ne rc want |
| 2470 | sset SM tcfail |
| 2471 | sx SM nm |
| 2472 | sx SM tcinfra |
| 2473 | sn SM rc |
| 2474 | sx SM tcwant |
| 2475 | sn SM want |
| 2476 | sx SM tcend |
| 2477 | say 1 SM |
| 2478 | cbad |
| 2479 | ret |
| 2480 | end |
| 2481 | sset SM tcpass |
| 2482 | sx SM nm |
| 2483 | sx SM tckill |
| 2484 | sx SM tcexit |
| 2485 | sn SM rc |
| 2486 | sx SM tcend |
| 2487 | say 1 SM |
| 2488 | end |
| 2489 | |
| 2490 | note mutant gate run: SLST cmp REF f F (file triple from SF1..3), rc |
| 2491 | fn mcmp f ulong to ulong |
| 2492 | aclr |
| 2493 | aps SLST |
| 2494 | apt tcmp |
| 2495 | aps SR |
| 2496 | aps f |
| 2497 | cF |
| 2498 | ctmp SD tmout |
| 2499 | ret spawnf SD |
| 2500 | end |
| 2501 | |
| 2502 | fn ref1 to void |
| 2503 | note expected record of fixtures/cpu.out, in slot SLST |
| 2504 | sset SLST tschem |
| 2505 | sb SLST 10 |
| 2506 | sx SLST tlsyn |
| 2507 | sb SLST 10 |
| 2508 | sx SLST tckk |
| 2509 | ok = fsha SF1 SHEX |
| 2510 | ss SLST SHEX |
| 2511 | sb SLST 10 |
| 2512 | sx SLST tmgk |
| 2513 | ok = fsha SF2 SHEX |
| 2514 | ss SLST SHEX |
| 2515 | sb SLST 10 |
| 2516 | sx SLST tprk |
| 2517 | ok = fsha SF3 SHEX |
| 2518 | ss SLST SHEX |
| 2519 | sb SLST 10 |
| 2520 | sx SLST tref2 |
| 2521 | ss SLST SE |
| 2522 | sb SLST 10 |
| 2523 | sx SLST tref3 |
| 2524 | ss SLST SC2 |
| 2525 | sb SLST 10 |
| 2526 | sx SLST tref4 |
| 2527 | end |
| 2528 | |
| 2529 | fn sameb a ulong b ulong to bool |
| 2530 | ok = fload a |
| 2531 | if not ok |
| 2532 | ret false |
| 2533 | end |
| 2534 | ok = floadc b |
| 2535 | if not ok |
| 2536 | ret false |
| 2537 | end |
| 2538 | if ne get gbn 0 get gcn 0 |
| 2539 | ret false |
| 2540 | end |
| 2541 | for i ulong get gbn 0 |
| 2542 | if ne get gb i get gc i |
| 2543 | ret false |
| 2544 | end |
| 2545 | end |
| 2546 | ret true |
| 2547 | end |
| 2548 | |
| 2549 | fn cpass t view uchar * to void |
| 2550 | sset SM tcpass |
| 2551 | sx SM t |
| 2552 | say 1 SM |
| 2553 | end |
| 2554 | |
| 2555 | fn cfailm t view uchar * to void |
| 2556 | sset SM tcfail |
| 2557 | sx SM t |
| 2558 | say 1 SM |
| 2559 | cbad |
| 2560 | end |
| 2561 | |
| 2562 | note the recorder and comparator arms on the synthetic fixtures |
| 2563 | fn chk1 to void |
| 2564 | sayt 1 th1 |
| 2565 | ref1 |
| 2566 | ctmp SX tcrefx |
| 2567 | ok = fsavs SX SLST |
| 2568 | ctmp SR tref |
| 2569 | cfx SY tcpuo |
| 2570 | crec SY t8 tsyn |
| 2571 | fo = fopf SR 577 |
| 2572 | rc = spawn -1 fo fo |
| 2573 | fcls fo |
| 2574 | if and eq rc 0 sameb SR SX |
| 2575 | cpass tcrr |
| 2576 | else |
| 2577 | cfailm tcrrb |
| 2578 | end |
| 2579 | fxo SY tamb |
| 2580 | fx 0 tl1 tl1a |
| 2581 | ctmp SD tamb |
| 2582 | crec SD t8 tsyn |
| 2583 | pat tpamb |
| 2584 | arm trecamb 5 |
| 2585 | fxo SY tflo |
| 2586 | fx 0 tl1 tl1b |
| 2587 | ctmp SD tflo |
| 2588 | crec SD t8 tsyn |
| 2589 | pat tpflo |
| 2590 | arm trecflo 0 |
| 2591 | fxo SY tgar |
| 2592 | fx 1 tgtec tgteg |
| 2593 | ctmp SD tgar |
| 2594 | crec SD t8 tsyn |
| 2595 | pat tpfmt |
| 2596 | arm trecgpu 4 |
| 2597 | crec SY t9 tsyn |
| 2598 | arm trecsh 4 |
| 2599 | fxo SY tord |
| 2600 | fx 1 tt12 tt13 |
| 2601 | ctmp SD tord |
| 2602 | crec SD t8 tsyn |
| 2603 | arm trecso 4 |
| 2604 | ok = fload SY |
| 2605 | xlast |
| 2606 | ctmp SD tnogte |
| 2607 | ok = fsavc SD |
| 2608 | crec SD t8 tsyn |
| 2609 | arm trecng 4 |
| 2610 | crec SY t8 tmaybe |
| 2611 | pat tpbarg |
| 2612 | arm treclab 2 |
| 2613 | cg |
| 2614 | apt trec |
| 2615 | aps SY |
| 2616 | pat tnl0 |
| 2617 | arm trecuse 2 |
| 2618 | end |
| 2619 | |
| 2620 | fn chk2 to void |
| 2621 | sayt 1 th2 |
| 2622 | cfx SZ tgm |
| 2623 | ccmp SZ |
| 2624 | pat tpm1 |
| 2625 | arm tcm1 0 |
| 2626 | ccmp SZ |
| 2627 | pat tpm2 |
| 2628 | arm tcm2 0 |
| 2629 | fxo SZ tdiv |
| 2630 | fx 1 tt13x tt13y |
| 2631 | ctmp SD tdiv |
| 2632 | ccmp SD |
| 2633 | pat tpdiv |
| 2634 | arm tcdiv 1 |
| 2635 | ok = fload SZ |
| 2636 | sset SA tt04 |
| 2637 | sset SB tnl0 |
| 2638 | sclr SH2 |
| 2639 | c = xf 2 SA SB SH2 |
| 2640 | cback |
| 2641 | sset SA tt05 |
| 2642 | c = xf 2 SA SB SH2 |
| 2643 | cback |
| 2644 | sset SA tg214 |
| 2645 | sset SB tg212 |
| 2646 | c = xf 1 SA SB SH2 |
| 2647 | ctmp SD tshort |
| 2648 | ok = fsavc SD |
| 2649 | ccmp SD |
| 2650 | pat tpshort |
| 2651 | arm tcshort 1 |
| 2652 | fxo SZ tdrift |
| 2653 | fx 1 tt02 tt02d |
| 2654 | ctmp SD tdrift |
| 2655 | ccmp SD |
| 2656 | pat tpdrift |
| 2657 | arm tcdrift 1 |
| 2658 | ctmp SD tck2 |
| 2659 | sset SV tck2t |
| 2660 | ok = fsavs SD SV |
| 2661 | end |
| 2662 | |
| 2663 | fn chk3 to void |
| 2664 | ctmp SD tck2 |
| 2665 | scp SH2 SF1 |
| 2666 | scp SF1 SD |
| 2667 | ccmp SZ |
| 2668 | scp SF1 SH2 |
| 2669 | pat tpnck |
| 2670 | arm tcock 3 |
| 2671 | scp SH2 SF2 |
| 2672 | scp SF2 SD |
| 2673 | ccmp SZ |
| 2674 | scp SF2 SH2 |
| 2675 | pat tpnmg |
| 2676 | arm tcomg 3 |
| 2677 | scp SH2 SF3 |
| 2678 | scp SF3 SD |
| 2679 | ccmp SZ |
| 2680 | scp SF3 SH2 |
| 2681 | pat tpnpr |
| 2682 | arm tcopr 3 |
| 2683 | ok = fload SZ |
| 2684 | sset SA tt1 |
| 2685 | sset SB tnl0 |
| 2686 | sclr SY |
| 2687 | c = xf 2 SA SB SY |
| 2688 | cback |
| 2689 | sset SA tg214 |
| 2690 | sset SB tg16 |
| 2691 | c = xf 1 SA SB SY |
| 2692 | ctmp SD tone0 |
| 2693 | ok = fsavc SD |
| 2694 | ccmp SD |
| 2695 | pat tpnp |
| 2696 | arm tccount 3 |
| 2697 | cfx SY tcpuo |
| 2698 | ccmp SY |
| 2699 | pat tpfmt |
| 2700 | arm tccpu 4 |
| 2701 | fxo SR tbadref |
| 2702 | fx 0 trdg trdgg |
| 2703 | ctmp SD tbadref |
| 2704 | cg |
| 2705 | apt tcmp |
| 2706 | aps SD |
| 2707 | aps SZ |
| 2708 | cF |
| 2709 | arm tcbadref 4 |
| 2710 | fxo SR tlenref |
| 2711 | fx 0 tp15 tp14 |
| 2712 | ctmp SD tlenref |
| 2713 | cg |
| 2714 | apt tcmp |
| 2715 | aps SD |
| 2716 | aps SZ |
| 2717 | cF |
| 2718 | arm tclen 4 |
| 2719 | cg |
| 2720 | apt tcmp |
| 2721 | aps SR |
| 2722 | pat tnl0 |
| 2723 | arm tcuse 2 |
| 2724 | end |
| 2725 | |
| 2726 | note review finding 2: the record header and row bounds |
| 2727 | fn chk4 to void |
| 2728 | sayt 1 th4 |
| 2729 | cfx SZ tgm |
| 2730 | pat tpfmt |
| 2731 | fxo SR tf2a |
| 2732 | fx 0 tp15 tp13 |
| 2733 | ok = fload SD |
| 2734 | sset SA tl15 |
| 2735 | sset SB tl13 |
| 2736 | sclr SY |
| 2737 | c = xf 0 SA SB SY |
| 2738 | cback |
| 2739 | sset SA tm15 |
| 2740 | sset SB tm13 |
| 2741 | c = xf 0 SA SB SY |
| 2742 | ctmp SD tf2a |
| 2743 | ok = fsavc SD |
| 2744 | cg |
| 2745 | apt tcmp |
| 2746 | aps SD |
| 2747 | aps SZ |
| 2748 | cF |
| 2749 | arm tcrmin 4 |
| 2750 | fxo SR tf2b |
| 2751 | fx 0 tm06 tm06b |
| 2752 | ctmp SD tf2b |
| 2753 | cg |
| 2754 | apt tcmp |
| 2755 | aps SD |
| 2756 | aps SZ |
| 2757 | cF |
| 2758 | arm tcfloor 4 |
| 2759 | fxo SR tf2c |
| 2760 | fx 0 tmx8 tmx0 |
| 2761 | ctmp SD tf2c |
| 2762 | cg |
| 2763 | apt tcmp |
| 2764 | aps SD |
| 2765 | aps SZ |
| 2766 | cF |
| 2767 | arm tcmx0 4 |
| 2768 | fxo SR tf2d |
| 2769 | fx 0 tmx8 tmx5 |
| 2770 | ctmp SD tf2d |
| 2771 | cg |
| 2772 | apt tcmp |
| 2773 | aps SD |
| 2774 | aps SZ |
| 2775 | cF |
| 2776 | arm tcmx5 4 |
| 2777 | fxo SR tf2e |
| 2778 | fx 0 tmx8 tmx4097 |
| 2779 | ctmp SD tf2e |
| 2780 | cg |
| 2781 | apt tcmp |
| 2782 | aps SD |
| 2783 | aps SZ |
| 2784 | cF |
| 2785 | arm tcmxbig 4 |
| 2786 | fxo SR tf2f |
| 2787 | fx 0 tdr0a tdr0b |
| 2788 | ctmp SD tf2f |
| 2789 | cg |
| 2790 | apt tcmp |
| 2791 | aps SD |
| 2792 | aps SZ |
| 2793 | cF |
| 2794 | arm tcdr0 4 |
| 2795 | fxo SR tf2g |
| 2796 | fx 0 tfl0a tfl0b |
| 2797 | ctmp SD tf2g |
| 2798 | cg |
| 2799 | apt tcmp |
| 2800 | aps SD |
| 2801 | aps SZ |
| 2802 | cF |
| 2803 | arm tcfl0 4 |
| 2804 | end |
| 2805 | |
| 2806 | fn chk5 to void |
| 2807 | sayt 1 th5 |
| 2808 | if mutant tm1 tm1a tm1b |
| 2809 | ctmp SD tdiv |
| 2810 | rc = mcmp SD |
| 2811 | mres tm1 eq rc 1 rc 0 |
| 2812 | end |
| 2813 | if mutant tm2 tm2a tm2b |
| 2814 | ctmp SD tdrift |
| 2815 | rc = mcmp SD |
| 2816 | mres tm2 eq rc 1 rc 0 |
| 2817 | end |
| 2818 | if mutant tm3 tm3a tm3b |
| 2819 | ctmp SD tck2 |
| 2820 | scp SH2 SF1 |
| 2821 | scp SF1 SD |
| 2822 | cfx SD tgm |
| 2823 | rc = mcmp SD |
| 2824 | scp SF1 SH2 |
| 2825 | mres tm3 eq rc 3 rc 0 |
| 2826 | end |
| 2827 | if mutant tm4 tm4a tm4b |
| 2828 | cg |
| 2829 | scp SG SLST |
| 2830 | cfx SY tcpuo |
| 2831 | crec SY t8 tsyn |
| 2832 | ctmp SG tgateb |
| 2833 | ctmp SD tmout |
| 2834 | fo = fopf SD 577 |
| 2835 | rc = spawn -1 fo -1 |
| 2836 | fcls fo |
| 2837 | ctmp SX tcrefx |
| 2838 | mres tm4 sameb SD SX rc 0 |
| 2839 | end |
| 2840 | if mutant tm5 tm5a tm5b |
| 2841 | ctmp SD tshort |
| 2842 | rc = mcmp SD |
| 2843 | ctmp SD tmout |
| 2844 | pat tpshort |
| 2845 | mres tm5 hasln SD SW rc 1 |
| 2846 | end |
| 2847 | if mutant tm6 tm6a tm6b |
| 2848 | ctmp SD tf2b |
| 2849 | aclr |
| 2850 | aps SLST |
| 2851 | apt tcmp |
| 2852 | aps SD |
| 2853 | cfx SY tgm |
| 2854 | aps SY |
| 2855 | cF |
| 2856 | ctmp SD tmout |
| 2857 | rc = spawnf SD |
| 2858 | mres tm6 eq rc 4 rc 0 |
| 2859 | end |
| 2860 | if mutant tm7 tm7a tm7b |
| 2861 | ctmp SD tf2a |
| 2862 | aclr |
| 2863 | aps SLST |
| 2864 | apt tcmp |
| 2865 | aps SD |
| 2866 | cfx SY tgm |
| 2867 | aps SY |
| 2868 | cF |
| 2869 | ctmp SD tmout |
| 2870 | rc = spawnf SD |
| 2871 | mres tm7 eq rc 4 rc 0 |
| 2872 | end |
| 2873 | end |
| 2874 | |
| 2875 | note the b0/b1 line comparison: count of differing line pairs; slot SW = b1's differing line |
| 2876 | note slot SW = gc bytes a..b |
| 2877 | fn lslotc a ulong b ulong to void |
| 2878 | sclr SW |
| 2879 | for i ulong sub b a |
| 2880 | sb SW get gc add a i |
| 2881 | end |
| 2882 | end |
| 2883 | |
| 2884 | fn lsame p ulong e ulong q ulong f ulong to bool |
| 2885 | if ne sub e p sub f q |
| 2886 | ret false |
| 2887 | end |
| 2888 | for i ulong sub e p |
| 2889 | if ne get gb add p i get gc add q i |
| 2890 | ret false |
| 2891 | end |
| 2892 | end |
| 2893 | ret true |
| 2894 | end |
| 2895 | |
| 2896 | fn ldiff to ulong |
| 2897 | p = ulong 0 |
| 2898 | q = ulong 0 |
| 2899 | d = ulong 0 |
| 2900 | while and lt p get gbn 0 lt q get gcn 0 bound 999999 |
| 2901 | e = leol p |
| 2902 | f = q |
| 2903 | while lt f get gcn 0 bound 999999 |
| 2904 | if eq get gc f 10 |
| 2905 | break |
| 2906 | end |
| 2907 | f = add f 1 |
| 2908 | end |
| 2909 | if not lsame p e q f |
| 2910 | d = add d 1 |
| 2911 | lslotc q f |
| 2912 | end |
| 2913 | p = add e 1 |
| 2914 | q = add f 1 |
| 2915 | end |
| 2916 | if or lt p get gbn 0 lt q get gcn 0 |
| 2917 | d = add d 1000 |
| 2918 | end |
| 2919 | ret d |
| 2920 | end |
| 2921 | |
| 2922 | note self build: drive build OMC TRAIN REV ST/out [NEG slot] |
| 2923 | fn cbld omc ulong trn ulong rev view uchar * ng ulong to void |
| 2924 | aclr |
| 2925 | apt tself |
| 2926 | apt tbuild |
| 2927 | aps omc |
| 2928 | aps trn |
| 2929 | apt rev |
| 2930 | aps SOUT |
| 2931 | if gt get gsl ng 0 |
| 2932 | aps ng |
| 2933 | end |
| 2934 | end |
| 2935 | |
| 2936 | fn ccount s ulong t view uchar * to ulong |
| 2937 | ok = fload s |
| 2938 | sset SA t |
| 2939 | sclr SY |
| 2940 | ret xf 0 SA SA SY |
| 2941 | end |
| 2942 | |
| 2943 | fn shaof d ulong dir view uchar * f view uchar * to void |
| 2944 | ctmp SP dir |
| 2945 | sb SP 47 |
| 2946 | sx SP f |
| 2947 | sclr d |
| 2948 | ok = fsha SP d |
| 2949 | end |
| 2950 | |
| 2951 | note slot d = the commit id rev names in repository slot s (no replace refs); false on failure |
| 2952 | fn revof s ulong rv view uchar * d ulong to bool |
| 2953 | agit |
| 2954 | apt tdash |
| 2955 | aps s |
| 2956 | apt trevp |
| 2957 | apt tverify |
| 2958 | apt rv |
| 2959 | ctmp SD trvo |
| 2960 | fo = fopf SD 577 |
| 2961 | rc = spawn -1 fo -1 |
| 2962 | fcls fo |
| 2963 | ok = fload SD |
| 2964 | trimnl |
| 2965 | sclr d |
| 2966 | if or ne rc 0 ne get gbn 0 40 |
| 2967 | ret false |
| 2968 | end |
| 2969 | lslot d 0 40 |
| 2970 | ret true |
| 2971 | end |
| 2972 | |
| 2973 | fn chk6 to void |
| 2974 | sayt 1 th6 |
| 2975 | sclr SNEG |
| 2976 | ctmp SOUT tb0 |
| 2977 | cbld SOMC STRN thead SNEG |
| 2978 | pat tnl0 |
| 2979 | arm tbdec 0 |
| 2980 | ctmp SP tb0 |
| 2981 | sb SP 47 |
| 2982 | sx SP tgold |
| 2983 | a = ccount SP toggm |
| 2984 | b = ccount SP tmain |
| 2985 | if and eq a 1 eq b 1 |
| 2986 | cpass tbone |
| 2987 | else |
| 2988 | cfailm tbone |
| 2989 | end |
| 2990 | sset SNEG tnegf |
| 2991 | sabs SNEG |
| 2992 | ctmp SOUT tb1 |
| 2993 | cbld SOMC STRN thead SNEG |
| 2994 | arm tbnegc 0 |
| 2995 | ok = fload SP |
| 2996 | ctmp SQ tb1 |
| 2997 | sb SQ 47 |
| 2998 | sx SQ tgold |
| 2999 | ok = floadc SQ |
| 3000 | d = ldiff |
| 3001 | if and eq d 1 seqt SW tnegl |
| 3002 | sset SM tcpass |
| 3003 | sx SM tnegok |
| 3004 | ss SM SW |
| 3005 | sx SM tcq2 |
| 3006 | say 1 SM |
| 3007 | else |
| 3008 | sset SM tcfail |
| 3009 | sx SM tnegbad |
| 3010 | sn SM d |
| 3011 | sx SM tcolon |
| 3012 | ss SM SW |
| 3013 | say 1 SM |
| 3014 | cbad |
| 3015 | end |
| 3016 | shaof SH2 tb0 tgoldb |
| 3017 | shaof SHEX tb1 tgoldb |
| 3018 | if seqs SH2 SHEX |
| 3019 | cfailm tnegsame |
| 3020 | else |
| 3021 | cpass tnegdiff |
| 3022 | end |
| 3023 | ctmp SNEG ttwo |
| 3024 | sset SV ttwot |
| 3025 | ok = fsavs SNEG SV |
| 3026 | ctmp SOUT tb2 |
| 3027 | cbld SOMC STRN thead SNEG |
| 3028 | pat tpchg2 |
| 3029 | arm tbwrong 4 |
| 3030 | sset SV ttrue0 |
| 3031 | sclr SNEG |
| 3032 | ctmp SOUT tb3 |
| 3033 | cbld SV STRN thead SNEG |
| 3034 | pat tnl0 |
| 3035 | arm tbother 3 |
| 3036 | ctmp SOUT tb6 |
| 3037 | cbld SOMC STRN tzrev SNEG |
| 3038 | arm tbrev 1 |
| 3039 | aclr |
| 3040 | apt tself |
| 3041 | apt tgate |
| 3042 | aps STRN |
| 3043 | apt thead |
| 3044 | aps SR |
| 3045 | cF |
| 3046 | ctmp SD tg0 |
| 3047 | aps SD |
| 3048 | pat tnohold |
| 3049 | arm tgnohold 3 |
| 3050 | end |
| 3051 | |
| 3052 | note review finding 1: the build is the commit, never the working tree |
| 3053 | fn chk7 to void |
| 3054 | sayt 1 th7 |
| 3055 | ctmp SX ttmd |
| 3056 | agit |
| 3057 | apt tclone |
| 3058 | apt tq0 |
| 3059 | apt tnohl |
| 3060 | aps STRN |
| 3061 | aps SX |
| 3062 | pat tnl0 |
| 3063 | arm tclonea 0 |
| 3064 | sjoin SP SX tgrpath |
| 3065 | fd = fopf SP 1025 |
| 3066 | w = write fd ttamp 0 len ttamp |
| 3067 | fcls fd |
| 3068 | agit |
| 3069 | apt tdash |
| 3070 | aps SX |
| 3071 | apt tupidx |
| 3072 | apt tskip |
| 3073 | apt tmodel |
| 3074 | arm tskipa 0 |
| 3075 | sjoin SP SX tmodel |
| 3076 | fd = fopf SP 1025 |
| 3077 | w = write fd ttamp 0 len ttamp |
| 3078 | fcls fd |
| 3079 | ctmp SOUT tb4 |
| 3080 | cbld SOMC SX thead SNEG |
| 3081 | arm tbwt 0 |
| 3082 | shaof SH2 tb0 tgold |
| 3083 | shaof SHEX tb4 tgold |
| 3084 | if seqs SH2 SHEX |
| 3085 | sset SM tcpass |
| 3086 | sx SM twtok |
| 3087 | ss SM SHEX |
| 3088 | sx SM tcend |
| 3089 | say 1 SM |
| 3090 | else |
| 3091 | cfailm twtbad |
| 3092 | end |
| 3093 | agit |
| 3094 | apt tdash |
| 3095 | aps SX |
| 3096 | apt tdc |
| 3097 | apt tun |
| 3098 | apt tdc |
| 3099 | apt tue |
| 3100 | apt tcmt |
| 3101 | apt tq0 |
| 3102 | apt tdasha |
| 3103 | apt tdashm |
| 3104 | apt ttamper |
| 3105 | arm tcommita 0 |
| 3106 | ctmp SOUT tb5 |
| 3107 | cbld SOMC SX thead SNEG |
| 3108 | arm tbcm 0 |
| 3109 | shaof SHEX tb5 tgold |
| 3110 | if seqs SH2 SHEX |
| 3111 | cfailm tcmbad |
| 3112 | else |
| 3113 | cpass tcmok |
| 3114 | end |
| 3115 | note review finding (e19cafd0 local read): a replace ref must not swap the archived tree |
| 3116 | agit |
| 3117 | apt tdash |
| 3118 | aps SX |
| 3119 | apt trepl |
| 3120 | apt thead1 |
| 3121 | apt thead |
| 3122 | arm treplA 0 |
| 3123 | ctmp SOUT tb7 |
| 3124 | cbld SOMC SX thead1 SNEG |
| 3125 | arm tbrp 0 |
| 3126 | shaof SHEX tb7 tgold |
| 3127 | if seqs SH2 SHEX |
| 3128 | cpass trpok |
| 3129 | else |
| 3130 | cfailm trpbad |
| 3131 | end |
| 3132 | note review finding 1 (27da864e local read): TRAIN's info/grafts and info/attributes must not select |
| 3133 | note the commit or shape the snapshot. U = an empty commit on the tamper T; HEAD~1 is T (the b5 source), |
| 3134 | note and the graft U -> HEAD~2 would make HEAD~1 name the clean commit instead |
| 3135 | shaof SY tb5 tgold |
| 3136 | agit |
| 3137 | apt tdash |
| 3138 | aps SX |
| 3139 | apt tdc |
| 3140 | apt tun |
| 3141 | apt tdc |
| 3142 | apt tue |
| 3143 | apt tcmt |
| 3144 | apt tq0 |
| 3145 | apt tallowe |
| 3146 | apt tdashm |
| 3147 | apt ttamper |
| 3148 | arm tgrbase 0 |
| 3149 | if not revof SX thead SZ |
| 3150 | cfailm tfixbad |
| 3151 | ret |
| 3152 | end |
| 3153 | if not revof SX thead2 SLK |
| 3154 | cfailm tfixbad |
| 3155 | ret |
| 3156 | end |
| 3157 | sclr SV |
| 3158 | ss SV SZ |
| 3159 | sb SV 32 |
| 3160 | ss SV SLK |
| 3161 | sb SV 10 |
| 3162 | sjoin SP SX tgrf |
| 3163 | ok = fsavs SP SV |
| 3164 | ctmp SOUT tb8 |
| 3165 | cbld SOMC SX thead1 SNEG |
| 3166 | arm tbgr 0 |
| 3167 | shaof SHEX tb8 tgold |
| 3168 | if seqs SY SHEX |
| 3169 | cpass tgrok |
| 3170 | else |
| 3171 | cfailm tgrbad |
| 3172 | end |
| 3173 | sjoin SP SX tgrf |
| 3174 | rmf SP |
| 3175 | sset SV tgrpath |
| 3176 | sx SV texig |
| 3177 | sjoin SP SX tatf |
| 3178 | ok = fsavs SP SV |
| 3179 | ctmp SOUT tb9 |
| 3180 | cbld SOMC SX thead1 SNEG |
| 3181 | arm tbat 0 |
| 3182 | shaof SHEX tb9 tgold |
| 3183 | if seqs SY SHEX |
| 3184 | cpass tatok |
| 3185 | else |
| 3186 | cfailm tatbad |
| 3187 | end |
| 3188 | end |
| 3189 | |
| 3190 | note review finding 2 (27da864e local read): the gate resolves REV once. Fixture: branch gmove at a |
| 3191 | note commit whose build.sh first moves gmove one commit back, so every build moves the branch |
| 3192 | fn chk8 to void |
| 3193 | sayt 1 th8 |
| 3194 | ctmp SX ttg |
| 3195 | agit |
| 3196 | apt tclone |
| 3197 | apt tq0 |
| 3198 | apt tnohl |
| 3199 | aps STRN |
| 3200 | aps SX |
| 3201 | pat tnl0 |
| 3202 | arm tclonea 0 |
| 3203 | agit |
| 3204 | apt tdash |
| 3205 | aps SX |
| 3206 | apt tco |
| 3207 | apt tq0 |
| 3208 | apt tdb |
| 3209 | apt tgmv |
| 3210 | arm tgfx1 0 |
| 3211 | sjoin SP SX tbsh |
| 3212 | ok = fload SP |
| 3213 | if not ok |
| 3214 | cfailm tfixbad |
| 3215 | ret |
| 3216 | end |
| 3217 | sset SV tmvl1 |
| 3218 | ss SV SX |
| 3219 | sx SV tmvl2 |
| 3220 | fd = fopf SP 577 |
| 3221 | say fd SV |
| 3222 | ok = wgb fd |
| 3223 | fcls fd |
| 3224 | agit |
| 3225 | apt tdash |
| 3226 | aps SX |
| 3227 | apt tdc |
| 3228 | apt tun |
| 3229 | apt tdc |
| 3230 | apt tue |
| 3231 | apt tcmt |
| 3232 | apt tq0 |
| 3233 | apt tdasha |
| 3234 | apt tdashm |
| 3235 | apt ttamper |
| 3236 | arm tgfx2 0 |
| 3237 | if not revof SX tgmv SY |
| 3238 | cfailm tfixbad |
| 3239 | ret |
| 3240 | end |
| 3241 | note the gate child claims the hold only so its build stage runs; REF is absent, so the gate stops |
| 3242 | note at NOT_RUN (no max_tokens) before any GPU program can start |
| 3243 | ctmp SOUT tgout |
| 3244 | ctmp SREF tnoref |
| 3245 | aclr |
| 3246 | apt tenv |
| 3247 | apt theld1 |
| 3248 | sset SV tomctr |
| 3249 | sb SV 61 |
| 3250 | ss SV SOMC |
| 3251 | aps SV |
| 3252 | sset SV tomcgt |
| 3253 | sb SV 61 |
| 3254 | ss SV SOMG |
| 3255 | aps SV |
| 3256 | sset SV tprocp |
| 3257 | sn SV ulong getpid |
| 3258 | sx SV texe |
| 3259 | aps SV |
| 3260 | apt tgate |
| 3261 | aps SX |
| 3262 | apt tgmv |
| 3263 | aps SREF |
| 3264 | aps SF1 |
| 3265 | aps SF2 |
| 3266 | aps SF3 |
| 3267 | aps SOUT |
| 3268 | pat tgnomx |
| 3269 | arm tgfa 3 |
| 3270 | pat tnl0 |
| 3271 | scp SREV SY |
| 3272 | ok1 = gbid tcand |
| 3273 | ok2 = gbid tnegd |
| 3274 | if and ok1 ok2 |
| 3275 | cpass tgfok |
| 3276 | else |
| 3277 | cfailm tgfbad |
| 3278 | end |
| 3279 | ctmp SX ttg |
| 3280 | ok = revof SX tgmv SZ |
| 3281 | if and ok not seqs SZ SY |
| 3282 | cpass tgmok |
| 3283 | else |
| 3284 | cfailm tgmbad |
| 3285 | end |
| 3286 | end |
| 3287 | |
| 3288 | fn dcheck to ulong |
| 3289 | put gk 1 0 |
| 3290 | sset SP tgateom |
| 3291 | if not there SP |
| 3292 | sayt 2 tnoroot |
| 3293 | ret 2 |
| 3294 | end |
| 3295 | ok = senv SOMG tomcgt |
| 3296 | sabs SOMG |
| 3297 | sset ST tgchk |
| 3298 | sn ST ulong getpid |
| 3299 | ok = mkd ST |
| 3300 | ctmp SG tgateb |
| 3301 | sset SP tgateom |
| 3302 | rc = gcomp SOMG SP SG |
| 3303 | if ne rc 0 |
| 3304 | rmrf ST |
| 3305 | ret rc |
| 3306 | end |
| 3307 | cfx SF1 tfck |
| 3308 | cfx SF2 tfmg |
| 3309 | cfx SF3 tfpr |
| 3310 | sset SE tnl0 |
| 3311 | for i ulong 64 |
| 3312 | sb SE 101 |
| 3313 | end |
| 3314 | sset SC2 tfsrc |
| 3315 | chk1 |
| 3316 | chk2 |
| 3317 | chk3 |
| 3318 | chk4 |
| 3319 | chk5 |
| 3320 | tr = senv STRN ttrainv |
| 3321 | om = senv SOMC tomctr |
| 3322 | if and tr om |
| 3323 | sabs STRN |
| 3324 | sabs SOMC |
| 3325 | sclr SNEG |
| 3326 | chk6 |
| 3327 | chk7 |
| 3328 | chk8 |
| 3329 | else |
| 3330 | sayt 1 tcnor |
| 3331 | end |
| 3332 | rmrf ST |
| 3333 | if eq get gk 1 0 |
| 3334 | sayt 1 tcgood |
| 3335 | ret 0 |
| 3336 | end |
| 3337 | sayt 1 tcbad |
| 3338 | ret 1 |
| 3339 | end |
| 3340 | |
| 3341 | note ---- main |
| 3342 | |
| 3343 | fn argabs s ulong i ulong to void |
| 3344 | ok = sarg s i |
| 3345 | if not ok |
| 3346 | sayt 2 tuse |
| 3347 | exit 2 |
| 3348 | end |
| 3349 | sabs s |
| 3350 | end |
| 3351 | |
| 3352 | fn main to int |
| 3353 | na = ulong argcnt |
| 3354 | if lt na 2 |
| 3355 | sayt 2 tuse |
| 3356 | ret 2 |
| 3357 | end |
| 3358 | ok = sarg SM 1 |
| 3359 | sset SP tgateom |
| 3360 | if not there SP |
| 3361 | sayt 2 tnoroot |
| 3362 | ret 2 |
| 3363 | end |
| 3364 | if seqt SM tbuild |
| 3365 | if or lt na 6 gt na 7 |
| 3366 | sayt 2 tuse |
| 3367 | ret 2 |
| 3368 | end |
| 3369 | argabs SOMC 2 |
| 3370 | argabs STRN 3 |
| 3371 | ok = sarg SREV 4 |
| 3372 | argabs SOUT 5 |
| 3373 | sclr SNEG |
| 3374 | if eq na 7 |
| 3375 | argabs SNEG 6 |
| 3376 | end |
| 3377 | ret int dbuild |
| 3378 | end |
| 3379 | if seqt SM trecord |
| 3380 | if or lt na 8 gt na 9 |
| 3381 | sayt 2 tuse |
| 3382 | ret 2 |
| 3383 | end |
| 3384 | argabs STRN 2 |
| 3385 | ok = sarg SREV 3 |
| 3386 | argabs SCK 4 |
| 3387 | argabs SMG 5 |
| 3388 | argabs SPR 6 |
| 3389 | argabs SOUT 7 |
| 3390 | sset SLAB treal |
| 3391 | if eq na 9 |
| 3392 | ok = sarg SLAB 8 |
| 3393 | end |
| 3394 | ok = senv SOMC tomctr |
| 3395 | sabs SOMC |
| 3396 | ok = senv SOMG tomcgt |
| 3397 | sabs SOMG |
| 3398 | ret int drec |
| 3399 | end |
| 3400 | if seqt SM tgate |
| 3401 | if ne na 9 |
| 3402 | sayt 2 tuse |
| 3403 | ret 2 |
| 3404 | end |
| 3405 | argabs STRN 2 |
| 3406 | ok = sarg SREV 3 |
| 3407 | argabs SREF 4 |
| 3408 | argabs SCK 5 |
| 3409 | argabs SMG 6 |
| 3410 | argabs SPR 7 |
| 3411 | argabs SOUT 8 |
| 3412 | ok = senv SOMC tomctr |
| 3413 | sabs SOMC |
| 3414 | ok = senv SOMG tomcgt |
| 3415 | sabs SOMG |
| 3416 | ret int dgate |
| 3417 | end |
| 3418 | if seqt SM tcore |
| 3419 | ret int dcore |
| 3420 | end |
| 3421 | if seqt SM tcheck |
| 3422 | ret int dcheck |
| 3423 | end |
| 3424 | sayt 2 tuse |
| 3425 | ret 2 |
| 3426 | end |