Data structures

Find a collection by what it does. Open a card to see its tradeoffs, Rust types, and instruction counts from retained runs.

How the USD estimates work

Counts come from counters measured around the operation in PocketIC. They exclude SDK entry and reply work and include page charges incurred inside the measured interval. Measurement guide · Collection counters · Crypto measurement notes

Prices cover the measured instructions on a standard 13-node ICP application subnet. One Wasm32 instruction costs one cycle and one Wasm64 instruction costs two. One trillion cycles equals one XDR. A replicated update adds a base charge of about $0.00000671. Ingress, storage, and IC services such as threshold signing have their own charges. ICP cycle prices

The USD estimate uses the December 1, 2026 IMF rate of 1.34112 dollars per XDR. Batch averages share the work of one update across its measured operations. The linked benchmarks identify the inputs, the build and what was timed. IMF exchange rates

MapLook up records by key or scan them in sorted order.

When to use Map

The B-tree supports exact lookups, updates and bounded ranges. Nyxus lends native values directly. Hylix stores records in stable memory and can scan keys without decoding their values.

Tradeoff. Choose an ordering that matches the app’s range queries. Nyxus ranges borrow live entries. Hylix value reads decode records and owning values need explicit transfer or retirement when removed.

Rust API

  • cdk_rsx_collections::nyxus::Map
  • cdk_rsx_collections::hylix::Map

Nyxus collections guide · Hylix collections guide · Hylix map mutation benchmark

Cost per operation

Get one key
342,146 instructions≈ $0.000000918
Nyxus Map with 100,000 keys Benchmark
Replace one value
500,522 instructions≈ $0.00000134
Nyxus Map with 100,000 keys Benchmark
Scan up to 4,096 entries
967,290 instructions≈ $0.00000259
Nyxus Map with 100,000 keys Benchmark
Benchmark measurements
Nyxus Map, one distant key lookup
1,002,362 instructions
100,000 populated records. Mean across 32 PocketIC updates, including the whole endpoint and page charges. Benchmark report
Hylix Map, one distant key lookup
1,205,427 instructions
100,000 populated records. Mean across 32 PocketIC updates in the same fixture, including the whole endpoint, page charges and virtual stable-memory mapping. Benchmark report
SetKeep unique keys and check membership exactly.

When to use Set

Use a B-tree set for eligibility lists, deduplication or sorted ranges of IDs. Nyxus lends keys from the retained heap. Hylix keeps keys in stable memory.

Tradeoff. The tree maintains sorted order on insert and removal. Add a Map when you also need to store values against each key.

Rust API

  • cdk_rsx_collections::nyxus::Set
  • cdk_rsx_collections::hylix::Set

Nyxus collections guide · Hylix collections guide

Cost per operation

Check a present key
706,545 instructions≈ $0.0000019
Hylix Set with 100,000 keys Benchmark
Check an absent key
707,338 instructions≈ $0.0000019
Hylix Set with 100,000 keys Benchmark
Check 32 present keys
2,248,150 instructions≈ $0.00000603
Hylix Set with 100,000 keys Benchmark
Benchmark measurements
Hylix Set, one distant membership probe
1,203,617 instructions
100,000 populated keys. Mean across 32 PocketIC updates, including the whole endpoint, page charges and virtual stable-memory mapping. Benchmark report
BitmapSetExact membership for a bounded range of integer IDs.Experimental

When to use BitmapSet

Use one bit per ID, with counts and paged ranges. Fits dense permissions and visited sets where each integer has a predictable position.

Tradeoff. Allocation grows through the highest used block. Widely spaced IDs can reserve more storage than a key-based set.

Rust API

  • cdk_rsx_collections_minima::BitmapSet

Minima collection guide · BitmapSet implementation (Rust source)

Cost per operation

Check a present ID
86,525 instructions≈ $0.000000232
100,000 dense integer IDs Benchmark
Check an absent ID
86,505 instructions≈ $0.000000232
100,000 dense integer IDs Benchmark
Check 32 present IDs
116,687 instructions≈ $0.000000313
Grouped check on 100,000 IDs Benchmark
Insert and remove 32 IDs
596,975 instructions≈ $0.0000016
Temporary set with duplicate checks Benchmark
Benchmark measurements
Probe one distant ID
736,156 → 414,161 instructions
100,000 dense integer IDs. Mean complete IC instructions over 32 warmed updates, at c5c905dc versus 614c714f. Benchmark report
Insert, reinsert, and remove 32 IDs
1,007,264 → 844,989 instructions
Grouped transitions with duplicate and absence checks. Mean complete IC instructions over 32 warmed updates, including temporary owner setup and retirement, at c5c905dc versus 614c714f. Benchmark report
FrozenHashMapExact key-to-value lookups for an immutable dataset.Experimental

When to use FrozenHashMap

Find a fixed-width value in at most two buckets. Grouped lookups share bucket reads and return results in the original key order.

Tradeoff. Changing data requires a rebuild. Keys must be unique, and construction works within finite reseed and growth limits.

Rust API

  • cdk_rsx_collections_minima::FrozenHashMap

Minima collection guide · FrozenHashMap implementation (Rust source)

Cost per operation

Get one present key
171,164 instructions≈ $0.000000459
100,000 fixed 64-bit keys and values Benchmark
Get one absent key
176,035 instructions≈ $0.000000472
100,000 fixed 64-bit keys and values Benchmark
Get 32 distant keys
334,423 instructions≈ $0.000000897
Grouped lookup over 100,000 entries Benchmark
Build and replace a 32-entry map
1,652,436 instructions≈ $0.00000443
Two builds with full checks Benchmark
Benchmark measurements
Look up one distant key
821,410 → 499,412 instructions
100,000 fixed u64 key/value pairs. Mean complete IC instructions over 32 warmed updates, at c5c905dc versus 614c714f. Benchmark report
Build and replace a 32-entry map
2,062,805 → 1,900,450 instructions
Two builds from unsorted inputs with full retrieval checks. Mean complete IC instructions over 32 warmed updates, including temporary owner setup and retirement, at c5c905dc versus 614c714f. Benchmark report
FrozenHashSetExact membership for a set built once from known keys.Experimental

When to use FrozenHashSet

Check whether a fixed-width key exists using at most two buckets. Useful when the answer is membership alone.

Tradeoff. Changing the keys requires a rebuild. Grouping reads pays for scratch and sorting, so the access pattern matters.

Rust API

  • cdk_rsx_collections_minima::FrozenHashSet

Minima collection guide · FrozenHashSet implementation (Rust source)

Cost per operation

Check a present key
171,112 instructions≈ $0.000000459
100,000 fixed 64-bit keys Benchmark
Check an absent key
176,078 instructions≈ $0.000000472
100,000 fixed 64-bit keys Benchmark
Build and replace a 32-key set
1,867,164 instructions≈ $0.00000501
Two builds with full checks Benchmark
Benchmark measurements
Probe one distant key
820,746 → 498,748 instructions
100,000 fixed u64 keys. Mean complete IC instructions over 32 warmed updates, at c5c905dc versus 614c714f. Benchmark report
Build and replace a 32-key set
2,277,565 → 2,115,178 instructions
Two disjoint builds with checks for new membership and old-key absence. Mean complete IC instructions over 32 warmed updates, including temporary owner setup and retirement, at c5c905dc versus 614c714f. Benchmark report
FrozenPhobicAssign each frozen key a distinct position in a dense array.Experimental

When to use FrozenPhobic

Use a minimal perfect index to locate separate fixed records by key. Known build keys receive collision-free positions.

Tradeoff. An unknown key can map to an occupied position, so membership is a separate check. Key changes need a rebuild.

Rust API

  • cdk_rsx_collections_minima::FrozenPhobic

Minima collection guide · FrozenPhobic implementation (Rust source)

Cost per operation

Find one perfect-hash index
321,292 instructions≈ $0.000000862
Known key among 2,048 keys Benchmark
Find 32 perfect-hash indexes
428,023 instructions≈ $0.00000115
Known keys among 2,048 keys Benchmark
Build and replace a 32-key index
1,455,394 instructions≈ $0.0000039
Two builds with bijection checks Benchmark
Benchmark measurements
Look up positions for 32 known keys
840,278 → 677,896 instructions
2,048 build keys. Mean complete IC instructions over 32 warmed updates, at c5c905dc versus 614c714f. Benchmark report
Build and replace a 32-key index
1,706,039 → 1,703,410 instructions
Two disjoint builds with complete bijection checks, including sorting returned positions. Mean complete IC instructions over 32 warmed updates, including temporary owner setup and retirement, at c5c905dc versus 614c714f. Benchmark report
FrozenSortedMapAn immutable map for exact lookup and ordered scans.Experimental

When to use FrozenSortedMap

Seek a start key once, then stream entries in order. Fits read-heavy indexes that need both point lookups and ranges.

Tradeoff. A changed dataset needs a new build. Keys must be unique, and grouped reads pay preparation costs that scattered lookups may not recover.

Rust API

  • cdk_rsx_collections_minima::FrozenSortedMap

Minima collection guide · FrozenSortedMap implementation (Rust source)

Cost per operation

Get one present key
180,350 instructions≈ $0.000000484
100,000 fixed 64-bit keys and values Benchmark
Get one absent key
180,394 instructions≈ $0.000000484
100,000 fixed 64-bit keys and values Benchmark
Scan up to 4,096 entries
464,993 instructions≈ $0.00000125
100,000 fixed 64-bit keys and values Benchmark
Build and replace a 32-entry map
1,122,275 instructions≈ $0.00000301
Two builds with full checks Benchmark
Benchmark measurements
Look up one distant key
830,595 → 508,597 instructions
100,000 fixed u64 key/value pairs. Mean complete IC instructions over 32 warmed updates, at c5c905dc versus 614c714f. Benchmark report
Build and replace a 32-entry sorted map
1,532,572 → 1,370,289 instructions
Two builds from unsorted inputs with full value checks. Mean complete IC instructions over 32 warmed updates, including temporary owner setup and retirement, at c5c905dc versus 614c714f. Benchmark report
QueuePush and pop retained items at either end.

When to use Queue

A ring buffer advances its head as you drain pending work. Hylix can read a bounded prefix in windows, so a batch can use fewer stable-memory reads.

Tradeoff. Growing the ring moves the live sequence. With Hylix, a popped item that owns stable data must move into another durable field or be retired.

Rust API

  • cdk_rsx_collections::nyxus::Queue
  • cdk_rsx_collections::hylix::Queue

Nyxus collections guide · Hylix collections guide · Bounded prefix read trace

Measured instruction cost

Heavy16 workload with Hylix Queue and Vec windows
1,127,003,694,396 instructions
Total across 19,200 workflows in 179 simulated rounds, versus 1,132,909,046,630 for the matched stable control. The totals cover the full workload, including other runtime work. Benchmark report
StringStore UTF-8 labels, names and text in module memory.

When to use String

Nyxus provides a mutable text buffer with borrowed reads. Hylix owns the encoded text in stable memory and can use it as an ordered key.

Tradeoff. Hylix text is replaced as a value, and returning it to a caller copies the bytes into transient memory. Slice text at UTF-8 character boundaries.

Rust API

  • cdk_rsx_collections::nyxus::String
  • cdk_rsx_collections::hylix::String

Nyxus collections guide · Hylix collections guide

Measured instruction cost

The retained benchmark set has no instruction measurement for this entry.

VecAppend items and read them by position.

When to use Vec

Use a growable sequence for ordered batches or rows with numeric positions. Nyxus retains a contiguous native buffer. Hylix reads the encoded slot at the requested index in stable memory.

Tradeoff. Inserts and removals in the middle shift other items. Hylix elements need a fixed-width codec and reads decode the item.

Rust API

  • cdk_rsx_collections::nyxus::Vec
  • cdk_rsx_collections::hylix::Vec

Nyxus collections guide · Hylix collections guide

Cost per operation

Get one value
683,786 instructions≈ $0.00000183
Hylix Vec of 100,000 values Benchmark
Set one value
482,062 instructions≈ $0.00000129
Hylix Vec of 100,000 values Benchmark
Scan up to 4,096 values
6,618,933 instructions≈ $0.0000178
Hylix Vec of 100,000 values Benchmark
Benchmark measurements
Hylix Vec, one distant indexed read
1,179,432 instructions
100,000 populated items. Mean across 32 PocketIC updates, including the whole endpoint, page charges and virtual stable-memory mapping. Benchmark report
Nyxus Vec<u8>, replace a 1 MiB upload
5,486,869 instructions
Mean across eight complete Tripwire uploads, including decoding, replacing the old record and disposing of its previous buffer. Benchmark report
FixedVecMutable fixed-width values at integer positions.Experimental

When to use FixedVec

Read a record by its position, append a run of values, or scan contiguous records. Fits dense tables and ordered histories.

Tradeoff. Each value has a fixed nonzero width and must fit one 4 KiB node. Grouped reads take sorted indices.

Rust API

  • cdk_rsx_collections_minima::FixedVec

Minima collection guide · FixedVec implementation (Rust source)

Cost per operation

Get one value
86,458 instructions≈ $0.000000232
100,000 64-bit values Benchmark
Set one value
324,827 instructions≈ $0.000000871
100,000 64-bit values Benchmark
Scan up to 4,096 values
156,325 instructions≈ $0.000000419
100,000 64-bit values Benchmark
Append, set and pop 32 values
585,455 instructions≈ $0.00000157
Temporary vector lifecycle Benchmark
Benchmark measurements
Read one distant value
736,703 → 414,705 instructions
100,000 populated u64 values. Mean complete IC instructions over 32 warmed updates, at c5c905dc versus 614c714f. Benchmark report
Append, set, and pop 32 values
995,764 → 833,469 instructions
Grouped writes, reverse scalar pops, and full value checks. Mean complete IC instructions over 32 warmed updates, including temporary owner setup and retirement, at c5c905dc versus 614c714f. Benchmark report
FrozenPrefixSumsExact range totals over immutable nonnegative values.Experimental

When to use FrozenPrefixSums

Answer a range sum from its two prefix endpoints. Fits fixed accounting summaries and histograms where wide ranges are common.

Tradeoff. Inputs are nonnegative u64 values. Total overflow rejects construction, and changing a value requires a rebuild.

Rust API

  • cdk_rsx_collections_minima::FrozenPrefixSums

Minima collection guide · FrozenPrefixSums implementation (Rust source)

Cost per operation

Sum one range of up to 4,096 values
166,803 instructions≈ $0.000000447
100,000 populated values Benchmark
Sum 32 distant ranges
134,098 instructions≈ $0.00000036
Grouped ranges of up to 4,096 values each Benchmark
Build and replace 32 prefix sums
820,221 instructions≈ $0.0000022
Two builds with singleton and total checks Benchmark
Benchmark measurements
Sum one range of up to 4,096 values
816,578 → 494,580 instructions
100,000 populated weights, cycling from 1 to 17. Mean complete IC instructions over 32 warmed updates, at c5c905dc versus 614c714f. Benchmark report
Build and replace sums for 32 values
1,230,530 → 1,068,235 instructions
Two builds with exact singleton and total-sum checks. Mean complete IC instructions over 32 warmed updates, including temporary owner setup and retirement, at c5c905dc versus 614c714f. Benchmark report
BlobKeep an owned binary payload in stable memory.

When to use Blob

Use it for files or opaque records. The streaming constructor writes the payload in chunks with reusable scratch space.

Tradeoff. Reading bytes out and writing a replacement both move data. When a field is replaced, retire the old stable owner or transfer it to another field.

Rust API

  • cdk_rsx_collections::hylix::Blob

Hylix collections guide

Measured instruction cost

Hylix Blob, replace a 1 MiB upload
15,032,833 instructions
Mean across eight complete Tripwire uploads, including decoding, 4 KiB scratch, stable writes and disposal of the old owner. The matched Wire endpoint averaged 22,536,080. Benchmark report
BoxGive one module a unique owner for a separately allocated value.

When to use Box

Move a large retained value by moving its handle. The value stays in the Nyxus heap and is released when its owner drops.

Tradeoff. Each box adds a separate allocation and indirection. The payload must satisfy the Nyxus retained-data contract.

Rust API

  • cdk_rsx_collections::nyxus::Box

Nyxus collections guide

Measured instruction cost

The retained benchmark set has no instruction measurement for this entry.

CellKeep one mutable record with a unique stable-memory owner.

When to use Cell

Use a Cell for a settings record, counters or a checkpoint. Read and edit guards work on the typed record, and the edit guard writes back when it closes.

Tradeoff. Reads decode the record, and guards must finish inside the actor frame. Retire or transfer an old field if it owns another stable allocation.

Rust API

  • cdk_rsx_collections::hylix::Cell

Hylix collections guide

Measured instruction cost

The retained benchmark set has no instruction measurement for this entry.

Rc / WeakShare one retained allocation and keep optional references to it.

When to use Rc / Weak

