interplane.Get Omega
Read in your language

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

branch main Branches Tags History

benchmarks-mv / src / bin / bench_verify_records.rs

84 lines · 3194 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//! Offline evidence-integrity check: validates benchmark records and SHA256SUMS artifact bundles.
17//!
18//! Usage: `bench_verify_records [--root <repo>] [--tracked] [PATH...]` (default paths: `records`,
19//! `artifacts`). `--tracked` adds every record and samples file git tracks under the root, found
20//! by its schema in `evidence::tracked_targets` (bad fixtures excluded), to the PATHs given.
21//! Prints one `path: field: reason` line per defect on stdout and exits 1 when there is any;
22//! exits 0 when every file passes. Reads files only: no network, no GPU, no live server.
23
24use aien_benchmarks::evidence::{tracked_targets, verify_paths};
25use clap::Parser;
26use std::path::PathBuf;
27
28#[derive(Parser)]
29#[command(name = "bench_verify_records")]
30#[command(about = "Validate aien-bench-record/1 records and SHA256SUMS bundles (offline)")]
31struct Args {
32 /// Repository root that evidence paths are relative to
33 #[arg(long, default_value = ".")]
34 root: PathBuf,
35
36 /// Also check every record and samples JSON that git tracks under the root
37 #[arg(long)]
38 tracked: bool,
39
40 /// Files or directories to check, relative to the root (default `records artifacts`
41 /// without --tracked, none with it)
42 paths: Vec<String>,
43}
44
45fn main() {
46 let args = Args::parse();
47 let mut paths = args.paths.clone();
48 if args.tracked {
49 let found = match tracked_targets(&args.root) {
50 Ok(found) => found,
51 Err(e) => {
52 eprintln!("bench_verify_records: --tracked: {e}");
53 std::process::exit(2);
54 }
55 };
56 // A tracked target inside a PATH given by hand is checked once, by that PATH.
57 let given = paths.clone();
58 paths.extend(found.into_iter().filter(|t| {
59 !given.iter().any(|g| {
60 let g = g.trim_end_matches('/');
61 t == g || t.starts_with(&format!("{g}/"))
62 })
63 }));
64 } else if paths.is_empty() {
65 paths = vec!["records".to_string(), "artifacts".to_string()];
66 }
67 let report = verify_paths(&args.root, &paths);
68 for note in &report.notes {
69 eprintln!("bench_verify_records: {note}");
70 }
71 for d in &report.defects {
72 println!("{d}");
73 }
74 eprintln!(
75 "bench_verify_records: {} records, {} bundles ({} files digest-checked), {} defects",
76 report.records,
77 report.bundles,
78 report.bundle_files,
79 report.defects.len()
80 );
81 if !report.defects.is_empty() {
82 std::process::exit(1);
83 }
84}