Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/benchmarks-mv/blob/main/src/bin/bench_index.rs # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `benchmarks-mv / src / bin / bench_index.rs` 59 lines ยท 2102 bytes Raw Blame History 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2026 Drake Stapleton (AIEN / aien-dev) 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 16 //! Writes (or with `--check`, compares) `docs/PERF_INDEX.md`, the generated discovery index. 17 //! 18 //! Usage: `bench_index [--root ] [--check]`. With `--check` it writes nothing and exits 1 19 //! when the committed index differs from what the files in the repository produce. 20 21 use aien_benchmarks::perf_index::{generate, INDEX_PATH}; 22 use clap::Parser; 23 use std::fs; 24 use std::path::PathBuf; 25 26 #[derive(Parser)] 27 #[command(name = "bench_index")] 28 #[command(about = "Generate docs/PERF_INDEX.md from the files in this repository")] 29 struct Args { 30 /// Repository root 31 #[arg(long, default_value = ".")] 32 root: PathBuf, 33 34 /// Compare instead of writing; exit 1 if the committed index is out of date 35 #[arg(long)] 36 check: bool, 37 } 38 39 fn main() { 40 let args = Args::parse(); 41 let text = generate(&args.root); 42 let path = args.root.join(INDEX_PATH); 43 if args.check { 44 let current = fs::read_to_string(&path).unwrap_or_default(); 45 if current != text { 46 eprintln!( 47 "bench_index: {INDEX_PATH} is out of date; run: cargo run --release --bin bench_index" 48 ); 49 std::process::exit(1); 50 } 51 eprintln!("bench_index: {INDEX_PATH} is up to date"); 52 return; 53 } 54 if let Err(e) = fs::write(&path, text) { 55 eprintln!("bench_index: cannot write {INDEX_PATH}: {e}"); 56 std::process::exit(2); 57 } 58 eprintln!("bench_index: wrote {INDEX_PATH}"); 59 }