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

Function find_diff

crates/ffi/src/kernel.rs:3251–3383  ·  view source on GitHub ↗
(
  a: &ix_common::env::Expr,
  b: &ix_common::env::Expr,
  path: &str,
)

Source from the content-addressed store, hash-verified

3249 &check.label,
3250 self.in_flight_label_chars
3251 ),
3252 age.as_secs_f64()
3253 ));
3254 }
3255 }
3256 }
3257 }
3258
3259 let mut entries: Vec<_> = active
3260 .iter()
3261 .filter_map(|slot| {
3262 slot.as_ref().map(|check| (check.started, check.label.clone()))
3263 })
3264 .collect();
3265 entries.sort_by_key(|(started, _)| *started);
3266 let in_flight = entries
3267 .into_iter()
3268 .take(self.in_flight_limit)
3269 .map(|(started, label)| {
3270 format!(
3271 "{} ({:.0}s)",
3272 compact_in_flight_label(&label, self.in_flight_label_chars),
3273 started.elapsed().as_secs_f64()
3274 )
3275 })
3276 .collect::<Vec<_>>();
3277 (in_flight, active_slow_lines)
3278 };
3279 let active_suffix = if in_flight.is_empty() {
3280 String::new()
3281 } else {
3282 format!(" · in-flight: {}", in_flight.join(", "))
3283 };
3284 let mem_suffix = kernel_check_mem_suffix(Some(&self.peak_rss_mib));
3285
3286 self.log(&format!(
3287 "[rs_kernel_check] {done}/{} ({pct:.1}%) · {:.1}/s · elapsed {:.0}s{eta}{mem_suffix}{active_suffix}",
3288 self.total,
3289 rate,
3290 elapsed,
3291 ));
3292 for line in active_slow_lines {
3293 self.log(&line);
3294 }
3295 }
3296
3297 fn log(&self, line: &str) {
3298 let _guard = self.print_lock.lock().unwrap();
3299 eprintln!("{line}");
3300 }
3301}
3302
3303fn kernel_check_progress_interval() -> Option<Duration> {
3304 let ms = std::env::var("IX_KERNEL_CHECK_PROGRESS_MS")
3305 .ok()
3306 .or_else(|| std::env::var("IX_PROGRESS_MS").ok())
3307 .and_then(|s| s.parse::<u64>().ok())
3308 .unwrap_or(2000);

Callers 1

compare_envsFunction · 0.85

Calls 9

hash_data_valueFunction · 0.85
get_hashMethod · 0.80
as_dataMethod · 0.80
joinMethod · 0.80
finalizeMethod · 0.80
pushMethod · 0.80
iterMethod · 0.45
lenMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected