C · Serialization

Serialization

#include <usearch/dense_index.h>#include <usearch/geospatial_index.h>#include <usearch/sequence_index.h>#include <usearch/shapes_index.h>#include <usearch/types.h> 3.0.0-rc.1 · 4c3e5023

Checkpoints ride the SafeGraphs interchange format, and the path’s extension picks the layout: a .safegraphs path is one monolith of every shard, a .safegraphs.json path is a manifest beside one monolith per shard. Loading reads the content, never the extension, so either form loads into any shard count, part p loading into shard p modulo the shard count.

usearch_bytes_view_t path = {(uint8_t const*)"index.safegraphs", 16};
usearch_dense_save(&(usearch_dense_save_t) {.index = index, .executor = executor, .outcome = &outcome, .path = path});

usearch_dense_index_t copy = NULL, mapped = NULL;
usearch_dense_load_ram(&(usearch_dense_load_ram_t) {
    .index = &copy, .executor = executor, .outcome = &outcome, .path = path});
usearch_dense_view_ram(&(usearch_dense_view_ram_t) {.index = &mapped, .outcome = &outcome, .path = path});

A loaded index is a mutable copy, while a viewed one serves the file in place through a memory mapping and refuses every mutating verb with usearch_status_read_only_k. The engine’s RAM shards cannot serve a mapping yet, so it answers usearch_dense_view_ram with usearch_status_unsupported_k, while usearch_dense_view_nvme serves checkpoints in place today. A cancelled or failed save leaves a file without its header or parts without a manifest, which every reader rejects and the caller removes, and a cancelled or failed load creates no handle. A checkpoint’s geometry and metric can be read without loading it:

usearch_dense_metadata_t metadata = {0};
usearch_dense_metadata_read(&(usearch_dense_metadata_read_t) {
    .executor = executor, .outcome = &outcome, .path = path, .metadata = &metadata});

An index can also be saved into memory as one monolith of every shard, which loads into any shard count. The bytes land in an arena, so the call needs no size estimate upfront:

usearch_bytes_view_t monolith = {0};
usearch_dense_save_buffer(&(usearch_dense_save_buffer_t) {
    .index = index, .executor = executor, .outcome = &outcome, .monolith = &monolith, .arena = arena});
usearch_dense_load_ram_buffer(&(usearch_dense_load_ram_buffer_t) {
    .index = &copy, .executor = executor, .outcome = &outcome, .buffer = monolith});

API

Types

usearch_dense_metadata_tThe geometry and metric a checkpoint froze - everything a reader learns without opening it, and nothing a reader must choose for itself.
dense_index.h:1846 ↗
struct usearch_dense_metadata_t

Placement is absent because a checkpoint records where it was written, never where a reader must keep it. So is values_per_key, which bounds a live handle's mutable state rather than anything the serialized form carries. Both remain the caller's to choose when loading, and no caller has to know which fields this call filled.

Fields

metricusearch_dense_metric_tThe metric kind the checkpoint scores with.
quantizationusearch_scalar_tThe scalar type its rows are stored & quantized into.
dimensionssize_tScalars per stored vector.
connectivitysize_tConnections per node the graph was built with.
usearch_geospatial_metadata_tThe geometry a checkpoint froze - everything a reader learns without opening it.
geospatial_index.h:1671 ↗
struct usearch_geospatial_metadata_t

Fields

connectivitysize_tConnections per node the graph was built with.
usearch_sequence_metadata_tThe metric and geometry a checkpoint froze - everything a reader learns without opening it.
sequence_index.h:1561 ↗
struct usearch_sequence_metadata_t

Fields

metricusearch_sequence_metric_tThe scoring kind the checkpoint was built under.
connectivitysize_tConnections per node the graph was built with.
usearch_shapes_metadata_tThe geometry and metric a checkpoint froze - everything a reader learns without opening it.
shapes_index.h:1563 ↗
struct usearch_shapes_metadata_t

Fields

metricusearch_shapes_metric_tThe kind the checkpoint compares shapes with.
quantizationusearch_scalar_tThe scalar type its points are stored in.
pointssize_tThe frozen point count, or zero for any count.
connectivitysize_tConnections per node the graph was built with.
usearch_bytes_view_tA borrowed run of bytes and its length, never null-terminated by contract - the shape every modality's string arguments arrive in.
types.h:161 ↗
struct usearch_bytes_view_t

Callers holding a Rust str, a Go string, or a Java byte array pass their own storage without manufacturing a terminator none of them keeps.

Fields

datausearch_byte_t const *First byte of the run; text is bytes that happen to decode.
lengthsize_tBytes the run spans, with no terminator assumed or written.

Functions

usearch_dense_load_ramCopies a checkpoint into a new, mutable index in host memory, shard by shard.
dense_index.h:418 ↗
void usearch_dense_load_ram(usearch_dense_load_ram_t *arguments);

Serialization

The geometry and metric come from the checkpoint's own headers, and only a non-zero connectivity widens the rows. Point path at the .safegraphs.json manifest, never at one of the parts it enumerates. The manifest is a small catalog that names every part and resolves each one relative to itself, so a checkpoint spread over a hundred files is opened by naming a single one. Naming a part directly is legal and loads exactly that part as a monolith, which is a fragment of the index rather than the index.

Where the parts end up is the call's own memory domains, never the manifest's: part p is written whole on shard p, and shards past the placed ones open over those domains in turn, so a checkpoint of eight parts loaded naming four domains places two parts on each.

A cancelled or failed load reports its status and creates no handle.

Parameters

indexusearch_dense_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the read fans out over, one shard per thread.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tThe manifest of a sharded checkpoint, or a single .safegraphs monolith.
ramusearch_ram_options_tThe memory domains to place the parts on, part p loading into shard p, those past the named domains opened over them in turn.
connectivitysize_tNeighbor IDs per node, at least the checkpoint's, whose wider rows keep the stored neighbors and leave the rest empty for a refine to fill; zero keeps the checkpoint's.
values_per_keysize_tUpper bound on entries sharing one key, which no checkpoint records; zero is unbounded.
progressusearch_progress_tThe optional handler, called with shards placed.

Statuses

usearch_dense_load_vramCopies a checkpoint into a new, mutable index in device memory, with the placement rules of usearch_dense_load_ram.
dense_index.h:471 ↗
void usearch_dense_load_vram(usearch_dense_load_vram_t *arguments);

Parameters

indexusearch_dense_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the upload runs on, one stream per device.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tThe manifest of a sharded checkpoint, or a single .safegraphs monolith.
vramusearch_vram_options_tThe devices to place the parts on, part p loading into shard p, those past the named devices opened over them in turn.
values_per_keysize_tUpper bound on entries sharing one key, which no checkpoint records; zero is unbounded.
progressusearch_progress_tThe optional handler, called with shards placed.

Statuses

usearch_dense_load_ram_bufferCopies a checkpoint from a memory buffer into a new, mutable index in host memory.
dense_index.h:529 ↗
void usearch_dense_load_ram_buffer(
    usearch_dense_load_ram_buffer_t *arguments);

This reports and cancels like its path-taking sibling and creates no handle when stopped. That sibling reaches the same bytes through a mapping, so buffer needs no file behind it and a mapped file needs no copy into one.

Parameters

indexusearch_dense_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the copy fans out over.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them.
ramusearch_ram_options_tThe memory domains to place shards on; part p is written whole on shard p.
connectivitysize_tNeighbor IDs per node, at least the checkpoint's, as usearch_dense_load_ram takes it.
values_per_keysize_tUpper bound on entries sharing one key, which no checkpoint records; zero is unbounded.
progressusearch_progress_tThe optional handler, called with bytes placed.

Statuses

usearch_dense_load_vram_bufferCopies a checkpoint from a memory buffer into a new, mutable index in device memory, reporting and cancelling like usearch_dense_load_ram_buffer.
dense_index.h:581 ↗
void usearch_dense_load_vram_buffer(
    usearch_dense_load_vram_buffer_t *arguments);

Parameters

indexusearch_dense_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the upload runs on, one stream per device.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them, in host or device memory; a device one is copied to the host first, so the call holds twice its bytes while it runs.
vramusearch_vram_options_tThe devices to place shards on; part p is written whole on shard p.
values_per_keysize_tUpper bound on entries sharing one key, which no checkpoint records; zero is unbounded.
progressusearch_progress_tThe optional handler, called with bytes placed.

