bug: build_ivf_model panics when num_partitions is unset
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- machine-learning
Research direction
Start in rust/lance/src/index/vector/ivf.rs at the public build_ivf_model entry point, then compare its parameter handling with build_ivf_model_and_pq and do_train_ivf_model. Verify that calling build_ivf_model with IvfBuildParams::default() no longer panics and uses the same fallback behavior as the sibling trainers.
Written by the indexing model from the issue text.
Description
Description
build_ivf_model in rust/lance/src/index/vector/ivf.rs starts with
let num_partitions = params.num_partitions.unwrap();
IvfBuildParams::num_partitions is an Option (it is deprecated in favour of target_partition_size, and IvfBuildParams::default() leaves both unset), and build_ivf_model is public, so a caller that sets neither gets a panic out of a library call. The two sibling trainers in the same file already handle it: build_ivf_model_and_pq uses ivf_params.num_partitions.unwrap_or(32) with the comment "we use 32 as the default to avoid panicking, 32 is the default value before we make num_partitions optional", and do_train_ivf_model does the same.
The in-tree index build paths fill num_partitions in before calling this, so this is about the public function's own contract.
Expected behavior
Fall back to the same default the sibling trainers use rather than unwrapping None.
Lance version
13.0.0-beta.4 (main)
Language binding
Rust
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 852
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 252
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lance-format/lance
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
lance-format/lance#9425 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
lance-format/lance#9422 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
lance-format/lance#9418 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
lance-format/lance#9415 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
lance-format/lance#9406 ·
All issues in lance-format/lance
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100