Skip to main content

Module graph_index

Module graph_index 

Source
Expand description

Revision-cached graph index — the per-cell index lifecycle (#22 step 3).

Building a QuinIndex over the daemon-graph snapshot on every resolve would be O(n) per call. Instead we memoize it by daemon_graph::graph_revision(): the index is rebuilt LAZILY only when the graph has actually changed, so resolution is O(1) amortized. The cache is host-side (separate from the 42 MB SlgArena).

“Per-cell” in the Fractal-Shard model means one cache per 512 MB cell; for the single daemon graph today this is that one cache. Streaming a huge graph via BIDX/demand- paging — so the index need not copy the whole snapshot — remains future work.

Structs§

RevisionCache
Memoizes a value T by a monotonically-advancing revision, rebuilding via build only when the supplied revision differs from the cached one.

Functions§

with_graph_index
Run f against a QuinIndex over the current daemon graph, rebuilt only when the graph revision has changed since the last build. This is what graph_resolve (and other index consumers) route through, so a burst of resolves between graph changes shares a single O(n) build.