aien-train
AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.
Brought by drakestapleton
aien-train / evidence / BTWAVE-P0 / README.md
| 1 | # BTWAVE-P0: Pure Seeded OM-2 Balanced-Ternary Waveguide and Give-Before-Take Compute Engine |
| 2 | |
| 3 | ## Outcome and Scope |
| 4 | |
| 5 | EXERCISED on Linux AArch64 (NVIDIA GB10 Grace-Blackwell SoC, Arm Cortex-X925 cores 16-18 @ 3900 MHz, |
| 6 | nice 10; Lean 4 checked on Arm Cortex-A725 cores 0-1 @ 2808 MHz, nice 10): |
| 7 | |
| 8 | `BTWAVE PASS mutants_killed=23/23 type_swaps_refused=4/4 trace_sha256=b0c6399a7ae894148e8e1678a272add68385bdf67d6221044ded82216fb73575` |
| 9 | |
| 10 | - **Pure OM-2 implementation and gate**: `native/btwave/{trit.om,ledger.om,wave_ipc.om,main.om,gate.om}` |
| 11 | contains zero C, C++, Rust, Python, or shell implementation or gate code (`DIRECTIVE-20261107-pure-omega.md`). |
| 12 | - **Deterministic replay**: two consecutive executions of the compiled pure-OM-2 `gate.om` binary |
| 13 | produced byte-identical `evidence/BTWAVE-P0/receipt.tsv` (`66` lines `MEASURED`). |
| 14 | - **Wrong-compiler negative control**: passing `/bin/true` as `<omc_path>` printed |
| 15 | `BTWAVE NOT_RUN omc sha256 does not match pinned seed/out/omc` and exited `77` (`MEASURED`). |
| 16 | - **Cross-core Cortex-X925 waveguide IPC**: forked parent on core `16` and child on core `17` |
| 17 | (`cpuset` + `cpunow`, cores `3, 7, 15` forbidden) executed `8` full-duplex raw `80-byte` pipe |
| 18 | frames with live `H16` error correction and chained SHA-256 Give-Before-Take ledger settlement in |
| 19 | `168,610 ns` (`0.169 ms` `MEASURED`, varies per run, `evidence/BTWAVE-P0/ipc.stdout`). The host |
| 20 | credits a Give round only when the returned job wave equals `job_wave(sym)` (`-46` otherwise) and |
| 21 | the receipt matches (`-44`); any host refusal closes the host pipe ends before `waitpid` so |
| 22 | `btwave ipc` exits `65`/`66`/`67` cleanly without blocking. |
| 23 | |
| 24 | ## Pins |
| 25 | |
| 26 | | Subject | Value | |
| 27 | | --- | --- | |
| 28 | | `aien-train` base | `07a6411b5a51714f9eed728c0673dbe13ca250e2` (`feat/btwave-ternary-p0`) | |
| 29 | | Root bootstrap seed | `omega-mv` `seed/rung0/seed0.hex` sha256 `baaf081fe6055a768485c5d25d7435681ce00b04cfa80b26c48169f78944e14d` | |
| 30 | | Seeded compiler source | `omega-mv` `713c9c079c2d97b58a2832495ddc7a374d462758` `seed/omc/omc.om` sha256 `c86159627820cf5741be0a2a4c05df0efb78f5c91a652b986fec5d745baa62ed` | |
| 31 | | Pinned `omc` binary | 3-stage `seed/out/omc` sha256 `f4fa7951816bbd09c5eaaae6692852a70c3c305164b365027c5b683dec7d63e9` (`674,212 B` `MEASURED`) | |
| 32 | | Concatenated product `.om` | `cat trit.om ledger.om wave_ipc.om main.om` sha256 `29de9fda42b04b1bf51b459a0bc4612fdcfa7f93d192d0f6ad3bdd9454191689` | |
| 33 | | Product ELF binary | sha256 `583209bf9bcf8dda9a3a976e2e45e4d19ac6cdd28a0b2dbe7e1147deb9d975a2` (`79,472 B` `MEASURED`, 3x identical) | |
| 34 | | Gate ELF binary | `cat trit.om gate.om` -> sha256 `06e7304aa22af1b04b8607ba31c6265e3dec19311fb70d99bbbc16a6fd181a05` (`91,996 B` `MEASURED`, not committed) | |
| 35 | | Wolfram oracle | `oracle-query.wl`, `oracle-wolfram-raw.json`, `expected-trace.out` (sha256 `b0c6399a7ae894148e8e1678a272add68385bdf67d6221044ded82216fb73575`) | |
| 36 | | Lean 4 toolchain | `lean-verify` `8b969194`, `leanprover/lean4:v4.35.0`, Mathlib `v4.35.0` (`lean/BtWaveProofs.lean`, `lean/lean-check.log`) | |
| 37 | |
| 38 | ## Independent Wolfram Oracle (`oracle-query.wl` -> `oracle-wolfram-raw.json`) |
| 39 | |
| 40 | Submitted verbatim to `https://agenttools.wolfram.com/mcp` (`WolframLanguageEvaluator`), returning: |
| 41 | |
| 42 | - `bt6_states -> 729`, `bt6_bijection -> True`, `bt6_neg_sym -> True`, `bt6_dark_zero -> True` |
| 43 | (`MODELED` & `MEASURED`: `729/729` bijective states on `[-364, 364]`, unique zero-power Dark |
| 44 | Consensus state at `u = 0`, total active carrier sum `2,916 trits`). |
| 45 | - `hc3_16_of_16 -> True`, `nl1_central_r3_max -> 14`, `nl1_affine_r3_max -> 15` |
| 46 | (`MODELED`: `M = 3` balanced trits reconstruct `16/16` hypercube corners vs `<= 14/16` for any |
| 47 | `4` central binary hyperplanes in `R^3`). |
| 48 | - `h16_min_dist -> 8`, `h16_counts -> {32, 512, 360, 1120, 70}` |
| 49 | (`MODELED` & `MEASURED`: `d_H = 8`, `100%` recovery up to `3` corruptions, `70/70` fail-closed |
| 50 | refusals on `4`-carrier odd-lane flips). |
| 51 | - `sha256_abc_hi64 -> 13436514500253700074` (`0xba7816bf8f01cfea` FIPS 180-4 `"abc"` self-check). |
| 52 | - `vmax_ceiling -> {83886080, 9223372036854775807, True}`, `ovf_sym0_sum -> 120`, |
| 53 | `ovf_probe_overflows64 -> True` (`MODELED` overflow bound and `2^62 * 120` overflow witness). |
| 54 | - `ledger_invariant_holds -> True`, `ledger_summary -> {2, 2, 12, 90, 90}`, |
| 55 | `trace_sha256 -> "b0c6399a7ae894148e8e1678a272add68385bdf67d6221044ded82216fb73575"`. |
| 56 | |
| 57 | Native `btwave trace` stdout matches `expected-trace.out` byte for byte (`982 B`, sha256 |
| 58 | `b0c6399a7ae894148e8e1678a272add68385bdf67d6221044ded82216fb73575` `MEASURED`). |
| 59 | |
| 60 | ## Mutant Matrix (`receipt.tsv`: 22 Runtime/Contract/Trap Mutants + 1 IPC Peer Mutant + 4 Compile-Fail Swaps) |
| 61 | |
| 62 | | ID | Target Guard / Invariant | Self-Test Verdict | Trace / Backstop Verdict | |
| 63 | | --- | --- | --- | --- | |
| 64 | | `m01-guard-opcode` | Drop opcode `op in {1, 2}` guard (`-1`) | `SELFTEST_CAUGHT` (`21`) | `ORACLE_KILLED` | |
| 65 | | `m02-guard-epoch` | Drop sequential `epoch + 1` guard (`-2`) | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` | |
| 66 | | `m03-guard-give-work` | Drop `GIVE` work range guard (`-3`) | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` | |
| 67 | | `m04-guard-h16-tie` | Bypass `H16` tie refusal (`-4`) | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` | |
| 68 | | `m05-guard-active-power` | Drop `32`-carrier active power guard (`-5`) | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` | |
| 69 | | `m06-guard-scale-zero` | Drop `scale_bad` range guard (`-6`) | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` | |
| 70 | | `m07-guard-sha256-rcpt` | Drop constant-time SHA-256 receipt check (`-7`) | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` | |
| 71 | | `m08-guard-take-bounds` | Drop `TAKE` grant range guard (`-8`) | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` | |
| 72 | | `m09-guard-give-first` | Drop `contributed > 0` parasite guard (`-9`) | `SELFTEST_CAUGHT` (`21`) | `ORACLE_KILLED` | |
| 73 | | `m10-guard-reciprocity` | Drop `extracted + take <= contributed` (`-10`) | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` | |
| 74 | | `m11-guard-chain-anchor` | Neutralize stale chain-anchor detection (`-11`) | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` | |
| 75 | | `m12-trit-neg-ident` | Replace `rotr a 32` negation with identity | `SELFTEST_CAUGHT` (`10`) | `ORACLE_KILLED` | |
| 76 | | `m13-trit-dot-sum` | Replace `pp - nn` inner product with `pp + nn` | `SELFTEST_CAUGHT` (`16`) | `ORACLE_KILLED` | |
| 77 | | `m14-bt6-dark-bias` | Shift `bt6enc` offset `364 -> 365` (breaks Dark Zero) | `SELFTEST_CAUGHT` (`10`) | `ORACLE_KILLED` | |
| 78 | | `m15-hc3-14of16-drop` | Narrow `hc3dec` to `14/16` hypercube corners | `SELFTEST_CAUGHT` (`12`) | `ORACLE_KILLED` | |
| 79 | | `m16-h16-allow-4flip-tie` | Accept `bestd <= 4` midpoint ties | `SELFTEST_CAUGHT` (`14`) | `ORACLE_KILLED` | |
| 80 | | `m17-mutate-before-verdict` | Mutate `extracted` prior to `recip_ok` check | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` | |
| 81 | | `m18-trap-trit-overlap` | Inject `(pos & neg) != 0` in `t32mul` (`Trit32mk`) | `TRAP10` (`110`) | `TRAP10` (`110`) | |
| 82 | | `m19-trap-wavedup-holds` | Break `dup32` mirror in `wdup_tag` (`holds WaveDup`) | `TRAP10` (`110`) | `TRAP10` (`110`) | |
| 83 | | `m20-trap-bt6-requires` | Off-by-one `u = 365` into `bt6enc` (`requires`) | `TRAP9` (`109`) | `TRAP9` (`109`) | |
| 84 | | `m21-vmax-ceiling-blowup` | Widen `VMAX` past `INT64_MAX / 1280` (`ovf-probe`) | `SELFTEST_CAUGHT` (`23`) | `ORACLE_KILLED` + `TRAP1` (`101`) | |
| 85 | | `m22-coordinated-selftest-blind` | Perturb `build_swar_vec` outside `selftest` | `SELFTEST_MISSED` (`0`) | `ORACLE_KILLED` | |
| 86 | | `m23-ipc-peer-wrong-job` | Node B returns `job_wave(sym xor 1)` with a self-consistent receipt | not run (`ipc` only) | `IPC_REFUSED_65` (`btwave ipc` exit `65`, empty stdout) | |
| 87 | | `x1-swap-credit-for-grant` | Pass `CreditJ` as `GrantJ` to `recip_ok` | `COMPILE_REFUSED_7` | `omc` exit `7` | |
| 88 | | `x2-swap-grant-for-credit` | Pass `GrantJ` as `CreditJ` to `recip_ok` | `COMPILE_REFUSED_7` | `omc` exit `7` | |
| 89 | | `x3-raw-ulong-as-trit32` | Pass raw `ulong` as `Trit32` to `h16dec` | `COMPILE_REFUSED_7` | `omc` exit `7` | |
| 90 | | `x4-swap-grant-as-wavedup` | Pass `GrantJ` as `WaveDup` to `wdup_chk` | `COMPILE_REFUSED_7` | `omc` exit `7` | |
| 91 | |
| 92 | ## Formal Proofs in Lean 4 (`lean/BtWaveProofs.lean`, `lean/lean-check.log`) |
| 93 | |
| 94 | Checked with `lake env lean` (`leanprover/lean4:v4.35.0`, Mathlib `v4.35.0`, `rc 0`). Every theorem's |
| 95 | `#print axioms` output uses only subsets of `[propext, Classical.choice, Quot.sound]` (zero |
| 96 | `sorryAx`, zero `native_decide`, zero custom `axiom`): |
| 97 | |
| 98 | 1. `bt6_valid_and_left_inv`, `bt6_right_inv`, `bt6_neg_sym`, `bt6_dark_zero`, |
| 99 | `hc3_reconstructs_16_of_16`: two-sided bijection on `[-364, 364]`, 1-op negation symmetry, |
| 100 | Dark Zero `bt6Pow(bt6Enc u) = 0 <-> u = 0`, and `16/16` hypercube corner reconstruction. |
| 101 | 2. `swar_lane_mul_iso`, `swar_popcount_dot_iso`, `h16_min_dist_eight`, |
| 102 | `h16_unique_decode_le_three`: `(pos, neg)` SWAR bitplane algebra isomorphism and `H16` minimum |
| 103 | distance `8` implying unique nearest-neighbor decoding for `<= 3` corruptions. |
| 104 | 3. `ledger_give_before_take_invariant`, `wave_eval_fits_signed64`: inductive Give-Before-Take |
| 105 | invariant `extracted <= contributed` across arbitrary event traces and signed 64-bit overflow |
| 106 | freedom under `|sc| <= 65536`. |
| 107 | 4. Load-bearing negative controls: `nl1_four_central_hyperplanes_r3_at_most_14` (`<= 14 < 16` |
| 108 | strict sign orthants for any `4` central hyperplanes in `R^3`), `h16_four_flip_tie_witness` |
| 109 | (distance-`4` tie under `4` flips), `dropping_reciprocity_guard_violates_invariant`, and |
| 110 | `ovf_probe_without_scale_guard_overflows64`. |
| 111 | |
| 112 | ## Reproduce |
| 113 | |
| 114 | ```sh |
| 115 | T=$(mktemp -d) |
| 116 | cat native/btwave/trit.om native/btwave/gate.om | "$OMC" > "$T/gate" |
| 117 | chmod +x "$T/gate" |
| 118 | cp -r evidence/BTWAVE-P0 "$T/ev" |
| 119 | "$T/gate" "$OMC" "$T/ev"; rc=$? |
| 120 | rm -rf "$T" |
| 121 | (exit "$rc") |
| 122 | ``` |
| 123 | |
| 124 | Run these commands from the repository root. The gate opens `native/btwave/*.om` relative to the |
| 125 | working directory; from any other directory it prints `BTWAVE FAIL gate check failed at step 5`. |
| 126 | The gate rewrites `receipt.tsv` and `ipc.stdout` in the directory it is given (`ipc.stdout` |
| 127 | `elapsed_ns` varies per run); pass a copy of `evidence/BTWAVE-P0` to keep the committed receipts |
| 128 | unchanged. The block works in a private `mktemp -d` directory and ends with the gate's exit status. |
| 129 | |
| 130 | No compiled ELF binaries are stored in `evidence/BTWAVE-P0/`. |
| 131 | |
| 132 | ## Not Run or Not Claimed |
| 133 | |
| 134 | - **GB10 GPU kernels, multi-host sockets/RDMA, LLM weight training, and AEGIS authority**: `NOT_RUN`. |
| 135 | - **x86-64 build**: `NOT_RUN` (`omc` emits static Linux AArch64 ELF binaries). |
| 136 | - **GitHub CI**: `NOT_RUN` (Radicle-only local bundle handoff). |