Cloned Rc owners keep the same Nyxus value alive. A Weak reference can look it up while a strong owner exists, which is useful for links back to an owner.

Tradeoff. Reference counts cannot reclaim strong cycles. Use Weak for links that should expire when the last strong owner drops.

Rust API

  • cdk_rsx_collections::nyxus::Rc
  • cdk_rsx_collections::nyxus::Weak

Nyxus collections guide

Measured instruction cost

The retained benchmark set has no instruction measurement for this entry.

Shared / SharedCellLet several retained records own one stable-memory value.

When to use Shared / SharedCell

Use Shared for an immutable value with multiple owners. SharedCell adds guarded mutation when those owners need to observe the same changing record.

Tradeoff. Create each durable owner with share() and retire it explicitly. Reads decode a temporary value. Saved fields hold owners, while temporary snapshots end in the frame.

Rust API

  • cdk_rsx_collections::hylix::Shared
  • cdk_rsx_collections::hylix::SharedCell

Hylix ownership guide

Measured instruction cost

The retained benchmark set has no instruction measurement for this entry.

SharedBytes / SharedTextKeep checked byte ranges or UTF-8 ranges into one retained buffer.

When to use SharedBytes / SharedText

SharedBytes takes subranges without copying the payload. SharedText does the same for validated UTF-8 and checks character boundaries when slicing. Reactor uses retained spans to queue packet fields.

Tradeoff. A small span holds its entire backing chunk in memory. Copy a small range if it needs to outlive a large packet.

Rust API

  • cdk_rsx_collections::nyxus::SharedBytes
  • cdk_rsx_collections::nyxus::SharedText

Nyxus collections guide

Measured instruction cost

Heavy16 workload with shared packet spans and borrowed dispatch
90,207,425,197 instructions
Complete Tripwire run with 19,200 workflows and 360,000 protocol items. The previous Tripwire run used 94,808,165,875. This is the combined result of several changes, including spans. Benchmark report
SharedSlice / SharedStringKeep one immutable array or string behind several retained handles.

When to use SharedSlice / SharedString

SharedSlice stores the ownership header and array together. Its byte reader can fill the final allocation directly, and SharedString can adopt the same bytes after validating UTF-8.

Tradeoff. The payload is immutable, and every live owner keeps the full allocation in memory. Build a replacement when the contents change.

Rust API

  • cdk_rsx_collections::nyxus::SharedSlice
  • cdk_rsx_collections::nyxus::SharedString

Nyxus collections guide

Measured instruction cost

The retained benchmark set has no instruction measurement for this entry.

FrozenRibbonRetrieve assigned fixed bytes for a known set of keys.Experimental

When to use FrozenRibbon

Store per-key metadata in a compact immutable representation, using a short band of coefficients for retrieval.

Tradeoff. Check membership separately when callers can supply arbitrary keys. An unknown key can return arbitrary bytes.

Rust API

  • cdk_rsx_collections_minima::FrozenRibbon

Minima collection guide · FrozenRibbon implementation (Rust source)

Cost per operation

Retrieve one assigned value
322,849 instructions≈ $0.000000866
Known key among 2,048 keys Benchmark
Retrieve 32 assigned values
478,356 instructions≈ $0.00000128
Known keys among 2,048 keys Benchmark
Build and replace 32 assignments
1,301,116 instructions≈ $0.00000349
Two builds with full checks Benchmark
Benchmark measurements
Retrieve 32 known keys
891,082 → 728,700 instructions
2,048 build keys with assigned 8-byte values. Mean complete IC instructions over 32 warmed updates, at c5c905dc versus 614c714f. Benchmark report
Build and replace 32 assigned values
1,711,463 → 1,549,130 instructions
Two builds with exact retrieval verification. Mean complete IC instructions over 32 warmed updates, including temporary owner setup and retirement, at c5c905dc versus 614c714f. Benchmark report
SlotArenaReusable record slots with generation-checked IDs.Experimental

When to use SlotArena

Keep handles to individually removable records. A recycled slot gets a new generation, so old IDs cannot name replacement records.

Tradeoff. Each slot has a 16-byte header and its full value must fit a node. Freed slots are reusable, and the arena retains its blocks until retirement.

Rust API

  • cdk_rsx_collections_minima::SlotArena

Minima collection guide · SlotArena implementation (Rust source)

Cost per operation

Get one slot
126,638 instructions≈ $0.00000034
100,000 slots with 64-bit values Benchmark
Set one slot
365,207 instructions≈ $0.00000098
100,000 slots with 64-bit values Benchmark
Get 32 distant slots
118,744 instructions≈ $0.000000319
Grouped read on 100,000 slots Benchmark
Allocate, set, remove and reuse 32 slots
686,669 instructions≈ $0.00000184
Temporary arena lifecycle Benchmark
Benchmark measurements
Read one distant slot
776,883 → 454,885 instructions
100,000 populated u64 slots. Mean complete IC instructions over 32 warmed updates, at c5c905dc versus 614c714f. Benchmark report
Allocate, update, remove, and reuse 32 slots
1,097,003 → 934,683 instructions
Grouped slice allocation with value, reuse, stale-ID, and generation checks. Mean complete IC instructions over 32 warmed updates, including temporary owner setup and retirement, at c5c905dc versus 614c714f. Benchmark report
NyxusGraphStore and traverse exact, directed, labeled relationships.

When to use NyxusGraph

Borrow sorted neighbors from retained heap for dependency searches, intersections or recommendations. The graph adapts to high-degree vertices and can maintain exact incoming edges.

Tradeoff. A reverse index costs extra storage and mutation work. The application maps its records to dense vertex IDs and manages work limits or resume state for long searches.

Rust API

  • cdk_rsx_graph_nyxus::NyxusGraph

Nyxus graph API · Graph guide

Cost per operation

