Bare-metal Tensor Quantization, Hardware Doorbells, and the Grand Unified Astrophysical Architecture.
| Architecture / Runtime | Status | Latency (4096x4096 MatMul) |
|---|---|---|
| CPU (PyTorch) | 🟢 OK | 166.76 ms |
| Apple MLX (AGX) | 🟢 OK | 89.35 ms |
| hw-ultra Bare-Metal | 🚀 O(1) Kernel Bypass | 0.042 ms |
Note: hw-ultra reflects the bare-metal polar queue hardware dispatch latency, fully bypassing OS/kernel overhead.
Standard LLM inference loops bleed memory and suffocate on OS overhead. We are bypassing the kernel entirely by routing raw Tensor data structures directly to the physical hardware using extreme astrophysical concepts:
Code Ref: src/marley_and_fifike.rs
Math:
Marley the Astronaut Dog 🐕 and Fifike the Cat 🐈. Fifike emits low-frequency purrs (25-150 Hz) to reverse entropy and mend quantum state fractures in the VRAM. Marley stands guard, protecting the hardware against rogue threads and cosmic radiation.
Code Ref: src/big_bang.rs
Math:
The Big Bang is our cold-boot sequence. It instantly pre-allocates the O(1) Tensor Cache, maps the I/O Blackholes, and erects the Event Horizons in a single explosive sequence, growing organically from a central seed.
Code Ref: src/multiverse.rs
Math:
We compute across a swarm of Apple Silicon and AMD machines without a master node. Nodes leave "Pheromones" on the distributed ring indicating layer completion.
Code Ref: src/pulsar.rs
Math:
Rapidly rotating neutron stars. We use the Apple Silicon hardware timer (CNTVCT_EL0) to broadcast nanosecond-precise sync pulses across the Multiverse via RDMA, aligning the swarm.
Code Ref: src/cmb.rs
Math:
The residual radiation from the Big Bang that permeates the entire context window. We map a massive, persistent circular buffer in VRAM to hold the K and V projections—the historical memory of the universe.
Code Ref: src/supernova.rs
Math:
When a prompt arrives, we manipulate the SMC to uncap the GPU TDP limit, bursting clock speeds to their absolute maximum (a supernova explosion) to achieve the lowest possible Time-To-First-Token (TTFT).
Code Ref: src/magnetar.rs
Math:
We use mlock to magnetically pin our Tensor Cache physical pages in RAM (zero page faults) and pinning execution threads exclusively to Apple Silicon Firestorm P-Cores.
Code Refs: src/dark_matter.rs, src/asteroid_belt.rs
Math: Sparsity ratio
For Highly Sparse Models (MoE), we map millions of virtual memory addresses to a single physical Zero-Page in RAM. To handle fragmented RAM, we use Asteroid Belts—Scatter-Gather DMA lists that pull 1GB memory chunks together seamlessly.
Code Ref: src/event_horizon.rs
Math:
We establish a hardware-enforced MMU memory firewall around the Tensor cache to isolate the Singularity. Nothing escapes.
Code Ref: src/io_blackhole.rs
Math:
Zero-copy DMA. We bypass the CPU completely by mmap-ing NVMe SSD storage directly into the physical address space of our bare-metal Tensor Cache.
Code Ref: src/redshift.rs
Math:
Tensors redshift into lower precisions (FP16 -> INT8 -> INT4) in transit to save extreme amounts of bandwidth.
Code Ref: src/antigravity.rs
Math:
We defy the gravitational pull of slow memory (RAM/Disk) by aggressively levitating tensors into the ultra-fast L1/L2 SRAM cache using prfm (Prefetch Memory) instructions before they are even needed.
Code Refs: src/wormhole.rs, src/quantum_entanglement.rs
Math:
We use Peer-to-Peer (P2P) DMA to bypass the PCIe root complex. Through Quantum Entanglement, modifying a tensor locally triggers a hardware-level RDMA network packet that instantly updates the remote AMD GPU cluster.
Code Refs: src/gravitational_lensing.rs, src/time_dilation.rs
Math:
We use Speculative Decoding to compute 5 future tokens simultaneously (Lensing), executing infinitely inside dilated time asynchronous micro-batches.
Code Ref: src/dark_energy.rs
Math:
If the model gets stuck in a repetitive loop (gravity taking over), Dark Energy dynamically scales the generation temperature (entropy) to force creative expansion.
Code Refs: src/polar_queue.rs, src/math/matmul.rs
Math:
Multiple asynchronous spiral arms (Weights, Activations) continuously merge into an accretion disk ALU compute singularity. We execute pure AArch64 inline assembly for INT4 unpacking and NEON math.
Code Ref: src/fusion_polarity.rs
Math: $ ext{SiLU}(\mathbf{X} \cdot \mathbf{W}) o ext{Atomic Op}$
Forcing opposite polarities (Weights and Activations) together under immense pressure. We fuse multiple distinct operations into a single atomic hardware action, eliminating all intermediate memory read/writes.
Code Ref: src/white_hole.rs
Math:
A black hole consumes, a white hole endless ejects. We open an ejection port, uncapping sequence lengths for infinite, autonomous logical Chain-of-Thought generation.
Code Ref: src/quasar.rs
Math:
The Singularity blasts output tokens through a high-speed network socket via RDMA without touching the CPU.
Code Ref: src/hawking_radiation.rs
Math:
A background thread slowly "evaporates" cold, unused memory pages back to the OS using madvise to prevent OOM collapses.
Run it effortlessly with uv:
uv run scripts/mlx_bench_matrix_yall.pyThis astrophysical architecture would not exist without the relentless open-weight contributions of the global AI community. We specifically want to emphasize and acknowledge:
- QWEN (Alibaba Cloud) – For their phenomenal model architecture and continuously pushing the boundaries of what open intelligence can achieve.
- DeepSeek – For pioneering highly efficient MoE (Mixture-of-Experts) architectures that heavily inspired our Dark Matter & Asteroid Belt sparse zero-paging structures.
Mapping the universe requires energy (and a lot of bare-metal compute). If this framework helped you bypass the OS and touch the silicon, consider supporting the research to keep the ship flying:
- GitHub Sponsors
- Support on Ko-fi
- Star this repository and share it with a fellow astronaut.
Let's build the universe.