diff --git a/README.md b/README.md index c014e45..fab24ec 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,20 @@ -# AIEN Sovereign Systems Performance Benchmarks +# AIEN Benchmarks [![License: AGPL-3.0-or-later](https://img.shields.io/badge/License-AGPL--3.0--or--later-blue.svg)](LICENSE) -Empirical performance measurements and active measurement harnesses for the **AIEN Sovereign Agent Architecture** running on the **NVIDIA DGX Spark** (Grace Blackwell GB10, aarch64). +This repository holds AIEN's performance measurements and the tools that take them. Everything is measured on one machine, the NVIDIA DGX Spark (Grace Blackwell GB10, aarch64). -AIEN does not compare itself with other people's systems. Speed is measured against the machine's physical limit, and correctness against our own reference. +An attachment of [Aienix](https://github.com/aien-dev/aienix), the core tree of AIEN. It lives in its own repository and plugs into the core at a boundary. +AIEN does not compare itself with other people's systems. Speed is measured against the machine's physical limit and our own previous run, and correctness against our own reference. -> **Status (23 September 2026, labels updated 12 October 2026):** the figures in the Executive Summary and the Detailed Telemetry sections below are **withdrawn**. They predate the evidence standard adopted in [aien-sovereign-core](https://github.com/aien-spark/aien-sovereign-core#measured-results), have not been regenerated, and stay here only as a historical record. A figure is current only when its artifact bundle carries commit identity, hardware and environment record, exact command, raw samples, SHA-256 digests, measurement definition, and reproducibility steps. The raw files in `data/` are kept as recorded, including service names from before the openclaw-rs to aegis-runtime rename. On 2026-10-15 the Python baseline rows and the Rust-versus-Python like-for-like records were removed from `data/` under the rule above; they remain in git history. +> **Status (2026-10-18):** one evidence-backed result, the [Prime Drag Race campaign of 5 October 2026](prime-drag-race/CAMPAIGN-2026-10-05.md). The older figures further down this page are **withdrawn** and kept only as a historical record. The main measurement harness does not build from a fresh clone yet (see [Before you build](#before-you-build)). The last merged change was on 2026-10-16 (streaming measurement semantics and Spark gates). An evidence-integrity check is proposed in an open pull request and is not on `main`. -> **Current result:** the [Prime Drag Race campaign of 5 October 2026](prime-drag-race/CAMPAIGN-2026-10-05.md) is the evidence-backed measurement in this repository. On the DGX Spark, the native GB10 prime sieve ran at 19,701 passes per second, 20.3x the frozen native baseline, with correctness checked on the chip against our own reference (receipt `1a3eafe9`). +## Current result: Prime Drag Race + +On the DGX Spark, the native GB10 prime sieve ran at 19,701 passes per second, 20.3x the frozen native baseline of 971.48 passes per second, with correctness checked on the chip against our own reference (receipt `1a3eafe9`, recorded in [CAMPAIGN-2026-10-05.md](prime-drag-race/CAMPAIGN-2026-10-05.md) with run files under [prime-drag-race/evidence/](prime-drag-race/evidence)). The fraction of the hardware ceiling for this workload is not measured. + +The frozen contract and suite runner live in [prime-drag-race/](prime-drag-race/CONTRACT.md). The runner is a standalone Rust crate: run `cargo build` inside that directory. --- @@ -22,11 +27,94 @@ AIEN does not compare itself with other people's systems. Speed is measured agai - **Compiler**: rustc 1.98.1 (48a229cea 2026-09-01) - **SIMD / Vector Width**: 128-bit NEON / SVE vector extensions + --- -## Executive Summary (withdrawn: pre-standard figures) +## The measurement harness + +The benchmark repository contains the active measurement harness that produced the withdrawn figures in the historical record below. It is built for the Spark's live service layout, so some steps only produce data where those services run. + +### Before you build + +The main crate (`aien-benchmarks`) has path dependencies on five crates under `../canonical-branch-native-runtime/crates/`: `aien-platform`, `aien-platform-linux`, `aien-kv-cache`, `aien-scheduler` and `aien-inference-abi`. No repository of that name exists in the aien-dev organisation, so a fresh clone does not build (`cargo metadata` fails to load `aien-inference-abi`) until that sibling directory is provided. Crates with the same names are in `aien-sovereign-core` under `crates/`; this repository does not record whether they are the same code. The `prime-drag-race/` crate declares its own workspace and builds on its own. The committed `Cargo.lock` still names `spark-max-rs` and `spark-max-cabi` (the Modular MAX bridge, removed from AIEN on 2026-10-15) only because the sibling copy of `aien-scheduler` it was generated against depended on them; no code in this repository uses them. + +### One-Command Measurement Sweep + +```bash +# Clone the repository +git clone https://github.com/aien-dev/benchmarks.git +cd benchmarks + +# Run the complete live measurement harness (needs the sibling crates above) +cargo run --release -- measure +``` + +By default `measure` writes `data/benchmarks_latest.json` and `assets/*.svg`, overwriting the committed copies. Use `--output-json` and `--output-assets` to write elsewhere. `--skip-standalone` skips steps 2 and 3 below, and `--skip-live` skips the live-service part of step 4. Step 5 measures the one streaming endpoint set by the `--llm-*` flags (see `llm-stream` below; `--skip-llm` skips it) and the embedding service on port 18081. + +### What the Measurement Harness Does Automatically + +1. **System & Environment Discovery**: Probes CPU architecture, unified memory capacity, host operating system kernel (`uname -r`), page size, and compiler version (`rustc --version`). +2. **Ephemeral Microservice Orchestration**: Starts the native compiled Rust standalone server on a dynamic ephemeral port. +3. **Concurrency Stress Testing**: Executes multi-threaded HTTP load sweeps across the standalone server's endpoints (`/api/status`, `/api/query`, `/api/vector`) measuring exact microsecond latency distributions (p50, p95, p99, min, max) and request throughput. +4. **OS Memory Telemetry**: Inspects process Resident Set Size (RSS) directly from `/proc/[pid]/status` (`VmRSS`) across live sovereign background services. +5. **Live Neural Inference Benchmarking**: Streams chat completion requests to one OpenAI-compatible endpoint (default `127.0.0.1:18006`, model `atlas-lightning-omni`, set with the `--llm-*` flags) and reports TTFT, inter-event latency and, only when the backend reports `usage.completion_tokens`, token rates (see "Measurement semantics (current)" above). +6. **SIMD Vector Benchmark**: Runs 100,000 iterations of 768-dimensional vector dot products to measure raw vector throughput and per-operation latency. +7. **Dataset & Asset Regeneration**: Automatically updates the structured JSON dataset (`data/benchmarks_latest.json`) and re-renders SVG charts (`assets/*.svg`). + +### Additional CLI Commands + +```bash +# Print the terminal summary report from existing dataset +cargo run --release -- report + +# Verify all metrics against invariant budgets (RSS budgets and latency thresholds) +cargo run --release -- verify + +# Re-render SVG charts with custom output directory +cargo run --release -- generate --output assets + +# Measure one streaming endpoint and write records/llm_streaming-