Statuses

usearch_dense_view_ramServes a checkpoint in place through a memory mapping, as a read-only index.
dense_index.h:607 ↗
void usearch_dense_view_ram(usearch_dense_view_ram_t *arguments);

Serialization

Nothing is copied, so opening costs the headers alone and a traversal pays only for the pages it touches. Every mutating verb on the handle reports usearch_status_read_only_k, and the files must stay unmodified until the handle is freed.

Parameters

indexusearch_dense_index_t *Output for the new, read-only index.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
pathusearch_bytes_view_tThe manifest of a sharded checkpoint, or a single .safegraphs monolith.

Statuses

usearch_dense_view_nvmeServes a checkpoint in place from NVMe drives as a read-only index, every later call reading it through its executor's engines.
dense_index.h:663 ↗
void usearch_dense_view_nvme(usearch_dense_view_nvme_t *arguments);

NVMe Walks & Mergers

Opening reads the headers, and with ram every part's key column once, on executor's engines, into a key table of about 11 bytes per entry: an 8-byte fingerprint and node per slot, a third more slots than entries. Every mutating verb on the handle reports usearch_status_read_only_k, and the parts must stay unmodified until the handle is freed.

Without a key table, usearch_dense_count, usearch_dense_get, usearch_dense_sample, a MaxSim and hinted walks refuse with usearch_status_unsupported_k rather than scan every key.

Parameters

indexusearch_dense_index_t *Output for the new, read-only index, written by the time the call is final.
executorusearch_executor_tThe NVMe executor the call is ordered on; the headers come through blocking reads.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tThe manifest of a sharded checkpoint, or a single .safegraphs monolith.
nvmeusearch_nvme_options_tThe devices the parts are served from; naming none serves each where its manifest points.
ramusearch_ram_options_t const *The optional RAM the view may hold beyond its headers, borrowed for the call: a key table on the first of ram->memory_domains within ram->memory_limit; NULL holds nothing per entry, so key lookups and hints refuse.

Statuses

usearch_dense_saveSaves a mutable index under path in the layout its shard count picks - one monolith, or a manifest beside its shards; concurrent readers keep searching throughout.
dense_index.h:1781 ↗
void usearch_dense_save(usearch_dense_save_t *arguments);

Serialization

A cancelled or failed monolith save leaves a file without its header, which every reader rejects; a cancelled manifest save leaves the parts it already wrote and no manifest, so the checkpoint reads as absent rather than half-valid. Those leftovers are the caller's to remove.

Parameters

indexusearch_dense_index_tThe handle to be written.
executorusearch_executor_tThe executor the write fans out over, one shard per thread or stream.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tDestination path: the monolith of a lone shard, or the manifest beside the parts of many.
progressusearch_progress_tThe optional handler, called with shards written.

Statuses

  • usearch_status_contended_k A RAM save meeting an insertion in flight or one publishing under it, or a VRAM save meeting an insertion, refinement, absorption or another save in flight; an insertion arriving while a VRAM save runs is refused the same way.
usearch_*_save_buffer× 4Saves a mutable index into arena: one monolith for a handle of one shard, or a manifest leading one part per shard.
dense_index.h:1835 ↗
void usearch_dense_save_buffer(usearch_dense_save_buffer_t *arguments);
Symbolindex
usearch_dense_save_bufferusearch_dense_index_t
usearch_geospatial_save_bufferusearch_geospatial_index_t
usearch_sequence_save_bufferusearch_sequence_index_t
usearch_shapes_save_bufferusearch_shapes_index_t

Serialization

A lone shard's monolith is the same bytes the path-taking sibling writes into its own mapping. Several shards write the manifest first, listing each part by its offset inside the buffer, then every part on the header's alignment, each with its shard's own node IDs, so a load opens one shard per part again. A caller who needs the bytes in memory it already owns, such as a mapped file, saves to a path instead. A VRAM handle's checkpoint is written in device memory, written on the host first, so the call holds twice its bytes while it runs.

Writing to memory is not writing quickly. A terabyte checkpoint on a handful of cores runs for minutes, so this reports and cancels like its path-taking sibling, and a cancelled call leaves monolith->data NULL.

Demands a mutation-free window; concurrent readers keep searching throughout.

A lone shard's monolith is the same bytes usearch_geospatial_save writes. Several shards write the manifest first, listing each part by its offset inside the buffer, then every part on the header's alignment, each with its shard's own node IDs, so a load opens one shard per part again. A cancelled call leaves monolith->data NULL.

Demands a mutation-free window; concurrent readers keep searching throughout.

A lone shard's monolith is the same bytes usearch_sequence_save writes. Several shards write the manifest first, listing each part by its offset inside the buffer, then every part on the header's alignment, each with its shard's own node IDs, so a load opens one shard per part again. A cancelled call leaves monolith->data NULL.

Demands a mutation-free window; concurrent readers keep searching throughout.

A lone shard's monolith is the same bytes usearch_shapes_save writes. Several shards write the manifest first, listing each part by its offset inside the buffer, then every part on the header's alignment, each with its shard's own node IDs, so a load opens one shard per part again. A cancelled call leaves monolith->data NULL.

Parameters

indexusearch_dense_index_tThe handle to be written.
executorusearch_executor_tThe executor to fan out over; its kind must match the residency.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
monolithusearch_bytes_view_t *Output for the checkpoint's bytes and length, inside arena.
arenausearch_arena_tMemory for monolith, rewound by the call.
progressusearch_progress_tThe optional handler, called with bytes written.

Statuses

usearch_*_metadata_read× 2Reads a checkpoint's geometry & metric without loading it.
dense_index.h:1890 ↗
void usearch_dense_metadata_read(
    usearch_dense_metadata_read_t *arguments);
Symbolmetadata
usearch_dense_metadata_readusearch_dense_metadata_t
usearch_shapes_metadata_readusearch_shapes_metadata_t

A manifest answers from its summary and its first part's header, so the cost does not grow with the index.

Parameters

executorusearch_executor_tThe executor the read runs on.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tThe manifest of a sharded checkpoint, or a single .safegraphs monolith.
metadatausearch_dense_metadata_t *Output for every field the checkpoint froze.

Statuses

usearch_dense_metadata_read_bufferReads geometry & metric from a serialized checkpoint buffer.
dense_index.h:1918 ↗
void usearch_dense_metadata_read_buffer(
    usearch_dense_metadata_read_buffer_t *arguments);

Parameters

executorusearch_executor_tThe executor the read runs on.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them.
metadatausearch_dense_metadata_t *Output for every field the checkpoint froze.

Statuses

usearch_geospatial_load_ramCopies a checkpoint into a new, mutable index in host memory, its geometry read from the checkpoint's own headers.
geospatial_index.h:374 ↗
void usearch_geospatial_load_ram(
    usearch_geospatial_load_ram_t *arguments);

Where the parts end up is the call's own memory domains, never the manifest's: part p is written whole on shard p, beside any placed shards the parts leave empty, and the shards past the placed ones open over those domains in turn.

Parameters

indexusearch_geospatial_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the read fans out over, one shard per thread.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
ramusearch_ram_options_tThe memory domains to place the parts on.
values_per_keysize_tObservations one key may hold at most, which no checkpoint records; zero is unbounded.
terrainusearch_geospatial_terrain_tThe optional terrain lines of sight are tested over, which no checkpoint carries.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

usearch_geospatial_load_ram_bufferCopies a checkpoint from a memory buffer into a new, mutable index in host memory.
geospatial_index.h:427 ↗
void usearch_geospatial_load_ram_buffer(
    usearch_geospatial_load_ram_buffer_t *arguments);

This places, reports and cancels like usearch_geospatial_load_ram, which reaches the same bytes through a mapping, so buffer needs no file behind it, and a mapped file no copy.

Parameters

indexusearch_geospatial_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the read fans out over, one shard per thread.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them.
ramusearch_ram_options_tThe memory domains to place the parts on.
values_per_keysize_tObservations one key may hold at most, which no checkpoint records; zero is unbounded.
terrainusearch_geospatial_terrain_tThe optional terrain lines of sight are tested over, which no checkpoint carries.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

usearch_geospatial_load_vramCopies a checkpoint into a new, mutable index in device memory, with the placement rules of usearch_geospatial_load_ram.
geospatial_index.h:480 ↗
void usearch_geospatial_load_vram(
    usearch_geospatial_load_vram_t *arguments);

Parameters

indexusearch_geospatial_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the upload runs on, one stream per device.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
vramusearch_vram_options_tThe devices to place the parts on.
values_per_keysize_tObservations one key may hold at most, which no checkpoint records; zero is unbounded.
terrainusearch_geospatial_terrain_tThe optional terrain lines of sight are tested over, which no checkpoint carries.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

usearch_geospatial_load_vram_bufferCopies a checkpoint from a memory buffer into a new, mutable index in device memory, reporting and cancelling like usearch_geospatial_load_vram.
geospatial_index.h:533 ↗
void usearch_geospatial_load_vram_buffer(
    usearch_geospatial_load_vram_buffer_t *arguments);

Parameters

indexusearch_geospatial_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the upload runs on, one stream per device.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them, in host memory.
vramusearch_vram_options_tThe devices to place the parts on.
values_per_keysize_tObservations one key may hold at most, which no checkpoint records; zero is unbounded.
terrainusearch_geospatial_terrain_tThe optional terrain lines of sight are tested over, which no checkpoint carries.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

usearch_geospatial_view_ramServes a checkpoint in place through a memory mapping, as a read-only index whose mutating verbs report usearch_status_read_only_k.
geospatial_index.h:568 ↗
void usearch_geospatial_view_ram(
    usearch_geospatial_view_ram_t *arguments);

Parameters

indexusearch_geospatial_index_t *Output for the new, read-only index.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
terrainusearch_geospatial_terrain_tThe optional terrain lines of sight are tested over, which no checkpoint carries.
ramusearch_ram_options_tThe class to dispatch as; a view reads its shards from the checkpoint, so only usearch_ram_options_t::cpu_class is read.

Statuses

usearch_geospatial_view_nvmeServes a checkpoint in place from NVMe drives as a read-only index, every later call reading it through its executor's engines.
geospatial_index.h:616 ↗
void usearch_geospatial_view_nvme(
    usearch_geospatial_view_nvme_t *arguments);

Opening reads the headers alone. Every mutating verb on the handle reports usearch_status_read_only_k, and the parts must stay unmodified until the handle is freed.

Parameters

indexusearch_geospatial_index_t *Output for the new, read-only index, written by the time the call is final.
executorusearch_executor_tThe NVMe executor the call is ordered on; the headers come through blocking reads.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
nvmeusearch_nvme_options_tThe devices the parts are served from; naming none serves each where its manifest points.
terrainusearch_geospatial_terrain_tThe optional terrain lines of sight are tested over, which no checkpoint carries.

Statuses

usearch_*_save× 3Saves a mutable index under path.
geospatial_index.h:1618 ↗
void usearch_geospatial_save(usearch_geospatial_save_t *arguments);
Symbolindex
usearch_geospatial_saveusearch_geospatial_index_t
usearch_sequence_saveusearch_sequence_index_t
usearch_shapes_saveusearch_shapes_index_t

Demands a mutation-free window; concurrent readers keep searching throughout.

The shard count picks the layout: one shard writes one monolith at path, and several write the manifest at path beside one part per shard, each with its shard's own node IDs. A cancelled save leaves the parts it already wrote and no manifest referencing them, so the checkpoint reads as absent rather than half-valid. Those leftovers are the caller's to remove.

Parameters

indexusearch_geospatial_index_tThe handle to be written.
executorusearch_executor_tThe executor the write fans out over, one shard per thread or stream.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tDestination path: the monolith of a lone shard, or the manifest beside the parts of many.
progressusearch_progress_tThe optional handler, called with parts written and their count.

Statuses

usearch_geospatial_metadata_readReads a checkpoint's geometry without loading it.
geospatial_index.h:1704 ↗
void usearch_geospatial_metadata_read(
    usearch_geospatial_metadata_read_t *arguments);

Parameters

executorusearch_executor_tThe executor the read runs on.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
metadatausearch_geospatial_metadata_t *Output for every field the checkpoint froze.

Statuses

