A header-only C++20 utility library. Zero external dependencies.
⚠️ Work in progress — APIs are not yet stable.
FAT-P provides containers, concurrency primitives, memory management utilities, serialization, and diagnostic tools as a self-contained, header-only library. Copy include/fat_p/ into your project and go — no build system integration required.
All code, architecture, documentation, and governance in this library were authored by AI systems — primarily Claude (Anthropic), with contributions from ChatGPT, Gemini, and Grok. The human (Matthew Schroeder) provided direction, constraints, and judgment but wrote none of the code.
The library was developed using a multi-AI collaborative pipeline: independent parallel design, cross-review and synthesis, adversarial review, and context reset cycles. The complete methodology is documented in Fat-P AI-Collaborative Development Methodology.
24 components have benchmark suites against 50+ competitor implementations from Boost, Abseil, LLVM, EASTL, and others. Most are competitive; some lead on specific operations, some trail. The data — including where FAT-P loses — is in benchmark_results/.
What this library is not. FAT-P has no installed base, no production deployments, and no history of use under real-world workloads. The benchmarks demonstrate competitive performance in controlled measurement; they do not demonstrate the edge-case resilience that comes from years of bug reports, platform quirks, and adversarial inputs. Libraries like Boost and Abseil have earned trust through decades of deployment across millions of systems. FAT-P has earned nothing yet except clean benchmarks and green CI. Use it with that understanding.
For the full account of who did what, see Authors.md.
- C++20 (GCC 10+, Clang 12+, MSVC 19.29+)
- No external dependencies
cp -r include/fat_p /your/project/include/
Or with CMake:
add_subdirectory(path/to/FatP)
target_link_libraries(your_target PRIVATE fatp)
Per-component tests, benchmarks, and user manuals live under components/. Highlights by area:
| Component | Description |
|---|---|
| SmallVector | Inline-storage vector, zero heap allocation for small sizes |
| FlatMap / FlatSet | Sorted vector-backed associative containers |
FastHashMap (FatPHashMap) |
High-performance open-addressing hash map with policy variants |
| StableHashMap | Hash map with pointer/reference stability on insert |
| CircularBuffer | Fixed-capacity ring buffer with O(1) push/pop |
| IntrusiveList | Intrusive doubly-linked list, zero allocation overhead |
| SlotMap | Generational index container with stable handles |
| SparseSet | Sparse set with dense iteration |
| BitSet | Fixed-size bit set with compiler intrinsics |
| PolicyIterator | Policy-based iterator utilities for container traversal |
| Component | Description |
|---|---|
| ObjectPool | Object pool with concurrency policy support |
| AllocationStrategies | Lightweight allocator policies |
| NumaAllocator | NUMA-aware memory allocator (Linux CI) |
| StringPool | String interning with policy-based thread safety |
| AlignedVector | Cache-aligned vector for HPC workloads |
| HpcVector | NUMA-local, SIMD-ready vector |
| Component | Description |
|---|---|
| ThreadPool | Work-stealing thread pool with priority queues |
| WorkQueue | Sharded lock-free MPMC work queue |
| LockFreeQueue | Lock-free MPMC queue with ABA prevention |
| LockFreeRingBuffer | Lock-free ring buffers (SPSC and MPMC) |
| ConcurrencyPolicies | Thread-safety policy classes for containers |
| RateLimiter | Token bucket and sliding window rate limiters |
| Signal | Signal/slot implementation |
| Component | Description |
|---|---|
| Expected | Monadic error handling (value-or-error type) |
| Enforce | Design-by-contract macros with customizable predicates |
| DiagnosticContext | Thread-local context stack for richer contract failures |
| ScopeGuard / ScopeGuardExpected | RAII scope-exit cleanup (throwing and Expected-based) |
| ContractException | Exception classes for contract violations |
| CheckedArithmetic | Overflow-safe arithmetic for integers and floats |
| EnforcedInit | Wrapper enforcing explicit initialization |
| EnhancedBoundsChecking | Bounds-checking helpers beyond raw indexing |
| Component | Description |
|---|---|
| JsonLite / JsonStreamLite | Standalone JSON (variant model, struct macros, ADL dispatch) |
| FatPJson / FatPJsonStream | Expected-based JSON bridge over JsonLite |
| XmlLite | Standalone XML parser/serializer with struct macros and vector modes |
| CborLite / CborStreamLite | Low-level CBOR encoder/decoder and streaming parser |
| FatPCbor / FatPCborStream | Expected-based CBOR bridge |
| BinaryLite / FatPBinary | Binary serialization (lite and Fat-P integrated) |
| TensorSerializer | Tensor snapshot encoding/decoding |
| Component | Description |
|---|---|
| Tensor | N-dimensional tensor with math, einsum, and serialization |
| CSRMatrix | Compressed Sparse Row matrix with parallel/HPC variants |
| SimdVector | Universal SIMD wrapper for vectorized operations |
| FloatingPointComparison | ULP, relative, and absolute float comparison |
| Jet | Fixed-size forward-mode automatic differentiation scalar |
| Component | Description |
|---|---|
| Skeleton | Typed hierarchical item registry (Bone addresses, capability masks) |
| StateMachine | Type-safe FSM with compile-time transition validation |
| Component | Description |
|---|---|
| DiagnosticLogger | Structured logging with JSON output and scope tracking |
| Stacktrace | Portable stack trace capture |
| Reflection | Compile-time reflection with unified macro syntax |
| EnumPlus | Enhanced enums with string conversion and iteration |
| StrongId | Type-safe ID wrapper preventing cross-domain mixing |
| FeatureManager | Runtime feature flags with compile-time optimization |
| ServiceLocator | Policy-based service locator with scoped overrides |
| IdGenerator | Type-safe unique ID generation with recycling |
| Stringify | Type-to-string conversion using C++20 concepts |
| EqualityAny / EqualityComparisons | Type-erased and typed equality helpers |
| DebugOnly | Debug-only utilities that compile away in release |
| ConstexprUtilities | Compile-time utility functions |
| Concepts / FatPConcepts | C++20 concepts for type constraints |
| PlatformDetection / CppFeatureDetection | Compiler, OS, architecture, and feature detection |
| CacheUtilities | Cache control and prefetching utilities |
| ValueGuard | Temporary value modification with automatic restoration |
| ViewLifetimeTracking | Debug-only lifetime tracking for views and references |
| MemoryMappedFile | Cross-platform memory-mapped file I/O (Linux CI) |
| SlidingFileWindow | Sliding window access to large files (Linux CI) |
| CoroutineTask / AsyncOperations | C++20 coroutine and async utilities with Expected integration |
| Factory | Policy-based factory with compile-time customization |
| Component | Description |
|---|---|
| FatPTest | Zero-dependency test framework |
| FatPBenchmarkRunner | Zero-dependency benchmark infrastructure |
FatP/
├── include/fat_p/ # Library headers
├── components/ # Per-component tests, benchmarks, and docs
├── ThirdParty/ # Vendored headers used by tests and benchmarks
├── benchmark_results/ # Published competitive benchmark analysis
├── Teaching/ # Guides, case studies, and reference material
├── Read_Me/ # Development guidelines and style guides
├── tools/ # Build scripts, CI generators, Desktop sync (see tools/README.md)
└── .github/workflows/ # CI workflows (regenerate with tools/generate_workflows.py)
cmake -B build -DFATP_BUILD_TESTS=ON -DFATP_BUILD_BENCHMARKS=OFF
cmake --build build
ctest --test-dir buildBuild helpers, CI generators, and the commit → push → sync Desktop workflow live under tools/. Regenerate README CI badges with python tools/update_readme_badges.py after adding workflows. See tools/README.md for full documentation.
MIT — see LICENSE.