feat: integrate tracing and enhance bit matrix operations

Add the `tracing` crate to `obidebruinj`, `obisys`, and resolve it in `Cargo.lock`. Replace `eprintln!` statements with structured `debug!` and `info!` macros. Introduce a `TracedBar` wrapper for progress bars and enhance the `Stage` lifecycle to emit structured events for timing, memory metrics, and swap warnings. Add a progress spinner for unitig degree computation. Extend `PersistentBitMatrix` with columnar bit-vector operations and parallel distance methods, enabling uniform distance computations across all storage layouts while replacing previous panics with dimension-based fallbacks.
This commit is contained in:
Eric Coissac
2026-06-08 19:48:17 +02:00
parent 3f47e22083
commit 09d9e21744
8 changed files with 405 additions and 41 deletions
+1
View File
@@ -10,6 +10,7 @@ ahash = "0.8"
hashbrown = { version = "0.14", features = ["rayon"] }
rayon = "1"
xxhash-rust = { version = "0.8.15", features = ["xxh3", "const_xxh3"] }
tracing = "0.1"
[features]
test-utils = []
+8 -7
View File
@@ -2,10 +2,11 @@
use hashbrown::HashMap;
use obikseq::k;
use obikseq::{CanonicalKmer, Sequence};
use rayon::prelude::*;
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
use std::fmt;
use std::sync::atomic::{AtomicU8, Ordering};
use xxhash_rust::xxh3::Xxh3Builder;
use tracing::{debug, info};
// ── Types ─────────────────────────────────────────────────────────────────────
@@ -379,7 +380,7 @@ impl GraphDeBruijn {
});
let n = n_new.load(Ordering::Relaxed);
eprintln!("[for_each_unitig] pass {}: {} starts", pass, n);
debug!("[for_each_unitig] pass {}: {} starts", pass, n);
n_chains.fetch_add(n, Ordering::Relaxed);
pass += 1;
if n == 0 {
@@ -410,11 +411,11 @@ impl GraphDeBruijn {
}
}
eprintln!(
"[for_each_unitig] chains={} phase2={} total={}",
n_chains.load(Ordering::Relaxed),
n2.load(Ordering::Relaxed),
n_chains.load(Ordering::Relaxed) + n2.load(Ordering::Relaxed),
info!(
chains = n_chains.load(Ordering::Relaxed),
phase2 = n2.load(Ordering::Relaxed),
total = n_chains.load(Ordering::Relaxed) + n2.load(Ordering::Relaxed),
"unitig traversal complete"
);
}