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/aien-sovereign-core-mv/blob/main/crates/crumbs/src/bin/crumbs.rs # aien-sovereign-core-mv AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination. 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 `aien-sovereign-core-mv / crates / crumbs / src / bin / crumbs.rs` 126 lines ยท 4486 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 //! `crumbs` command-line tool (sealed side). 17 //! 18 //! crumbs families list registered families (sealed labels) 19 //! crumbs vectors DIR write Crumb v1 conformance vectors 20 //! crumbs run --learner PATH [--n N] [--seed S] [--library] [--out DIR] 21 //! crumbs experiment --learner PATH [--out DIR] [--seed S] [--phase1 N] 22 //! crumbs gates --learner PATH [--out DIR] learner-dependent qualification gates 23 24 use crumbs::gen::{self, registry}; 25 use crumbs::mixer::{Mixer, MixerConfig}; 26 use crumbs::promotion::PromotionConfig; 27 use crumbs::protocol::SearchConfig; 28 use crumbs::session::{Session, SessionConfig}; 29 use std::path::PathBuf; 30 31 fn arg(args: &[String], name: &str) -> Option { 32 args.iter() 33 .position(|a| a == name) 34 .and_then(|i| args.get(i + 1).cloned()) 35 } 36 37 fn flag(args: &[String], name: &str) -> bool { 38 args.iter().any(|a| a == name) 39 } 40 41 fn main() { 42 let args: Vec = std::env::args().collect(); 43 let cmd = args.get(1).map(String::as_str).unwrap_or("help"); 44 let code = match cmd { 45 "families" => { 46 for f in ®istry().families { 47 println!( 48 "{:4} {:32} {:26} {:?} {:?}", 49 f.id, 50 f.key, 51 f.mechanism.key(), 52 f.rung, 53 f.source_family 54 ); 55 } 56 0 57 } 58 "vectors" => crumbs::conformance::write_vectors(&PathBuf::from(args.get(2).expect("DIR"))), 59 "run" => run(&args), 60 "experiment" => crumbs::experiment::main(&args), 61 "gates" => crumbs::gates::main(&args), 62 _ => { 63 eprintln!("usage: crumbs families | vectors DIR | run --learner PATH | experiment --learner PATH | gates --learner PATH"); 64 2 65 } 66 }; 67 std::process::exit(code); 68 } 69 70 fn run(args: &[String]) -> i32 { 71 let learner = arg(args, "--learner").expect("--learner PATH"); 72 let n: u64 = arg(args, "--n").map_or(40, |v| v.parse().unwrap()); 73 let seed: u64 = arg(args, "--seed").map_or(1, |v| v.parse().unwrap()); 74 let cfg = SessionConfig { 75 condition: if flag(args, "--library") { 76 "learning".into() 77 } else { 78 "control".into() 79 }, 80 learner, 81 run_id: format!("run-{seed}"), 82 search: SearchConfig::default(), 83 library_enabled: flag(args, "--library"), 84 promotion: PromotionConfig::default(), 85 record_transcript: false, 86 out_dir: arg(args, "--out").map(PathBuf::from), 87 }; 88 let mut s = Session::start(cfg).expect("learner starts"); 89 let mut mixer = Mixer::new(MixerConfig::default(), seed); 90 for _ in 0..n { 91 let d = mixer.draw(); 92 let fam = registry().get(d.family_id).unwrap(); 93 let o = s 94 .present(fam, d.seed, d.population, "run") 95 .expect("session"); 96 mixer.record(fam, o.verified); 97 println!( 98 "{:4} {:30} pop={:?} supported={} accepted={} verified={} subs={} fh={} gen={} lib_avail={} reuse={} admitted={}", 99 o.seq, 100 o.family_key, 101 o.population, 102 o.supported, 103 o.accepted, 104 o.verified, 105 o.evaluations.len(), 106 o.falsified_hidden(), 107 o.stats.generated, 108 o.library_ops_available, 109 o.reused_library(), 110 o.admissions_after.len() 111 ); 112 } 113 let _ = gen::GENERATOR_VERSION; 114 let (ledger, _, ladder) = s.finish().expect("clean shutdown"); 115 println!( 116 "ledger head {} records {}", 117 ledger.head, 118 ledger.records.len() 119 ); 120 println!( 121 "ops tracked {} admitted {}", 122 ladder.ops.len(), 123 ladder.count(crumbs::promotion::Stage::Admitted) 124 ); 125 0 126 }