• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

joaoh82 / rust_sqlite / 25079608728
69%

Build:
DEFAULT BRANCH: main
Ran 28 Apr 2026 09:56PM UTC
Jobs 1
Files 31
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Apr 2026 09:52PM UTC coverage: 70.927% (+0.6%) from 70.322%
25079608728

push

github

web-flow
Phase 7d.3: HNSW persistence + DELETE/UPDATE rebuild trigger (#52)

Closes out Phase 7d. Three intertwined pieces:

  1. **HNSW graph persistence** via a new KIND_HNSW (0x05) cell tag.
     New src/sql/pager/hnsw_cell.rs holds the HnswNodeCell encoder
     (varint node_id + per-layer neighbor lists). Each HNSW index
     gets its own page tree parallel to secondary indexes; the tree
     reuses TableLeaf pages because Cell::peek_rowid works
     uniformly across all cell kinds (it just reads the first
     varint after the kind tag, which is node_id here). Slot-
     directory binary search by node_id therefore works without
     HNSW-specific page-level code.

     Save: stage_hnsw_btree → stage_hnsw_leaves emit one cell per
     node, sibling-chained leaves + interior layers as the index
     grows past one page. The rootpage goes into sqlrite_master.

     Open: load_hnsw_nodes walks the leaves, decodes cells,
     hands the (id, layers) tuples to the new
     HnswIndex::from_persisted_nodes constructor — no algorithm
     runs on the load path; the loaded graph is bit-identical to
     what was saved. Compatibility path retained for files saved
     before persistence (rootpage == 0): execute_create_index
     re-walks current rows, same as 7d.2.

  2. **DELETE / UPDATE on HNSW-indexed tables now works.** The 7d.2
     refusals are removed. New `needs_rebuild` flag on
     HnswIndexEntry marks an index as stale when DELETE removes a
     row or UPDATE touches its column. save_database calls
     rebuild_dirty_hnsw_indexes at the top, before any immutable
     borrows: walks the table's current Vec<f32> column, builds a
     fresh HnswIndex, replaces the entry's index, clears the flag.
     Then the staging loop serializes the rebuilt graph.

     Cost: O(N · ef_construction · log N) per dirty index per save.
     Fine for ≤ 10k-row tables, expensive for ≥ 100k-row bulk
     deletes. Matches the trade-off SQLite makes for FTS5
     (rebuild-on-muta... (continued)

251 of 293 new or added lines in 5 files covered. (85.67%)

5 existing lines in 2 files now uncovered.

5211 of 7347 relevant lines covered (70.93%)

1.46 hits per line

Uncovered Changes

Lines Coverage ∆ File
29
89.39
-2.29% src/sql/pager/mod.rs
12
89.66
src/sql/pager/hnsw_cell.rs
1
91.74
0.18% src/sql/hnsw.rs

Coverage Regressions

Lines Coverage ∆ File
3
17.61
-0.33% src/lib.rs
2
92.85
0.05% src/sql/mod.rs
Jobs
ID Job ID Ran Files Coverage
1 25079608728.1 28 Apr 2026 09:56PM UTC 31
70.93
GitHub Action Run
Source Files on build 25079608728
  • Tree
  • List 31
  • Changed 8
  • Source Changed 0
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 697d75a8 on github
  • Prev Build on main (#25067108976)
  • Next Build on main (#25079732301)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc