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

Method report

crates/ffi/src/kernel.rs:2642–2720  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

2640 "[123/456] _private.Std.Tactic.BVDecide.LRAT.Internal.Formula.Proof";
2641 let compact = compact_in_flight_label(label, 40);
2642 assert!(compact.starts_with("[123/456] ..."));
2643 assert!(compact.ends_with("Internal.Formula.Proof"));
2644 assert!(compact.chars().count() <= 40);
2645 }
2646
2647 #[test]
2648 fn compact_in_flight_label_handles_tiny_limits() {
2649 assert_eq!(compact_in_flight_label("[1/2] Very.Long.Name", 0), "");
2650 assert_eq!(compact_in_flight_label("[1/2] Very.Long.Name", 2), "[1");
2651 }
2652}
2653
2654/// Default threshold at and above which a completed check is "slow" enough to
2655/// keep a persistent line in quiet mode. Override with
2656/// `IX_KERNEL_CHECK_SLOW_MS`.
2657const DEFAULT_SLOW_THRESHOLD: Duration = Duration::from_secs(7);
2658
2659/// Default threshold for a one-shot "still checking ..." line when an active
2660/// parallel check has been in-flight for a long time. Override with
2661/// `IX_KERNEL_CHECK_ACTIVE_SLOW_MS`; set it to `0` to disable the notice.
2662const DEFAULT_ACTIVE_SLOW_THRESHOLD: Duration = Duration::from_secs(30);
2663
2664const DEFAULT_IN_FLIGHT_LIMIT: usize = 3;
2665const DEFAULT_IN_FLIGHT_LABEL_CHARS: usize = 120;
2666const DEFAULT_CHECK_CLEAR_EVERY: usize = 1;
2667
2668fn env_duration_ms(var: &str, default: Duration) -> Duration {
2669 std::env::var(var)
2670 .ok()
2671 .and_then(|s| s.parse::<u64>().ok())
2672 .map_or(default, Duration::from_millis)
2673}
2674
2675fn env_duration_ms_optional(var: &str, default: Duration) -> Option<Duration> {
2676 let ms = std::env::var(var)
2677 .ok()
2678 .and_then(|s| s.parse::<u64>().ok())
2679 .unwrap_or_else(|| u64::try_from(default.as_millis()).unwrap_or(u64::MAX));
2680 if ms == 0 { None } else { Some(Duration::from_millis(ms)) }
2681}
2682
2683fn env_usize(var: &str, default: usize) -> usize {
2684 std::env::var(var)
2685 .ok()
2686 .and_then(|s| s.parse::<usize>().ok())
2687 .unwrap_or(default)
2688}
2689
2690fn kernel_check_slow_threshold() -> Duration {
2691 env_duration_ms("IX_KERNEL_CHECK_SLOW_MS", DEFAULT_SLOW_THRESHOLD)
2692}
2693
2694fn kernel_check_clear_every() -> usize {
2695 env_usize("IX_KERNEL_CHECK_CLEAR_EVERY", DEFAULT_CHECK_CLEAR_EVERY).max(1)
2696}
2697
2698/// Threshold (max cache len) above which a per-block diagnostic line is
2699/// emitted, when `IX_KERNEL_CHECK_DIAG=1`. Default 100k entries — empirically

Callers 1

spawn_reporterMethod · 0.45

Calls 7

kernel_check_mem_suffixFunction · 0.85
pushMethod · 0.80
logMethod · 0.80
iterMethod · 0.45
cloneMethod · 0.45
takeMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected