Skip to main content

Module vectors

Module vectors 

Source
Expand description

Vector dataset access nodes via the vectordata crate.

Each node takes a dataset source string (URL, local path, or catalog name) as a const parameter and loads the dataset handle at construction time.

Source specifier formats:

  • "dataset" — catalog lookup, uses default profile
  • "dataset:profile" — catalog lookup with explicit profile
  • "https://..." — direct URL
  • "/path/to/dir" — local filesystem path

§Prebuffering

Use dataset_prebuffer("source") to eagerly download all facets for a dataset before workload execution. After prebuffering, data access uses local mmap readers (zero HTTP overhead).

§Cache-aware loading

For catalog-resolved datasets, the loader checks the local cache at ~/.cache/vectordata/<dataset>/ before issuing HTTP requests. Prebuffering populates this cache; subsequent loads are local.

Feature-gated behind vectordata.

§Upstream API reference

See the vectordata consumer guide for the full dataset access, catalog, caching, and fetch model — the crate’s AGENTS.md, rendered as vectordata::_agents: https://docs.rs/vectordata/latest/vectordata/_agents/index.html

Modules§

fixtures
The small predicated dataset vectordata embeds for tests: 190 base vectors and 10 queries with record metadata, a layout that types every field, a mixed predicate set, the rows each predicate admits and all three ground truths. predicated writes it to a directory, which a source string then names by path. It is regenerated from the dataset pipeline, so a test asserts properties of it and not particular rows.

Structs§

