OS-agnostic no_std exact p/q balanced-ternary kernels, kompress fold, Laplacian oracle, qULB capsules, and self-checking exact-arithmetic examples
  • Rust 99.6%
  • Shell 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-11 08:55:52 -05:00
crates chore: baseline wukong-zeno v0.2.0 + erdos-lodri pq plan 2026-11-11 08:18:07 -05:00
docs/superpowers docs(plan): float ns/gate is fractional 2026-11-11 08:36:50 -05:00
examples fix: gate all examples, correct std-target docs, report float ns/gate 2026-11-11 08:35:48 -05:00
scripts fix: gate all examples, correct std-target docs, report float ns/gate 2026-11-11 08:35:48 -05:00
src fix: gate all examples, correct std-target docs, report float ns/gate 2026-11-11 08:35:48 -05:00
.gitignore chore: baseline wukong-zeno v0.2.0 + erdos-lodri pq plan 2026-11-11 08:18:07 -05:00
AGENTS.md docs(agents): origin mirrors GitHub and Codeberg 2026-11-11 08:55:52 -05:00
Cargo.lock chore: baseline wukong-zeno v0.2.0 + erdos-lodri pq plan 2026-11-11 08:18:07 -05:00
Cargo.toml chore: baseline wukong-zeno v0.2.0 + erdos-lodri pq plan 2026-11-11 08:18:07 -05:00
README.md fix: gate all examples, correct std-target docs, report float ns/gate 2026-11-11 08:35:48 -05:00

wukong-zeno

OS-agnostic, no_std, dependency-free Rust workspace for exact p/q balanced-ternary computation:

  • pivot-abi - frozen central mediator ABI (rationals, trits, pods, frames, ports).
  • felix-simd - NEON / SSE2 kernels with safe scalar parity.
  • mem8-wave - kompress-super-ultra 128 B -> 32 B fold with CRC-8 frames.
  • regularity-oracle - exact rational ternary Laplacian and partitioning.
  • phoenix-capsule - qULB typestate capability capsules.

The root wukong-zeno package hosts the examples/*.rs targets, which are the only places std is permitted.

Contracts

  • Library crates are #![no_std], allocation-free, and have no third-party dependencies.
  • No floating point: #![deny(clippy::float_arithmetic)] in every crate.
  • unsafe is confined to felix-simd/src/arch/; every other crate is #![forbid(unsafe_code)].
  • All wire values are little-endian; KompressFrame32 is exactly 32 bytes and CentroidPod64 is exactly 128 bytes.
  • Arithmetic is checked and deterministic; there are no clocks, environment reads, or OS calls in the libraries.

Layout

wukong-zeno/
  crates/pivot-abi/          frozen ABI and port traits
  crates/felix-simd/         scalar + aarch64 NEON + x86_64 SSE2 kernels
  crates/mem8-wave/          fold/unfold, CRC-8, packed trits
  crates/regularity-oracle/  Laplacian, degree partitions, density, pivots
  crates/phoenix-capsule/    Sealed -> Active -> Attenuated -> Consumed
  examples/omni_zeno_smoke.rs      canonical end-to-end digest test
  examples/cayley_bench.rs         exact Q / F_P Cayley vs f64 drift
  examples/erdos_lodri_e2e.rs      percolation -> shadow cut -> fold -> capsule
  examples/fp31_bench.rs           branchless Fp31 2M-gate round trip
  scripts/verify.sh                full gate

Examples

Example Proves
omni_zeno_smoke All five crates through the frozen ABI; digest 0x5F745302BDDBB7DE.
cayley_bench Exact rational Cayley gate preserves L2 energy; 10 000-step F_P invariance; f64 drift reported, never asserted.
erdos_lodri_e2e Exact Molloy–Reed κ, broad V_2 × V_4 density, Σ(L₃x) = 0, four cross-module Cayley gates, fold fixed point, linear capsule.
fp31_bench Branchless Mersenne F_{2^31−1} multiply; 2 000 000 forward+inverse gate applications restore every lane bit-for-bit; f32/f64 baselines.

scripts/verify.sh runs the tests, clippy, and all four examples.

Build and verify

cargo test --workspace
cargo test --workspace --doc
cargo clippy --workspace --all-targets -- -D warnings
cargo run --release --example omni_zeno_smoke

# Cross-target compilation (no std available on the bare-metal target)
cargo check --workspace --lib --target wasm32-unknown-unknown
cargo check --workspace --lib --target x86_64-apple-darwin
cargo check --workspace --lib --target aarch64-unknown-none

Expected smoke output:

wukong-zeno v0.2.0 - omni zeno smoke
kernel parity : 1000/1000 vectors, 0 mismatches
kompress      : 128B -> 32B -> 128B, active=57 scale=163774/19 crc=0xC2
               refold=fixed-point tamper=CRC-mismatch unfolded_l1=370660
oracle        : Delta_H3=0 partitions=[0:2 1:1 2:2 3:1 4:1 5:1 6:1 7:1] pivots=2 density=5/8
qulb          : fixed_point=true authority=1/3 budget=14 energy=32 capsule=0x8B15
digest        : 0x5F745302BDDBB7DE

The digest is an FNV-1a 64-bit fingerprint of the frame, Laplacian result, and qULB state; it must stay stable across hosts and architectures.

License

MIT OR Apache-2.0.