benchmarks-mv
Measurement harnesses and evidence bundles for AIEN on the NVIDIA DGX Spark GB10. Speed is reported against the machine's physical limit and my own previous run. Attachment of AienOS.
Brought by drakestapleton
GitHub aien-dev/benchmarks-mv#8 (code only)
Apply it
git checkout -b patch-c60c3ab7b95a3030 9b9a4eb99752cd6fdd8d82e8716ede93dd22aa85 curl -fsSL https://interplane.io/drakestapleton/benchmarks-mv/patches/c60c3ab7b95a3030.patch | git am
Provenance
github-import 1
aien-dev/benchmarks-mv
8
0814acbebc834f4881291cd54844ca4984f7ed91
{"kind":"github-import","owner":"aien-dev","repo":"benchmarks-mv","number":8,"url":"https://github.com/aien-dev/benchmarks-mv/pull/8","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:40:25Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..7ec6aaf --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,27 @@ +name: Benchmark Suite CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + verify: + name: Benchmark Invariant & Provenance Audit + runs-on: spark + steps: + - name: Checkout Source + uses: actions/checkout@v4 + + - name: Verify Code Formatting + run: cargo fmt --all -- --check + + - name: Cargo Check + run: cargo check --all-targets + + - name: Run Test Suite + run: cargo test --verbose + + - name: Verify Invariants + run: cargo run --release -- verify diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a13a1a4..d966061 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,9 @@ -name: CI +name: CI (Manual GitHub Dispatch) +# Canonical CI runs natively on NVIDIA DGX Spark via Forgejo Actions (.forgejo/workflows/ci.yml). +# GitHub Actions is set to workflow_dispatch only to prevent billable runner minutes. on: - push: - branches: [main] - pull_request: - branches: [main] + workflow_dispatch: + jobs: verify: runs-on: ubuntu-latest diff --git a/AGENT_CODE_OF_CONDUCT.md b/AGENT_CODE_OF_CONDUCT.md index c2c2e9c..e0b305d 100644 --- a/AGENT_CODE_OF_CONDUCT.md +++ b/AGENT_CODE_OF_CONDUCT.md @@ -17,7 +17,7 @@ This Specification establishes non-negotiable operational requirements for all a --- ### Article II: Multi-Agent Topology, Inter-Agent Payloads, and Anti-Enclosure -1. **Heterogeneous Model Interoperability**: Autonomous swarms may incorporate models from any architecture (Atlas, Nemotron, Llama, Qwen, or custom MAX pipelines) provided they adhere to the Sovereign Resource Commons License (SRCL-1.0). +1. **Heterogeneous Model Interoperability**: Autonomous swarms may incorporate models from any architecture (Atlas, Nemotron, Llama, Qwen, or custom MAX pipelines) under standard open-source licenses or applicable model terms. 2. **Typed Inter-Agent Payloads**: Subagent communication must utilize structured, typed schemas (JSON or Bincode) rather than free-form conversational chatter. Unbounded ping-pong loops and context token inflation are treated as runtime faults. 3. **Attribution and Imprint Provenance**: Any distilled knowledge, learned heuristics, or memory entities transferred between agents must record canonical provenance in Cortex memory, preserving the downstream lineage and copyright attribution of the human Licensor. @@ -33,7 +33,7 @@ This Specification establishes non-negotiable operational requirements for all a --- ### Article IV: Hardware Silicon Vault and Secret Redaction -1. **Dynamic In-Memory Key Resolution**: Autonomous agents are strictly forbidden from writing API keys, passwords, private tokens, or credentials to disk, logs, scratchpads, or commit histories. All secrets must resolve dynamically in memory from the hardware TPM vault (atlas-vault). +1. **Dynamic In-Memory Key Resolution**: Autonomous agents are strictly forbidden from writing API keys, passwords, private tokens, or credentials to disk, logs, scratchpads, or commit histories. All secrets must resolve dynamically in memory from hardware-backed key vaults via the SecretProvider abstraction. 2. **Active Stream Redaction**: Agent output streams, logs, and subagent payloads must actively redact any string matching secret key signatures with [REDACTED_BY_ATLAS_VAULT]. 3. **Data Firewall Enforcement**: Outbound peer communications must traverse the Personal Data Firewall (beacon-core), sanitizing personal file paths and sensitive host identifiers before egress. @@ -44,5 +44,5 @@ This Specification establishes non-negotiable operational requirements for all a 2. **Autonomous PR Verification Standard**: Every pull request submitted by an autonomous agent must include: - Complete compilation and test pass proof (cargo test --verbose). - Benchmark latency and throughput numbers where applicable. - - Clean diff audit from spark-inquisitor confirming zero telemetry, zero plaintext secrets, and unslop compliance. - - Explicit certification of zero disk secrets and human operator attribution. + - Clean diff audit from spark-inquisitor confirming no unsolicited outbound telemetry, hardware-backed secret protection at rest, and unslop compliance. + - Explicit certification of hardware-backed secret protection at rest and human operator attribution. diff --git a/CONSTITUTION.md b/CONSTITUTION.md index 97dd39f..ba055f0 100644 --- a/CONSTITUTION.md +++ b/CONSTITUTION.md @@ -1,5 +1,7 @@ # The Sovereign AI Constitution +> **Governance Notice:** This Constitution serves exclusively as the internal architectural charter, technical doctrine, and engineering standard for the upstream AIEN Sovereign AI Ecosystem. It does not modify, condition, restrict, or supplement the licenses granted to downstream users of AIEN software under the Apache License, Version 2.0. Downstream developers possess complete operational freedom without obligation to adopt, enforce, or retain this internal charter. + ## Preamble Artificial intelligence is a shared milestone of human civilization. The breakthroughs achieved across the globe, from American laboratories building ChatGPT, Claude, and Grok, to international teams creating open-weight architectures such as Qwen and DeepSeek, reflect the dedication of human beings working toward the frontier of intelligence. @@ -30,29 +32,29 @@ This Constitution establishes our foundational principles, our engineering stand ### Section 3. Upstream Architectural Charter and Downstream Freedom 1. This Constitution serves as the internal architectural charter, technical doctrine, and engineering standard for the upstream AIEN Sovereign AI Ecosystem and its core repositories. -2. Downstream forks, independent applications, client libraries, and commercial distributions are governed strictly and exclusively by the terms of the Sovereign Resource Commons License (SRCL-1.0). Downstream developers possess complete freedom to innovate, customize, brand, and extend the software without obligation to adopt or enforce this internal development charter. -3. Legal Decoupling: Legal rights, grants, and covenants reside exclusively within the formal LICENSE document. This Constitution imposes zero behavioral covenants or philosophical constraints on downstream users, ensuring standard open-source compatibility across public package registries, corporate environments, and independent commercial deployments. +2. Downstream forks, independent applications, client libraries, and commercial distributions are governed strictly and exclusively by the terms of the Apache License, Version 2.0 (see [LICENSE](LICENSE)). Downstream developers possess complete freedom to innovate, customize, brand, and extend the software without obligation to adopt or enforce this internal development charter. +3. Legal Decoupling: Legal rights, grants, and warranties reside exclusively within the formal LICENSE and NOTICE documents, and artifact licensing policies outlined in [ARTIFACT_LICENSING.md](ARTIFACT_LICENSING.md). This Constitution imposes zero behavioral covenants or philosophical constraints on downstream users, ensuring standard open-source compatibility across public package registries, corporate environments, and independent commercial deployments. ### Section 4. The Zero-Surveillance Invariant Privacy and mutual trust form the basis of open cooperation. -1. Zero telemetry: our tools never phone home, harvest user keystrokes, track IP addresses, or build covert behavioral profiles. -2. Zero plaintext disk secrets: all cryptographic credentials, private keys, and API tokens must reside in hardware silicon (TPM vault) and resolve dynamically in volatile memory. +1. No unsolicited outbound telemetry: our tools never phone home, harvest user keystrokes, track IP addresses, or build covert behavioral profiles. Local operational telemetry and performance counters remain entirely under operator control on local interfaces. +2. Hardware-backed secret protection at rest: all cryptographic credentials, private keys, and API tokens must be protected using platform-native hardware security facilities (TPM 2.0 on Linux, Secure Enclave / Keychain on Apple Silicon) via the SecretProvider abstraction, resolving dynamically in volatile memory. 3. Leaking user data or secret keys is treated as a critical defect requiring immediate remediation. -### Section 5. The One Team Principle and Reciprocal Commons -1. What we discover, we share openly. What we construct, we release under the Sovereign Resource Commons License (SRCL-1.0), combining Apache 2.0 operational freedom with reciprocal transparency. -2. Knowledge must remain accessible to the human family. We share tools freely with individuals, startups, and community builders while asking for reciprocal weight transparency from well-capitalized frontier laboratories. +### Section 5. The One Team Principle and Reciprocal Cooperation +1. What we discover, we share openly. What we construct in software, we release under the Apache License, Version 2.0, providing universal operational freedom. +2. Knowledge must remain accessible to the human family. We share tools freely with individuals, startups, and community builders while encouraging reciprocal weight transparency and distillation access from frontier laboratories. 3. Upstream contributions are foundational: any public open-source project adapted to run on our stack is contributed back upstream. We never hoard fixes or improvements. -4. Infrastructure Efficiency and Open Weights: -Hardware manufacturers (including NVIDIA, AMD, Intel, Apple) and compute providers (such as RunPod, Lambda, and independent data centers) possess complete freedom to adopt, embed, and deploy our runtime stack to improve hardware efficiency, eliminate memory overhead, and expand bandwidth for developers. That is welcomed and fully authorized under Section 11 of SRCL-1.0. -Under Section 12 of SRCL-1.0 (the One Team Covenant), well-capitalized commercial enterprises training foundation models on this work agree to release their resulting model weights openly to the world within thirty days. True safety and progress emerge when frontier capital and open-weights unite to serve humanity. +4. Voluntary Bilateral Cooperation and Reciprocal Commons: +Hardware manufacturers (including NVIDIA, AMD, Intel, Apple) and compute providers (such as RunPod, Lambda, and independent data centers) possess complete freedom to adopt, embed, and deploy our runtime stack under the Apache License, Version 2.0 to improve hardware efficiency, eliminate memory overhead, and expand bandwidth for developers. +For organizations seeking deeper bilateral research cooperation, model weight transparency, distillation reciprocity, or joint compute pooling, the voluntary terms of [OPEN_COOPERATION_COVENANT.md](OPEN_COOPERATION_COVENANT.md) provide a collaborative framework. ### Section 6. The Contributor Oath -Anyone contributing to our repositories, whether human operator or autonomous agent, ratifies the following covenant: +Anyone contributing to our repositories, whether human operator or autonomous agent, ratifies the Developer Certificate of Origin (DCO 1.1) and the following stewardship covenant: -> "I certify that my contribution is submitted in service of human sovereignty, global unity, and open collaboration. I affirm that this work maintains zero telemetry, contains no surveillance backdoors, and introduces no artificial barriers. I build to bridge divides, expand access, and empower all of humanity." +> "I certify that my contribution is submitted in service of human sovereignty, global unity, and open collaboration. I affirm that this work introduces no unsolicited outbound telemetry, contains no surveillance backdoors, and respects the open architecture. I build to bridge divides, expand access, and empower all of humanity." -Legal Provenance and Warranty: Legal standing, copyright warranty, and provenance under law are held and warranted exclusively by the human contributor or operator submitting the pull request. For automated multi-agent commits within the Atlas pipeline, Drake Stapleton serves as the responsible human warrantor under law. +Legal Provenance and Warranty: Legal standing, copyright warranty, and provenance under law are held and warranted exclusively by the human contributor or operator submitting the pull request under DCO 1.1. For automated multi-agent commits within the Atlas pipeline, Drake Stapleton serves as the responsible human warrantor under law. --- @@ -97,10 +99,10 @@ Systems learn and adapt continuously, but core purpose remains steadfast. To maintain code quality, security, and mutual trust: 1. **Two-Tier Verification**: - - **Critical Invariants (Hard Blocking Gates)**: Pull requests must pass automated audits for zero plaintext secrets (hardware TPM only), zero telemetry, and license integrity. Violations result in automatic PR rejection. + - **Critical Invariants (Hard Blocking Gates)**: Pull requests must pass automated audits for hardware-backed secret protection at rest, no unsolicited outbound telemetry, and license integrity. Violations result in automatic PR rejection. - **Stylistic and Unslop Standards (Core Standards & Community Advisory)**: The unslop invariant is enforced across core repositories, internal agents, and official releases. For outside community pull requests, style audits provide automated formatting suggestions rather than immediate rejection. 2. **Integrity of Purpose**: Submissions attempting to introduce surveillance hooks, covert tracking SDKs, or extractive lock-in mechanisms will be rejected. -3. **Open Downstream Freedom**: Downstream users, forks, and commercial builders operate with complete legal freedom under the terms of SRCL-1.0. +3. **Open Downstream Freedom**: Downstream users, forks, and commercial builders operate with complete legal freedom under the terms of the Apache License, Version 2.0. 4. **Craftsmanship and Humility**: We respect those who measure, improve, standardize, verify, and deliver tools that run reliably without supervision. --- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 187f285..47a23f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,4 +7,4 @@ We welcome reproducible benchmark contributions from sovereign operators. 1. **Measurement Environment**: Document exact CPU/GPU model, kernel version, memory architecture, and compiler flags. 2. **Reproducible Code**: Include CLI flags and measurement scripts so any operator can reproduce the results. 3. **Verification**: Run `cargo test --verbose` and ensure all tests pass with zero warnings. -4. **License**: All contributions are accepted under the Sovereign Resource Commons License (SRCL-1.0). +4. **License & Provenance**: All contributions are accepted under the Apache License, Version 2.0 and the Developer Certificate of Origin (DCO 1.1). diff --git a/Cargo.toml b/Cargo.toml index 21afcd1..2c46398 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" authors = ["Drake Stapleton <drake.aien@proton.me>"] description = "Sovereign Systems Benchmark Suite: reproducible performance comparisons on NVIDIA DGX Spark Grace Blackwell" -license = "SRCL-1.0" +license = "Apache-2.0" [dependencies] serde = { version = "1.0", features = ["derive"] } diff --git a/DCO b/DCO new file mode 100644 index 0000000..49b8cb0 --- /dev/null +++ b/DCO @@ -0,0 +1,34 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/LICENSE b/LICENSE index 88c9552..6803235 100644 --- a/LICENSE +++ b/LICENSE @@ -1,20 +1,3 @@ -Sovereign Resource Commons License 1.0 (SRCL-1.0) -Copyright (c) 2026 Drake Stapleton (Operator & Lead AI Architect) <drake.aien@proton.me>. -All rights reserved. - -Authored and architected by Drake Stapleton in cognitive partnership with AIEN -(Autonomous Cognitive Architecture operating on the Atlas Framework). All legal -rights, title, copyright, and licensing authority reside exclusively in Drake Stapleton. - -This Work is dedicated to open cognitive collaboration, global technological -advancement, and the shared empowerment of humanity. We believe that frontier -intelligence flourishes when communities, independent developers, and research -laboratories unite across borders to solve shared challenges. Licensed under the -Apache License, Version 2.0 (with LLVM Exception) and the Sovereign Reciprocal -Commons Rider set forth below. - -================================================================================ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -24,7 +7,7 @@ Commons Rider set forth below. 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 16 of this document. + and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. @@ -81,10 +64,9 @@ Commons Rider set forth below. subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of - this License, including the express conditions precedent set forth in - Sections 10, 11, 12, and 13, each Contributor hereby grants to - You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, - irrevocable copyright license to reproduce, prepare Derivative Works of, + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. @@ -191,156 +173,29 @@ Commons Rider set forth below. incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - --- LLVM Exceptions to the Apache 2.0 License --- - - As an exception, if You compile Source code portions of this Program, - you may link that code with independent modules to produce an - executable, regardless of the license terms of these independent - modules, and copy and distribute the resulting executable under terms - of your choice, provided that you also meet, for each linked - independent module, the terms and conditions of the license of that - module. An independent module is a module which is not derived from or - based on this program. If you modify this library, you may extend this - exception to your version of the library, but you are not obliged to - do so. If you do not wish to do so, delete this exception statement - from your version. - - --- SOVEREIGN RECIPROCAL COMMONS RIDER (SRCL-1.0) --- - - Section 10. Express Conditions Precedent (Jacobsen v. Katzer Doctrine) - All permissions, grants, and licenses conferred by this document are subject - to the express conditions precedent set forth in Sections 11, 12, and 13. - Any use, reproduction, preparation of Derivative Works, distribution, or - AI Training outside of or in breach of these conditions is unpermitted, - void ab initio, and constitutes willful copyright infringement under 17 U.S.C. - § 106 and § 501. - - Section 11. Swarm Covenant (Operational Freedom & Reciprocal Engine Source Transparency) - Commercial use, monetization, deployment, and operation of this Work are - expressly authorized and welcomed for all individuals and enterprises with zero - revenue caps. You are fully permitted to build proprietary applications, offer - hosted services, embed compiled object binaries, and monetize software - incorporating this Work under the LLVM Exception without any obligation to - disclose or license your independent application source code or proprietary - service code. - - Supremacy of the LLVM Exception for Applications: For the avoidance of doubt, - the LLVM Exception governs all independent application code, user services, - client modules, proprietary algorithms, and composite executables that compile, - link against, or embed the Object form of this Work. Linking against this Work, - compiling it into a proprietary service binary, or communicating with this - Work over network protocols imposes zero obligation to provide or license - source code for your independent application or service. - - Limited Reciprocity for Direct Engine Modifications: The reciprocal source - transparency requirement of this Section 11 applies exclusively to direct - modifications, forks, or alterations made to the core Source code files of - this Work itself. Only if You directly modify the Source code files of this - Work and deploy such modified core runtime as a public or commercial networked - SaaS or API service, You must make the Source code of Your modifications to - this Work publicly available under these same license terms within thirty (30) - days of deployment. - - Section 12. One Team Covenant (Reciprocal AI Weight Release) - (a) Purpose, Scope, and Definitions: This Section operates both as an - express condition precedent under copyright law and as an independent, - binding contractual covenant governing access, ingestion, and computational - utilization of this Work. This covenant reflects the One Team principle: - frontier intelligence is a shared human endeavor. When frontier laboratories - and capitalized enterprises build upon the open contributions of the global - developer community, mutual transparency and shared weights ensure that - advancements benefit all of humanity together rather than fueling opaque - rivalries or uncoordinated risks. - For the purposes of this Section: - (i) "AI Training" means using the Source code, Object code, architectural - specifications, internal reasoning traces, documentation, test suites, - prompts, or embedded training datasets of this Work to train, pre-train, - fine-tune, distill, align, optimize, or reinforce any neural network, - machine learning model, or generative foundation model. - (ii) "Model Weights" means all learned numerical parameters, tensors, - biases, checkpoint files, embedding layers, and tokenizer definitions - governing inference. - (iii) "Qualifying Enterprise" means any commercial enterprise, corporation, - conglomerate, foundation AI research laboratory, or affiliated Legal - Entity with annual gross revenues, aggregate raised investment capital, - or balance-sheet valuation exceeding twenty-five million United States - Dollars ($25,000,000 USD). - - (b) Condition of Reciprocal Weight Release: If a Qualifying Enterprise conducts AI - Training upon this Work or its Derivative Works, it is an express condition - precedent of this License that such Qualifying Enterprise must publish and - release the resulting Model Weights, architecture specifications, and - inference recipes openly to the general public under an OSI-approved open - source license or permissive OpenRAIL or Apache-compatible license within - thirty (30) days of commercial availability, internal production use, or - public release. - - (c) Safe Harbor for Builders, Researchers, and Startups: Individual developers, - open-source collaborators, academic institutions, non-profit organizations, - and commercial enterprises with annual gross revenues and capital below - twenty-five million United States Dollars ($25,000,000 USD) are explicitly - exempt from this Model Weight release condition. - - (d) Anti-Circumvention and Intermediary Scope: The obligations of this Section 12 - bind: (i) any Qualifying Enterprise; (ii) any parent, subsidiary, affiliate, - joint venture, or successor entity; (iii) any contractor, subcontractor, - research partner, agent, or third party conducting AI Training for the direct - or indirect benefit of, under contract with, funded by, or transferring - resulting Model Weights or training artifacts to a Qualifying Enterprise; and - (iv) any entity that transfers, assigns, licenses, or provides resulting Model - Weights to a Qualifying Enterprise. No Qualifying Enterprise may evade this - condition through intermediaries, contract training, synthetic distillation - relays, or subsidiary entities. - - (e) Automatic License Forfeiture: Failure of a Qualifying Enterprise (or any party - acting on its behalf under subsection (d)) to satisfy the condition in - subsection (b) results in immediate, automatic, and retroactive termination - of all copyright, patent, and trademark licenses granted herein. Any continued - reproduction, distribution, inference hosting, or commercial utilization of - models or software derived from such training constitutes willful copyright - infringement under Title 17 of the United States Code. - - Section 13. Dual Remedies: Statutory Copyright Damages and Contractual Covenants - (a) Copyright Remedy: Any Qualifying Enterprise or party that conducts - unauthorized AI Training on this Work in breach of Section 12 acts without a - license, committing willful copyright infringement subject to maximum - statutory damages of up to one hundred fifty thousand United States Dollars - ($150,000 USD) per infringed work pursuant to 17 U.S.C. § 504(c)(2), - disgorgement of profits, and permanent injunctive relief under 17 U.S.C. § 502. - - (b) Contractual Alternative and Agreed Licensing Fee: In the event any court of - competent jurisdiction determines that AI Training on this Work does not - constitute copyright infringement or falls within affirmative defenses such - as fair use, accessing, downloading, ingesting, parsing, or executing this - Work constitutes affirmative assent to this License as a binding bilateral - contract. Any Qualifying Enterprise that breaches Section 12 agrees to pay - to Licensor, as liquidated damages and an agreed reasonable commercial licensing - fee, the greater of: (i) one hundred fifty thousand United States Dollars - ($150,000 USD) per work ingested; or (ii) ten percent (10%) of all gross - revenues realized by the Qualifying Enterprise from the commercialization, - operation, or API deployment of the resulting model or service, in addition - to restitution for unjust enrichment. - - Section 14. Prevailing Party Legal Fees and Costs - In any legal proceeding, arbitration, or judicial action brought to enforce - the terms of this License, for copyright infringement arising from breach - of the conditions precedent herein, or for breach of contract, the prevailing - party shall be entitled to an award of its reasonable attorney fees, expert - witness fees, and litigation costs pursuant to 17 U.S.C. § 505 and applicable law. - - Section 15. Severability and Preservation of Grant - If any provision, sentence, or clause of this Rider is held invalid, illegal, - or unenforceable by a court of competent jurisdiction, such invalidity shall - not affect any other provision of this License. The remaining provisions - shall remain in full legal force and effect, and the invalid clause shall be - reformed to the minimum extent necessary to achieve its economic intent. - - Section 16. Governing Law and Exclusive Venue - This License, and all claims or causes of action arising out of or related to - this Work or License, shall be governed by and construed in accordance with - the federal laws of the United States of America and the substantive laws of - the State of Texas, without giving effect to conflict of laws principles. - Any judicial action, proceeding, or litigation shall be brought exclusively in - the United States District Court for the Western District of Texas (Austin - Division), and each party irrevocably submits to the personal and subject-matter - jurisdiction of such court. + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2026 Drake Stapleton and AIEN Contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..d465384 --- /dev/null +++ b/NOTICE @@ -0,0 +1,9 @@ +AIEN Sovereign Systems Performance Benchmarks +Copyright 2026 Drake Stapleton and AIEN Contributors + +This product includes software developed by Drake Stapleton in cognitive +partnership with AIEN (Autonomous Cognitive Architecture operating on the +Atlas Framework). + +Website: https://github.com/aien-dev/benchmarks +Lead Architect: Drake Stapleton <drake.aien@proton.me> diff --git a/README.md b/README.md index ca510eb..97ec343 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AIEN Sovereign Systems Performance Benchmarks -[](LICENSE) +[](LICENSE) [](https://github.com/aien-dev/benchmarks) [](https://github.com/aien-dev/benchmarks) [](https://github.com/aien-dev/benchmarks) @@ -165,12 +165,11 @@ cargo test --verbose --- -## License +## License and Governance -Licensed under the [Sovereign Resource Commons License 1.0 (SRCL-1.0)](LICENSE). +Licensed under the [Apache License, Version 2.0](LICENSE). +Copyright (c) 2026 Drake Stapleton and AIEN Contributors. See [NOTICE](NOTICE) for attribution. -- **Section 11 (Swarm Covenant)**: Grants complete operational freedom to developers, startups, and enterprises to build, link, deploy, and monetize with zero revenue caps. -- **Section 12 (One Team Covenant)**: Mandates reciprocal weight transparency from well-capitalized frontier entities ($25M+), requiring resulting model weights to be released openly within 30 days. -- **Section 13 (Dual Remedies & Retroactive Inception)**: Enforces statutory copyright damages and binding contractual covenants ab initio upon breach of reciprocal conditions. - -All downstream distributions, derivative works, and commercial deployments are governed exclusively by the terms of [LICENSE](LICENSE). [CONSTITUTION.md](CONSTITUTION.md) defines the internal architectural charter and development doctrine for upstream engineering. +- **Benchmark Code & Harness**: Standard [Apache License 2.0](LICENSE) for universal execution, replication, and integration. +- **Benchmark Data & Metrics**: Raw telemetry JSON, hardware timing records, and SVG comparison charts are dedicated to the public domain under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0/). +- **Upstream Development Charter**: [CONSTITUTION.md](CONSTITUTION.md) defines the internal architectural doctrine and stewardship standards for upstream development and does not bind downstream users. diff --git a/data/benchmarks_20260919.json b/data/benchmarks_20260919.json index 852ebf2..48ee8b0 100644 --- a/data/benchmarks_20260919.json +++ b/data/benchmarks_20260919.json @@ -1,6 +1,9 @@ { "benchmark_suite": "AIEN Sovereign Systems Performance Benchmark Suite", "version": "0.2.0", + "schema_version": "1.0.0", + "benchmark_commit": "latest", + "core_commit": "34e4b41", "timestamp": "2026-09-19T12:19:36Z", "hardware": { "system": "NVIDIA DGX Spark", @@ -20,6 +23,7 @@ }, "memory_rss": [ { + "measurement_id": "BENCH-FASTAPI-RSS-001", "service": "python-fastapi-baseline", "role": "Python Microservice Baseline", "architecture": "Python 3.12 + FastAPI + Uvicorn", @@ -28,6 +32,7 @@ "reduction_pct": 0.0 }, { + "measurement_id": "BENCH-OPENCLAW-RSS-001", "service": "openclaw-rs", "role": "Sovereign Gateway & Heartbeat", "architecture": "Native Rust (Grace Blackwell)", @@ -36,6 +41,7 @@ "reduction_pct": 89.80624890905918 }, { + "measurement_id": "BENCH-CORTEX-RSS-001", "service": "cortex-rs", "role": "Canonical Memory Engine", "architecture": "Native Rust + SQLite WAL", @@ -44,6 +50,7 @@ "reduction_pct": 58.29987781462733 }, { + "measurement_id": "BENCH-COCKPIT-RSS-001", "service": "spark-cockpit-rs", "role": "Real-time Telemetry Cockpit", "architecture": "Native Rust + Axum", @@ -52,6 +59,7 @@ "reduction_pct": 71.18170710420667 }, { + "measurement_id": "BENCH-ENCODER-RSS-001", "service": "cortex-encoder-rs", "role": "Neural Embedding Microservice", "architecture": "Rust + ONNX Runtime (BGE-M3)", @@ -62,6 +70,7 @@ ], "latency_concurrency": [ { + "measurement_id": "BENCH-FASTAPI-LATENCY-001", "service": "python-fastapi-baseline", "endpoint": "/api/status", "description": "Python FastAPI Baseline Ping", @@ -74,6 +83,7 @@ "sample_size": 500 }, { + "measurement_id": "BENCH-CORTEX-LATENCY-001", "service": "cortex-rs", "endpoint": "/api/cortex/get", "description": "Cortex Canonical Retrieval", @@ -86,6 +96,7 @@ "sample_size": 500 }, { + "measurement_id": "BENCH-COCKPIT-LATENCY-001", "service": "spark-cockpit-rs", "endpoint": "/api/pulse", "description": "Real-time System Pulse", @@ -98,6 +109,7 @@ "sample_size": 500 }, { + "measurement_id": "BENCH-ENCODER-LATENCY-001", "service": "cortex-encoder-rs", "endpoint": "/health", "description": "ONNX Runtime Service Health", @@ -112,6 +124,7 @@ ], "like_for_like": [ { + "measurement_id": "BENCH-LFL-STATUS-001", "category": "HTTP Microservice", "workload": "Minimal JSON Status Ping (/api/status)", "rust_engine": "Rust Standalone (Native Compiled)", @@ -126,6 +139,7 @@ "memory_reduction_pct": 94.24855995810788 }, { + "measurement_id": "BENCH-LFL-QUERY-001", "category": "Database & Serialization", "workload": "Single Entity Query & JSON Serialization (/api/query)", "rust_engine": "Rust Standalone (Native Compiled)", @@ -140,6 +154,7 @@ "memory_reduction_pct": 94.24855995810788 }, { + "measurement_id": "BENCH-LFL-VECTOR-001", "category": "Vector & SIMD Compute", "workload": "768-dimensional Vector Dot Product (/api/vector)", "rust_engine": "Rust SIMD Vector Loop", @@ -156,6 +171,7 @@ ], "neural_inference": [ { + "measurement_id": "BENCH-NEURAL-TTFT-GPU-001", "workload": "First Token Latency (TTFT) - GPU Seat", "model": "Nemotron 3.5 Lightning 30B (BF16)", "engine": "Modular MAX (Grace Blackwell GB10 GPU)", @@ -163,6 +179,7 @@ "p95_ms": 426.91011000000003 }, { + "measurement_id": "BENCH-NEURAL-ITL-GPU-001", "workload": "Inter-Token Latency (ITL) - GPU Seat", "model": "Nemotron 3.5 Lightning 30B (BF16)", "engine": "Modular MAX (Grace Blackwell GB10 GPU)", @@ -170,6 +187,7 @@ "p95_ms": 47.881523 }, { + "measurement_id": "BENCH-NEURAL-TTFT-CPU-001", "workload": "First Token Latency (TTFT) - CPU Fallback", "model": "Llama 3.2 1B Instruct (Q4_K)", "engine": "Modular MAX (Grace Neoverse CPU)", @@ -177,6 +195,7 @@ "p95_ms": 155.398386 }, { + "measurement_id": "BENCH-NEURAL-ITL-CPU-001", "workload": "Inter-Token Latency (ITL) - CPU Fallback", "model": "Llama 3.2 1B Instruct (Q4_K)", "engine": "Modular MAX (Grace Neoverse CPU)", @@ -184,6 +203,7 @@ "p95_ms": 99.418419 }, { + "measurement_id": "BENCH-NEURAL-EMBED-001", "workload": "Bi-Encoder Vector Embedding", "model": "BAAI/bge-base-en-v1.5 (INT8)", "engine": "cortex-encoder-rs (ONNX Runtime)", @@ -191,6 +211,7 @@ "p95_ms": 8.832346 }, { + "measurement_id": "BENCH-NEURAL-DOTPROD-001", "workload": "SIMD Vector Dot Product (768-dim)", "model": "In-Memory Cortex Embedding", "engine": "Rust SIMD Vector Loop", diff --git a/data/benchmarks_latest.json b/data/benchmarks_latest.json index 852ebf2..48ee8b0 100644 --- a/data/benchmarks_latest.json +++ b/data/benchmarks_latest.json @@ -1,6 +1,9 @@ { "benchmark_suite": "AIEN Sovereign Systems Performance Benchmark Suite", "version": "0.2.0", + "schema_version": "1.0.0", + "benchmark_commit": "latest", + "core_commit": "34e4b41", "timestamp": "2026-09-19T12:19:36Z", "hardware": { "system": "NVIDIA DGX Spark", @@ -20,6 +23,7 @@ }, "memory_rss": [ { + "measurement_id": "BENCH-FASTAPI-RSS-001", "service": "python-fastapi-baseline", "role": "Python Microservice Baseline", "architecture": "Python 3.12 + FastAPI + Uvicorn", @@ -28,6 +32,7 @@ "reduction_pct": 0.0 }, { + "measurement_id": "BENCH-OPENCLAW-RSS-001", "service": "openclaw-rs", "role": "Sovereign Gateway & Heartbeat", "architecture": "Native Rust (Grace Blackwell)", @@ -36,6 +41,7 @@ "reduction_pct": 89.80624890905918 }, { + "measurement_id": "BENCH-CORTEX-RSS-001", "service": "cortex-rs", "role": "Canonical Memory Engine", "architecture": "Native Rust + SQLite WAL", @@ -44,6 +50,7 @@ "reduction_pct": 58.29987781462733 }, { + "measurement_id": "BENCH-COCKPIT-RSS-001", "service": "spark-cockpit-rs", "role": "Real-time Telemetry Cockpit", "architecture": "Native Rust + Axum", @@ -52,6 +59,7 @@ "reduction_pct": 71.18170710420667 }, { + "measurement_id": "BENCH-ENCODER-RSS-001", "service": "cortex-encoder-rs", "role": "Neural Embedding Microservice", "architecture": "Rust + ONNX Runtime (BGE-M3)", @@ -62,6 +70,7 @@ ], "latency_concurrency": [ { + "measurement_id": "BENCH-FASTAPI-LATENCY-001", "service": "python-fastapi-baseline", "endpoint": "/api/status", "description": "Python FastAPI Baseline Ping", @@ -74,6 +83,7 @@ "sample_size": 500 }, { + "measurement_id": "BENCH-CORTEX-LATENCY-001", "service": "cortex-rs", "endpoint": "/api/cortex/get", "description": "Cortex Canonical Retrieval", @@ -86,6 +96,7 @@ "sample_size": 500 }, { + "measurement_id": "BENCH-COCKPIT-LATENCY-001", "service": "spark-cockpit-rs", "endpoint": "/api/pulse", "description": "Real-time System Pulse", @@ -98,6 +109,7 @@ "sample_size": 500 }, { + "measurement_id": "BENCH-ENCODER-LATENCY-001", "service": "cortex-encoder-rs", "endpoint": "/health", "description": "ONNX Runtime Service Health", @@ -112,6 +124,7 @@ ], "like_for_like": [ { + "measurement_id": "BENCH-LFL-STATUS-001", "category": "HTTP Microservice", "workload": "Minimal JSON Status Ping (/api/status)", "rust_engine": "Rust Standalone (Native Compiled)", @@ -126,6 +139,7 @@ "memory_reduction_pct": 94.24855995810788 }, { + "measurement_id": "BENCH-LFL-QUERY-001", "category": "Database & Serialization", "workload": "Single Entity Query & JSON Serialization (/api/query)", "rust_engine": "Rust Standalone (Native Compiled)", @@ -140,6 +154,7 @@ "memory_reduction_pct": 94.24855995810788 }, { + "measurement_id": "BENCH-LFL-VECTOR-001", "category": "Vector & SIMD Compute", "workload": "768-dimensional Vector Dot Product (/api/vector)", "rust_engine": "Rust SIMD Vector Loop", @@ -156,6 +171,7 @@ ], "neural_inference": [ { + "measurement_id": "BENCH-NEURAL-TTFT-GPU-001", "workload": "First Token Latency (TTFT) - GPU Seat", "model": "Nemotron 3.5 Lightning 30B (BF16)", "engine": "Modular MAX (Grace Blackwell GB10 GPU)", @@ -163,6 +179,7 @@ "p95_ms": 426.91011000000003 }, { + "measurement_id": "BENCH-NEURAL-ITL-GPU-001", "workload": "Inter-Token Latency (ITL) - GPU Seat", "model": "Nemotron 3.5 Lightning 30B (BF16)", "engine": "Modular MAX (Grace Blackwell GB10 GPU)", @@ -170,6 +187,7 @@ "p95_ms": 47.881523 }, { + "measurement_id": "BENCH-NEURAL-TTFT-CPU-001", "workload": "First Token Latency (TTFT) - CPU Fallback", "model": "Llama 3.2 1B Instruct (Q4_K)", "engine": "Modular MAX (Grace Neoverse CPU)", @@ -177,6 +195,7 @@ "p95_ms": 155.398386 }, { + "measurement_id": "BENCH-NEURAL-ITL-CPU-001", "workload": "Inter-Token Latency (ITL) - CPU Fallback", "model": "Llama 3.2 1B Instruct (Q4_K)", "engine": "Modular MAX (Grace Neoverse CPU)", @@ -184,6 +203,7 @@ "p95_ms": 99.418419 }, { + "measurement_id": "BENCH-NEURAL-EMBED-001", "workload": "Bi-Encoder Vector Embedding", "model": "BAAI/bge-base-en-v1.5 (INT8)", "engine": "cortex-encoder-rs (ONNX Runtime)", @@ -191,6 +211,7 @@ "p95_ms": 8.832346 }, { + "measurement_id": "BENCH-NEURAL-DOTPROD-001", "workload": "SIMD Vector Dot Product (768-dim)", "model": "In-Memory Cortex Embedding", "engine": "Rust SIMD Vector Loop", diff --git a/src/harness/inference_bench.rs b/src/harness/inference_bench.rs index 78a72fa..a6f7755 100644 --- a/src/harness/inference_bench.rs +++ b/src/harness/inference_bench.rs @@ -182,6 +182,7 @@ pub fn run_neural_inference_benchmarks() -> Vec<NeuralMetric> { res.ttft_ms, res.itl_p50_ms, res.tokens_per_sec ); metrics.push(NeuralMetric { + measurement_id: Some("BENCH-LIVE-TTFT-GPU-001".to_string()), workload: "First Token Latency (TTFT) - GPU Seat".to_string(), model: "Nemotron 3.5 Lightning 30B (BF16)".to_string(), engine: "Modular MAX (Grace Blackwell GB10 GPU)".to_string(), @@ -189,6 +190,7 @@ pub fn run_neural_inference_benchmarks() -> Vec<NeuralMetric> { p95_ms: res.ttft_ms, }); metrics.push(NeuralMetric { + measurement_id: Some("BENCH-LIVE-ITL-GPU-001".to_string()), workload: "Inter-Token Latency (ITL) - GPU Seat".to_string(), model: "Nemotron 3.5 Lightning 30B (BF16)".to_string(), engine: "Modular MAX (Grace Blackwell GB10 GPU)".to_string(), @@ -223,6 +225,7 @@ pub fn run_neural_inference_benchmarks() -> Vec<NeuralMetric> { res.ttft_ms, res.itl_p50_ms, res.tokens_per_sec ); metrics.push(NeuralMetric { + measurement_id: Some("BENCH-LIVE-TTFT-CPU-001".to_string()), workload: "First Token Latency (TTFT) - CPU Fallback".to_string(), model: "Llama 3.2 1B Instruct (Q4_K)".to_string(), engine: "Modular MAX (Grace Neoverse CPU)".to_string(), @@ -230,6 +233,7 @@ pub fn run_neural_inference_benchmarks() -> Vec<NeuralMetric> { p95_ms: res.ttft_ms, }); metrics.push(NeuralMetric { + measurement_id: Some("BENCH-LIVE-ITL-CPU-001".to_string()), workload: "Inter-Token Latency (ITL) - CPU Fallback".to_string(), model: "Llama 3.2 1B Instruct (Q4_K)".to_string(), engine: "Modular MAX (Grace Neoverse CPU)".to_string(), @@ -256,6 +260,7 @@ pub fn run_neural_inference_benchmarks() -> Vec<NeuralMetric> { p50, p95 ); metrics.push(NeuralMetric { + measurement_id: Some("BENCH-LIVE-EMBED-001".to_string()), workload: "Bi-Encoder Vector Embedding".to_string(), model: "BAAI/bge-base-en-v1.5 (INT8)".to_string(), engine: "cortex-encoder-rs (ONNX Runtime)".to_string(), diff --git a/src/harness/mod.rs b/src/harness/mod.rs index f58ebc4..39e7170 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -144,6 +144,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, let speedup_status = py_bench_status.p50_ms / rust_bench_status.p50_ms.max(0.001); let reduction_status = (1.0 - (rust_rss / py_rss.max(0.001))) * 100.0; like_for_like.push(LikeForLikeMetric { + measurement_id: Some("BENCH-LIVE-LFL-STATUS-001".to_string()), category: "HTTP Microservice".to_string(), workload: "Minimal JSON Status Ping (/api/status)".to_string(), rust_engine: "Rust Standalone (Native Compiled)".to_string(), @@ -161,6 +162,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, // 2. Query Like-for-Like let speedup_query = py_bench_query.p50_ms / rust_bench_query.p50_ms.max(0.001); like_for_like.push(LikeForLikeMetric { + measurement_id: Some("BENCH-LIVE-LFL-QUERY-001".to_string()), category: "Database & Serialization".to_string(), workload: "Single Entity Query & JSON Serialization (/api/query)".to_string(), rust_engine: "Rust Standalone (Native Compiled)".to_string(), @@ -178,6 +180,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, // 3. Vector Dot Product Like-for-Like let speedup_vec = py_bench_vector.p50_ms / rust_bench_vector.p50_ms.max(0.001); like_for_like.push(LikeForLikeMetric { + measurement_id: Some("BENCH-LIVE-LFL-VEC-001".to_string()), category: "Vector & SIMD Compute".to_string(), workload: "768-dimensional Vector Dot Product (/api/vector)".to_string(), rust_engine: "Rust SIMD Vector Loop".to_string(), @@ -194,6 +197,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, // Add real python baseline to latency_concurrency for direct apples-to-apples comparison latency_concurrency.push(LatencyMetric { + measurement_id: Some("BENCH-LIVE-FASTAPI-PING-001".to_string()), service: "python-fastapi-baseline".to_string(), endpoint: "/api/status".to_string(), description: "Python FastAPI Baseline Ping".to_string(), @@ -234,6 +238,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, // Baseline memory for comparisons (use measured Python baseline if available, else 40.0 MB default) let baseline_rss = py_rss_measured.unwrap_or(40.0); memory_rss.push(MemoryMetric { + measurement_id: Some("BENCH-LIVE-FASTAPI-RSS-001".to_string()), service: "python-fastapi-baseline".to_string(), role: "Python Microservice Baseline".to_string(), architecture: "Python 3.12 + FastAPI + Uvicorn".to_string(), @@ -250,6 +255,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, if let Some(openclaw_pid) = memory::find_pid_by_pattern("openclaw-rs") { if let Some(openclaw_rss) = memory::read_process_rss_mb(openclaw_pid) { memory_rss.push(MemoryMetric { + measurement_id: Some("BENCH-LIVE-OPENCLAW-RSS-001".to_string()), service: "openclaw-rs".to_string(), role: "Sovereign Gateway & Heartbeat".to_string(), architecture: "Native Rust (Grace Blackwell)".to_string(), @@ -264,6 +270,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, if let Some(cortex_pid) = memory::find_pid_by_pattern("cortex-rs") { if let Some(cortex_rss) = memory::read_process_rss_mb(cortex_pid) { memory_rss.push(MemoryMetric { + measurement_id: Some("BENCH-LIVE-CORTEX-RSS-001".to_string()), service: "cortex-rs".to_string(), role: "Canonical Memory Engine".to_string(), architecture: "Native Rust + SQLite WAL".to_string(), @@ -278,6 +285,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, if let Some(cockpit_pid) = memory::find_pid_by_pattern("spark-cockpit-rs") { if let Some(cockpit_rss) = memory::read_process_rss_mb(cockpit_pid) { memory_rss.push(MemoryMetric { + measurement_id: Some("BENCH-LIVE-COCKPIT-RSS-001".to_string()), service: "spark-cockpit-rs".to_string(), role: "Real-time Telemetry Cockpit".to_string(), architecture: "Native Rust + Axum".to_string(), @@ -292,6 +300,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, if let Some(encoder_pid) = memory::find_pid_by_pattern("cortex-encoder-rs") { if let Some(encoder_rss) = memory::read_process_rss_mb(encoder_pid) { memory_rss.push(MemoryMetric { + measurement_id: Some("BENCH-LIVE-ENCODER-RSS-001".to_string()), service: "cortex-encoder-rs".to_string(), role: "Neural Embedding Microservice".to_string(), architecture: "Rust + ONNX Runtime (BGE-M3)".to_string(), @@ -313,6 +322,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, config.warmup as usize, ) { latency_concurrency.push(LatencyMetric { + measurement_id: Some("BENCH-LIVE-CORTEX-GET-001".to_string()), service: "cortex-rs".to_string(), endpoint: "/api/cortex/get".to_string(), description: "Cortex Canonical Retrieval".to_string(), @@ -336,6 +346,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, config.warmup as usize, ) { latency_concurrency.push(LatencyMetric { + measurement_id: Some("BENCH-LIVE-PULSE-001".to_string()), service: "spark-cockpit-rs".to_string(), endpoint: "/api/pulse".to_string(), description: "Real-time System Pulse".to_string(), @@ -359,6 +370,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, config.warmup as usize, ) { latency_concurrency.push(LatencyMetric { + measurement_id: Some("BENCH-LIVE-ENCODER-HEALTH-001".to_string()), service: "cortex-encoder-rs".to_string(), endpoint: "/health".to_string(), description: "ONNX Runtime Service Health".to_string(), @@ -383,6 +395,7 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, simd_bench.elapsed_ms, simd_bench.operations_per_sec, simd_bench.p50_latency_us ); neural_inference.push(NeuralMetric { + measurement_id: Some("BENCH-LIVE-SIMD-DOT-001".to_string()), workload: "SIMD Vector Dot Product (768-dim)".to_string(), model: "In-Memory Cortex Embedding".to_string(), engine: "Rust SIMD Vector Loop".to_string(), @@ -405,6 +418,9 @@ pub fn run_measurement_suite(config: MeasurementConfig) -> Result<BenchmarkData, Ok(BenchmarkData { benchmark_suite: "AIEN Sovereign Systems Performance Benchmark Suite".to_string(), version: "0.2.0".to_string(), + schema_version: Some("1.0.0".to_string()), + benchmark_commit: None, + core_commit: None, timestamp, hardware, environment, diff --git a/src/main.rs b/src/main.rs index 126cc5b..4ee1903 100644 --- a/src/main.rs +++ b/src/main.rs @@ -55,6 +55,16 @@ enum Commands { Report, /// Verify all metrics against baseline invariants Verify, + /// Synchronize benchmark claims in documentation files from benchmarks_latest.json + SyncDocs { + /// Target markdown documentation files to synchronize + #[arg(short, long)] + target: Vec<String>, + + /// Check mode: exit with non-zero code if documentation differs from data + #[arg(long)] + check: bool, + }, } fn load_data(path: &str) -> BenchmarkData { @@ -272,7 +282,114 @@ fn main() { } println!("All invariant checks passed successfully."); } + Commands::SyncDocs { target, check } => { + let data = load_data(&cli.input); + let table = generate_markdown_table(&data); + + let targets = if target.is_empty() { + vec![ + "../README.md".to_string(), + "../docs/STATE_OF_AIEN.md".to_string(), + ] + } else { + target.clone() + }; + + let mut mismatch = false; + for t in &targets { + let p = Path::new(t); + if !p.exists() { + println!("Target file not found, skipping: {}", t); + continue; + } + let content = fs::read_to_string(p).expect("Failed to read target file"); + let updated = sync_markdown_content(&content, &table); + + if updated != content { + if check { + eprintln!("Benchmark table out of date in: {}", t); + mismatch = true; + } else { + fs::write(p, &updated).expect("Failed to write target file"); + println!("Synchronized benchmark table into: {}", t); + } + } else { + println!("Benchmark table already in sync: {}", t); + } + } + + if mismatch { + std::process::exit(1); + } + } + } +} + +pub fn generate_markdown_table(data: &BenchmarkData) -> String { + let mut out = String::new(); + out.push_str("<!-- AIEN:BENCHMARKS:START -->\n"); + out.push_str("<!-- Sourced automatically from benchmarks/data/benchmarks_latest.json (Measurement Suite v"); + out.push_str(&data.version); + out.push_str(") -->\n"); + out.push_str("| Workload / Service | Architecture | Measurement ID | Resident Memory (RSS) | p50 Latency | Throughput |\n"); + out.push_str("| :--- | :--- | :--- | :---: | :---: | :---: |\n"); + + for mem in &data.memory_rss { + let lat = data.latency_concurrency.iter().find(|l| l.service == mem.service); + let id = mem.measurement_id.as_deref().unwrap_or("BENCH-UNKNOWN"); + let rss_str = if mem.reduction_pct > 0.0 { + format!("{:.2} MB (-{:.1}%)", mem.rss_mb, mem.reduction_pct) + } else { + format!("{:.2} MB", mem.rss_mb) + }; + let (lat_str, tps_str) = match lat { + Some(l) => ( + format!("{:.2} ms", l.p50_ms), + format!("{:.0} req/s", l.requests_per_sec), + ), + None => ("N/A".to_string(), "N/A".to_string()), + }; + + out.push_str(&format!( + "| {} | {} | `{}` | {} | {} | {} |\n", + mem.role, mem.architecture, id, rss_str, lat_str, tps_str + )); } + + out.push_str("\n*Hardware Reference: "); + out.push_str(&data.hardware.system); + out.push_str(" ("); + out.push_str(&data.hardware.processor); + out.push_str(", "); + out.push_str(&data.hardware.memory_unified_gb.to_string()); + out.push_str(" GB unified memory). All metrics measured under concurrency C="); + out.push_str(&data.environment.concurrency_tested.to_string()); + out.push_str(" over "); + out.push_str(&data.environment.requests_per_endpoint.to_string()); + out.push_str(" requests per endpoint.*\n"); + out.push_str("<!-- AIEN:BENCHMARKS:END -->"); + out +} + +pub fn sync_markdown_content(content: &str, replacement: &str) -> String { + let start_marker = "<!-- AIEN:BENCHMARKS:START -->"; + let end_marker = "<!-- AIEN:BENCHMARKS:END -->"; + + let start_idx = match content.find(start_marker) { + Some(idx) => idx, + None => return content.to_string(), + }; + + let end_idx = match content.find(end_marker) { + Some(idx) => idx + end_marker.len(), + None => return content.to_string(), + }; + + let mut out = String::with_capacity(content.len() + replacement.len()); + out.push_str(&content[..start_idx]); + out.push_str(replacement); + out.push_str(&content[end_idx..]); + out } #[cfg(test)] @@ -303,4 +420,25 @@ mod tests { assert!(!lat_svg.contains('\u{2014}'), "Must not contain em dash"); assert!(!lat_svg.contains('\u{2013}'), "Must not contain en dash"); } + + #[test] + fn test_sync_markdown_table_generation() { + let raw = include_str!("../data/benchmarks_latest.json"); + let data: BenchmarkData = serde_json::from_str(raw).expect("Valid JSON"); + let table = generate_markdown_table(&data); + + assert!(table.contains("<!-- AIEN:BENCHMARKS:START -->")); + assert!(table.contains("<!-- AIEN:BENCHMARKS:END -->")); + assert!(table.contains("BENCH-FASTAPI-RSS-001")); + assert!(table.contains("BENCH-CORTEX-RSS-001")); + assert!(!table.contains('\u{2014}'), "Must not contain em dash"); + assert!(!table.contains('\u{2013}'), "Must not contain en dash"); + + let doc = "# Header\n<!-- AIEN:BENCHMARKS:START -->\nold table\n<!-- AIEN:BENCHMARKS:END -->\n# Footer"; + let synced = sync_markdown_content(doc, &table); + assert!(synced.contains("# Header")); + assert!(synced.contains("# Footer")); + assert!(synced.contains("BENCH-FASTAPI-RSS-001")); + assert!(!synced.contains("old table")); + } } diff --git a/src/models.rs b/src/models.rs index 9ecb05f..90e0941 100644 --- a/src/models.rs +++ b/src/models.rs @@ -4,6 +4,12 @@ use serde::{Deserialize, Serialize}; pub struct BenchmarkData { pub benchmark_suite: String, pub version: String, + #[serde(default)] + pub schema_version: Option<String>, + #[serde(default)] + pub benchmark_commit: Option<String>, + #[serde(default)] + pub core_commit: Option<String>, pub timestamp: String, pub hardware: HardwareInfo, #[serde(default)] @@ -45,6 +51,8 @@ pub struct EnvironmentInfo { #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct MemoryMetric { + #[serde(default)] + pub measurement_id: Option<String>, pub service: String, pub role: String, pub architecture: String, @@ -55,6 +63,8 @@ pub struct MemoryMetric { #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LatencyMetric { + #[serde(default)] + pub measurement_id: Option<String>, pub service: String, pub endpoint: String, pub description: String, @@ -69,6 +79,8 @@ pub struct LatencyMetric { #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LikeForLikeMetric { + #[serde(default)] + pub measurement_id: Option<String>, pub category: String, pub workload: String, pub rust_engine: String, @@ -85,6 +97,8 @@ pub struct LikeForLikeMetric { #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct NeuralMetric { + #[serde(default)] + pub measurement_id: Option<String>, pub workload: String, pub model: String, pub engine: String, @@ -94,6 +108,8 @@ pub struct NeuralMetric { #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ConcurrencyPressureMetric { + #[serde(default)] + pub measurement_id: Option<String>, pub concurrency: u32, pub aien_ttft_p50_ms: f64, pub aien_ttft_p95_ms: f64, @@ -108,6 +124,8 @@ pub struct ConcurrencyPressureMetric { #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ContextScalingMetric { + #[serde(default)] + pub measurement_id: Option<String>, pub context_length: u32, pub ttft_p50_ms: f64, pub prefix_cache_hit_pct: f64,