CodeCreeps System Engine
Ultra-compact algorithmic benchmarks, lock-free concurrency primitives, and SIMD data structures.


A systems engineering laboratory exploring lock-free algorithms, cacheline-aligned RingBuffers, high-performance serialization, and AVX-512 vector search algorithms in modern Rust and modern C++.
48.2M ops/s sustained throughput with 0 heap allocation.
Architecture
Engineered with strict cacheline alignment (`#[repr(align(64))]`), zero-cost abstractions, memory barrier ordering (`Acquire` / `Release`), and explicit SIMD vectorization primitives targeting x86_64 and ARM NEON hardware architectures.
Standard library collections (like HashMap and VecDeque) prioritize general-purpose ergonomics over strict hardware-level mechanical sympathy, creating unnecessary cache misses and allocation overhead in latency-critical data pipelines.
Key Decisions
Implemented atomic head and tail pointers with explicit memory barriers rather than mutex locks.
Impact: Zero thread contention stalls and sustained throughput of 48 million operations per second.
Utilized AVX-512 / AVX2 intrinsics for high-speed bit scanning.
Impact: Accelerated graph traversal and sparse matrix lookups by 4.8x.
Designed arena allocator providing pre-allocated linear chunk memory.
Impact: Zero syscall overhead during execution cycles.
Benchmarks
| Metric | CodeCreeps System Engine | Standard / Competitor |
|---|---|---|
| Queue Insertion Throughput | 48.2M ops/s | 9.1M ops/s (Mutex Protected MutexQueue) |
| L1 Cache Miss Ratio | 0.38% | 4.12% (Standard Unaligned Queue) |
| P99 Latency under 100% Load | 42 ns | 840 ns (Spinlock Queue) |
Installation & Setup
cargo add codecreeps --features simd