Traverse a dependency graph
10,864,111 instructions≈ $0.0000291
10,000-vertex path, one search limited to 10,000 hops Benchmark
Intersect 64 candidate pairs
953,576 instructions≈ $0.00000256
Sparse graph with 10,000 vertices Benchmark
Run eight four-hop searches
1,680,112 instructions≈ $0.00000451
Sparse graph with 10,000 vertices Benchmark
Apply 1,024 edge changes and summarize
9,632,801 instructions≈ $0.0000258
Sparse graph with 10,000 vertices Benchmark
Benchmark measurements
One complete dependency search with a 10,000-hop limit
11,113,721 instructions
Path-shaped graph with 10,000 vertices and 100,000 edges. Mean across eight fresh PocketIC updates with the optimized application traversal, versus 149,456,417.25 in the matched baseline. Benchmark report
64 candidate intersections on a sparse graph
1,202,330 instructions
10,000 vertices and 100,000 edges. Mean across eight fresh PocketIC updates, including scratch preparation and reply. Benchmark report
DeltaGraphAn exact mutable graph with bounded segments for changes.Experimental

When to use DeltaGraph

Apply local changes against base segments, then consolidate them while keeping the logical revision intact.

Tradeoff. Dense vertex-root rows can reserve more storage for sparse graphs. The retained sparse fixture used nine 64 KiB payload blocks.

Rust API

  • cdk_rsx_collections_minima::graph::DeltaGraph

Exact graph guide · Graph storage layouts

Cost per operation

Look up one edge
83,212 instructions≈ $0.000000223
Sparse graph with 512 vertices Benchmark
Page through up to 16 neighbors
87,142 instructions≈ $0.000000234
Sparse graph with 512 vertices Benchmark
Intersect one candidate pair
154,660 instructions≈ $0.000000415
Sparse graph with 512 vertices Benchmark
Advance a breadth-first search
245,935 instructions≈ $0.00000066
One bounded step with a 32-edge budget Benchmark
Benchmark measurements
Look up one distant edge
574,418 instructions
Mean complete IC instructions over 32 warmed updates on a sparse 512-vertex, 530-edge graph with reverse indexing. Artifact d41a4128. Benchmark report
Read a page of up to 16 neighbors
578,952 instructions
Mean complete IC instructions over 32 warmed updates on a sparse 512-vertex, 530-edge graph with reverse indexing. Artifact d41a4128. Benchmark report
ExternalGraphSketchSample an edge that crosses a graph partition.Experimental

When to use ExternalGraphSketch

Use a compact, buffered summary to look for links between groups of vertices in an undirected graph.

Tradeoff. Mirror changes from the exact graph and flush the buffer before sampling. NoSample is inconclusive.

Rust API

  • cdk_rsx_collections_minima::ExternalGraphSketch

Graph sampling and exact backing

Cost per operation

Sample one prefix cut
464,490 instructions≈ $0.00000125
64-vertex path Benchmark
Sample 32 prefix cuts
653,709 instructions≈ $0.00000175
64-vertex path Benchmark
Add and delete 32 edges
1,902,529 instructions≈ $0.0000051
33-vertex path with flushes and checks Benchmark
Benchmark measurements
32 prefix-cut samples
1.066M → 903.8k instructions
Complete update on a 64-vertex path fixture. Benchmark report
Ingest and delete 32 path edges
2.313M → 2.151M instructions
Complete temporary-owner lifecycle for a path, including grouped ingestion, flushes, verification, and retirement. Benchmark report
FrozenGraphAn immutable exact graph with contiguous neighbor lists.Experimental

When to use FrozenGraph

Read outgoing adjacency from sorted edge arrays and offsets. A reverse index can also provide predecessors. Fits sealed graph snapshots.

Tradeoff. Changes require a replacement build. Prepare finite edge input and plan output bounds for scans.

Rust API

  • cdk_rsx_collections_minima::graph::FrozenGraph

Exact graph guide · Graph storage layouts

Cost per operation

Look up one edge
86,350 instructions≈ $0.000000232
Sparse graph with 512 vertices Benchmark
Page through up to 16 neighbors
87,314 instructions≈ $0.000000234
Sparse graph with 512 vertices Benchmark
Intersect one candidate pair
190,007 instructions≈ $0.00000051
Sparse graph with 512 vertices Benchmark
Advance a breadth-first search
246,097 instructions≈ $0.00000066
One bounded step with a 32-edge budget Benchmark
Benchmark measurements
Look up one distant edge
577,485 instructions
Mean complete IC instructions over 32 warmed updates on a sparse 512-vertex, 530-edge graph with reverse indexing. Artifact e37d3073. Benchmark report
Read a page of up to 16 neighbors
579,056 instructions
Mean complete IC instructions over 32 warmed updates on a sparse 512-vertex, 530-edge graph with reverse indexing. Artifact e37d3073. Benchmark report
PackedGraphAn exact mutable graph with globally ordered edges.Experimental

When to use PackedGraph

Keep edges for small neighborhoods together in a stable B+ tree. It supports sorted bulk construction and ordered neighbor traversal.

Tradeoff. Each edge stores its source ID. In the retained dense-ish fixture it used more stable payload blocks than the other three Minima graph layouts.

Rust API

  • cdk_rsx_collections_minima::graph::PackedGraph

Exact graph guide · Graph storage layouts

Cost per operation

