MCPcopy Create free account
hub / github.com/argumentcomputer/ix / check_consts_loop

Function check_consts_loop

crates/ffi/src/kernel.rs:2382–2492  ·  view source on GitHub ↗
(
  ixon_env: Arc<IxonEnv>,
  lookups: Arc<IxonIngressLookups>,
  names: Vec<Name>,
  expect_pass: Vec<bool>,
  ungrounded: FxHashMap<Name, String>,
  work: Vec<CheckWorkItem>,
  quiet: bool,
  failur

Source from the content-addressed store, hash-verified

2380 TypeChecker::<Anon>::new_with_lazy_anon(&mut kenv, &env);
2381 let r = tc.check_const(&kid);
2382 // The TypeChecker is recreated per work item, so the final
2383 // constant's record would never be flushed by a trailing reset —
2384 // flush it explicitly.
2385 tc.finish_constant_accounting();
2386 r
2387 };
2388 if res.is_ok() {
2389 passed.fetch_add(1, Ordering::Relaxed);
2390 } else {
2391 failed.fetch_add(1, Ordering::Relaxed);
2392 }
2393 checks_since_clear += 1;
2394 }
2395 if let Some(sink) = kenv.profile_sink.take() {
2396 sinks.lock().unwrap().push(sink);
2397 }
2398 })
2399 .map_err(|e| format!("spawn profile worker: {e}"))?;
2400 handles.push(handle);
2401 }
2402
2403 let mut panicked = false;
2404 for h in handles {
2405 if h.join().is_err() {
2406 panicked = true;
2407 }
2408 }
2409 if panicked {
2410 return Err("profile worker panicked".to_string());
2411 }
2412
2413 let mut merged = ProfileSink::new(isolate);
2414 let collected = Arc::try_unwrap(sinks)
2415 .map_err(|_| "profile sinks still shared".to_string())?
2416 .into_inner()
2417 .map_err(|_| "profile sinks mutex poisoned".to_string())?;
2418 for s in collected {
2419 merged.merge(s);
2420 }
2421 Ok((passed.load(Ordering::Relaxed), failed.load(Ordering::Relaxed), merged))
2422}
2423
2424/// Profile a `.ixe` out of circuit and write the `.ixprof` sidecar. Pure-Rust
2425/// entry point (used by the FFI wrapper and Rust tests).
2426pub fn profile_anon_ixe(
2427 path: &str,
2428 out: &str,
2429 isolate: bool,
2430 quiet: bool,
2431) -> Result<ProfileStats, String> {
2432 let load_start = Instant::now();
2433 let ixon_env = IxonEnv::get_anon_mmap(std::path::Path::new(path))
2434 .map_err(|e| format!("profile: mmap+deserialize {path}: {e}"))?;
2435 eprintln!(
2436 "[rs_kernel_profile] loaded {} consts in {:.1?}",
2437 ixon_env.const_count(),
2438 load_start.elapsed()
2439 );

Callers

nothing calls this directly

Calls 15

kernel_check_clear_everyFunction · 0.85
check_one_constFunction · 0.85
startMethod · 0.80
prefixMethod · 0.80
persistMethod · 0.80
is_expectedMethod · 0.80
is_slowMethod · 0.80
checked_suffixMethod · 0.80
prettyMethod · 0.80
flushMethod · 0.80

Tested by

no test coverage detected