Skip to content

SuperInstance/ternary-mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

ternary-mirror

State mirroring for GPU cluster replication with ternary consistency. {+1=consistent, 0=lagging, -1=diverged}. Sync tracking, divergence detection, repair.

Why This Matters

ternary-mirror

State mirroring for GPU cluster replication with ternary consistency.

The Five-Layer Stack

This crate is part of the Oxide Stack — a distributed GPU runtime built on five layers:

┌─────────────────┐
│  cudaclaw        │  Persistent GPU kernels, warp consensus, SmartCRDT
├─────────────────┤
│  cuda-oxide      │  Flux → MIR → Pliron → NVVM → PTX compiler
├─────────────────┤
│  flux-core       │  Bytecode VM + A2A agent protocol
├─────────────────┤
│  pincher         │  "Vector DB as runtime, LLM as compiler"
├─────────────────┤
│  open-parallel   │  Async runtime (tokio fork)
└─────────────────┘

The key insight: ternary values {-1, 0, +1} map directly to GPU compute. They pack 16× denser than FP32, enable XNOR+popcount matmul, and conservation laws become compile-time checks.

Design

Every value in this crate follows ternary algebra (Z₃):

Value Meaning GPU Analog
+1 Positive / Active / Healthy Warp vote yes
0 Neutral / Pending / Balanced Warp vote abstain
-1 Negative / Failed / Overloaded Warp vote no

This isn't arbitrary — ternary is the natural encoding for:

  1. BitNet b1.58 (Microsoft) — ternary LLMs at 60% less power
  2. GPU warp voting — hardware ballot returns ternary consensus
  3. Conservation laws — {-1, 0, +1} preserves quantity

Key Types

pub enum Consistency
pub struct MirrorEntry
pub struct MirrorNode
pub fn new
pub fn put
pub fn get
pub fn entry_count
pub struct MirrorManager
pub fn new
pub fn add_replica
pub fn write_primary
pub fn sync_replica

Usage

[dependencies]
ternary-mirror = "0.1.0"
use ternary_mirror::*;
// See src/lib.rs tests for complete working examples

Testing

git clone https://github.com/SuperInstance/ternary-mirror.git
cd ternary-mirror
cargo test    # 8 tests

Stats

Metric Value
Tests 8
Lines of Rust 196
Public API 16 items

License

Apache-2.0

About

State mirroring for GPU cluster replication with ternary consistency. {+1=consistent, 0=lagging, -1=diverged}. Sync, divergence detection, repair.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages