Work
Source Code
Data Structures & Systems

CodeCreeps System Engine

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

Akila Wasalathilaka
Akila Wasalathilaka
Lead Systems & AI Engineer
v0.9.4Active Production
RustC++20AssemblySIMD
CodeCreeps System Engine
Executive Summary

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++.

Core Specifications
THROUGHPUT
48M ops/sec
Lock-free MPSC ring buffer
CACHE MISS RATE
< 0.4%
Cacheline-aligned 64-byte layout
ALLOCATIONS
0 Heap
Pure stack & bump allocator
VECTOR SPEEDUP
4.8x AVX-512
SIMD string and bitset scans
Interactive System PreviewLive Client Architecture
SIMD RingBuffer Benchmarks

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.

Problem Context

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

01Lock-Free RingBuffer with Acquire-Release Semantics

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.

02SIMD Bitset Searching

Utilized AVX-512 / AVX2 intrinsics for high-speed bit scanning.

Impact: Accelerated graph traversal and sparse matrix lookups by 4.8x.

03Zero Heap Allocation Bump Allocator

Designed arena allocator providing pre-allocated linear chunk memory.

Impact: Zero syscall overhead during execution cycles.

Benchmarks

MetricCodeCreeps System EngineStandard / Competitor
Queue Insertion Throughput48.2M ops/s9.1M ops/s (Mutex Protected MutexQueue)
L1 Cache Miss Ratio0.38%4.12% (Standard Unaligned Queue)
P99 Latency under 100% Load42 ns840 ns (Spinlock Queue)

Installation & Setup

cargo add codecreeps --features simd