Guard the SVS code paths so USE_SVS=OFF builds - #1006
Open
plusky wants to merge 1 commit into
Open
Conversation
plusky
force-pushed
the
guard-svs-include-in-tiered-factory-header
branch
from
July 30, 2026 12:54
2d18483 to
8d545f8
Compare
Building with -DUSE_SVS=OFF does not compile. HAVE_SVS is then 0 and the
ScalableVectorSearch sources are never fetched, but two translation units still
reach for SVS unconditionally:
src/VecSim/algorithms/svs/svs.h:21:10: fatal error:
svs/index/vamana/dynamic_index.h: No such file or directory
(via tiered_factory.h -> svs_tiered.h -> svs.h)
src/VecSim/algorithms/svs/svs_utils.h:16:10: fatal error:
svs/core/distance.h: No such file or directory
(via vec_sim.cpp)
tiered_factory.h needs nothing from svs_tiered.h -- none of its declarations
mention an SVS type -- so that include is simply guarded, the way
tiered_factory.cpp and svs_factory.cpp already guard the same headers.
vec_sim.cpp does use VecSimSVSThreadPool, in two functions that are part of the
public C API and so have to keep existing either way:
- VecSim_UpdateThreadPoolSize() sets the write mode and then resizes the
shared SVS pool. With no SVS there is no pool, and setting the write mode is
all the call has to do.
- VecSim_GetSharedMemory() reports the process-wide shared allocation. That is
an SVS construct; without it nothing is held outside the individual indexes,
which already report their own, so it returns 0.
plusky
force-pushed
the
guard-svs-include-in-tiered-factory-header
branch
from
July 30, 2026 13:05
8d545f8 to
cbfed38
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cmake/svs.cmakeoffersUSE_SVSas a real option (cmake_dependent_option(USE_SVS "Build with SVS library support" ON "SVS_SUPPORTED" OFF)), but building with-DUSE_SVS=OFFdoes not compile.With SVS off,
HAVE_SVSis0and the ScalableVectorSearch sources are never fetched — but two translation units still reach for SVS unconditionally:tiered_factory.hneeds nothing fromsvs_tiered.h— none of its declarations mention an SVS type — so that include is simply guarded, the waytiered_factory.cppandsvs_factory.cppalready guard the same headers.vec_sim.cppdoes useVecSimSVSThreadPool, in two functions that are part of the public C API and so have to keep existing either way:VecSim_UpdateThreadPoolSize()sets the write mode and then resizes the shared SVS pool. With no SVS there is no pool, so setting the write mode is all the call has to do.VecSim_GetSharedMemory()reports the process-wide shared allocation. That is an SVS construct; without it nothing is held outside the individual indexes, which already report their own, so it returns 0.No behaviour change when SVS is on — every added branch is under
#if HAVE_SVS.Why this matters outside your CI
I hit it packaging Redis 8.10.0 for openSUSE. Distribution builds have no network access at build time, and
USE_SVS=ONwantseve,fmt,spdlog,tomlplusplusandrobin-mapcloned from git duringcmakeconfigure — plus theSVS_SHARED_LIBpath, which downloads a pre-compiled shared library.-DUSE_SVS=OFFis exactly the escape hatch for that case, and these guards are all that stand between it and a working build. VectorSimilarity then uses its own HNSW and flat indexes, a perfectly good default for a distribution package.Happy to add a
USE_SVS=OFFconfiguration to CI in a follow-up so this stays fixed.