|
| 1 | +## 2026-07-23 — Wave Loop 765 (module-scope `[349][2]^6 Pt` non-power-of-two outer-dimension AoS variable) |
| 2 | + |
| 3 | +### What worked |
| 4 | +- Variant A extended the module-scope packed AoS odd outer-dimension ladder to 349. |
| 5 | + The `[349][2]^6 Pt` witness is 714,752 bits (~0.682 MiBit), still well under the 4-MiBit |
| 6 | + cliff, and required no compiler changes. |
| 7 | +- A module-level `pub var dst : [349][2]^6 Pt` can be initialized from a function |
| 8 | + call and exercised with indexed signed field writes, with zero compiler changes. |
| 9 | +- The cocotb/Python reference model correctly mirrored the row-major flattening |
| 10 | + with outer stride 349, confirming the layout is preserved end-to-end. |
| 11 | +- Reused the corrected W632 element-index formula for mid-row expected values: |
| 12 | + `[r][a5][a4][a3][a2][a1][a0]` is element `r*64 + a5*32 + a4*16 + a3*8 + a2*4 + a1*2 + a0`. |
| 13 | +- For `OUTER = 349`, `MID_IDX = 174`; the frame-condition element is |
| 14 | + `[174][1][0][0][0][0][0]`, element number `174*64 + 32 = 11,168`. |
| 15 | +- Updated weak-point audit: 48 commits in 30 days (39 with `Closes #N`), 51 |
| 16 | + `.t27` specs without `test`/`invariant`/`bench`, 23 `scripts/*.sh` under `scripts/`. |
| 17 | + |
| 18 | +### What changed behavior |
| 19 | +- No changes to `bootstrap/src/compiler.rs`. |
| 20 | +- No changes to `bootstrap/stage0/FROZEN_HASH`. |
| 21 | +- No changes to `scripts/cocotb_ref_model.py`. |
| 22 | +- Added `specs/scratch/w765_bench_module_349x2p6_aos_var_call_write.t27` (~1,528 KB / |
| 23 | + ~66,371 lines) with seal and Icarus baseline. |
| 24 | +- Added integration test `accepts_w765_bench_module_349x2p6_aos_var_call_write`. |
| 25 | +- Added generator script `scripts/gen_w765.py`. |
| 26 | + |
| 27 | +### Validation |
| 28 | +- `cargo build --release -p t27c`: OK. |
| 29 | +- `cargo test -p t27c --bin t27c`: 1494 passed; 0 failed; 2 ignored. |
| 30 | +- `cargo test -p tri`: 78 passed; 0 failed. |
| 31 | +- `cargo test -p t27c --test icarus_lowerable`: 225 passed; 0 failed. |
| 32 | +- Direct `t27c parse` W765: PASS. |
| 33 | +- Direct `t27c icarus-lowerable` W765: PASS (`lowerable`). |
| 34 | +- Direct `t27c icarus-simulate` W765: PASS (17 cycles, PASSED). |
| 35 | +- Direct `t27c icarus-cocotb` W765: PASS (`reference-model OK`). |
| 36 | + |
| 37 | +### Scientific / engineering background |
| 38 | +- IEEE 1800-2017 7.4.1/7.4.3 define packed-array total width as the product of |
| 39 | + packed dimensions, with no power-of-two restriction. Variant A emits a single |
| 40 | + 714,752-bit packed vector, which is legal SystemVerilog. |
| 41 | +- Lutsig verified array lowering and CIRCT `HWLegalizeModules` show that |
| 42 | + flattening nested arrays to wide packed vectors is a well-founded compiler |
| 43 | + discipline, even when outer dimensions are non-power-of-two. |
| 44 | +- Icarus issue #1134 documents assertion failures for unpacked arrays of packed |
| 45 | + structs; t27 scalar flattening avoids that construct entirely. |
| 46 | +- Yosys issue #2677 / #4653 confirm that arrays of packed structs remain |
| 47 | + unsupported in the native frontend; t27 packed-vector lowering avoids the |
| 48 | + gap. |
| 49 | +- 2025-2026 ternary/MVL literature scan found: |
| 50 | + - 5500FP / GargantuRAM — 24-trit balanced ternary RISC processor on Efinix |
| 51 | + Trion FPGA at 20 MHz, 120-instruction ISA, real ±3.3 V ternary I/O, |
| 52 | + CERN-OHL-P v2 board, commercially available (Zenodo/GitHub/Hackaday 2026). |
| 53 | + - Trinity B002 / Trinity v2.0.x — zero-DSP ternary-weight autoregressive LLM |
| 54 | + inference on Xilinx Artix-7 via OpenXC7, ~63 tok/s @ ~1 W, QMTech XC7A100T |
| 55 | + (Zenodo 2025/2026). |
| 56 | + - TernaryCore — open-source native {-1,0,+1} Verilog BitNet b1.58 accelerator, |
| 57 | + zero DSP, 31/31 simulations passing, Artix-7 roadmap (GitHub 2026). |
| 58 | + - ternfpga — end-to-end ternary LLM decode engine on Xilinx Arty A7-35T, 0 DSP, |
| 59 | + ~1.62 J/token vs. 3.67 J/token on RTX 3060 (GitHub 2026). |
| 60 | + - VitaLLM — versatile ternary/mixed-precision LLM accelerator in TSMC 16 nm, |
| 61 | + ~70–72 tok/s decode, <1 s prefill, 0.214–0.223 mm², ~60–66 mW |
| 62 | + (arXiv 2026). |
| 63 | + - KU Leuven MICAS ternary-lut-dse — LUT-based ternary MatMul DSE for 1.58-bit |
| 64 | + LLM inference, accepted at IEEE ISPASS 2026 (GitHub 2026). |
| 65 | + - BitNet b1.58 2B4T Technical Report — Microsoft native 1.58-bit LLM |
| 66 | + (arXiv 2025). |
| 67 | + - Bitnet.cpp — Microsoft CPU inference for ternary LLMs, up to 6.25× speedup |
| 68 | + over FP16 (ACL 2025). |
| 69 | + - Unbalanced ternary full adder in CNTFET — 42-transistor design with 35.8–75.2% |
| 70 | + power reduction (IEEE TCAD 2026). |
| 71 | + - CNTFET-based ternary full adder — 76/55 CNTFET complete/partial adders with |
| 72 | + ~24% delay improvement (IEEE TCAD 2025). |
| 73 | + - Energy-optimized ternary full adder using capacitive threshold logic and |
| 74 | + CNTFETs for DSP (AEU 2026). |
| 75 | + - OpenXC7 / nextpnr-xilinx / Project X-Ray — fully open-source Xilinx |
| 76 | + 7-series toolchain, used for QMTech XC7A100T ternary projects without Vivado. |
| 77 | + |
1 | 78 | ## 2026-07-23 — Wave Loop 764 (module-scope `[347][2]^6 Pt` non-power-of-two outer-dimension AoS variable) |
2 | 79 |
|
3 | 80 | ### What worked |
|
0 commit comments