AdmittedRowsAt
The base positions the predicate of query index admits, as a set: vectordata’s admitted-row set over the query’s metadata_results record, on an admitted_rows wire. Where metadata_results_at puts the whole list on a wire, this is a handle to the record that reads nothing until it is asked, by admitted_rows_contain, by admitted_rows_len, or by a host that keeps the value and asks it directly (Value::Dataset(DatasetValue::AdmittedRows(set)), where set is vectordata’s OrdinalSet). Holding one keeps the record’s storage open. The query index wraps modulo the facet’s rows. A profile whose base window does not start at zero is refused with vectordata’s reason.
AdmittedRowsContain
Whether the admitted rows rows, from admitted_rows_at, hold the base position ordinal: whether the query’s predicate admits that base vector.
AdmittedRowsLen
How many base positions the admitted rows rows, from admitted_rows_at, hold.
BaseFacet
The base facet of a dataset.
DatasetDistanceFunction
Return the dataset’s distance function (e.g., “COSINE”, “EUCLIDEAN”). Operates on the dataset group; takes a group or prebuffered handle.
DatasetFacets
Report which facets are available for the default profile of a dataset group as a comma-separated list. Expects a group or prebuffered handle.
DatasetGroupOpen
dataset_group_open(source: str) -> Handle
DatasetOpen
dataset_open(source: str, facet: str) -> Handle
DatasetPrebuffer
Eagerly download all facets for a dataset profile into the local cache, returning a dataset handle that every facet accessor and every group accessor takes as its first argument. After this returns, every subsequent facet read served by vectordata::TestDataView hits the merkle- verified mmap fast path with no further network traffic.
DatasetProfileCount
Total number of profiles in a dataset group.
DatasetProfileNameAt
Look up a profile name by index from the canonical sorted list.
DatasetProfileNames
Comma-separated list of all profile names in canonical sort order (by base_count).
FilteredNeighborDistancesAt
Access filtered ground-truth neighbor distances. Expects an F32 handle. filtered_neighbor_distances is the legacy name of the prefiltered facet, so this reads what prefiltered_neighbor_distances_at reads.
FilteredNeighborDistancesFacet
The filtered_neighbor_distances facet of a dataset.
FilteredNeighborIndicesAt
Access filtered ground-truth neighbor indices. Expects an I32 handle. filtered_neighbor_indices is the legacy name of the prefiltered facet, so this reads what prefiltered_neighbor_indices_at reads.
FilteredNeighborIndicesFacet
The filtered_neighbor_indices facet of a dataset.
MatchingProfileNameAt
Name of the index-th profile matching pattern, in canonical (base-count-ascending) order. Pairs with profile_partitions’s masked-position idx_of so a sweep can prebuffer the active tier’s own ground-truth facets (dataset_prebuffer(str_concat("ds:", name))). pattern follows the literal / glob / regex promotion; the index wraps modulo the number of matching profiles; empty string if none match.
MatchingProfiles
Return profile names matching a prefix, comma-separated.
MetadataContentCount
Count of metadata content records. Expects a Generic handle.
MetadataContentFacet
The metadata_content facet of a dataset.
MetadataCountOf
How many records carry the metadata value value.
MetadataOrdinalsOf
The base ordinals whose metadata value is value, ascending.
MetadataPredicatesFacet
The metadata_predicates facet of a dataset.
MetadataResultsAt
Access metadata indices (variable-length matching base ordinals per query) at an index. Expects an Ivvec32 handle.
MetadataResultsCount
Return the metadata indices count (number of predicate result sets). Expects an Ivvec32 handle.
MetadataResultsFacet
The metadata_results facet of a dataset.
MetadataResultsLenAt
Return the length of one metadata_results record without loading the data (reads only the 4-byte header). Expects an Ivvec32 handle.
MetadataValueAt
Access a metadata value per base ordinal. Expects a Generic handle opened against the metadata_content facet.
NeighborCount
Return the per-record neighbor count (k) for an I32 neighbor-indices handle.
NeighborDistancesAt
Access ground-truth neighbor distances for a query. Expects an F32 handle.
NeighborDistancesFacet
The neighbor_distances facet of a dataset.
NeighborEmptyRows
How many queries have no live neighbor in the unfiltered (neighbor_indices) ground truth, as vectordata counts its coverage. A depth of zero, or deeper than the facet, is refused.
NeighborFullRows
How many queries have at least k live neighbors in the unfiltered (neighbor_indices) ground truth, as vectordata counts its coverage. A depth of zero, or deeper than the facet, is refused.
NeighborIndicesAt
Access ground-truth neighbor indices for a query. Expects an I32 handle.
NeighborIndicesFacet
The neighbor_indices facet of a dataset.
NeighborLiveDepthAt
How many live neighbors a query has in the unfiltered (neighbor_indices) ground truth: the length of its row before the padding.
NeighborLiveIndicesAt
The live neighbors of a query in the unfiltered (neighbor_indices) ground truth: the base positions its row names, nearest first, without the padding a row carries when it has fewer neighbors than the facet is deep. As long as the row’s live depth, so shorter than the facet’s width for a padded row and empty for a query with no neighbor.
NeighborRecallCeiling
The recall at k a perfect search would score against the unfiltered (neighbor_indices) ground truth when every query is scored out of k: vectordata’s coverage ceiling. 1.0 when every query has k neighbors, and less by the share of slots no neighbor exists for. A depth of zero, or deeper than the facet, is refused.
PostfilteredNeighborDistancesAt
Access the distances of a query’s postfiltered ground-truth neighbors, in the order of postfiltered_neighbor_indices_at. Expects an F32 handle.
PostfilteredNeighborDistancesFacet
The postfiltered_neighbor_distances facet of a dataset.
PostfilteredNeighborEmptyRows
How many queries have no live neighbor in the postfiltered (postfiltered_neighbor_indices) ground truth, as vectordata counts its coverage. A depth of zero, or deeper than the facet, is refused.
PostfilteredNeighborFullRows
How many queries have at least k live neighbors in the postfiltered (postfiltered_neighbor_indices) ground truth, as vectordata counts its coverage. A depth of zero, or deeper than the facet, is refused.
PostfilteredNeighborIndicesAt
Access the postfiltered ground-truth neighbor indices of a query: its unfiltered nearest neighbors with those its predicate does not admit removed, in rank order. A row with fewer survivors than the facet’s depth is padded with -1. Expects an I32 handle.
PostfilteredNeighborIndicesFacet
The postfiltered_neighbor_indices facet of a dataset.
PostfilteredNeighborLiveDepthAt
How many live neighbors a query has in the postfiltered (postfiltered_neighbor_indices) ground truth: the length of its row before the padding.
PostfilteredNeighborLiveIndicesAt
The live neighbors of a query in the postfiltered (postfiltered_neighbor_indices) ground truth: the base positions its row names, nearest first, without the padding a row carries when it has fewer neighbors than the facet is deep. As long as the row’s live depth, so shorter than the facet’s width for a padded row and empty for a query with no neighbor.
PostfilteredNeighborRecallCeiling
The recall at k a perfect search would score against the postfiltered (postfiltered_neighbor_indices) ground truth when every query is scored out of k: vectordata’s coverage ceiling. 1.0 when every query has k neighbors, and less by the share of slots no neighbor exists for. A depth of zero, or deeper than the facet, is refused.
PredicateAt
The predicate of query index, as structure: which of forms it takes, and its ordinal. A host selects the statement it prepared for that form and binds the predicate’s record through the form’s binder. Nothing is read and nothing is allocated here. The query index wraps modulo the facet’s predicates.
PredicateBandAt
The selectivity band of the predicate of query index, one of predicate_bands, or empty for a predicate whose recorded selectivity no band is read from. Refused when the facet publishes no strata. The query index wraps modulo the facet’s predicates.
PredicateBands
The distinct selectivity bands of a dataset’s predicates, widest first and comma-joined, or empty when the facet publishes none. A constant.
PredicateCountOf
How many queries carry the predicate value value.
PredicateFamilies
The distinct families of a dataset’s predicates, sorted and comma-joined, or empty when the facet publishes none. A constant.
PredicateFamilyAt
The family of the predicate of query index, one of predicate_families. Refused when the facet publishes no strata. The query index wraps modulo the facet’s predicates.
PredicateFieldNames
The metadata fields a dataset’s predicates constrain, sorted and comma-joined: the fields a target indexes to serve them. A constant.
PredicateForms
The forms of a dataset’s predicates: every distinct form its metadata_predicates records take, with the form’s template and count, the form of the predicate at each ordinal, the strata the facet publishes, and the layout of the metadata records the conditions bind against. A constant: the facet is read once, when the program is built.
PredicateOrdinalsOf
The query ordinals whose predicate value is value, ascending.
PredicateTextAt
The predicate of query index, rendered as text by the packaged vernacular vernacular, comparands inline. An unknown vernacular is refused with the names that exist. The query index wraps modulo the facet’s predicates.
PredicateValueAt
Access a predicate value per query ordinal. Expects a Generic handle opened against the metadata_predicates facet.
PrefilteredNeighborDistancesAt
Access the distances of a query’s prefiltered ground-truth neighbors, in the order of prefiltered_neighbor_indices_at. Expects an F32 handle.
PrefilteredNeighborDistancesFacet
The prefiltered_neighbor_distances facet of a dataset.
PrefilteredNeighborEmptyRows
How many queries have no live neighbor in the prefiltered (prefiltered_neighbor_indices) ground truth, as vectordata counts its coverage. A depth of zero, or deeper than the facet, is refused.
PrefilteredNeighborFullRows
How many queries have at least k live neighbors in the prefiltered (prefiltered_neighbor_indices) ground truth, as vectordata counts its coverage. A depth of zero, or deeper than the facet, is refused.
PrefilteredNeighborIndicesAt
Access the prefiltered ground-truth neighbor indices of a query: its nearest neighbors among the base vectors its predicate admits, nearest first. A row with fewer admitted vectors than the facet’s depth is padded with -1. Expects an I32 handle.
PrefilteredNeighborIndicesFacet
The prefiltered_neighbor_indices facet of a dataset.
PrefilteredNeighborLiveDepthAt
How many live neighbors a query has in the prefiltered (prefiltered_neighbor_indices) ground truth: the length of its row before the padding.
PrefilteredNeighborLiveIndicesAt
The live neighbors of a query in the prefiltered (prefiltered_neighbor_indices) ground truth: the base positions its row names, nearest first, without the padding a row carries when it has fewer neighbors than the facet is deep. As long as the row’s live depth, so shorter than the facet’s width for a padded row and empty for a query with no neighbor.
PrefilteredNeighborRecallCeiling
The recall at k a perfect search would score against the prefiltered (prefiltered_neighbor_indices) ground truth when every query is scored out of k: vectordata’s coverage ceiling. 1.0 when every query has k neighbors, and less by the share of slots no neighbor exists for. A depth of zero, or deeper than the facet, is refused.
ProfileBaseCount
Return the base vector count for the profile at a given index.
ProfileFacets
Return the comma-separated facet list for the profile at a given index.
ProfilePartitions
Partition a dataset’s vector space by its profiles matching a pattern, treated as cumulative size tiers (a partition source, cursor_partitions.md §7.1). One partition per masked profile, in canonical (base-count-ascending) order: partition k spans [prev_masked_base_count, this_masked_base_count) — exactly the vectors added at that tier — so a sweep’s “load only the increment since the previously loaded set” is just the partition’s [start_of(p), end_of(p)), and a partition inherently knows its start (no cross-iteration carry needed). idx_of(p) is the 0-based masked position (pairs with matching_profile_name_at to address the tier’s own ground-truth facets); count_of(p) is the number of masked tiers; base_extent is the largest masked tier’s size.
QueryCount
Return the count of query vectors. Counts the query facet of a source string or prebuffered handle, as vector_count counts the base facet.
QueryFacet
The query facet of a dataset.
QueryVectorAt
Access a query vector by index. Reads the query facet of a source string or prebuffered handle, as vector_at reads the base facet.
RecordAt
The metadata record of base vector index, as structure: its ordinal among the records forms describes. A host binds the record’s fields through forms.binder to the statement it prepared from the layout. Nothing is read and nothing is allocated here. The index wraps modulo the record count.
RecordBoolAt
The boolean field field, resolved by record_field_bool, of the metadata record at index. Nothing is checked per record.
RecordBytesAt
The bytes field field, resolved by record_field_bytes, of the metadata record at index. Nothing is checked per record.
RecordF64At
The floating-point field field, resolved by record_field_f64, of the metadata record at index. Nothing is checked per record.
RecordFieldBool
Resolve a boolean field of a dataset’s metadata records, for record_bool_at to read. Refused when the records have no such field, when the field is not a boolean, and when the dataset declares it may be null.
RecordFieldBytes
Resolve a bytes field of a dataset’s metadata records, for record_bytes_at to read. Refused when the records have no such field, when the field is not a blob, and when the dataset declares it may be null.
RecordFieldF64
Resolve a floating-point field of a dataset’s metadata records, for record_f64_at to read. A 16-bit or 32-bit field reads as f64 without loss. Refused when the records have no such field, when the field is not a float, and when the dataset declares it may be null.
RecordFieldI64
Resolve an integer field of a dataset’s metadata records, for record_i64_at to read. A 16-bit or 32-bit field reads as i64 without loss. Refused when the records have no such field, when the field is not an integer, and when the dataset declares it may be null.
RecordFieldNames
The names of the fields of a dataset’s metadata records, in layout order, comma-joined: what a column list or an iteration over the fields takes. A constant.
RecordFieldStr
Resolve a text field of a dataset’s metadata records, for record_str_at to read. The name is resolved to its position in the layout here, once. Refused when the records have no such field, when the field is not text, and when the dataset declares it may be null. Expects the metadata_content facet of a profile that publishes records.
RecordForms
The form of a dataset’s metadata records: the layout that names and types a record’s fields, with the binder that reads every field in layout order. A record facet has this one form. A constant.
RecordI64At
The integer field field, resolved by record_field_i64, of the metadata record at index. Nothing is checked per record.
RecordLayoutText
The layout of a dataset’s metadata records, rendered as text by the packaged vernacular vernacular: the text one record stands for, such as a schema’s column definitions, before any record is read. A constant. An unknown vernacular is refused with the names that exist.
RecordStrAt
The text field field, resolved by record_field_str, of the metadata record at index. Nothing is checked per record.
RecordTextAt
The metadata record of base vector index, rendered as text by the packaged vernacular vernacular. An unknown vernacular is refused with the names that exist. The index wraps modulo the record count.
VectorAt
Access an f32 vector by index, returning a typed VecF32. Reads the base facet of a source string or prebuffered handle, and whatever facet an opened F32 handle names.
VectorCount
Return the count of records in the facet a handle was opened against. This is the canonical “how many vectors / queries / neighbor-rows” accessor — vector_count(base_handle) for base vectors, vector_count(query_handle) for query vectors, etc. A source string or prebuffered handle counts the base facet.
VectorDim
Return the dimensionality (f32 count per record) of a vector facet handle.