Subroutine CS: Master Programming
Through Sound & Visual Intuition
Welcome to Subroutine CS (subroutine-cs.cc) - an interactive educational blog covering algorithms, low-level systems optimization, C++, neural networks, and computer architecture.
Educational Articles
Written in MDX with embedded audio-visual simulators
The Crank-Nicolson Method: Unconditionally Stable PDE Integration
Solving parabolic partial differential equations with second-order temporal accuracy, implicit finite-difference discretization, and tridiagonal matrix solvers.
eBPF & XDP: Programmable Line-Rate Packet Processing in the Linux Kernel
How eBPF and eXpress Data Path (XDP) execute sandboxed bytecode directly in the network driver layer, bypassing sk_buff allocation for 100Gbps packet filtering.
The EVM Execution Pipeline: Stack Mechanics, Gas Scheduling & Transient Storage
How the Ethereum Virtual Machine executes 256-bit word bytecode, dynamically calculates gas costs, manages persistent vs transient storage (EIP-1153), and enforces reentrancy protection.
PagedAttention & KV-Cache Management in High-Throughput LLM Serving
Eliminating GPU memory fragmentation in large language model inference using virtual memory paging principles, non-contiguous block tables, and copy-on-write.
Post-Quantum Cryptography: Lattice-Based Key Encapsulation with ML-KEM
Transitioning public-key infrastructure away from RSA and elliptic curves toward NIST FIPS 203 Module-LWE lattices to protect against future quantum adversaries.
QUIC and HTTP/3: Eliminating Head-of-Line Blocking Over UDP
Why multi-stream TCP connections stall on single-packet drops, and how QUIC moves transport layer flow control into userspace with per-stream loss isolation and 0-RTT.
Rust Pin and Unpin: Self-Referential Structs & Async State Machines
Deconstructing why compiler-generated async futures require memory pinning, how pointer movement invalidates self-references, and the safety contract of Pin.
Solana Sealevel: Parallel Transaction Scheduling & Account-Based Execution
How Solana overcomes single-threaded blockchain bottlenecks via explicit account read/write declarations, non-overlapping DAG scheduling across multi-core CPUs, and eBPF bytecode JIT compilation.
Featured Interactive Visualizer
Live Web Audio API & HTML5 Canvas Simulation
Quick Sort
Avg: O(N log N)Space: O(log N)Picks a pivot element and partitions the surrounding array into elements smaller and larger than the pivot recursively.
template <typename T>
int partition(std::vector<T>& arr, int low, int high) {
T pivot = arr[high];
int i = low - 1;
for (int j = low; j < high; j++) {
if (arr[j] < pivot) {
i++;
std::swap(arr[i], arr[j]);
}
}
std::swap(arr[i + 1], arr[high]);
return i + 1;
}
template <typename T>
void quickSort(std::vector<T>& arr, int low, int high) {
if (low < high) {
int p = partition(arr, low, high);
quickSort(arr, low, p - 1);
quickSort(arr, p + 1, high);
}
}