Skip to content

fix: write the inferred index list back where load_indices reads it - #68

Merged
amunra merged 1 commit into
release-8.0.0from
adam/fri-infer-writeback-r8
Sep 2, 2026
Merged

amunra merged 1 commit into
release-8.0.0from
adam/fri-infer-writeback-r8

Conversation

@amunra

@amunra amunra commented Sep 2, 2026

Copy link
Copy Markdown

load_indices reads the manifest's index list from the unpartitioned manifest_index_cache — that list is not translated through the fragment reuse index, and load_manifest prefetches it there before any remap form is known. The infer_missing_vector_details write-back was left on the remap-partitioned index_cache, so producer and consumer disagree.

Inference is never observed: the entry lands where no reader looks, so it re-runs on every load_indices — scan planning, validate(), every commit — and each call leaves another unreachable entry admitted against the byte-bounded cache. Silent, because the returned value is correct either way. Only datasets carrying legacy vector indices are affected; infer_missing_vector_details returns early otherwise.

Testing

Asserted by reading the cache back, not by calling load_indices twice: inference runs on every call and is deterministic, so a second call returns inferred details whichever handle was written. Non-vacuous — restoring the partitioned handle fails with the cached list still has empty details, so the inferred list was written to a handle that no reader reads.

No Rust CI runs on this branch: rust.yml triggers on release/**, which release-8.0.0 does not match. Verified locally — cargo fmt --all -- --check and cargo clippy --all --tests --benches -- -D warnings clean, cargo test -p lance 2059 passed.

Backport

Of 455d1278b from #59 (release-10.0.0). Adapted: this base's IndexMetadataKey has no store_identity field, so the test's key literal carries only version.

🤖 Generated with Claude Code

`load_indices` reads the manifest's index list from the unpartitioned
`manifest_index_cache`, because that list is not translated through the fragment
reuse index and `load_manifest` prefetches it there before any remap form is known.
The `infer_missing_vector_details` write-back was left on the remap-partitioned
handle, so producer and consumer disagree one level down.

Inference is therefore never observed: the entry it writes sits where no reader
looks, so it re-runs on every `load_indices` -- scan planning, `validate()` and
every commit -- and each call leaves another unreachable entry admitted against the
byte-bounded cache. Silent, since the returned value is correct either way;
inference runs in memory before the write. Datasets with no legacy vector indices
are unaffected, as `infer_missing_vector_details` returns early for them.

Tested by reading the cache back, not by calling `load_indices` twice: inference
runs on every call, outside the cache closure, and is deterministic, so a second
call returns inferred details whichever handle was written. The test seeds the cache
with a `VectorIndexDetails` whose value is empty and asserts the entry is non-empty
afterwards. Checked non-vacuous by restoring the partitioned handle:

    the cached list still has empty details, so the inferred list was written to a
    handle that no reader reads

Seeded directly rather than by doctoring a manifest, because a committed manifest
has its details inferred and persisted, after which inference is a no-op and this
branch is never entered.

Verified locally only: `.github/workflows/rust.yml` on this branch triggers on
`release/**`, which `release-8.0.0` does not match, so no Rust CI runs here.
`cargo fmt --all -- --check`, `cargo clippy --all --tests --benches -- -D warnings`
and `cargo test -p lance` (2059 passed) are green.

Backport of #59's `455d1278b` (release-10.0.0), adapted: this base's
`IndexMetadataKey` has no `store_identity` field, so the test's key literal carries
only `version`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@amunra
amunra merged commit a9a87cf into release-8.0.0 Sep 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants