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

Function rs_kernel_check_anon

crates/ffi/src/kernel.rs:1516–1624  ·  view source on GitHub ↗
(
  env_path: LeanString<LeanBorrowed<'_>>,
  quiet: LeanBool<LeanBorrowed<'_>>,
  fail_out: LeanString<LeanBorrowed<'_>>,
)

Source from the content-addressed store, hash-verified

1514
1515 for &result_idx in &result_idxs {
1516 // Each result slot is written exactly once across the
1517 // entire run. `build_anon_work` assigns disjoint
1518 // `result_idxs` per work item; if this assertion fires,
1519 // that invariant has been broken (likely by a future
1520 // dedup refactor) and we'd silently drop the second
1521 // write rather than expose the bug.
1522 if results[result_idx].set(result.clone()).is_err() {
1523 debug_assert!(
1524 false,
1525 "anon work-item dedup invariant: result slot {result_idx} set twice"
1526 );
1527 }
1528 if let (Some(log), Err((_, msg))) =
1529 (failure_log_worker.as_ref(), result.as_ref())
1530 {
1531 let label = format!("#{}", addrs[result_idx].hex());
1532 log.record(&label, msg);
1533 }
1534 }
1535 checks_since_clear += 1;
1536 }
1537 }) {
1538 Ok(h) => h,
1539 Err(e) => {
1540 progress.stop_reporter();
1541 if let Some(r) = reporter.take() {
1542 let _ = r.join();
1543 }
1544 for h in handles {
1545 let _ = h.join();
1546 }
1547 return Err(format!("spawn anon worker: {e}"));
1548 },
1549 };
1550 handles.push(handle);
1551 }
1552
1553 let mut panicked = false;
1554 for h in handles {
1555 if h.join().is_err() {
1556 panicked = true;
1557 }
1558 }
1559 progress.stop_reporter();
1560 if let Some(r) = reporter {
1561 let _ = r.join();
1562 }
1563 progress.log_mem_summary();
1564 if panicked {
1565 return Err("anon worker panicked".to_string());
1566 }
1567
1568 if let Some(path) = &per_const_out {
1569 let rows = per_const_rows
1570 .lock()
1571 .map_err(|e| format!("per-const entries poisoned: {e}"))?;
1572 let mut out = String::with_capacity(rows.len() * 96 + 96);
1573 out.push_str(

Callers

nothing calls this directly

Calls 10

run_anon_checks_parallelFunction · 0.85
build_uniform_errorFunction · 0.85
build_anon_result_arrayFunction · 0.85
finalizeMethod · 0.80
build_anon_workFunction · 0.70
is_emptyMethod · 0.45
lenMethod · 0.45
cloneMethod · 0.45
countMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected