t81-foundation

Research Synthesis & Decision Report — Ternary Research Closure and Next-Hypothesis Selection

Document ID: docs/research/TERNARY_RESEARCH_CLOSURE_AND_NEXT_HYPOTHESIS.md Date: April 2026 Status: Complete / Final Research Synthesis Authors: Jules (Software Engineer — Adversarial Synthesis) Target Repository: T81 Foundation (t81dev/t81-foundation) Associated Sequence: PRs #544–#549 (Ternary Arithmetic, Radix Comparison, Packed Ternary MatVec, SIMD Decoders, Cross-Architecture Break-Even) Experimental Artifacts: experiments/radix_comparison/, experiments/packed_ternary_matvec/


Executive Summary

This report concludes the ternary CPU arithmetic and inference research sequence executed in PRs #544 through #549. Through a rigorous evidence reconstruction, adversarial audit, prior-art contextualization, and experimental freeze, we establish the empirical boundary of CPU ternary execution and select the next research hypothesis for the T81 Foundation.

Key Operational Decisions

  1. CPU Ternary Kernel Optimization Frozen (STOP): Further optimization of software CPU ternary kernels (scalar, SWAR, LUT, AVX2 VPSHUFB, ARM NEON vqtbl1_s8) is formally frozen. Custom CPU ternary bit manipulation cannot compete with native 8-bit/32-bit SIMD vector execution on general-purpose binary ALUs.
  2. Inference Standardization: Standardize CPU-based ternary model inference ($W \in {-1, 0, 1}$) on native byte-aligned INT8 / FP16 SIMD execution pipelines (e.g., GGML / llama.cpp vector dequantization), using 2-bit packing exclusively as a memory storage and transmission format.
  3. Next Hypothesis Selected: Select Candidate 3: Deterministic Execution & Canonical Provenance Verification in Policy-Gated AI Runtimes (RFC-0028 / RFC-0030 / Axion) as the single bounded 30-day research objective.

Phase 1 — Evidence Reconstruction & Claim/Evidence Ledger

A comprehensive audit of the source changes, CTest targets, benchmark reports, and CI execution artifacts across PRs #544–#549 yields the following claim/evidence ledger, categorized into six distinct evidential tiers.

Claim / Evidence Matrix (PRs #544–#549)

Category Claim / Statement Empirical Status Source Artifacts Verified Reality / Boundary Conditions    
1. Mathematical Proofs Uniqueness of Balanced Ternary representation CONFIRMED TERNARY_ARITHMETIC_AND_RADIX_COMPARISON.md Proved by induction on $ V $. Digit sequence $d_i \in {-1,0,1}$ is strictly unique for every integer $V \in \mathbb{Z}$.
  Radix-3 Redundant Signed-Digit (RSD) Zero Uniqueness CONFIRMED TERNARY_ARITHMETIC_AND_RADIX_COMPARISON.md Proved $V=0 \implies d_i=0 \, \forall i$ in $D={-2..2}$ ($d_0 \equiv 0 \pmod 3 \implies d_0=0$). Corrects initial PR #544 proof error.    
  Non-Zero RSD Equality Testing Cost CONFIRMED TERNARY_ARITHMETIC_AND_RADIX_COMPARISON.md Non-zero values have redundant representations (e.g., $1 = \langle 1 \rangle_3 = \langle 1, -2 \rangle_3$). Determining $A == B$ requires $O(N)$ canonicalization.    
  64-Bit Integer Trit / Byte Requirement CONFIRMED TERNARY_ARITHMETIC_AND_RADIX_COMPARISON.md $3^{40} < 2^{64} < 3^{41} \implies 41 \text{ trits}$ needed ($11 \text{ bytes}$ at 2 bits/trit), correcting PR #544’s 40-trit / 10-byte claim.    
2. Implemented Algorithms Stack-backed Radix-81 tryte addition (std::array) CONFIRMED experiments/radix_comparison/radix_comparison.hpp Fixed-width 11-tryte array addition reduces latency from $105.34\text{ ns}$ down to $11.70\text{ ns}$ by removing heap allocation.    
  2-bit AVX2 SIMD MatVec (matvec_ternary_2bit_avx2) CONFIRMED experiments/packed_ternary_matvec/matvec_experiment.hpp VPSHUFB nibble-parallel lookup table decoding eliminates scalar shift/mask instructions, achieving $12.91\text{ GFLOP/s}$ on $4096^2$.    
  ARM64 NEON candidate (matvec_ternary_2bit_neon) CONFIRMED experiments/packed_ternary_matvec/matvec_experiment.hpp Table lookup via vqtbl1_s8 implemented, but multi-instruction vzip/unpacking limits throughput under emulated conditions.    
3. Correctness Tests Oracle correctness across 18 matrix shapes & 7 patterns CONFIRMED t81_packed_ternary_matvec_oracle_test $100\%$ pass across 126 shape/pattern combinations against double-precision reference (matvec_oracle_f64).    
  Invalid 2-bit code policy ($0\text{x}02 \to 0$) CONFIRMED matvec_experiment.hpp Code $10_2$ ($0\text{x}02$) decodes safely to $0$ across all kernels without faulting or contaminating accumulations.    
4. Reproducible Benchmarks Fixed-array Radix-81 add ($11.7\text{ ns}$) vs Binary ALU ($1.1\text{ ns}$) CONFIRMED t81_radix_comparison_test Grouping 4 trits into Base-81 trytes speeds up software ternary add by $2.77\times$, but binary 64-bit ALU remains $10.6\times$ faster.    
  2-bit AVX2 MatVec ($12.91\text{ GFLOP/s}$) vs INT8 AVX2 ($17.15\text{ GFLOP/s}$) CONFIRMED t81_packed_ternary_matvec_oracle_test AVX2 2-bit SIMD kernel reaches $75.3\%$ of INT8 AVX2 speed on DRAM-bound $4096^2$ workloads while saving $75\%$ weight footprint.    
5. Emulated Hardware Results ARM64 NEON MatVec throughput CAVEATED t81_packed_ternary_matvec_arm64_qemu_test Executed via qemu-aarch64 user emulation. Reflected QEMU JIT translation overhead rather than physical ARM silicon cycle times.    
6. Speculative Extrapolations “2-bit packing provides faster CPU MatVec execution than INT8” FALSIFIED Cross-architecture break-even audit On general binary CPUs, 2-bit bit-shuffle decode instruction tax offsets memory bandwidth savings across all cache tiers.    
  “4-trit limb BigInt suffers a $102\times$ multiplication penalty” CONTEXTUALIZED T81BigInt repo inspection Strawman 4-trit limb is $102\times$ slower; actual T81BigInt implementation uses 27-trit limbs ($3^{27}$, 42.8 bits), incurring only a $2.23\times$ penalty.    

Phase 2 — Audited Research Conclusions & Document Corrections

An audit of the historical research documentation across PRs #544–#549 reveals several initial errors, overstatements, and analytical gaps that require formal correction.

1. Mathematical Example & Proof Corrections

2. Overstated Performance & Memory Bandwidth Claims

3. QEMU Emulation vs Physical Hardware Contextualization

4. Single-Use vs Pre-Packed Execution Path Separation

5. Prior-Art Analysis


Phase 3 — Frozen Experiment Status & Preservation Register

Preservation Status: FROZEN / STOP

All experimental software implementations, CTest targets, and benchmark harnesses developed in PRs #544–#549 are preserved in the repository as reproducible historical research baselines. No further engineering effort will be invested in custom CPU ternary kernel optimization.

+-----------------------------------------------------------------------------------+
|                            T81 TERNARY CPU RESEARCH FREEZE                        |
+-----------------------------------------------------------------------------------+
| Subsystem                     | CTest Target                         | Status    |
+-------------------------------+--------------------------------------+-----------+
| experiments/radix_comparison/ | t81_radix_comparison_test            | FROZEN    |
| experiments/packed_ternary/   | t81_packed_ternary_matvec_oracle_test| FROZEN    |
| experiments/packed_ternary/   | t81_packed_ternary_matvec_arm64_test | FROZEN    |
+-----------------------------------------------------------------------------------+

Reproducibility Instructions

  1. Build Research Executables:
    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DT81_BUILD_TESTS=ON
    cmake --build build --target t81_radix_comparison t81_packed_ternary_matvec --parallel 4
    
  2. Execute Correctness & Benchmark Harnesses:
    ctest --test-dir build --output-on-failure -R "(radix|packed_ternary)"
    
  3. Inspect Machine-Readable Artifacts:
    • build/experiments/radix_comparison/radix_comparison_results.json
    • build/experiments/packed_ternary_matvec/packed_ternary_matvec_results.json

Phase 4 — Candidate Hypotheses Assessment

To transition T81’s research focus away from incremental CPU kernel micro-optimization, we evaluate five candidate research hypotheses spanning broader mathematical, architectural, and runtime domains.


Candidate 1: Redundant Signed-Digit (RSD) Multi-Precision Arithmetic Crossover Analysis


Candidate 2: Hardware Cost Models for Ternary Logic & Memory (ASIC / FPGA vs Binary CMOS)


Candidate 3: Deterministic Execution & Canonical Provenance Verification in Policy-Gated AI Runtimes (RFC-0028 / RFC-0030 / Axion)


Candidate 4: Ternary-Native Sparse Graph Analytics & Adjacency Representations


Candidate 5: Algebraic & Galois Field Representations ($\text{GF}(3^k)$ / Base-81) for Verifiable Storage & Communication


Phase 5 — Hypothesis Ranking & Next Experiment Proposal

Candidate Comparative Ranking Matrix

Candidate Novelty Feasibility Scientific Significance Reproducibility Implementation Cost Total Score Rank
3. Deterministic AI Runtime Verification High Very High High 100% (Bit-Identical) Low (2 wks) 9.5 / 10 #1 (Selected)
5. Galois Field $\text{GF}(3^9)$ vs $\text{GF}(2^8)$ Medium High Medium 100% Low (2 wks) 7.5 / 10 #2
1. RSD Multi-Precision Crossover Medium High Medium 100% Low (2 wks) 7.0 / 10 #3
4. Sparse 2-Bit Ternary Graph Analytics Medium Medium Medium High Medium (3 wks) 6.5 / 10 #4
2. Transistor-Level Ternary Logic Cost High Low High Medium High (4 wks + EDA) 5.5 / 10 #5

Selected Next Experiment Proposal

Experiment Title

Cross-Platform Bit-Identical Deterministic AI Execution & Trace Provenance Verification (30-Day Bounded Objective)

Objective & Scope

Validate whether T81’s Deterministic Math Subsystem (RFC-0030 CORDIC/Minimax soft-float transcendentals) and Canonical Trace Cache (RFC-0028) can achieve 100% bit-identical execution parity across x86_64, ARM64, and WebAssembly targets under policy-gated pre-side-effect enforcement (Axion), while incurring a $<5\%$ runtime performance tax relative to non-deterministic host libm floating-point operations.

Experimental Design & Test Protocol

  1. Target Subsystem: tests/determinism/ and vm/determinism/.
  2. Evaluation Workloads:
    • Softmax and LayerNorm activation traces across $100,000$ adversarial floating-point inputs (including subnormals, NaNs, infinities, and extreme exponents).
    • Multi-layer MLP token generation trace ($N=1024$ steps) executed on x86_64 GCC 13, ARM64 Apple Clang 16, and WASM Emscripten.
  3. Primary Metrics:
    • Bitwise Hash Parity: CanonHash81(Trace_x86_64) == CanonHash81(Trace_ARM64) == CanonHash81(Trace_WASM).
    • Execution Latency Tax: $\frac{\text{Latency}{\text{DeterministicSoftFloat}} - \text{Latency}{\text{HostLibm}}}{\text{Latency}_{\text{HostLibm}}} \times 100\%$.
  4. Stopping Criteria:
    • If cross-platform bitwise parity is achieved with $<5\%$ overhead, validate Option A (Governed Deterministic Runtime) as T81’s core architecture foundation.
    • If overhead exceeds $20\%$, trigger soft-float approximation lookup table optimization.

Note: This proposal outlines the next bounded research objective for the T81 project. No code implementation for this experiment is included in this PR.