fix(format): move FLAG_UNKNOWN off the tagged FRI bit - #9420
Merged
Merged
Conversation
Contributor
Author
|
cc @jackye1995 @Xuanwo @BubbleCal -- you reviewed #9136 / #9119 which introduced these two flags, so flagging this for your eyes. This is a correctness fix for a latent bit collision, not a format/spec change: the on-disk flag values are unchanged ( |
LuQQiu
marked this pull request as ready for review
September 18, 2026 19:18
LuQQiu
force-pushed
the
lu/fix-unknown-flag-bit
branch
2 times, most recently
from
September 18, 2026 19:23
e32a303 to
992c685
Compare
FLAG_FRAG_REUSE_WITH_STABLE_ROW_IDS (#9119) took bit 9, which pushed FLAG_UNKNOWN up to bit 10 -- the same bit FLAG_FRAGMENT_REUSE_INDEX (#9136) already occupies. On main the collision is latent because the tagged FRI bit stays below the FLAG_UNKNOWN boundary and is never marked supported. Move FLAG_UNKNOWN to bit 11 so it sits above every named flag again, reorder FLAG_FRAGMENT_REUSE_INDEX to its bit-order position (after bit 9, before the unknown boundary), add a const assert pinning it below the boundary so an insertion cannot recreate the collision silently, and explicitly keep the tagged FRI bit unsupported (as the boundary used to do implicitly) until its reader/writer handling lands. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgAshYD7wVzPVdjXRuWPPs
LuQQiu
force-pushed
the
lu/fix-unknown-flag-bit
branch
from
September 18, 2026 19:24
992c685 to
3ccf21f
Compare
wjones127
approved these changes
Sep 18, 2026
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.
Problem
Two feature-flag constants collide on bit 10:
FLAG_FRAGMENT_REUSE_INDEX(#9136) was defined at bit 10 whileFLAG_UNKNOWNwas at bit 9. Later #9119 insertedFLAG_FRAG_REUSE_WITH_STABLE_ROW_IDSat bit 9 and bumpedFLAG_UNKNOWNup one -- but only to bit 10, which #9136 had already claimed. So on current main both live on the same bit.The collision is latent on main:
supported_flags_whenusesFLAG_UNKNOWN - 1as the base mask, so bit 10 is currently below the boundary being masked out, and the tagged FRI bit is never marked supported. But the moment any build activates the tagged FRI flag (adds it to the supported set), theFLAG_UNKNOWN-based "reject unknown flags" tests break, becauseFLAG_UNKNOWNis the FRI bit -- the rejection path would silently accept it.Fix
FLAG_UNKNOWNto1 << 11so it sits above every named flag again.const _: () = assert!(FLAG_FRAGMENT_REUSE_INDEX < FLAG_UNKNOWN)to pin the invariant so a future insertion can't recreate the collision silently.mark_supported(FLAG_FRAGMENT_REUSE_INDEX, false)-- with the boundary moved, bit 10 would otherwise fall insideFLAG_UNKNOWN - 1and become supported; keep tagged FRI unsupported (exactly as the boundary did implicitly) until its reader/writer handling lands.No behavior change: tagged FRI stays unsupported, unknown-flag rejection still fires on the correct bit.
Test
cargo build -p lance-table(const asserts pass)cargo test -p lance-table --lib feature_flags-- 14 passed, incl.test_frag_reuse_with_stable_row_ids_flag_is_reserved_not_supported🤖 Generated with Claude Code