mirror of
https://github.com/8b-is/wukong-zeno.git
synced 2026-11-21 23:30:07 +01:00
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%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| crates | ||
| docs/superpowers | ||
| examples | ||
| scripts | ||
| src | ||
| .gitignore | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
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. unsafeis confined tofelix-simd/src/arch/; every other crate is#![forbid(unsafe_code)].- All wire values are little-endian;
KompressFrame32is exactly 32 bytes andCentroidPod64is 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.