Look up one edge
91,007 instructions≈ $0.000000244
Sparse graph with 512 vertices Benchmark
Page through up to 16 neighbors
92,507 instructions≈ $0.000000248
Sparse graph with 512 vertices Benchmark
Intersect one candidate pair
200,254 instructions≈ $0.000000537
Sparse graph with 512 vertices Benchmark
Advance a breadth-first search
251,153 instructions≈ $0.000000674
One bounded step with a 32-edge budget Benchmark
Benchmark measurements
Look up one distant edge
582,212 instructions
Mean complete IC instructions over 32 warmed updates on a sparse 512-vertex, 530-edge graph with reverse indexing. Artifact d41a4128. Benchmark report
Read a page of up to 16 neighbors
584,320 instructions
Mean complete IC instructions over 32 warmed updates on a sparse 512-vertex, 530-edge graph with reverse indexing. Artifact d41a4128. Benchmark report
PagedGraphAn exact mutable graph with storage that follows vertex degree.Experimental

When to use PagedGraph

Keep one edge inline, use shared slabs as neighborhoods grow, and use trees for hubs. It used the fewest instructions most often in the recorded small mutable comparison.

Tradeoff. Growing neighborhoods move between representations. Choose using your graph shape and measure again at your target scale.

Rust API

  • cdk_rsx_collections_minima::graph::PagedGraph

Exact graph guide · Graph storage layouts

Cost per operation

Look up one edge
82,327 instructions≈ $0.000000221
Sparse graph with 512 vertices Benchmark
Page through up to 16 neighbors
83,468 instructions≈ $0.000000224
Sparse graph with 512 vertices Benchmark
Intersect one candidate pair
182,301 instructions≈ $0.000000489
Sparse graph with 512 vertices Benchmark
Advance a breadth-first search
242,264 instructions≈ $0.00000065
One bounded step with a 32-edge budget Benchmark
Benchmark measurements
Look up one distant edge
573,532 instructions
Mean complete IC instructions over 32 warmed updates on a sparse 512-vertex, 530-edge graph with reverse indexing. Artifact e37d3073. Benchmark report
Read a page of up to 16 neighbors
575,280 instructions
Mean complete IC instructions over 32 warmed updates on a sparse 512-vertex, 530-edge graph with reverse indexing. Artifact e37d3073. Benchmark report
AerisFilterRefine a range filter after a confirmed false positive.Experimental

When to use AerisFilter

Use for bounded integer ranges where repeated empty lookups make it worthwhile to remember false positives.

Tradeoff. Refining needs the complete backing key set and a committed update. Fixed slot capacity and hash lengths limit how far a filter can adapt.

Rust API

  • cdk_rsx_collections_minima::AerisFilter

Aeris range and refinement rules

Cost per operation

Check one key
345,042 instructions≈ $0.000000925
Approximate filter with 2,048 keys Benchmark
Check 32 ranges
1,166,617 instructions≈ $0.00000313
2,048 keys, 16 integers per range Benchmark
Insert and remove 32 keys, then refine
4,867,017 instructions≈ $0.0000131
Temporary filter with exact checks Benchmark
Benchmark measurements
32 range probes
1.579M → 1.416M instructions
Complete update on the populated paper-collection fixture. Each queried range spans 16 integers. Benchmark report
32 range probes after packed-span optimization
2,105,850 → 1,578,732 instructions
A separate matched optimization round. Complete update with 32 ranges of 16 integers each. Benchmark report
BlockedBloomFilterRule out missing keys before an exact lookup.Experimental

When to use BlockedBloomFilter

Use ahead of a map or set when most requests miss. Each probe checks a small block of bits, and grouped probes can share a read.

Tradeoff. Confirm positive answers against the exact data. This filter accepts additions and is best suited to growing sets.

Rust API

  • cdk_rsx_collections_minima::BlockedBloomFilter

Minima filter contracts

Cost per operation

Check one known key
86,908 instructions≈ $0.000000233
Filter only with a 512 KiB filter Benchmark
Check 100 keys
245,122 instructions≈ $0.000000657
Grouped filter-only checks, 99% misses Benchmark
Build a filter and insert 32 keys
598,738 instructions≈ $0.00000161
Temporary 8 KiB filter with validation Benchmark
Benchmark measurements
100 grouped membership probes
896.1k → 573.6k instructions
Complete update against 100,000 populated keys with 99% misses and a 512 KiB filter. This row measures the filter alone. Benchmark report
100 membership checks with exact confirmation
2,871,215 → 925,487 instructions
A separate complete-update comparison on a 100,000-key set with 99% misses. Exact-set lookup alone versus a grouped 512 KiB Bloom precheck followed by exact lookup on positives. Benchmark report
BlockedCountingBloomRule out missing keys in a set that also deletes entries.Experimental

When to use BlockedCountingBloom

Use counters to track insertions and removals while skipping exact lookups on definite misses.

Tradeoff. Drive each change from an authoritative exact set. Positive probes can collide, and updates can refuse counter overflow.

Rust API

  • cdk_rsx_collections_minima::BlockedCountingBloom

Deletable filter contracts

Cost per operation

Check one known key
87,490 instructions≈ $0.000000235
Filter-only check with 100,000 entries Benchmark
Insert one key
328,343 instructions≈ $0.000000881
Single scalar mutation Benchmark
Remove one known key
328,336 instructions≈ $0.000000881
Single scalar mutation Benchmark
Benchmark measurements
100 grouped membership probes
904.8k → 582.6k instructions
Complete update against 100,000 populated keys with 99% misses. This row measures the filter alone. Benchmark report
Insert and remove 32 exact-authorized keys
1.168M → 1.006M instructions
Complete temporary-owner lifecycle with scalar operations, including preparation, verification, and retirement. Benchmark report
CuckooFilterKeep a deletable membership precheck with short fingerprints.Experimental

When to use CuckooFilter

Use two candidate buckets to check whether an exact lookup is worth making, including for sets that remove keys frequently.

Tradeoff. Confirm positive probes and authorize deletes using your exact set. A bounded insertion can return Full before the nominal capacity is reached.

Rust API

  • cdk_rsx_collections_minima::CuckooFilter

Deletable filter contracts