usearch_geospatial_metadata_read_bufferReads the fields a checkpoint in a memory buffer froze without loading it, as usearch_geospatial_metadata_read reads them from a path.
geospatial_index.h:1734 ↗
void usearch_geospatial_metadata_read_buffer(
    usearch_geospatial_metadata_read_buffer_t *arguments);

Parameters

executorusearch_executor_tThe executor the read runs on.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them.
metadatausearch_geospatial_metadata_t *Output for every field the checkpoint froze.

Statuses

usearch_sequence_load_ramCopies a checkpoint into a new, mutable index in host memory.
sequence_index.h:354 ↗
void usearch_sequence_load_ram(usearch_sequence_load_ram_t *arguments);

Where the parts end up is the call's own memory domains, never the manifest's: part p is written whole on shard p, beside any placed shards the parts leave empty, and the shards past the placed ones open over those domains in turn.

Parameters

indexusearch_sequence_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the read fans out over, one shard per thread.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
ramusearch_ram_options_tThe memory domains to place the parts on.
values_per_keysize_tUpper bound on entries sharing one key, which no checkpoint records; zero is unbounded.
weightsusearch_sequence_weights_t const *The weights an alignment checkpoint was built with; NULL for the Levenshtein kinds.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

usearch_sequence_load_ram_bufferCopies a checkpoint from a memory buffer into a new, mutable index in host memory.
sequence_index.h:409 ↗
void usearch_sequence_load_ram_buffer(
    usearch_sequence_load_ram_buffer_t *arguments);

This places, reports and cancels like usearch_sequence_load_ram, which reaches the same bytes through a mapping, so buffer needs no file behind it, and a mapped file no copy.

Parameters

indexusearch_sequence_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the read fans out over, one shard per thread.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them.
ramusearch_ram_options_tThe memory domains to place the parts on.
values_per_keysize_tUpper bound on entries sharing one key, which no checkpoint records; zero is unbounded.
weightsusearch_sequence_weights_t const *The weights an alignment checkpoint was built with; NULL for the Levenshtein kinds.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

usearch_sequence_load_vramCopies a checkpoint into a new, mutable index in device memory, with the placement rules of usearch_sequence_load_ram.
sequence_index.h:466 ↗
void usearch_sequence_load_vram(
    usearch_sequence_load_vram_t *arguments);

Parameters

indexusearch_sequence_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the upload runs on, one stream per device.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
vramusearch_vram_options_tThe devices to place the parts on.
values_per_keysize_tZero alone: a GPU index keeps no key lookup, so it bounds no key's entries and refuses any bound it is given.
weightsusearch_sequence_weights_t const *The weights an alignment checkpoint was built with; NULL for the Levenshtein kinds.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

  • usearch_status_invalid_argument_k An empty path, a checkpoint or part path that does not parse, or weights without a substitution matrix.
  • usearch_status_malformed_k The checkpoint lists no part, or a part, its header, columns, sums or recorded costs do not parse.
  • usearch_status_unknown_kind_k A checkpoint of an unknown metric.
  • usearch_status_unsupported_k A values_per_key bound, or devices that do not run the pinned class.
  • usearch_status_config_mismatch_k Devices of two classes, weights for a checkpoint of another kind than Needleman-Wunsch or folding into more than 32 classes, a negative gap or a pair above its mean self-score, a Needleman-Wunsch checkpoint recording no costs and given no weights, the executor driving no stream on some shard's device, or the checkpoint's columns differing from the shards' in dtype, shape or key width.
  • usearch_status_device_k An ordinal past the listing, devices this build carries no kernels for, a build without GPU kernels, or an executor that is not a VRAM executor.
  • usearch_status_contended_k Another call holds the executor.
  • usearch_status_overflow_k A part passes a shard's bound or its key multimap.
  • usearch_status_io_k A read of the checkpoint failed mid-load.
usearch_sequence_load_vram_bufferCopies a checkpoint from a memory buffer into a new, mutable index in device memory, reporting and cancelling like usearch_sequence_load_vram.
sequence_index.h:523 ↗
void usearch_sequence_load_vram_buffer(
    usearch_sequence_load_vram_buffer_t *arguments);

Parameters

