Skip to content

Commit 3c28c93

Browse files
committed
tsan fix and update ci to upload logs
1 parent fc8a55f commit 3c28c93

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@ jobs:
121121
run: meson compile -C build_tsan
122122

123123
- name: Test
124-
run: meson test -C build_tsan
124+
run: meson test -C build_tsan --print-errorlogs --verbose
125+
- name: Upload tsan test logs
126+
if: always()
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: tsan-test-logs
130+
path: build_tsan/meson-logs/testlog.txt
125131

126132
# =============================================================================
127133
# Linux Benchmarks

include/sqlite-vec-cpp/index/hnsw.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,20 +812,20 @@ template <concepts::VectorElement StorageT, typename MetricT> class HNSWIndex {
812812
/// This improves search quality by not traversing to dead-ends
813813
/// Call after batch deletions but before search
814814
void isolate_deleted() {
815+
std::unique_lock nodes_lock(nodes_mutex_);
815816
std::shared_lock deleted_lock(deleted_mutex_);
816817
if (deleted_ids_.empty())
817818
return;
818819

819-
std::unique_lock nodes_lock(nodes_mutex_);
820820
for (auto& [id, node] : nodes_) {
821821
if (is_deleted_unlocked(id))
822822
continue;
823823

824824
// Remove edges to deleted nodes at each layer
825825
for (size_t layer = 0; layer < node.edges.size(); ++layer) {
826826
auto& layer_edges = node.edges[layer];
827-
std::erase_if(layer_edges,
828-
[this](size_t neighbor) { return is_deleted(neighbor); });
827+
std::erase_if(
828+
layer_edges, [this](size_t neighbor) { return is_deleted_unlocked(neighbor); });
829829
}
830830
}
831831
}

0 commit comments

Comments
 (0)