Cost per operation

Check one known key
87,070 instructions≈ $0.000000234
Filter-only check with 100,000 entries Benchmark
Insert one key
355,922 instructions≈ $0.000000955
Single scalar mutation Benchmark
Remove one known key
327,259 instructions≈ $0.000000878
Single scalar mutation Benchmark
Benchmark measurements
100 scalar membership probes
1.168M → 845.5k instructions
Complete update against 100,000 populated keys with 99% misses. This row measures the filter alone. Benchmark report
FrozenBinaryFuseCompress membership checks for a fixed set of keys.Experimental

When to use FrozenBinaryFuse

Use a sealed 16-bit fingerprint filter when your dataset changes by whole replacements and you want a compact precheck.

Tradeoff. Build from the full deduplicated set and budget for construction scratch. Confirm positive probes with the exact data.

Rust API

  • cdk_rsx_collections_minima::FrozenBinaryFuse

Binary fuse construction and probes

Cost per operation

Check one known key
87,568 instructions≈ $0.000000235
Filter-only check with 100,000 entries Benchmark
Check 100 keys
408,102 instructions≈ $0.00000109
Grouped filter-only checks, 99% misses Benchmark
Build and replace a 32-key filter
999,248 instructions≈ $0.00000268
Two builds with full checks Benchmark
Benchmark measurements
100 grouped membership probes
1.058M → 736.6k instructions
Complete update against 100,000 populated keys with 99% misses. This row measures the filter alone. Benchmark report
FrozenZorPrecheck membership in an immutable set with an exception index.Experimental

When to use FrozenZor

Use the static filter with its auxiliary key index when most queries can be resolved by the compact representation.

Tradeoff. Build or replace the filter as a unit. Count the auxiliary index in storage and probe costs, and confirm positive results exactly.

Rust API

  • cdk_rsx_collections_minima::FrozenZor

ZOR construction and exceptions

Cost per operation

Check one key
324,309 instructions≈ $0.00000087
2,048 keys with the exceptional-key structure included Benchmark
Check 32 keys
524,234 instructions≈ $0.00000141
2,048 keys with the exceptional-key structure included Benchmark
Build and replace a 32-key filter
1,453,230 instructions≈ $0.0000039
Two builds with full checks Benchmark
Benchmark measurements
32 membership probes
936.3k → 774.0k instructions
Complete update on a frozen paper-collection fixture. This row measures the filter alone. Benchmark report
MementoFilterSkip scans when an integer range is definitely empty.Experimental

When to use MementoFilter

Put a point or range precheck before an exact index. This can avoid fetching a range that has no matching keys.

Tradeoff. Ranges and storage geometry are bounded. Confirm positives using the exact index and mirror its authorized insertions and removals.

Rust API

  • cdk_rsx_collections_minima::MementoFilter

Range filter contracts

Cost per operation

Check one key
335,789 instructions≈ $0.000000901
Approximate filter with 2,048 keys Benchmark
Check 32 ranges
1,129,587 instructions≈ $0.00000303
2,048 keys, 16 integers per range Benchmark
Insert and remove 32 keys
3,985,924 instructions≈ $0.0000107
Temporary filter with admission and removal checks Benchmark
Benchmark measurements
32 range probes
1.542M → 1.379M instructions
Complete update on the populated paper-collection fixture. Each queried range spans 16 integers. Benchmark report
32 range probes after packed-span optimization
2,124,782 → 1,541,702 instructions
A separate matched optimization round. Complete update with 32 ranges of 16 integers each. Benchmark report
CountMinSketchEstimate how often a supplied key appeared.Experimental

When to use CountMinSketch

Track frequent requests or events in a fixed amount of space. The sketch adds positive weights and can merge compatible counters.

Tradeoff. Hash collisions can inflate estimates, especially for low counts. Keep exact records for key listings, decreases, and decisions that depend on a precise total.

Rust API

  • cdk_rsx_collections_minima::CountMinSketch

Frequency sketch contracts

Cost per operation

Estimate one key’s frequency
86,641 instructions≈ $0.000000232
100,000 observed keys Benchmark
Add one weighted key
328,225 instructions≈ $0.00000088
Single scalar addition Benchmark
Merge two sketches
1,294,464 instructions≈ $0.00000347
Four rows of 2,048 counters Benchmark
Benchmark measurements
100 frequency estimates
933.3k → 610.6k instructions
Complete update against 100,000 populated entries, with 99 previously unseen probe keys. Benchmark report
DDSketchEstimate percentiles for a stream of numeric values.Experimental

When to use DDSketch

Track latency or size distributions with configurable relative value error. One scan can answer a batch of sorted percentile requests.

Tradeoff. Choose a fixed positive range before collecting observations. Zero has its own counter, and values outside the admitted range are rejected.

Rust API

  • cdk_rsx_collections_minima::DDSketch

Ranges, weighting, and quantiles

Cost per operation

Estimate one quantile
337,572 instructions≈ $0.000000905
2,048 observations at 1% relative accuracy Benchmark
Estimate 32 quantiles
375,397 instructions≈ $0.00000101
2,048 observations with a shared scan Benchmark
Add 32 values, merge and clear
1,450,574 instructions≈ $0.00000389
Temporary sketch with weighted values and rank checks Benchmark
Benchmark measurements
32 quantiles in one shared scan
787.5k → 625.1k instructions
Complete update including query preparation. The fixture uses the range 1–10,000 with 1% configured relative error. Benchmark report
ExaLogLogEstimate distinct keys with registers that track maxima and history.Experimental

When to use ExaLogLog

Use a dense alternative to HyperLogLog for unique counts and merge compatible sketches for a union estimate.

Tradeoff. This implementation uses a fixed dense representation and a likelihood estimate. Compare measured costs and error for your population.

