Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@ include(CTest)
include(Catch)
catch_discover_tests(tests ADD_TAGS_AS_LABELS SKIP_IS_FAILURE)

option(SVS_TEST_CONCURRENT_FULL_SIZE
"Run the concurrent MutableVamanaIndex tests at full (stress) problem size (slow)" OFF
)
if (SVS_TEST_CONCURRENT_FULL_SIZE)
target_compile_definitions(tests PRIVATE SVS_TEST_CONCURRENT_FULL_SIZE)
endif()

#####
##### ThreadSanitizer targets for the concurrent index
#####
Expand Down
21 changes: 13 additions & 8 deletions tests/svs/concurrent/concurrency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,22 @@ namespace ccg = svs::index::vamana::concurrent::graphs;

namespace {

// ThreadSanitizer costs roughly an order of magnitude in both time and memory, and it is
// looking for *races*, which show up just as readily in a small index. Shrink the problem
// rather than skipping the run.
#if defined(__SANITIZE_THREAD__) || defined(SVS_THREAD_SANITIZER)
constexpr size_t kInitialPoints = 4000;
constexpr size_t kIncrementalPoints = 1000;
constexpr size_t kNumQueries = 50;
#else
// Races and broken invariants show up just as readily in a small index, so the small size
// is the default. At full size these four tests take ~10 minutes of serial ctest time on a
// 4-vCPU CI runner, more than half of the whole suite, and run in every matrix job.
// `SVS_TEST_CONCURRENT_FULL_SIZE` restores the larger problem for stress runs.
//
// ThreadSanitizer costs roughly an order of magnitude in both time and memory, so it always
// uses the small size, even when full size is requested.
#if defined(SVS_TEST_CONCURRENT_FULL_SIZE) && \
!(defined(__SANITIZE_THREAD__) || defined(SVS_THREAD_SANITIZER))
constexpr size_t kInitialPoints = 20000;
constexpr size_t kIncrementalPoints = 5000;
constexpr size_t kNumQueries = 200;
#else
constexpr size_t kInitialPoints = 4000;
constexpr size_t kIncrementalPoints = 1000;
constexpr size_t kNumQueries = 50;
#endif

constexpr size_t kDim = 32;
Expand Down
Loading