Expand description
Foundation for KIND vector.turbo collections (PRD #668, issue #693).
Mirrors blockchain_kind for the marker side of the contract:
red.collection.{name}.kind = "turbo" is the durable signal that
distinguishes a TurboQuant-backed vector collection from the legacy
vector kind. Routing in impl_ddl, create_vector, and the
vector-search executor reads is_turbo to branch.
The per-collection runtime state (TurboCollectionState) owns the
in-memory TurboQuantIndex and a TurboExtent when a pager is
available, plus the codec dimension / metric inherited from the
collection contract.
Structs§
- Turbo
Collection State - Per-collection runtime state for a
vector.turbocollection.
Constants§
- TURBO_
CODEC_ SEED - Deterministic codec seed shared by every turbo collection in this process. The seed feeds the rotation matrix + codebook; a fixed seed guarantees that re-encoding the same vector across restarts produces the same code, which is what makes lazy re-population from the persisted vector entities safe.
- TURBO_
KIND_ TAG - Value stored under
red.collection.{name}.kindfor vector.turbo collections. Must be distinct fromblockchain_kind::CHAIN_KIND_TAGand from any future kind marker.
Functions§
- is_
turbo - True if
mark_as_turbowas ever called for this collection. Cheap (one config-tree read) and safe to call on every INSERT/SEARCH — the legacyvectorpath takes thefalsebranch with no extra cost beyond the lookup. - mark_
as_ turbo - Persist the
turbokind marker. Called once at collection creation. Idempotent againstIF NOT EXISTS: re-stamping the same value is a no-op at the config-tree layer. - ready_
flag_ from_ catalog - Read the persisted readiness flag from the catalog. Used by
admin/introspection paths that don’t hold the runtime
TurboCollectionState(e.g. SHOW COLLECTION metadata, cross- process tooling). The in-memoryTurboCollectionState::is_readyis the authoritative live signal; this is the persisted shadow. - spawn_
background_ rebuild - Public hook (#673) — issued by
RedDB::turbo_statethe first time a turbo collection’s state is materialised. Spawns a worker thread that drains the WAL replay buffer + persisted vector entities and flips the readiness flag. Non-vector traffic never blocks on this; vector SEARCH/INSERT against a not-yet-ready collection observes the flag viais_ready/wait_until_ready.