You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IndexStaticFaced::ConfigCheck (introduced in #888) is supposed to dispatch to per-index StaticConfigCheck implementations to validate (indexType, config) combinations before building. The dispatch has been silently dead since the feature merged: staticConfigCheckMap is never populated for any registered index, so the per-index checks never run.
Root cause is a type mismatch in the SFINAE probe that gates registration:
IndexStaticFaced::InternalConfigCheck is declared with (const BaseConfig&, const IndexVersion&, std::string&) (include/knowhere/index/index_static.h:134).
All real StaticConfigCheck implementations take (const Config&, PARAM_TYPE, std::string&) (e.g. src/index/ivf/ivf.cc:138, src/index/hnsw/hnsw.h:94).
PARAM_TYPE is an unscoped enum, and int32_t (IndexVersion) does not implicitly convert to it, so has_static_StaticConfigCheck<...>::value evaluates to false for every index. The if constexpr block in RegisterStaticFunc (index_static.h:114-117) is therefore dead code, staticConfigCheckMap stays empty, and ConfigCheck always falls through to return Status::success at index_static.cc:63.
Expected Behavior
IndexStaticFaced<fp32>::ConfigCheck("IVF_FLAT", version, {"metric_type":"HAMMING","nlist":128}, msg) should return Status::invalid_metric_type (since IVF float indexes only accept L2/IP/COSINE).
Actual Behavior
Returns Status::success. The metric/data-type validation defined in IvfIndexNode::StaticConfigCheck and HnswIndexNode::StaticConfigCheck never executes. Build-time pre-check is a no-op for any caller.
Impact
All callers (e.g. Milvus pre-build validation) get false-positive success on invalid config combinations. The non-fatal layers downstream still catch most cases at build time, but later and with worse error messages.
The tests/ut/test_config.cc::checkBuildConfig helper only asserts Status::success, so the bug never surfaced in CI.
Description
IndexStaticFaced::ConfigCheck(introduced in #888) is supposed to dispatch to per-indexStaticConfigCheckimplementations to validate(indexType, config)combinations before building. The dispatch has been silently dead since the feature merged:staticConfigCheckMapis never populated for any registered index, so the per-index checks never run.Root cause is a type mismatch in the SFINAE probe that gates registration:
IndexStaticFaced::InternalConfigCheckis declared with(const BaseConfig&, const IndexVersion&, std::string&)(include/knowhere/index/index_static.h:134).StaticConfigCheckimplementations take(const Config&, PARAM_TYPE, std::string&)(e.g.src/index/ivf/ivf.cc:138,src/index/hnsw/hnsw.h:94).PARAM_TYPEis an unscoped enum, andint32_t(IndexVersion) does not implicitly convert to it, sohas_static_StaticConfigCheck<...>::valueevaluates tofalsefor every index. Theif constexprblock inRegisterStaticFunc(index_static.h:114-117) is therefore dead code,staticConfigCheckMapstays empty, andConfigCheckalways falls through toreturn Status::successatindex_static.cc:63.Expected Behavior
IndexStaticFaced<fp32>::ConfigCheck("IVF_FLAT", version, {"metric_type":"HAMMING","nlist":128}, msg)should returnStatus::invalid_metric_type(since IVF float indexes only accept L2/IP/COSINE).Actual Behavior
Returns
Status::success. The metric/data-type validation defined inIvfIndexNode::StaticConfigCheckandHnswIndexNode::StaticConfigChecknever executes. Build-time pre-check is a no-op for any caller.Impact
tests/ut/test_config.cc::checkBuildConfighelper only assertsStatus::success, so the bug never surfaced in CI.