indexusearch_sequence_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the upload runs on, one stream per device.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them, in host memory.
vramusearch_vram_options_tThe devices to place the parts on.
values_per_keysize_tZero alone: a GPU index keeps no key lookup, so it bounds no key's entries and refuses any bound it is given.
weightsusearch_sequence_weights_t const *The weights an alignment checkpoint was built with; NULL for the Levenshtein kinds.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

  • usearch_status_invalid_argument_k An empty buffer, or weights without a substitution matrix.
  • usearch_status_malformed_k The manifest lists no part, or a part, its header, columns, sums or recorded costs do not parse.
  • usearch_status_unknown_kind_k A checkpoint of an unknown metric.
  • usearch_status_unsupported_k A buffer in device memory, a values_per_key bound, or devices that do not run the pinned class.
  • usearch_status_config_mismatch_k Devices of two classes, weights for a checkpoint of another kind than Needleman-Wunsch or folding into more than 32 classes, a negative gap or a pair above its mean self-score, a Needleman-Wunsch checkpoint recording no costs and given no weights, the executor driving no stream on some shard's device, or the checkpoint's columns differing from the shards' in dtype, shape or key width.
  • usearch_status_device_k An ordinal past the listing, devices this build carries no kernels for, a build without GPU kernels, or an executor that is not a VRAM executor.
  • usearch_status_contended_k Another call holds the executor.
  • usearch_status_overflow_k A part passes a shard's bound or its key multimap.
usearch_sequence_view_ramServes a checkpoint in place through a memory mapping, as a read-only index whose mutating verbs report usearch_status_read_only_k.
sequence_index.h:561 ↗
void usearch_sequence_view_ram(usearch_sequence_view_ram_t *arguments);

Parameters

indexusearch_sequence_index_t *Output for the new, read-only index.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
weightsusearch_sequence_weights_t const *The weights an alignment checkpoint was built with; NULL for the Levenshtein kinds.
ramusearch_ram_options_tThe class to dispatch as; a view reads its shards from the checkpoint, so only usearch_ram_options_t::cpu_class is read.

Statuses

usearch_sequence_view_nvmeServes a checkpoint in place from NVMe drives as a read-only index, every later call reading it through its executor's engines.
sequence_index.h:612 ↗
void usearch_sequence_view_nvme(
    usearch_sequence_view_nvme_t *arguments);

Opening reads the headers alone. Every mutating verb on the handle reports usearch_status_read_only_k, and the parts must stay unmodified until the handle is freed.

Parameters

indexusearch_sequence_index_t *Output for the new, read-only index, written by the time the call is final.
executorusearch_executor_tThe NVMe executor the call is ordered on; the headers come through blocking reads.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
nvmeusearch_nvme_options_tThe devices the parts are served from; naming none serves each where its manifest points.
weightsusearch_sequence_weights_t const *The weights an alignment checkpoint was built with; NULL for the Levenshtein kinds.

Statuses

usearch_sequence_metadata_readReads a checkpoint's metric & geometry without loading it.
sequence_index.h:1597 ↗
void usearch_sequence_metadata_read(
    usearch_sequence_metadata_read_t *arguments);

Parameters

executorusearch_executor_tThe executor the read runs on.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
metadatausearch_sequence_metadata_t *Output for every field the checkpoint froze.

Statuses

usearch_sequence_metadata_read_bufferReads the fields a checkpoint in a memory buffer froze without loading it, as usearch_sequence_metadata_read reads them from a path.
sequence_index.h:1627 ↗
void usearch_sequence_metadata_read_buffer(
    usearch_sequence_metadata_read_buffer_t *arguments);

Parameters

executorusearch_executor_tThe executor the read runs on.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them.
metadatausearch_sequence_metadata_t *Output for every field the checkpoint froze.

Statuses

usearch_shapes_load_ramCopies a checkpoint into a new, mutable index in host memory, its geometry read from the checkpoint's own headers.
shapes_index.h:366 ↗
void usearch_shapes_load_ram(usearch_shapes_load_ram_t *arguments);

Where the parts end up is the call's own memory domains, never the manifest's: part p is written whole on shard p, beside any placed shards the parts leave empty, and the shards past the placed ones open over those domains in turn.

Parameters

