Add UDI index mode API vocabulary - #14959
Conversation
✅ clang-tidy: No findings on changed linesCompleted in 390.8s. |
afcba09 to
508dc46
Compare
508dc46 to
9edaf57
Compare
ed5e9fd to
3569f24
Compare
Claude Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit ed5e9fd SummaryClean, well-scoped preparatory PR that adds inert API vocabulary for the UDI index mode refactor. No runtime behavior changes — verified by codebase-wide grep. Two medium-severity and several low-severity findings. High-severity findings (0): Full review (click to expand)Findings🟡 MEDIUMM1.
|
| Context | Does code execute? | Assumptions hold? | Action needed? |
|---|---|---|---|
| All runtime contexts | NO | N/A | None — fields are inert |
| Options serialization (BBTO) | YES — index_mode is serializable |
YES — string map is complete | None |
| Options serialization (ReadOptions) | NO — read_index not registered |
N/A | Intentional — ReadOptions doesn't use OptionTypeInfo |
| C API auto-generation | Blocked | YES — both fields blocklisted | None |
| Options settable test | YES — index_mode added |
YES — test string includes it | None |
Inertness verification:
- Grep for
.index_modeand.read_index(as ReadOptions field) across the codebase returned zero matches outside the diff. - No
memcmpor byte-level comparison ofReadOptionsorBlockBasedTableOptionsexists. - The new fields are compile-time additions with no runtime readers.
String map completeness:
block_base_table_index_mode_string_mapcontains all 5IndexModevalues:kStandardOnly,kStandardDefault,kCustomDefault,kCustomOnly,kStandardRequired. Complete.
Naming consistency:
- Map name
block_base_table_index_mode_string_mapfollows the existingblock_base_table_prefix pattern. Consistent.
Positive Observations
- Clean separation of API vocabulary from runtime wiring — good incremental approach.
- Proper C API blocklist entries prevent accidental auto-generation of experimental bindings.
- The
static_assertchecks for type alias correctness are a nice compile-time safety net. - Options settable test updated correctly for the new BBTO field.
- Comments clearly document the experimental/preparatory nature of the new fields.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/code_review.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit 3569f24 SummaryClean, well-scoped API vocabulary PR. The inert enum additions and type aliases introduce no runtime behavioral changes. No high-severity issues found. High-severity findings (0): No high-severity findings. Full review (click to expand)Findings🔴 HIGHNone. 🟡 MEDIUMM1.
|
| Context | Does code execute? | Assumptions hold? | Action needed? |
|---|---|---|---|
| Options serialization (BBTO) | YES - IndexMode is registered | YES - round-trip works | None |
| Options serialization (ReadOptions) | NO - ReadIndex not registered | N/A | None (intentional) |
| JNI/Java bindings | NO - no Java mapping for IndexMode | YES | None until wiring lands |
| C API auto-generation | Blocked by blocklist entries | YES | None |
| options_settable_test | YES - IndexMode covered | YES | None |
| Zero-initialized structs | Possible concern | IndexMode default is kStandardDefault (1), not kStandardOnly (0). If struct is zero-initialized, index_mode would be kStandardOnly. Since the field is inert, no runtime effect yet. | Document when wiring lands |
Positive Observations
- Good scope discipline: The PR strictly adds vocabulary without wiring, making it easy to review independently.
- Proper C API blocklist entries: Both new enum fields are correctly blocked from auto-generation with clear reasons.
- options_settable_test updated: The byte-counting test is updated to cover the new
index_modefield, preventing silent regressions. ReadIndexusesuint8_tunderlying type: Good for minimizing ReadOptions struct size (ReadOptions is copied frequently in hot paths).- Scoped enums (
enum class): Consistent with CLAUDE.md guidance preferring scoped enums. - Clear EXPERIMENTAL documentation: Both enums are documented as experimental with notes about future wiring.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/code_review.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
3569f24 to
7f66517
Compare
Part 2 of 13 in the UDI split.
Stack order:
Previous: #14954.
Next: #14960.
Depends on #14954. Until #14954 lands, GitHub shows the cumulative diff against main. After that lands, the intended review diff is:
zaidoon/udi-01-index-factory-compat-shim..zaidoon/udi-02-index-mode-apiThat final review delta is 4 files with 52 insertions.
What changed:
Validation:
git diff --checkmake check-sourcespython3 tools/c_api_gen/verify_generated_up_to_date.pyAUTO_CLEAN=1 make check-c-api-gen./c_test