Repository navigation
update on disk version to v7 - #799
Merged
Merged
Conversation
…ests. Added fix for Feature hard coding on disk version that has already been applied in ash-dev as well
MarkWolters
requested review from
ashkrisk,
dian-lun-lin,
jshook,
r-devulap,
tlwillke and
vasimuddinmd
as code owners
November 12, 2026 17:34
Contributor
|
Before you submit for review:
If you did not complete any of these, then please explain below. |
r-devulap
approved these changes
Nov 13, 2026
r-devulap
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for fixing this @MarkWolters :)
Contributor
r-devulap
pushed a commit
that referenced
this pull request
Nov 13, 2026
…ests. Added fix for Feature hard coding on disk version that has already been applied in ash-dev as well (#799)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Write inline int8 vectors at on-disk format version 7, not version 6
Targets
int8-support(#709).Problem
#709 adds
FeatureId.INLINE_BYTE_VECTORStoallFeatures(), which is the feature set of format version 6. Version 6 shipped in 4.0.1 and 4.0.2, and the Javadoc onallFeatures()says its set must not change. Graphs that use the feature have a layout 4.0.x can't read:dimensioninline bytes, so it's longer and every field after the inline block moves.I wrote a byte-vector graph with
withVersion(6)on #709 and loaded it withjvector-basebuilt from the4.0.2tag. It fails while reading the header:Hosts choose the format version they write so they can roll back. For example, DataStax Cassandra passes its SAI-selected version (6 today) to every JVector write. If V6 allows this feature, a host could start writing byte-vector graphs as V6 without ever opting into a new format, and rolling back to 4.0.x would then fail on those indexes. A new version makes that an explicit choice and lets 4.0.x reject the files cleanly as an unknown version.
Change
This follows the version 7 structure on
ash-dev(#796), which addsFUSED_ASHthe same way. Where the two branches make the same change, the text is identical, so those lines merge cleanly.This follows the version 7 structure on
ash-dev(#796), which addsFUSED_ASHthe same way. Where the two branches make the same change, the text is identical, so those lines merge cleanly.AbstractGraphIndexFormat.allFeatures(): back to the five features V6 shipped with.GraphIndexFormatV6: a protected(int version, Set<FeatureId>)constructor, so a later version can reuse the V6 layout. Identical toash-dev.GraphIndexFormatV7: extends V6 and addsINLINE_BYTE_VECTORS. Same structure asash-dev's.GraphIndexFormatFactory: registers version 7. Identical toash-dev.OnDiskGraphIndex.CURRENT_VERSION: 6 → 7. Identical toash-dev. Writers that don't set a version now write V7.onDiskIndexVersion6 → 7, becauseMultiConfigrequires it to equalCURRENT_VERSION. Identical toash-devexcept in the files noted under merge notes.ash-devalready has this fix. Without it, raisingCURRENT_VERSIONwould make awithVersion(6)graph embed version 7 in its PQ and NVQ headers, so the file would no longer match what 4.0.x writes. The commit is applied as is, except for itsFusedASHhunk (that class doesn't exist here).InlineByteVectorsgets the same versionedwriteHeader(out, version)asInlineVectors. Its header is empty, so its bytes are unchanged.UPGRADING.mdgets an "On-disk format version 7" section, worded likeash-dev's.709.feature.mdnow says int8 indexes need version 7.On-disk effect
INLINE_BYTE_VECTORS. 4.0.x rejects it as an unsupported version.withVersion(6). A V6 writer now rejectsINLINE_BYTE_VECTORS:Feature INLINE_BYTE_VECTORS is not supported by version 6.withVersion(6), asUPGRADING.mddescribes.Testing
TestGraphIndexFormatFactory: V6 excludesINLINE_BYTE_VECTORS; V7 supports every feature.TestOnDiskGraphIndex.testInlineByteVectorsRequiresVersion7: a V6 writer rejects the feature. The existingtestInlineByteVectorsRoundTripnow writes V7 by default.TestFeatureHeaderVersion(from removing hard coded version #797, without itsFUSED_ASHcase): for every version from 2 toCURRENT_VERSION, PQ, NVQ and separated NVQ headers are written at that version.TestDatasetPrefetching: its YAML usesCURRENT_VERSIONinstead of a hard-coded 6.jvector-tests(421) andjvector-examples(127) suites: 0 failures.Merge notes with
ash-devWhichever of this PR and #796 reaches
mainsecond will need to resolve these:FeatureIdordinals: both branches append their feature as ordinal 5. Ordinals are the on-disk feature IDs in V6+ headers, so the second branch must move its feature to ordinal 6. Neither is released, but V7 files written for testing before the merge won't load afterwards.GraphIndexFormatV7: both branches add this file. Keep one class whosesupportedFeatures()adds both features.TestGraphIndexFormatFactory,UPGRADING.md,709.feature.md: list both features for V7 and exclude both from V6.TestFeatureHeaderVersion: both branches add it. Takeash-dev's version, which includes theFUSED_ASHcase.run-config.yml:ash-dev's version line carries an ASH-specific comment.dpr-gemma-10M.yml,dpr-gemma-1M.yml:ash-devdeletes these in favour of lowercase-10m/-1mcopies. Take the delete.TestDatasetPrefetching:ash-devalso bumpsyamlSchemaVersionto 2. Take its version.