indexusearch_shapes_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the read fans out over, one shard per thread.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
ramusearch_ram_options_tThe memory domains to place the parts on.
values_per_keysize_tUpper bound on entries sharing one key, which no checkpoint records; zero is unbounded.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

usearch_shapes_load_ram_bufferCopies a checkpoint from a memory buffer into a new, mutable index in host memory.
shapes_index.h:417 ↗
void usearch_shapes_load_ram_buffer(
    usearch_shapes_load_ram_buffer_t *arguments);

This places, reports and cancels like usearch_shapes_load_ram, which reaches the same bytes through a mapping, so buffer needs no file behind it, and a mapped file no copy.

Parameters

indexusearch_shapes_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the read fans out over, one shard per thread.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them.
ramusearch_ram_options_tThe memory domains to place the parts on.
values_per_keysize_tUpper bound on entries sharing one key, which no checkpoint records; zero is unbounded.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

usearch_shapes_load_vramCopies a checkpoint into a new, mutable index in device memory, with the placement rules of usearch_shapes_load_ram.
shapes_index.h:468 ↗
void usearch_shapes_load_vram(usearch_shapes_load_vram_t *arguments);

Parameters

indexusearch_shapes_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the upload runs on, one stream per device.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
vramusearch_vram_options_tThe devices to place the parts on.
values_per_keysize_tUpper bound on entries sharing one key, which no checkpoint records; zero is unbounded.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

usearch_shapes_load_vram_bufferCopies a checkpoint from a memory buffer into a new, mutable index in device memory, reporting and cancelling like usearch_shapes_load_vram.
shapes_index.h:519 ↗
void usearch_shapes_load_vram_buffer(
    usearch_shapes_load_vram_buffer_t *arguments);

Parameters

indexusearch_shapes_index_t *Output for the new index, written by the time the call is final.
executorusearch_executor_tThe executor the upload runs on, one stream per device.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them, in host memory.
vramusearch_vram_options_tThe devices to place the parts on.
values_per_keysize_tUpper bound on entries sharing one key, which no checkpoint records; zero is unbounded.
progressusearch_progress_tThe optional handler, called with parts placed and their count.

Statuses

usearch_shapes_view_ramServes a checkpoint in place through a memory mapping, as a read-only index whose mutating verbs report usearch_status_read_only_k.
shapes_index.h:551 ↗
void usearch_shapes_view_ram(usearch_shapes_view_ram_t *arguments);

Parameters

indexusearch_shapes_index_t *Output for the new, read-only index.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
ramusearch_ram_options_tThe class to dispatch as; a view reads its shards from the checkpoint, so only usearch_ram_options_t::cpu_class is read.

Statuses

usearch_shapes_view_nvmeServes a checkpoint in place from NVMe drives as a read-only index, every later call reading it through its executor's engines.
shapes_index.h:597 ↗
void usearch_shapes_view_nvme(usearch_shapes_view_nvme_t *arguments);

Opening reads the headers alone. Every mutating verb on the handle reports usearch_status_read_only_k, and the parts must stay unmodified until the handle is freed.

Parameters

indexusearch_shapes_index_t *Output for the new, read-only index, written by the time the call is final.
executorusearch_executor_tThe NVMe executor the call is ordered on; the headers come through blocking reads.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
pathusearch_bytes_view_tCheckpoint path - a monolith, or a manifest naming many.
nvmeusearch_nvme_options_tThe devices the parts are served from; naming none serves each where its manifest points.

Statuses

usearch_shapes_metadata_read_bufferReads the fields a checkpoint in a memory buffer froze without loading it, as usearch_shapes_metadata_read reads them from a path.
shapes_index.h:1635 ↗
void usearch_shapes_metadata_read_buffer(
    usearch_shapes_metadata_read_buffer_t *arguments);

Parameters

executorusearch_executor_tThe executor the read runs on.
outcomeusearch_outcome_t *Output for the outcome, final once its status leaves usearch_status_deferred_k.
completionusearch_completion_tBlocking, the default, or deferred.
bufferusearch_bytes_view_tSource holding one serialized monolith, or the manifest of several parts leading them.
metadatausearch_shapes_metadata_t *Output for every field the checkpoint froze.

Statuses