ci: lint all targets, run interop suites for real, compile benches
- clippy --all-targets plus a clawhdf5-format feature matrix (parallel, lz4, zstd, pcodec, fast-checksum); fix the accumulated lint backlog in test, bench and feature-gated code (no behaviour changes). - Install python3 + h5py/numpy/netCDF4/xarray in the CI container and set CLAWHDF5_REQUIRE_INTEROP=1, which makes a missing interop dependency a test failure. Every h5py/netCDF4 interop test used to skip silently in CI. Run the #[ignore]d writer_h5py_tests suite explicitly. - cargo bench --no-run so benches can't rot; fix bench.rs and memory_bench.rs, which no longer compiled against the current strategy/consolidation APIs. - Optional fuzz smoke run via CLAWHDF5_FUZZ_SECONDS. - CHANGELOG and docs/known-issues.md updated. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
706189c3ef
commit
bbe1baa208
@@ -563,7 +563,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_importance_scorer_surprise_identical() {
|
||||
let emb = unit_vec(4, 0);
|
||||
let existing = vec![MemoryRecord {
|
||||
let existing = [MemoryRecord {
|
||||
id: 0,
|
||||
chunk: "existing".to_string(),
|
||||
embedding: emb.clone(),
|
||||
@@ -603,23 +603,20 @@ mod tests {
|
||||
fn test_importance_scorer_length() {
|
||||
assert!((ImportanceScorer::score_length("")).abs() < f32::EPSILON);
|
||||
// 50 words → 0.5
|
||||
let fifty_words = std::iter::repeat("word")
|
||||
.take(50)
|
||||
let fifty_words = std::iter::repeat_n("word", 50)
|
||||
.collect::<Vec<_>>()
|
||||
.join(" ");
|
||||
let s50 = ImportanceScorer::score_length(&fifty_words);
|
||||
assert!((s50 - 0.5).abs() < 1e-5, "expected 0.5, got {s50}");
|
||||
|
||||
// 100 words → 1.0
|
||||
let hundred_words = std::iter::repeat("word")
|
||||
.take(100)
|
||||
let hundred_words = std::iter::repeat_n("word", 100)
|
||||
.collect::<Vec<_>>()
|
||||
.join(" ");
|
||||
assert_eq!(ImportanceScorer::score_length(&hundred_words), 1.0);
|
||||
|
||||
// 200 words → still 1.0 (clamped)
|
||||
let two_hundred = std::iter::repeat("word")
|
||||
.take(200)
|
||||
let two_hundred = std::iter::repeat_n("word", 200)
|
||||
.collect::<Vec<_>>()
|
||||
.join(" ");
|
||||
assert_eq!(ImportanceScorer::score_length(&two_hundred), 1.0);
|
||||
@@ -693,9 +690,11 @@ mod tests {
|
||||
// ---------------------------------------------------------------------------
|
||||
#[test]
|
||||
fn test_consolidate_eviction_working() {
|
||||
let mut cfg = ConsolidationConfig::default();
|
||||
cfg.working_capacity = 3;
|
||||
cfg.working_to_episodic_threshold = 2.0; // never promote in this test
|
||||
let cfg = ConsolidationConfig {
|
||||
working_capacity: 3,
|
||||
working_to_episodic_threshold: 2.0, // never promote in this test
|
||||
..Default::default()
|
||||
};
|
||||
let mut engine = ConsolidationEngine::new(cfg);
|
||||
|
||||
// Add 5 records; all have very low importance so none get promoted.
|
||||
@@ -853,9 +852,11 @@ mod tests {
|
||||
// ---------------------------------------------------------------------------
|
||||
#[test]
|
||||
fn test_consolidate_episodic_eviction() {
|
||||
let mut cfg = ConsolidationConfig::default();
|
||||
cfg.episodic_capacity = 3;
|
||||
cfg.working_to_episodic_threshold = 2.0; // never auto-promote from Working
|
||||
let cfg = ConsolidationConfig {
|
||||
episodic_capacity: 3,
|
||||
working_to_episodic_threshold: 2.0, // never auto-promote from Working
|
||||
..Default::default()
|
||||
};
|
||||
let mut engine = ConsolidationEngine::new(cfg);
|
||||
|
||||
// Seed 5 records directly in Episodic.
|
||||
|
||||
Reference in New Issue
Block a user