Vector Params Verification Tests¶
Covers validation of vector index parameters passed into the Java layer.
All the tests are in TestVectorParams.
What's Covered¶
- Quantization modes:
INT8,NONE,BINARY,PRODUCT. store_vectors_in_graphandadd_hierarchyflags.- Native
INT8encoding, and its guard against the defaultINT8quantization. - Per-index cache settings:
graph_build_cache_sizemutations_before_rebuild
- The
max_connectionsdefault, which must equal the engine's. - Reopening a database that holds a configured index.
- JVM heap sanity check via JPype runtime memory stats.
Test Cases¶
- test_quantization_param:
create_vector_index(..., quantization="INT8")gives an index whoseget_quantization()and Java metadataquantizationTypeare bothINT8. - test_quantization_none, test_quantization_binary, test_quantization_product: the same two checks for
NONE,BINARY, andPRODUCT. - test_store_vectors_in_graph_param:
store_vectors_in_graph=Trueshows up asstoreVectorsInGraphtrue in the index metadata. - test_add_hierarchy_param:
add_hierarchy=Trueshows up asaddHierarchytrue in the index metadata. - test_encoding_param: an index on a
BINARYproperty withquantization="NONE", encoding="INT8"has metadataencoding == INT8andquantizationType == NONE. - test_encoding_int8_rejects_default_int8_quantization:
encoding="INT8"without an explicit quantization raisesArcadeDBErrornamingencoding='INT8'andquantization='INT8'. - test_per_index_cache_params:
location_cache_size=123raisesValueError("no longer supported", removed by the engine in #5559 and #5568);graph_build_cache_size=456andmutations_before_rebuild=789reach the index metadata asgraphBuildCacheSize == 456andmutationsBeforeRebuild == 789. - test_wrapper_default_matches_engine_default: the default of
create_vector_index(max_connections=...)equalsmaxConnectionson a freshly constructed engineLSMVectorIndexMetadata. - test_omitted_max_connections_reaches_the_index: an index created without
max_connectionshas the engine default in its metadata. - test_params_persistence: creates an
INT8index withstore_vectors_in_graphandadd_hierarchy, closes, reopens, and asserts thatschema:indexeslists an index on the type and that avectorNeighborsquery returns a row. It does not read the parameters back after the reopen. - test_jvm_heap_check: the JVM's
Runtime.maxMemory()is above 1 GB (the default heap is 4 GB).