Rust API

  • cdk_rsx_collections_minima::ExaLogLog

ExaLogLog API and dense register format

Cost per operation

Estimate the distinct count
663,823 instructions≈ $0.00000178
2,048 keys in a P8 sketch Benchmark
Observe 32 duplicate keys
338,739 instructions≈ $0.000000909
Grouped duplicate observations Benchmark
Observe 32 keys, merge and clear
1,305,044 instructions≈ $0.0000035
Temporary P8 sketch Benchmark
Benchmark measurements
One distinct-count estimate
995.9k → 913.6k instructions
Complete update on the populated paper-collection fixture with P8 precision. Benchmark report
MinimaHllEstimate how many different keys a stream contains.Experimental

When to use MinimaHll

Count unique visitors or IDs with a small, fixed register array. Compatible sketches can merge to estimate the size of a union.

Tradeoff. The error is statistical. Higher precision uses more registers, and merging requires matching precision, key and hash contracts, and seeds.

Rust API

  • cdk_rsx_collections_minima::MinimaHll

HyperLogLog configuration and merges

Cost per operation

Estimate the distinct count
179,580 instructions≈ $0.000000482
P12 sketch Benchmark
Observe one new key
165,894 instructions≈ $0.000000445
P12 sketch Benchmark
Observe one duplicate key
165,894 instructions≈ $0.000000445
P12 sketch Benchmark
Benchmark measurements
One distinct-count estimate
829.5k → 507.2k instructions
Complete update with P12 precision and 100,000 populated entries. Benchmark report
OmniSketchEstimate how many records match several equality conditions.Experimental

When to use OmniSketch

Explore combinations such as category and region using bounded samples, with no dedicated counter for every combination.

Tradeoff. Use unique immutable IDs and merge only disjoint sets. Rare matches can have large relative errors when few samples survive.

Rust API

  • cdk_rsx_collections_minima::OmniSketch

OmniSketch conjunction and merge contracts

Cost per operation

Estimate one two-field conjunction
350,751 instructions≈ $0.000000941
2,048 unique records Benchmark
Estimate 32 two-field conjunctions
1,532,504 instructions≈ $0.00000411
2,048 unique records Benchmark
Append 32 records, merge and clear
1,255,386 instructions≈ $0.00000337
Temporary sketch with disjoint records Benchmark
Benchmark measurements
32 two-condition estimates
1.945M → 1.782M instructions
Complete update on the populated paper-collection fixture configured for three attributes, three rows, width eight, and 64 samples per cell. Benchmark report
QSketchEstimate a total that counts each weighted key once.Experimental

When to use QSketch

Estimate the total size of distinct files, for example, when each file ID has one fixed positive size and repeated observations should add no weight.

Tradeoff. Each key needs a single positive, immutable weight across updates and merges. Treat the result as an estimate.

Rust API

  • cdk_rsx_collections_minima::QSketch

Immutable weights and merge contracts

Cost per operation

Estimate weighted cardinality
630,530 instructions≈ $0.00000169
2,048 keys and 1,024 registers Benchmark
Observe 32 duplicate keys
3,014,598 instructions≈ $0.00000809
Grouped duplicate observations Benchmark
Observe 32 keys, merge and clear
3,524,030 instructions≈ $0.00000945
Temporary 128-register sketch Benchmark
Benchmark measurements
One distinct weighted-count estimate
962.6k → 880.3k instructions
Complete update on the populated paper-collection fixture with 1,024 registers and weights from 1 through 7. Benchmark report
SetSketchEstimate the size of cohorts and how much they overlap.Experimental

When to use SetSketch

Compare readership or inventory groups without scanning every member. The sketch estimates distinct counts and Jaccard similarity, and can merge compatible groups.

Tradeoff. Updates do work across the register array. Use exact records for membership decisions and choose compatible configurations and seeds before merging.

Rust API

  • cdk_rsx_collections_minima::SetSketch

SetSketch API · Harbor Forum cohort comparison

Cost per operation

Estimate the distinct count
556,443 instructions≈ $0.00000149
2,048 keys and 1,024 registers Benchmark
Estimate joint cardinality
1,019,975 instructions≈ $0.00000274
Paired sketch calculation Benchmark
Observe 32 keys, merge and clear
3,979,466 instructions≈ $0.0000107
Temporary 128-register sketch Benchmark
Benchmark measurements
One distinct-count estimate
968.6k → 806.2k instructions
Complete update on the populated paper-collection fixture with 1,024 registers. Benchmark report
Rateless IBLTFind which keys differ between two immutable snapshots.Experimental

When to use Rateless IBLT

Send coded summaries incrementally when you are unsure how far apart two sorted ID sets are. The decoder can retain progress across calls.

Tradeoff. Authenticate the snapshot identity and version at both ends. Use the signed differences only after the decoder reports Complete.

Rust API

  • cdk_rsx_collections_minima::RatelessEncoder
  • cdk_rsx_collections_minima::RatelessDecoder

Encoder and decoder API

Cost per operation

Advance reconciliation with budget 1
487,807 instructions≈ $0.00000131
One bounded step between overlapping 96-ID snapshots Benchmark
Advance reconciliation with budget 32
609,483 instructions≈ $0.00000163
One bounded step between overlapping 96-ID snapshots Benchmark
Reconcile two 32-ID snapshots
2,121,223 instructions≈ $0.00000569
Full import and reconciliation with two differing IDs Benchmark
Benchmark measurements
One decoder progress call
1.022M → 859.2k instructions
Complete update along a saved decoder trajectory at work budget 32. The budget counts progress events. Benchmark report
Complete reconciliation
2.532M → 2.369M instructions
Complete temporary-owner lifecycle for two 32-ID snapshots with two signed differences, including preparation, checks, and retirement. Benchmark report