Repository navigation
impl(011): increment 4, the embedding cache - #445
Conversation
AI review (no-findings)Reviewing the four changed files: a new
Eviction loop underflow guard. Before the while loop, the code checks Empty-entries panic risk. If LRU hit path. Principal isolation. Token key ambiguity. Length-framing with Generation-based invalidation. Non-finite rejection. The Duplicate admission.
Zero hidden-size guard.
The increment text correctly describes: off-by-default, key composition (ArtifactId + principal SHA-256 + token/mask SHA-256), repeatability gating ( No concrete defects found. {"head": "96bbe3222a81ab500861cd497ddede35d7bd795f", "verdict": "no-findings", "findings": []}Subject: a49e40f...96bbe32, diff digest 4b7ae8b5c3bed56a4549a89b1d1910ae5f8c5001637e8ebcd6738abee4e71b9f, 1 call(s). An AI comment is not an approval. |
An opt-in in-process cache of pooled embeddings keyed by artifact, principal and token digest, refused unless repeatability is shown (3.14).
96bbe32 to
21110c2
Compare
AI review (no-findings)I reviewed the new
Test review: The LRU scenario in Spec update: The text in No concrete defects found. {"head": "21110c29468483c265051c58290d6fe6b45cfab7", "verdict": "no-findings", "findings": []}Subject: 41b490d...21110c2, diff digest 3c3fdd58225e377a04a8c0fe94edd61f73e0d14b0f9b5c1c9d6a5c9cbaa87836, 1 call(s). An AI comment is not an approval. |
Summary
Spec 011, increment 4: the embedding cache (3.14), landing before increment 3.
backends/rustev-backend-embed-linear/src/cache.rsis the backend-internal memo the increment 3 backend will call; nothing constructs it yet.embedding_cache: {max_entries, max_bytes}is given; process memory only.ArtifactId, a domain-separated SHA-256 of the principal handle and the SHA-256 of the token ids and attention mask after truncation, so entries never cross principal handles (spec 017).cache_not_equivalentunless the platform's repeatability evidence shows bitwise run-to-run repeatability in one process: the synthetic encoder has it (3.19.1); anonnxencoder needs a passing feasibility record, which no platform has yet.clear()anderase_principal(handle)advance a generation, so a run started under an earlier one is not stored; erasure removes every entry of the handle before returning.cache_stats()reportshits,misses,admitted,evicted,bytes,invalidations.Spec: a dated increment 4 paragraph appended to 011's implementation record (approved spec text; ratifies on merge).
Verification
cargo test -p rustev-backend-embed-linear --locked(17 passed,cache_testsintests/bundle.rs), clippy-D warnings,cargo fmt --all --check,make gate,scripts/check-authored-content.sh.