Skip to content

ruvector-delta-index test_insert_and_search hangs indefinitely (DeltaHnsw insert/search) #825

Description

@ruvnet

Summary

ruvector-delta-index::tests::test_insert_and_search (crates/ruvector-delta-index/src/lib.rs:731) hangs indefinitely rather than failing. It is not slow — it never terminates.

Evidence

Observed on CI run 31675583441 (PR #822, ci/split-core-platform). The core-platform shard sat in a nextest SLOW loop on this single test for 3h 52m until the job was cancelled at the 240-minute cap. No other test in the shard reported progress after it started.

Reproduction / nondeterminism

The test builds its input from random_vector(128), which uses an unseeded rand::thread_rng():

fn random_vector(dim: usize) -> Vec<f32> {
    use rand::Rng;
    let mut rng = rand::thread_rng();
    (0..dim).map(|_| rng.gen()).collect()
}

#[test]
fn test_insert_and_search() {
    let mut index = DeltaHnsw::new(128, DeltaHnswConfig::default());
    for i in 0..100 {
        let vec = random_vector(128);
        index.insert(&format!("vec_{}", i), vec).unwrap();
    }
    assert_eq!(index.len(), 100);
    let query = random_vector(128);
    let results = index.search(&query, 10).unwrap();
    assert_eq!(results.len(), 10);
}

Because the vectors are unseeded, the hang is nondeterministic — it reproduces only for graph topologies that trigger the bug. This is consistent with the test having passed on earlier runs before the core-platform shard split surfaced it.

The hang is almost certainly an unterminated loop in DeltaHnsw::insert or DeltaHnsw::search — a candidate-set/visited-set traversal that fails to make progress (e.g. a neighbor list containing a cycle, or a while over a candidate heap that re-pushes an already-visited node).

Impact on CI

Until this is fixed, a hung test burns the full 240-minute job budget. Two mitigations landed in PR #822:

  1. .config/nextest.toml now sets slow-timeout = { period = "120s", terminate-after = 5 }, so any test is killed and reported as a failure after 10 minutes instead of running forever.
  2. ruvector-delta-index is temporarily held out of CI tests entirely — removed from the core-platform shard's package list and kept in the core-and-rest catch-all's --exclude list — so the crate does not block the pipeline.

Fix checklist

  • Root-cause the non-terminating loop in DeltaHnsw::insert / DeltaHnsw::search
  • Add a progress/iteration bound so a malformed graph fails loudly instead of hanging
  • Seed the test RNG (or use a fixed fixture) so the case is deterministic and regression-testable
  • Re-add -p ruvector-delta-index to the core-platform shard and drop its --exclude from core-and-rest in .github/workflows/ci.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions