chore: update dependencies and adapt to updated crate APIs
Bumps core dependencies including ndarray, rand, hashbrown, niffler, ureq, sysinfo, indicatif, lru, and remove_dir_all. Adapts source code to accommodate breaking changes by migrating RNG initialization, adjusting HTTP response handling, and replacing the fs4 crate with standard library file locking. Adds a planning document for query benchmarking and sparse index regression tests.
This commit is contained in:
Generated
+247
-479
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ edition = "2024"
|
||||
[dependencies]
|
||||
common_traits = "0.11"
|
||||
memmap2 = "0.9"
|
||||
ndarray = "0.16"
|
||||
ndarray = "0.17"
|
||||
rayon = "1"
|
||||
tempfile = "3"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ edition = "2021"
|
||||
obikseq = { path = "../obikseq" }
|
||||
obifastwrite = { path = "../obifastwrite" }
|
||||
ahash = "0.8"
|
||||
hashbrown = { version = "0.14", features = ["rayon"] }
|
||||
hashbrown = { version = "0.17", features = ["rayon"] }
|
||||
rayon = "1"
|
||||
crossbeam-channel = "0.5"
|
||||
xxhash-rust = { version = "0.8.15", features = ["xxh3", "const_xxh3"] }
|
||||
|
||||
@@ -11,12 +11,12 @@ obiskio = { path = "../obiskio" }
|
||||
obisys = { path = "../obisys" }
|
||||
obicompactvec = { path = "../obicompactvec" }
|
||||
obilayeredmap = { path = "../obilayeredmap" }
|
||||
ndarray = "0.16"
|
||||
ndarray = "0.17"
|
||||
rayon = "1"
|
||||
crossbeam-channel = "0.5"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
indicatif = "0.17"
|
||||
indicatif = "0.18"
|
||||
tracing = "0.1.44"
|
||||
hwlocality = { version = "1.0.0-alpha.11", features = ["vendored"], optional = true }
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ obikrope = { path = "../obikrope" }
|
||||
|
||||
[dependencies]
|
||||
niffler = "3.0.0"
|
||||
remove_dir_all = "0.8"
|
||||
remove_dir_all = "1.0"
|
||||
obikseq = { path = "../obikseq" }
|
||||
obikentropy = { path = "../obikentropy" }
|
||||
obiskbuilder = { path = "../obiskbuilder" }
|
||||
@@ -19,7 +19,7 @@ obiskio = { path = "../obiskio" }
|
||||
obidebruinj = { path = "../obidebruinj" }
|
||||
obilayeredmap = { path = "../obilayeredmap" }
|
||||
rayon = "1"
|
||||
sysinfo = "0.33"
|
||||
sysinfo = "0.39"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
tracing = "0.1.44"
|
||||
@@ -28,6 +28,6 @@ epserde = "0.8"
|
||||
memmap2 = "0.9.10"
|
||||
obicompactvec = { path = "../obicompactvec" }
|
||||
ptr_hash = "1.1"
|
||||
indicatif = "0.17"
|
||||
indicatif = "0.18"
|
||||
obisys = { path = "../obisys" }
|
||||
obipipeline = { path = "../obipipeline" }
|
||||
|
||||
@@ -14,8 +14,8 @@ obilayeredmap = { path = "../obilayeredmap" }
|
||||
obiskbuilder = { path = "../obiskbuilder" }
|
||||
obipipeline = { path = "../obipipeline" }
|
||||
memmap2 = "0.9"
|
||||
ndarray = "0.16"
|
||||
rand = "0.8"
|
||||
ndarray = "0.17"
|
||||
rand = "0.10"
|
||||
rayon = "1"
|
||||
tracing = "0.1.44"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
use std::collections::HashSet;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use rand::Rng;
|
||||
use rand::RngExt;
|
||||
use rayon::prelude::*;
|
||||
|
||||
use obikindex::{KmerIndex, OKIError, OKIResult};
|
||||
@@ -97,7 +97,7 @@ fn reservoir_sample_layer(layer_dir: &Path, n_layer: usize) -> OKIResult<HashSet
|
||||
let mut reservoir: Vec<usize> = Vec::with_capacity(n_layer);
|
||||
let mut seen: u64 = 0;
|
||||
let mut family_idx: usize = 0;
|
||||
let mut rng = rand::thread_rng();
|
||||
let mut rng = rand::rng();
|
||||
for slot in 0..annex.len() {
|
||||
let Some(mask) = annex.get(slot) else { continue };
|
||||
if !mask.is_minorant() {
|
||||
@@ -111,7 +111,7 @@ fn reservoir_sample_layer(layer_dir: &Path, n_layer: usize) -> OKIResult<HashSet
|
||||
if reservoir.len() < n_layer {
|
||||
reservoir.push(this_family_idx);
|
||||
} else {
|
||||
let j = rng.gen_range(0..=seen);
|
||||
let j = rng.random_range(0..=seen);
|
||||
if j < n_layer as u64 {
|
||||
reservoir[j as usize] = this_family_idx;
|
||||
}
|
||||
@@ -188,7 +188,7 @@ fn entropy_biased_sample_layer(layer_dir: &Path, p0: f64, bias: EntropyBias) ->
|
||||
let entropy_annex = EntropyAnnex::open(&layer_dir.join(ENTROPY_ANNEX_FILE_NAME)).map_err(OKIError::Io)?;
|
||||
let mut selected = HashSet::new();
|
||||
let mut family_idx: usize = 0;
|
||||
let mut rng = rand::thread_rng();
|
||||
let mut rng = rand::rng();
|
||||
for slot in 0..annex.len() {
|
||||
let Some(mask) = annex.get(slot) else { continue };
|
||||
if !mask.is_minorant() {
|
||||
@@ -207,7 +207,7 @@ fn entropy_biased_sample_layer(layer_dir: &Path, p0: f64, bias: EntropyBias) ->
|
||||
let Some(entropy) = entropy_annex.get(this_family_idx) else { continue };
|
||||
let d = (entropy as f64 - bias.mu) / bias.sigma;
|
||||
let w = (-0.5 * d * d).exp();
|
||||
if rng.r#gen::<f64>() < p0 * w {
|
||||
if rng.random::<f64>() < p0 * w {
|
||||
selected.insert(this_family_idx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ ptr_hash = "1.1"
|
||||
cacheline-ef = "1.1"
|
||||
epserde = "0.8"
|
||||
rayon = "1"
|
||||
ndarray = "0.16"
|
||||
ndarray = "0.17"
|
||||
bitvec = "1"
|
||||
memmap2 = "0.9"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
||||
@@ -5,11 +5,15 @@ edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
obikrope = { path = "../obikrope" }
|
||||
niffler = { version = "2", default-features = false, features = ["gz", "bz2", "lzma", "zstd"] }
|
||||
bzip2-sys = { version = "0.1", features = ["static"] }
|
||||
liblzma-sys = { version = "0.3", features = ["static"] }
|
||||
ureq = "2"
|
||||
niffler = { version = "3", default-features = false, features = ["gz", "bz2", "lzma", "zstd"] }
|
||||
# `niffler`'s plain "bz2" feature only pulls the `bzip2` crate, without
|
||||
# picking a backend — its own "default" feature is what forwards
|
||||
# "bzip2/default" (the pure-Rust libbz2-rs-sys backend). Depend on it
|
||||
# directly, default features on, purely to select that backend.
|
||||
bzip2 = "0.6"
|
||||
liblzma = { version = "0.4", features = ["static"] }
|
||||
ureq = "3"
|
||||
tracing = "0.1.44"
|
||||
tracing-subscriber = { version = "0.3.23", features = ["fmt", "env-filter"] }
|
||||
infer = "0.19.0"
|
||||
infer = "0.22.0"
|
||||
regex = "1"
|
||||
|
||||
@@ -52,7 +52,7 @@ fn http_reader(url: &str) -> io::Result<Box<dyn Read + Send>> {
|
||||
ureq::get(url)
|
||||
.call()
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))
|
||||
.map(|resp| -> Box<dyn Read + Send> { Box::new(resp.into_reader()) })
|
||||
.map(|resp| -> Box<dyn Read + Send> { Box::new(resp.into_body().into_reader()) })
|
||||
}
|
||||
|
||||
fn decompress(raw: Box<dyn Read + Send>) -> io::Result<Box<dyn Read + Send>> {
|
||||
|
||||
@@ -6,7 +6,7 @@ edition = "2024"
|
||||
[dependencies]
|
||||
niffler = "3.0.0"
|
||||
rustix = { version = "1.1.4", features = ["process"] }
|
||||
lru = "0.12"
|
||||
lru = "0.18"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2"
|
||||
sysinfo = "0.33"
|
||||
indicatif = "0.17"
|
||||
sysinfo = "0.39"
|
||||
indicatif = "0.18"
|
||||
tracing = "0.1"
|
||||
fs4 = "0.9"
|
||||
|
||||
@@ -11,9 +11,9 @@ use tracing::info;
|
||||
/// only needs to lock the destination.
|
||||
///
|
||||
/// Uses the OS's advisory file lock (`flock` on Unix, `LockFileEx` on
|
||||
/// Windows) via `fs4`, not a hand-rolled PID file: the OS releases it
|
||||
/// automatically on process exit, including a crash — no stale-lock cleanup
|
||||
/// logic needed.
|
||||
/// Windows) via `std::fs::File::lock`/`try_lock`, not a hand-rolled PID
|
||||
/// file: the OS releases it automatically on process exit, including a
|
||||
/// crash — no stale-lock cleanup logic needed.
|
||||
pub struct DirLock {
|
||||
_file: std::fs::File,
|
||||
}
|
||||
@@ -23,8 +23,6 @@ impl DirLock {
|
||||
/// and the lock file within it if needed). Logs once if the wait is
|
||||
/// non-trivial, so a blocked command doesn't look silently hung.
|
||||
pub fn acquire(dir: &std::path::Path) -> std::io::Result<Self> {
|
||||
use fs4::fs_std::FileExt;
|
||||
|
||||
std::fs::create_dir_all(dir)?;
|
||||
let lock_path = dir.join(".obikmer.lock");
|
||||
let file = std::fs::OpenOptions::new()
|
||||
@@ -33,9 +31,9 @@ impl DirLock {
|
||||
.write(true)
|
||||
.open(&lock_path)?;
|
||||
|
||||
if file.try_lock_exclusive().is_err() {
|
||||
if file.try_lock().is_err() {
|
||||
info!(dir = %dir.display(), "waiting for another obikmer process to release this index");
|
||||
file.lock_exclusive()?;
|
||||
file.lock()?;
|
||||
}
|
||||
Ok(Self { _file: file })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user