1. SIMD / CPU Math (libs/pl_math.h)
Zero deps + cross-platform: each item below = AVX2 path + NEON path + scalar fallback, gated by #if defined(__AVX2__) / __ARM_NEON / else, plus a microbench across all three. Plan ~2 weekends per item.
2. Benchmarking Infrastructure
No Google Benchmark — homegrown, header-only, in PilotLight style.
3. Profiling & Instrumentation
4. Small Wins (existing TODOs in source)
5. GPU Compute Primitives (new pl_gpu_primitives_ext)
Native Vulkan + Metal compute shaders — no CUDA, no external lib.
6. GPU Compute Features
7. Concurrency / Job System (pl_job_ext)
8. Memory / GPU Allocator (pl_gpu_allocators_ext)
9. Async Compute
References
Books
- Programming Massively Parallel Processors — Hwu, Kirk, Hajj (4th ed) — primary text for sections 5 & 6
- Computer Architecture: A Quantitative Approach — Hennessy & Patterson (7th ed) — Ch. 4 (data-level parallelism)
- Computer Systems: A Programmer's Perspective — Bryant & O'Hallaron (3rd ed) — memory hierarchy + optimization chapters
- Modern Parallel Programming with C++ and Assembly Language — Kusswurm — primary text for section 1
- C++ Concurrency in Action — Williams — primary text for section 7
- Effective Modern C++ — Meyers
Reference manuals
Blogs (technique)
Source to read (read, don't vendor)
- Google Highway (
google/highway) — portable SIMD; teaches AVX + NEON + SVE side-by-side, even though we won't depend on it
- simdjson — exemplary AVX2 + NEON code with both ISA paths
- ggml / llama.cpp — modern perf-critical x86 + ARM, no-deps philosophy similar to PilotLight
- sse2neon — SSE → NEON translation header; reading it teaches ISA equivalences
- CUB / CUTLASS — reference implementations for section 5 primitives (CUDA, read-only)
- Thrust — high-level patterns on CUB
GPU profiling tools (external, used alongside the app)
- Nsight Compute / Nsight Systems (Nvidia)
- Xcode Instruments → GPU trace (Metal)
- RenderDoc — frame capture
Conference talks
- Andreas Fredriksson — "SIMD at Insomniac Games" (CppCon)
- Fedor Pikus — "Branchless Programming in C++" (CppCon)
- Sean Parent — "Better Code: Concurrency"
1. SIMD / CPU Math (
libs/pl_math.h)pl_simd.hheader with shared macros / typedefs (no abstraction layer — just consistent conventions)pl_mat4_mul+ microbench (canonical warmup)pl_mat4_transform(transform N points)pl_mul_quat,pl_norm_quat)2. Benchmarking Infrastructure
clock_gettime/mach_absolute_time/QueryPerformanceCounter)tests/(warmup, repetition, min/median/p99) — build alongside section 13. Profiling & Instrumentation
pl_profile_ext(just a JSON serializer, no dep)pl_profile_ext/pl_stats_extpl_profile_ext(VulkanVK_QUERY_TYPE_TIMESTAMP+ MetalMTLCounterSampleBuffer)4. Small Wins (existing TODOs in source)
pl_ui_widgets.c—FIXME-OPTmarkers (text edit memmove inefficiency)pl_model_loader_ext.c— delete unused entities on unloadpl_renderer_internal.c— optimize the "check all rects" iterationpl_renderer_internal.c— cascade shadow layout wastes spacepl_renderer_internal.c— handle shadow atlas overflow > 40965. GPU Compute Primitives (new
pl_gpu_primitives_ext)6. GPU Compute Features
7. Concurrency / Job System (
pl_job_ext)libs/8. Memory / GPU Allocator (
pl_gpu_allocators_ext)pl_stats_ext9. Async Compute
References
Books
Reference manuals
Blogs (technique)
Source to read (read, don't vendor)
google/highway) — portable SIMD; teaches AVX + NEON + SVE side-by-side, even though we won't depend on itGPU profiling tools (external, used alongside the app)
Conference talks