Skip to content

Part 9: Optional standalone C kernels

This part contains independent C exercises for data structures, numerical routines, and neural-network kernels. The C units compile into standalone test programs with shared C support from rt.02; Python and Rust implementations remain independent. Cross-language parity uses checked-in files and process protocols.

Course passes: Pass 6 optional practice, with runtime support in rt.02 and rt.03. These modules are not required by the Python or Rust engine paths.

Build contract: c/Makefile produces a static archive for local C use. The harness compiles the declared C units into standalone test executables; SANITIZE=1 enables ASan and UBSan. The rules are in c/ABI.md.

#ModuleChapterKindPass
1rt.02C runtime support and arena allocator with marks (optional)side6
2rt.03Thread pool and tl_parallel_for (optional C)side6
3L9.1Cache-blocked, packed, batch-invariant matmul in C (optional)side6
4L9.2Softmax in C: three-pass and online two-passside6
5L9.3FlashAttention forward in Cside6
6L9.4Paged attention for decode in Cside6
7L9.5Fused int4 and int8 dequantize-matmul in Cside6
8L9.6Elementwise kernels in C: RMSNorm, RoPE, SiLU-mul, embedding, add, argmaxside6