Before cutting over to a new embedding model, how do you prove every current source chunk has a vector from that model, and what gaps can a green job status hide?
answer
- exit code is not proof
- expected set versus actual set
- per tenant, not one total
- recompute a random sample
basics
~20 sReconcile, per tenant, the current chunk IDs against the vectors the store holds at the new version, then check shape, content hashes and a recomputed sample. A green job can hide skipped errors, misaligned batch results and missing filter metadata.
solid answer
~50 sA green exit only says the loop stopped. The proof reconciles two sets per tenant: every current chunk ID from the pipeline's own records, and every chunk ID with a vector or recorded rejection at the new version in the store. Missing, extra, rejected and mixed-version counts each have a cause, and missing and mixed must be zero. Then I check the vectors themselves: dimension and no zero vectors, the stored content hash against the current one, a recomputed random sample compared by similarity, and a few self-retrieval probes through the tenant's real query path. Those catch what a count cannot: results matched to inputs by position after an item was dropped, a work list frozen at job start, errors logged and skipped, vectors missing the tenant metadata the filter needs, and writes not yet searchable. I count from the searchable side and re-run the proof right before each flip.
code
pseudocode · 12 lines# Per-tenant completeness proof (illustrative names)
for tenant in tenants:
expected = set(chunk_id for chunk in current_chunks(tenant))
actual = set(r.chunk_id for r in store.records(tenant, model = PINNED)) # vectors and rejections
missing = expected - actual
extra = actual - expected
mixed = count(store.vectors(tenant) where model not in {PINNED, OLD})
stale = count(r in store.vectors(tenant, PINNED) where r.content_hash != current_hash(r.chunk_id))
embedded = set(r.chunk_id for r in store.vectors(tenant, PINNED)) & expected # excludes rejections
sample = random_sample(embedded, 2000)
recompute_ok = fraction(s in sample where cosine(embed(s.text, PINNED), stored(s)) > 0.99)
report(tenant, missing, extra, mixed, stale, recompute_ok)go deeper
Recall that a job finishing without errors does not prove every chunk was embedded; the proof compares what should exist with what the store holds.
Explain the two sets, where each comes from, and what missing, extra, rejected and mixed-version differences each tell you about the run.
Name the silent gaps a green job hides and the check that catches each: sample recompute, self-retrieval probes, hash comparison and filtered counts on the searchable side.
Make the per-tenant report the cutover gate: which counts must be zero, which may be decided exceptions, who signs them off, and how stale a proof may be at flip time.
## What "done" has to mean A re-embedding backfill is done when **every chunk that should be retrievable now has exactly one correct vector from the new model, and the index can return it to the right queries**. A job's exit status proves something much weaker: that the job's own loop stopped without raising an error. The gap between those two statements is where cutovers fail, so the proof is a separate step, run against the vector store, before any tenant switches. ## Reconcile two sets The core of the proof is a reconciliation between: - **the expected set**: every current chunk ID, taken from the ingestion pipeline's own record of what chunks exist now, not from the job's work list; and - **the actual set**: every chunk ID that has a vector, or a recorded rejection, at the new model version, read from the store. The differences each mean something: | Difference | Meaning | Typical cause | |---|---|---| | expected minus actual | **missing**: chunks with no new-model vector | swallowed errors, a work list taken at job start, mark-before-write bugs | | actual minus expected | **extra**: new-model vectors for chunks that no longer exist | documents deleted during the run, orphans | | present but rejected or truncated | **decided gaps** | inputs the new model refused or cut | | present but tagged with another revision | **mixed versions** | a worker on a stale configuration | Run it **per tenant**, not only as one corpus total. Forty million against forty million can hide one tenant missing half its chunks while another has duplicates. ## Check the vectors, not only their presence Counts prove that something exists. A few cheap checks show it is the right thing: 1. **Shape.** Every vector has the expected dimension, with no zero vectors and no non-numeric values; if the model's vectors are normalised, norms sit near one. 2. **Freshness.** The content hash stored with each vector matches the chunk's current hash; a mismatch means the text changed after it was embedded (catching those up is the change-log problem covered with shadow reindexing). 3. **Recompute a sample.** Re-embed a random sample of a few thousand chunks with the pinned model and compare with the stored vectors. Allow for small floating-point differences, since some services are not bit-for-bit deterministic; a low similarity means the vector belongs to another chunk or another model. 4. **Self-retrieval probes.** Embed a sample chunk's own text as a query, search the tenant's new-version vectors, and expect the chunk itself at or near the top. This exercises the query-side encoder, the tenant filter and the index together. It is a wiring check, not a retrieval-quality evaluation, which is designed elsewhere. ## The silent gaps a green job hides - **Partial batch responses.** A service that drops or reorders one item, combined with a client that matches results by position, attaches vectors to the wrong chunks. The count is perfect; the content is wrong. Only a recompute or a self-retrieval probe catches it. - **A frozen work list.** A job that listed its chunks at start never embeds chunks created since. - **Errors logged and skipped.** A loop that catches an exception, logs it and moves on exits zero. - **Missing metadata.** Vectors written without the tenant or permission fields that query filters rely on exist but can never be returned to that tenant. - **Written, not yet searchable.** Many stores apply writes to the index asynchronously, so a count from write acknowledgements can run ahead of what a search can find. How long that takes is covered with write and delete visibility; the proof simply counts from the searchable side. ## What the proof produces A short report per tenant, kept with the run: - expected, present, missing, extra, rejected, truncated and mixed-version counts; - sample recompute and self-retrieval pass rates; - the time it was taken and the model revision it was taken against. The cutover gate reads that report. A tenant flips when missing and mixed-version counts are zero, every rejection is decided, and the samples pass. Re-run the proof just before the flip if writes kept arriving, because a proof taken yesterday describes yesterday's corpus.
- Why recompute a sample of stored vectors with the new model when the counts already match?Counts prove presence, not correctness. Re-embedding a few thousand random chunks with the pinned model and comparing them with the stored vectors catches vectors attached to the wrong chunk, a worker on a stale model, or text that changed after embedding. Allow small floating-point differences; a low similarity is the signal.
- Why must a completeness proof count from what the index can return rather than from the job's write acknowledgements?Many vector stores apply writes to the searchable index asynchronously, and a write can land without the tenant or permission fields its filter needs. Counting what a filtered search can actually return at the new version catches both; how long a store takes to make a write searchable is covered with write and delete visibility.
- The job exited zero, so every chunk has a new vector.
- Matching total counts prove each chunk carries its own correct vector.
- Count the job's write acknowledgements rather than what the index returns.
- One corpus-wide total is enough; per-tenant counts add nothing.
- A few percent missing is fine because retrieval is approximate anyway.