- Create project directory structure
- Initialize git repository
- Create basic CMakeLists.txt
- Set up src/ directory with placeholder files
- Implement aligned_alloc.hpp with platform-independent aligned allocation
- Support for cache-line alignment (typically 64-byte)
- Handle allocation failures gracefully
- Updated aligned_alloc to return nullptr on failure (no exceptions)
- Provide aligned free function
- Implement templated Copy kernel in benchmark.hpp
- Implement templated Scale kernel in benchmark.hpp
- Implement templated Add kernel in benchmark.hpp
- Implement templated Triad kernel in benchmark.hpp
- Add optional SIMD vectorization support
- Ensure numerical correctness of operations
- Implement command-line argument parsing in main.cpp
- Support options: -s/--size, -n/--iters, -t/--type, -S/--simd, -R/--randomrw, -h/--help
- Implement benchmark execution loop with timing
- Calculate and format bandwidth results
- Output results in CSV-friendly format
- Update medium test to only use 256 MiB size (excludes 1024 MiB stress test)
- Update quick test to only use 64 MiB size (smaller, faster execution)
- Ensure CUDA/RoCm/SQLite/JSON are opt-in only, never default in documentation
- Platform identification only shown when -P flag is called or as header before tests
- Platform identification must contain: Architecture, Platform name, RAM size, Core count
- Add global Makefile to simplify build/test commands
- Configure CMakeLists.txt for C++17 and Release optimizations
- Add GitHub Actions workflow (.github/workflows/ci.yml)
- Install required dependencies in CI jobs (CMake, compilers)
- Run unit tests (ctest) in CI and verify execution
- Add status badge to README.md
- Add CLI parameters for running test suites
-R, --run-apu- Run APU system identifier collection-N, --run-npu- Run NPU benchmark--run-npu-suite- Run NPU benchmark suite (all precision/operation combinations)-M, --run-medium-test- Run only default test subset (excludes 1024 MiB stress test)
- Migrate build system from bash scripts to comprehensive Makefile
- Removed build.sh script
- Added full Makefile with build, test, lint, benchmark targets
- Supports debug/release/simd build modes
- Includes dedicated targets for APU/NPU benchmarks
- Provides custom benchmark configuration (SIZE=, ITERS=, TYPE=)
- Build and test on Linux/macOS/Windows
- Validate output format matches specification
- Add long-running CTest (1024 MiB) to ensure cache exhaustion
- Add CMake support for PowerPC32/64 and i386 Linux
- Provide toolchain files (toolchain-ppc32.cmake, etc.)
- Implement posox_memalign fallback in aligned_alloc.hpp
- Guard SIMD flags (-maltivec for PPC, -msse2 for i386)
- Update README.md with Legacy Support section
- Add GPU memory bandwidth benchmark (CUDA/OpenCL)
- Implement ALU intensive kernels (Integer/FP stress)
- Implement SSD I/O tests (Sequential/Random, 1kB-4kB blocks)
- Update main.cpp and documentation for GPU/ALU/SSD flags
- Add APU (AMD Strix Point/Halo) support for memory bandwidth benchmarking
- Add NPU (Neural Processing Unit) benchmark tests
- Add APU system identifier collection to implementation plan
- Complete benchmark-spec.md and architecture-spec.md
- Update README.md with clear usage and Legacy Support sections
- Define system identifier collection (CPU model, memory size/type)
- Created specs/system-identifier-spec.md with full specification
- Implemented SystemInfo class in src/system_info.cpp
- Platform: Linux/macOS/Windows detection
- Compiler version detection
- System ID hash generation
- Add functionality to persist benchmark runs
- Created CSV persistence mechanism in src/csv_output.hpp/cpp
- Added CSVOutput class to append results to files
- CSV format includes timestamp, system_id, kernel, size, type, bandwidth, latency
- Created JSON output implementation in src/json_output.hpp/cpp
- Active ToDos:
- SQLiteOutput class implemented in src/sqlite_output.hpp/cpp
- SQLite schema documented (systems + benchmarks tables with indexes)
- SQLite output integrated into main benchmark execution flow (run_sqlite_output called after memory benchmarks)
- Verified timestamp roundtrip: sqlite_output writes
"%Y-%m-%d %H:%M:%S", sqlite_input reads it correctly - Removed dead code: main.cpp:492-493
br.timestampassignment (sqlite_output ignores it, uses ownnow()) - Removed redundant
#define ENABLE_SQLITEfrom top of sqlite_output.cpp and sqlite_input.cpp - Fixed CMake bug: test_sqlite_output and test_sqlite_input were missing
ENABLE_SQLITEcompile definition — tests compiled but GoogleTest never ran due to#ifdef ENABLE_SQLITEguards - Populate systems table with real values (core_count, memory_size_mb, platform currently hardcoded to 0/"") — pass through
SystemInfo::collect()viarun_sqlite_output() - Add transaction wrapping to SQLiteOutput::append() for bulk writes
- Add thread-safety (mutex) to SQLite I/O for concurrent benchmark runs
- Proper CSV quoting in csv_output and SQLiteInput::export_csv()
- Proper JSON escaping in SQLiteInput::export_json() (currently raw string concatenation)
- Complete platform detection implementation
- Updated specs/architecture-spec.md with platform detection logic
- Implement runtime platform detection in src/platform_detection.hpp
- Three-level detection architecture:
- Compile-time: CPU ISA determination via compiler macros
- CPU-level (Runtime): Manufacturer detection via
/proc/cpuinfoor system files - PCIe-level (Runtime): Hardware enumeration via
/sys/filesystem
- Three-level detection architecture:
- Implement hardware vendor detection
- AMD GPU/NPU detection (PCIe vendor ID 0x1002)
- NVIDIA GPU detection (PCIe vendor ID 0x10de)
- Intel GPU/iGPU detection (PCIe vendor ID 0x8086)
- ARM vendor detection (PCIe vendor ID 0x13b5)
- Add PCIe scan functionality
- Scan
/sys/bus/pci/devicesfor accelerators - Filter Display/3D controllers (Class 03xxxx)
- Extract vendor, device, and class IDs
- Scan
- Create platform-specific detection implementations
- Linux:
/sysfilesystem scanning - IMPLEMENTED - macOS: CoreFoundation/IOKit sysctl calls - IMPLEMENTED
- macOS: PCI enumeration via IOKit device tree - IMPLEMENTED
- Windows: CPU vendor detection via
__cpuidintrinsic - IMPLEMENTED - Windows: PCI scanning - returns empty (future: WMI/SetupAPI)
- Linux:
| Platform | Architecture | CPU Detection | PCI Enumeration | Platform String | Status |
|---|---|---|---|---|---|
| Linux | x86_64 | /proc/cpuinfo vendor_id" |
/sys/bus/pci/devices |
x86_64-linux |
Complete |
| Linux | aarch64 | /proc/cpuinfo vendor_id" |
/sys/bus/pci/devices |
aarch64-linux |
Complete |
| macOS | x86_64 | sysctlbyname("machdep.cpu.vendor") |
IOKit device tree | x86_64-macos |
Complete |
| macOS | aarch64 | sysctlbyname("machdep.cpu.vendor") |
IOKit device tree | arm64-macos |
Complete |
| Windows | x86_64 | __cpuid intrinsic |
WMI + SetupAPI fallback | x86_64-windows |
Complete |
| Windows | aarch64 | __cpuid intrinsic |
WMI + SetupAPI fallback | arm64-windows |
Complete |
Note: Platform detection order bug (architecture checked before OS) has been FIXED in both system_info.cpp and apu_identifier.hpp. OS is now checked first, then architecture.
- Test platform detection on real Windows/macOS hardware
- Cross-platform CI testing for Windows/macOS detection paths (platform-independent test coverage)
- Platform Identification should ONLY be shown when called with "-P" flag OR as a header line before tests
- Platform Identification must contain: Architecture (arm64/x86_64), Platform name, RAM size (total system memory), Core count
- Add
-P, --show-platformflag to display platform info and exit immediately - Platform header displayed at start of benchmark runs (before kernel execution)
- Platform info includes: CPU architecture, OS name/version, total memory MB, core count
detect_platform()insystem_info.cppanddetect_apu_platform()inapu_identifier.hppnow use OS-first ordering- macOS correctly returns
arm64-macosorx86_64-macos
detect_platform()now checks_WIN32before architecture, with nested__aarch64__/_M_ARM64check- Windows ARM64 correctly returns
arm64-windows
- Detection now prioritizes OS detection (
__APPLE__,_WIN32,__linux__) before architecture
Issue: scan_pci_macos() in platform_detection.cpp returns empty vector
- Current: Returns empty
std::vector<HardwareDeviceInfo>() - Expected: Use IOKit or
system_profiler SPHardwareDataTypeto enumerate devices
| Platform | CPU Detection | PCI Enumeration | Platform String | Notes |
|---|---|---|---|---|
| Linux | /proc/cpuinfo vendor_id |
/sys/bus/pci/devices full scan |
x86_64-linux, aarch64-linux |
Complete, functional |
| macOS | sysctlbyname("machdep.cpu.vendor") |
IOKit IOPCIDevice service tree |
x86_64-macos, arm64-macos |
CPU detection works; PCI populates vendor_id from device tree |
| Windows | __cpuid intrinsic |
Empty stub (returns []{}) |
x86_64-windows, arm64-windows |
CPU detection functional; PCI needs WMI/SetupAPI (low priority) |
| Cross-platform | — | — | Fallback: unknown-unknown |
ARM returns "ARM 64-bit CPU" with no actual model |
- macOS PCI scan: Uses IOKit but only populates
vendor_idfromCFDatabytes;vendorstring may be empty - Windows PCI scan: Returns empty vector — needs WMI/SetupAPI for real enumeration (low priority)
- Windows system_info:
detect_cpu_model(),detect_memory_size(),detect_os()only have__linux__/__APPLE__guards — no Windows implementation - ARM CPU model:
detect_cpu_model()returns literal"ARM 64-bit CPU"with no actual model identification - simd_enabled: Hardcoded to
trueinSystemIdentifierregardless of compile-time or runtime availability
- Enhanced
run_platform_detection()function insrc/main.cppwith comprehensive system reporting - Show Architecture (arm64/x86_64) - IMPLEMENTED
- Show OS name and version - IMPLEMENTED
- Show Memory size (total system memory in MB) - IMPLEMENTED
- Show CPU model - IMPLEMENTED
- Show CPU core count - IMPLEMENTED
- Show Platform string - IMPLEMENTED
- Update
PlatformInfostruct to include architecture, OS, memory fields - IMPLEMENTED - Platform detection output only shown with
-Pflag or as header before test execution - IMPLEMENTED
- Add
--quick-test/-Qflag for short/quick test mode- Updated to use 64 MiB, 5 iterations (faster execution)
- Add
--show-platform/-Pflag for platform identification display - Update medium test: only 256 MiB size (excludes 1024 MiB stress test)
- Document new flags in README.md
- Test quick test mode across all platforms
- Add quick test to CI build matrix (fast turnaround)
-
Multi-threaded kernel implementations (OpenMP / std::thread) - IMPLEMENTED (std::thread + std::async)
-
Additional STREAM kernels (Scale, Add) with vectorization - ALREADY IN benchmark.hpp
-
Non-temporal (streaming) store implementations - IMPLEMENTED in benchmark.hpp
-
JSON output format (additional to CSV and text) - IMPLEMENTED in json_output.hpp/cpp
-
SQLite backend for structured benchmark queries and indexing - IMPLEMENTED (sqlite_output + sqlite_input)
-
--list-benchmarks CLI flag - IMPLEMENTED (gated behind ENABLE_SQLITE)
-
--search CLI flag - IMPLEMENTED (gated behind ENABLE_SQLITE)
-
--export-db CLI flag - IMPLEMENTED (gated behind ENABLE_SQLITE)
-
Automated graph generation from persistent CSV data - NOT YET IMPLEMENTED
-
Diff comparison tool for benchmark regression detection - NOT YET IMPLEMENTED
-
Remote storage integration for collaborative benchmarking - NOT YET IMPLEMENTED
- Non-temporal (streaming) store implementations for systems that support them
- SQLite backend fully implemented (read + write + CLI integration)
- Removed dead br.timestamp code in main.cpp
- Fixed CMake ENABLE_SQLITE definition for test targets (tests were silently not running)
- Verified timestamp roundtrip works correctly
- Automated graph generation from persistent CSV data
- Diff comparison tool for benchmark regression detection
- Remote storage integration for collaborative benchmarking
- Fix timestamp format mismatch: sqlite_output writes
"%Y-%m-%d %H:%M:%S"but sqlite_input reads as milliseconds epoch - Populate systems table with real values (core_count, memory_size_mb, platform are hardcoded to 0/"")
- Add thread-safety (mutex) to SQLite I/O for concurrent benchmark runs
- Add CSV/JSON escaping for string fields containing special characters
- CSV output already implemented in
src/csv_output.hpp/cpp - JSON output already implemented in
src/json_output.hpp/cpp - System identifier collection in
src/system_info.cpp - SQLite3 support enabled via CMake flag
ENABLE_SQLITE_OUTPUT
-
--list-benchmarks- IMPLEMENTED: Lists all benchmark runs filtered by system ID, date range, kernel type, sorted by timestamp DESC -
--search <pattern>- IMPLEMENTED: Search by system_id, kernel, cpu_model, os_name (LIKE query) -
--export-db <format> <output>- IMPLEMENTED: Exports to csv or json-
--export-db csv output.csv -
--export-db json output.json - Proper CSV quoting for fields containing commas/special characters
- Proper JSON escaping for string fields (quotes, backslashes)
-
CREATE TABLE benchmarks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp TEXT NOT NULL,
system_id TEXT NOT NULL,
kernel TEXT NOT NULL,
size_mib INTEGER NOT NULL,
data_type TEXT NOT NULL,
iterations INTEGER NOT NULL,
bandwidth_gb_s REAL NOT NULL,
time_seconds REAL NOT NULL,
bytes_per_iter INTEGER NOT NULL,
cpu_model TEXT,
os_name TEXT,
os_version TEXT,
FOREIGN KEY (system_id) REFERENCES systems(system_id)
);
CREATE TABLE systems (
system_id TEXT PRIMARY KEY,
cpu_model TEXT,
core_count INTEGER,
memory_size_mb INTEGER,
os_name TEXT,
os_version TEXT,
platform TEXT,
created_at TEXT NOT NULL
);
CREATE INDEX idx_timestamp ON benchmarks(timestamp);
CREATE INDEX idx_system_id ON benchmarks(system_id);
CREATE INDEX idx_kernel ON benchmarks(kernel);Note: Schema is fully implemented in sqlite_output.cpp::initialize_schema(). Indexes match spec. created_at is set via strftime('%Y-%m-%d %H:%M:%S', 'now').
- Create
src/sqlite_output.hppwithSQLiteOutputclass - Implement
src/sqlite_output.cppwith:- Database initialization and connection management
- Schema creation (systems + benchmarks tables)
- Insert benchmark results with system info
- Query methods for listing/searching
- Create
src/sqlite_input.hppwithSQLiteInputclass for reading - Implement
src/sqlite_input.cppwith:- Database connection and query execution
- Result set parsing into
BenchmarkResultstructs - Filter methods:
query_by_system_id(),query_by_kernel(),query_by_date_range() - Search:
search(pattern)with LIKE across multiple fields - Export:
export_csv(),export_json()
- Add database path option to
Optionsstruct (default:~/.mem_band/benchmarks.db) - Implement
--list-benchmarksflag inmain.cpp - Implement
--searchflag with pattern matching - Implement
--export-dbflag for format conversion - Update
print_usage()to document new database commands - Handle SQLite compilation with
#ifdef ENABLE_SQLITE - Document SQLite schema for persistent storage (update specs/ to match actual schema)
- Add database version/migration column for schema evolution
- Add
DELETEcommand to clear old records
- Stub values:
core_countandmemory_size_mbinensure_system_exists()are hardcoded to0;platformis""— realSystemInfovalues never passed- Fix needed: Pass real
SystemInfo::collect()values throughrun_sqlite_output()to populate systems table
- Fix needed: Pass real
- No transaction wrapping:
append()does one INSERT at a time; needsBEGIN/COMMITfor bulk writes - No thread-safety: No mutex around
sqlite3_stmtoperations for concurrent benchmark runs - No JSON escaping:
export_json()uses raw string concatenation — quotes/backslashes incpu_modelorsystem_idproduce malformed JSON - No CSV quoting:
export_csv()andcsv_outputdon't quote fields containing commas
# List all benchmarks
./mem_band --list-benchmarks
# List Copy kernel results only
./mem_band --list-benchmarks --kernel Copy
# Search by system ID
./mem_band --search "ab12cd"
# Search by kernel name
./mem_band --search "kernel:Triad"
# Export to CSV
./mem_band --export-db csv results.csv
# Export specific query to JSON
./mem_band --search "size>512" --export-db json large_results.json- Add
tests/test_sqlite_output.cppfor SQLite persistence tests (106 lines) - Add
tests/test_sqlite_input.cppfor SQLite query tests (153 lines) - Add tests for timestamp format consistency (write vs read)
- Add tests for CSV quoting and JSON escaping edge cases
- Update
README.mdwith new database CLI commands
-
High Priority (IMPLEMENTED, bugs remain):
- SQLite output class implementation ✅
- SQLite input class implementation ✅
- Database schema design ✅
--list-benchmarkscommand ✅--searchcommand ✅--export-dbcommand ✅- Populate systems table with real SystemInfo values (core_count, memory_size_mb, platform hardcoded to 0/"")
-
Medium Priority:
- Add transaction wrapping for bulk writes
- Add thread-safety (mutex) to SQLite I/O
- Proper CSV/JSON escaping for export functions
- Database version/migration support
- Add DELETE/clear-records functionality
-
Low Priority:
- Advanced filtering/sorting
- Remote storage integration
- Graph generation from database
- Database spec document (
specs/database-spec.md)
- Modular dependency system complete
- Created specs/dependencies-spec.md with full dependency documentation
- Defined core vs optional dependencies
- Documented graceful degradation patterns
- Created dependency matrix for all features
- Restructured CMakeLists.txt with modular dependency support
- Added CMake options for all optional dependencies:
- ENABLE_SIMD (AVX2/SSE2/Altivec)
- ENABLE_CUDA (NVIDIA GPU benchmarking)
- ENABLE_ROCM (AMD GPU benchmarking)
- ENABLE_JSON_OUTPUT (JSON serialization)
- ENABLE_SQLITE_OUTPUT (SQLite persistent storage)
- Implemented feature detection:
- CMake find_package for CUDA, ROCm, SQLite3
- Automatic capability checking with CHECK_FEATURES
- Conditional message display
- Created separate executables for optional features:
- mem_band (core, no dependencies)
- mem_band_cuda (CUDA/GPU only, when available)
- mem_band_rocm (ROCm/AMD only, when available)
- Core executable builds with zero external dependencies
- Test executables use GoogleTest via FetchContent (build-time only)
- GPU executables conditionally built based on CUDA/ROCm availability
- Graceful runtime degradation when optional features unavailable
- Platform-specific dependencies isolated (Linux /sys, Windows WMI, macOS IOKit)
- CUDA, RoCm, SQLite, JSON output are all opt-in features (disabled by default)
- Build scripts and Makefile reflect opt-in nature of optional dependencies
- Documentation updated to show optional features require explicit flags
- Default build produces minimal, portable
mem_bandexecutable
- Implement dynamic library loading (dlopen/LoadLibrary) for truly optional features
- Runtime capability discovery and feature flags
- Clear warning messages when optional features unavailable
- Documentation of permission requirements (e.g., Linux /sys access)
- Created specs/permission-spec.md with full permission requirements
- Core benchmark requires no special permissions
- Platform detection: Linux /sys (optional video/dmi groups), Windows WMI, macOS sysctl
- Optional features: CUDA, ROCm, SSD I/O all work with standard user privileges
- Permission troubleshooting guide included
- Document default build (no dependencies)
- Document full build (all optional features)
- Document minimal build (core only, no tests)
- Add build troubleshooting guide (AGENTS.md Build Troubleshooting section)
- Document CI build matrix for different dependency configurations (AGENTS.md CI Build Matrix)
Add CLI flags to generate ASCII diagrams showing CPU/Memory/PCIe device layout for different system architectures.
- Add
-L, --system-layoutflag to display system layout- Current: System layout is accessed via
info layoutsubcommand (not-L/--system-layoutflag) - The
Options::system_layoutfield exists but is never populated by the argument parser (dead code)
- Current: System layout is accessed via
- Support layout output formats:
-
text(default) - ASCII diagram with box-drawing characters —TextFormatter -
mermaid- Mermaid.jsflowchart TD—MermaidFormatter(has bugs: duplicate CPU node output, hardcoded connections) -
json- Structured layout data —JSONFormatter(no metadata escaping) -
--layout-typeflag for manual archetype override (not implemented) -
--update-layoutflag for layout refresh (not implemented) -
--run-benchmarkflag for post-layout execution (not implemented)
-
- CPU Cluster: CPU model, core count, L3 cache — populated from
SystemInfo::collect() - Memory subsystem: Total memory (MB), channel count — populated from
SystemInfo::collect() - PCIe devices: Vendor/device IDs, device type (GPU/NPU/Unknown) — populated from
PlatformDetection::detect()- PCIe slot/bandwidth information (not collected by platform detection)
- Link generation/speed (not collected by platform detection)
┌─────────────────────────────────────────────────────────────┐
│ NVIDIA GB10 (Grace+Blackwell) │
│ Coherent ARM Architecture │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ │
│ │ Grace H5 │───────────────┐ │
│ │ ARM CPU │ NVLink-C2C │ │
│ │ 72-core │ (800 GB/s) │ │
│ └─────────────┘ │ │
│ │ │
│ ┌─────────────┐ │ │
│ │ Blackwell H1 │──────────────┘ │
│ │ GPU │ │
│ │ 144-warps │ │
│ │ LPDDR5X │←───────1 TB/s (unified memory)───────────┤
│ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ AMD Strix Halo │
│ Shared x86 Architecture │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Zen 5 │────│ Shared │────│ RDNA 3.5 │ │
│ │ CPU │ │ MIPI │ │ iGPU │ │
│ │ 16-core │ │ Interconnect│ │ Graphics │ │
│ │ L3 Cache │ │ (400 GB/s) │ │ (12 CU) │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │
│ ┌─────────────┐ │ │
│ │ PCIe Gen5 │ │ │
│ │ Slots │ │ │
│ │ (x16) │ │ │
│ └─────────────┘ │ │
│ │ │
│ ┌─────────────┐ │ │
│ │ LPDDR5X │←─────500 GB/s (shared memory)────────────┤
│ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ NVIDIA RTX 3090 │
│ Discrete x86 Architecture │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ x86 Host │◄────────►│ RTX 3090 │ │
│ │ CPU │ PCIe │ GPU │ │
│ │ 8+Core │ Gen4 │ Ampere │ │
│ │ │ (32 GB/s)│ 829 CUDA │ │
│ └─────────────┘ │ 24GB GDDR6X│ │
│ │ 384-bit │←──936 GB/s───────┤
│ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Apple Mac Studio │
│ Unified ARM Architecture │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────┐ │
│ │ M-Series Ultra/Max │ │
│ │ (SoC) │ │
│ │ │ │
│ │ ┌─────────┐ ┌───────┐ ┌──────────────┐ │ │
│ │ │ CPU │──│Memory │──│ GPU │ │ │
│ │ │ 12-24 │ │Unified│ │ 24-40 │ │ │
│ │ │ cores │ │ 80-128│ │ cores │ │ │
│ │ │ │ │ GB/s │ │ │ │ │
│ │ └─────────┘ └───────┘ └──────────────┘ │ │
│ │ │ │
│ │ ┌─────────┐ ┌───────┐ ┌──────────────┐ │ │
│ │ │ NPU │──│ │──│ Media │ │ │
│ │ │ 16-core│ │ │ │ Engine │ │ │
│ │ └─────────┘ │ │ └──────────────┘ │ │
│ │ │ │ │ │
│ │ └───────┘ │ │
│ │ │ │
│ │ ┌─────────────┐ │ │
│ │ │ PCIe/USB │ │ │
│ │ │ controllers│ │ │
│ │ └─────────────┘ │ │
│ └─────────────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────────┼─────────────────────────────┤
│ │ LPDDR5 │ ~800 GB/s │
│ └──────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
- Create
src/layout_builder.hppwith layout data structures-
SystemNode(struct) - CPU/Memory/PCIe nodes with type/name/metadata map -
CPUNode- No separate class;SystemNodewith type="cpu" plus metadata (model, cores, l3_cache) -
MemoryNode- No separate class;SystemNodewith type="memory" plus metadata (size_mb, channels) -
PCIEDeviceNode- No separate class;SystemNodewith type="pcie_device" plus metadata (vendor, device_type) -
Connection(struct) - Link between nodes with type/bandwidth_gb_s - Connection struct missing from_idx/to_idx — formatters cannot render correct edges (hardcoded to node0->node1)
-
- Implement
src/layout_builder.cpp:- Build CPU cluster from
SystemInfo(cores, cache) - Build memory layout from
SystemInfo(size, channels) - Build PCIe device tree from
PlatformDetectionresults - Connect nodes based on interconnect type (NVLink, PCIe, etc.) — NOT implemented; connections use hardcoded node indices, not actual interconnect detection
- Build CPU cluster from
- Implement text formatter (ASCII box-drawing diagrams) —
TextFormatter - Implement Mermaid.js formatter (for documentation) —
MermaidFormatter- Bug: Duplicates CPU node labels (two lines per CPU instead of one)
- Bug: All connections hardcoded to
node0 --> node1regardless of actual indices - [x ] Connection edge rendering
- Implement JSON formatter (for programmatic use) —
JSONFormatter- Bug: No escaping of metadata strings (quotes/backslashes break JSON)
- Node metadata serialization
- Connection serialization (no from/to indices included)
-
-L, --system-layoutflag — NOT implemented. Current access is viainfo layoutsubcommand only. - Detect runtime environment to determine default layout type:
- Linux with NVIDIA GPU → Show GB10-style layout (if detected)
- Linux with AMD GPU/NPU → Show Strix Halo-style layout
- macOS → Show Mac Studio-style layout
- Windows with discrete GPU → Show RTX 3090-style layout
- Allow manual layout override with
--layout-type <type>flag:-
gb10,strix,rtx3090,macstudio,generic
-
- Support layout update mode with
--update-layoutflag (re-scan hardware) - Implement layout cache for faster subsequent runs
- Show layout preview before benchmark selection (interactive mode)
- Layout is wired into
info layoutsubcommand in main.cpp (lines 640-680)
- Enhance
platform_detection.hppwith layout-relevant methods:-
GetInterconnectType()- Returns NVLink/PCIe/InternalBus/None -
GetMemoryTopology()- Returns unified/shared/discrete -
GetPCIeBandwidth()- Returns PCIe generation x lanes
-
- Auto-detect system archetype from hardware:
- Check CPU vendor + GPU vendor combination
- Check interconnect presence (NVLink, internal bus)
- Map to known archetypes (GB10, Strix, RTX 3090, Mac Studio)
- Add automatic archetype selection based on runtime detection
- Build layout dynamically from system info + platform detection
- Support partial layouts (e.g., missing GPU info)
- Add layout validation (consistency checks for connectivity)
- Detect interconnect type (NVLink, PCIe, internal bus)
- Extract PCIe link generation (Gen1-Gen6)
- Extract memory channel count and bandwidth
- Handle ARM vs x86 platform differences
- Add
-L, --system-layoutflag toOptionsstruct (currently dead code — field exists but never set by parser) - Add
--layout-formatsubflag for output format selection (text/mermaid/json) — WORKS viainfo layoutsubcommand - Add
--layout-typemanual override flag - Add
--update-layoutfor layout refresh - Update
print_usage()with layout-related options (documented underinfo layout) - Support
--run-benchmarkflag for post-layout execution - Handle layout display and benchmark execution flow (currently
info layoutdoes NOT run benchmarks after)
- Add
tests/test_layout_builder.cppfor unit tests (10 tests)- Test layout generation on different hardware configurations
- Test text, mermaid, and json formatters
- Test empty layout
- Test connection indexing in formatters (currently not tested due to bug)
- Fix layout caching behavior (caching not implemented yet)
- Add
tests/test_layout_cli.cppfor CLI parsing tests (12 tests)- Note: Test file defines its own
struct Optionsandparse_args()— duplicates main.cpp parsing logic. If main.cpp parser changes, the test stays stale.
- Note: Test file defines its own
- Update README.md with new layout CLI documentation (via
info layout) - Add examples showing layout output for different platforms
- Document Mermaid output for documentation generation
- Document system layout workflow (currently only documented under
infosubcommands)- Add system archetype identification guide
- Document known formatter bugs (duplicate CPU nodes in Mermaid, hardcoded connections)
-
High Priority:
- Layout data structures and core builder class ✅ IMPLEMENTED
- Text-based ASCII output format ✅ IMPLEMENTED
- Mermaid.js output ✅ IMPLEMENTED (with bugs to fix)
- JSON output ✅ IMPLEMENTED (with escaping issues)
- CLI wired into
info layoutsubcommand ✅ IMPLEMENTED - Fix Mermaid formatter: duplicate CPU nodes and hardcoded connections
- Add
from_idx/to_idxtoConnectionstruct
-
Medium Priority:
- Runtime environment detection for automatic layout selection
- Interconnect detection (
GetInterconnectType(),GetPCIeBandwidth()) - Automatic archetype detection from hardware
- Layout caching for performance
--layout-typemanual override- Add standalone
-L, --system-layoutflag (in addition toinfo layout)
-
Low Priority:
- Layout comparison/diff functionality
- Interactive layout exploration tools
- PCIe link generation detection
- Advanced layout customization options
- Enhance
run_platform_detection()insrc/main.cppto show comprehensive system information - DONE - Add Architecture field to platform detection output (arm64/x86_64) - DONE
- Add OS name and version to platform detection output - DONE
- Add Memory size (total system memory) to platform detection output - DONE
- Add CPU model details to platform detection output - DONE
- Show Architecture, Platform, RAM size, Core count in platform output - DONE
- Platform identification only shown with
-Pflag or as header before tests - DONE - Platform header displayed before benchmark execution - DONE
- Add Windows-specific detection for
detect_cpu_model(),detect_memory_size(),detect_os()in system_info.cpp - Fix
simd_enabledhardcoded totrue— should reflect actual compile-time SIMD availability - Fix ARM
detect_cpu_model()to return actual model (e.g.,sysctlon macOS,/proc/cpuinfoon Linux)
- Medium test subset uses only 256 MiB size (excludes 1024 MiB stress test)
- Updated
-M, --run-medium-testflag to use 256 MiB default - Maintains correct iteration counts for stable measurements
- Quick test uses only 64 MiB size (faster execution)
- Reduces iteration count to 5 for rapid validation
- Updated
-Q, --quick-testflag to use 64 MiB / 5 iterations
- CUDA feature is opt-in only (requires
-DENABLE_CUDA=ON) - RoCm feature is opt-in only (requires
-DENABLE_ROCM=ON) - SQLite output is opt-in only (requires
-DENABLE_SQLITE_OUTPUT=ON) - JSON output is opt-in only (requires
-DENABLE_JSON_OUTPUT=ON) - All optional features documented as requiring explicit CMake flags
- Default build produces minimal portable
mem_bandexecutable
- Platform identification only displayed when
-P, --show-platformflag is used - Platform identification also shown as header line before benchmark execution
- Platform output includes:
- Architecture (arm64/x86_64)
- Platform name (e.g., "NVIDIA DGX Spark", "AMD Strix Halo", "Apple Mac Studio")
- RAM size (total system memory in MB)
- Core count (CPUlogical cores)
- Platform identification exits immediately after display (no benchmark execution)
- All test configuration changes completed
- All build configuration updates completed
- All platform identification requirements completed
- README.md updated with correct defaults and opt-in flags
- Hardcoded paths: CMakeLists.txt lines 56-59 use
/home/philipp/sqlite_includeand/home/philipp/sqlite_lib— should be removed - test_gpu extension mismatch: CMakeLists.txt references
tests/test_gpu.cppbut file istests/test_gpu.cu— won't build - test_system_info not registered:
tests/test_system_info.cppexists but has noadd_executableoradd_testin CMakeLists.txt - Missing
specs/database-spec.md: Referenced in plan but not created - Removed redundant
#define ENABLE_SQLITEfrom top of sqlite_output.cpp and sqlite_input.cpp — CMake already defines via-DENABLE_SQLITE - Fixed CMake bug: test_sqlite_output and test_sqlite_input now have
target_compile_definitions(... ENABLE_SQLITE)— tests were silently not running -
output_formatfield is dead code:Options::output_formatis parsed and validated butmain()never uses it — benchmark output is always printed as text -
Options::system_layoutfield is dead code: Declared but never set by argument parser
- Add MLX (Apple Metal Learning Exchange) as supported runtime for macOS
- MLX provides GPU acceleration for Apple Silicon (M-Series) via Metal
- Supports FP32/FP16/BF16 precision modes
- Integrates with Apple GPU via Metal framework
- Create
src/mlx_benchmark.hppwith MLX kernel implementations - Add MLX matrix operations (MatMul, Conv2D, Softmax)
- Support MLX array API for unified memory management
- Add MLX device detection (GPU name, memory, compute units)
- Implement MLX benchmark execution with timing metrics
- Add
ENABLE_MLXCMake flag (default: OFF) - Detect MLX installation via
pkg-configor find_package - Conditional compilation with
#ifdef ENABLE_MLX - Graceful degradation when MLX unavailable
- Add
--run-mlxflag for MLX benchmark execution - Add
--mlx-dtype <float|half|bfloat>for precision selection - Add
--mlx-op <matmul|conv2d|softmax>for operation selection
- MLX benchmark results with latency, throughput, memory usage
- GPU utilization metrics (if available via MLX)
- Platform-specific performance profiling
- Add
tests/test_mlx.cppfor MLX benchmark verification - Test on Apple Silicon devices (M1/M2/M3 series)
- Verify MLX integration without requiring external dependencies
- Update README.md with MLX support section for macOS
- Document MLX build instructions for Apple Silicon
- Add MLX performance comparison with CPU/GPU benchmarks
Note: MLX is Apple's new machine learning framework that provides efficient GPU acceleration on Apple Silicon. Integration would enable Mac Studio/MacBook benchmarks against NVIDIA/AMD platforms.