pub struct GlobalRankCache {
pub epoch: String,
pub policy: String,
pub salt: String,
pub global_vector: Vec<f64>,
pub node_symbol_map: BTreeMap<String, f64>,
pub candidates_epoch: String,
pub candidate_ids: Vec<String>,
pub hits: u64,
}Expand description
Global-rank cache (Wave 15.2, per-ModelEpoch rank caching): the
expensive, epoch-stable parts of a global Surface build —
SystemRanker::new (heterogeneous node graph + adjacency + rarity),
the 50-iteration global PageRank vector, and the projection to symbol
scores — serialized to the store cache so consecutive startups in the
same model epoch skip the rank build entirely.
Scope evidence (Part F profiling, cli-service fixture, budget 7000):
cold rebuild 44-242µs vs 25µs cache hit — the rebuild is sub-millisecond
at fixture scale, so the seam stays STARTUP-ONLY; plain scc surface /
MCP surface_map keep the uncached build_surface (identical output,
measured cost negligible). Re-measure before extending the seam to
larger corpora. Key:
rank:global:<blake3(epoch, policy, salt)[..20]> (mirrors the
system_atlas pack-cache pattern in ContextCompiler::system_atlas).
Fields§
§epoch: StringThe composite cache epoch the entry was computed under.
policy: StringThe TrustPolicy fingerprint (trust_policy_str) the rank used.
salt: StringThe active rank salt (ContextSettings::rank_salt).
global_vector: Vec<f64>The heterogeneous global PageRank vector (index i == nodes()[i]).
Retained so a future task-PPR path can warm-start from it.
node_symbol_map: BTreeMap<String, f64>Symbol id -> projected global score (project_to_symbols output) —
exactly what the surface pipeline consumes as global_of.
candidates_epoch: StringThe epoch the candidate entry list came from (epoch-stability marker; the cache key already pins the epoch).
candidate_ids: Vec<String>Epoch-stable candidate entry ids (cheap accounting — avoids a
compile_surface_map walk for the surface accounting line).
hits: u64How many times this entry has been reused (deterministic cache-hit marker for tests).