chore: replace IVF split memory resource test with component tests

オープン
#10,973 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
data, testing

調査の方向性

Start in rust/lance/src/index/vector/builder.rs at raw_vector_fetch_shape, take_vectors_stream, and slice_evenly; read their implementations and the existing regroup_by_bytes unit test. Add focused tests for fetch shape, bounded concurrent calls, and slice counts and sizes, then remove the slow resource test from PR CI. Done when the component tests cover the stated cases and the full scale check is assigned to a benchmark or nightly job.

索引モデルが issue の本文から書いたものです。

説明

chore rust

test_ivf_split_reshuffle_memory_stays_bounded is the slowest test in the Rust suite: about 100s in the ci profile (timings from #10971). It guards the fix from #9574 by building an IVF-PQ index over 512 MiB of vectors, running optimize_indices to force a split, and checking peak allocations against a 128 MiB ceiling. Allocation tracking only works at that scale, since at small scale runtime overhead hides the signal.

The bound comes from a few small components in reshuffle_partitions, each with its own number we can assert directly:

https://github.com/lance-format/lance/blob/05a401f04406cf45ae9860d3415316bb79f45149/rust/lance/src/index/vector/builder.rs#L2422-L2435

Proposal: replace the resource test with sub-100ms tests of each component.

  • raw_vector_fetch_shape is pure and untested. Use rstest cases over block size (64 KiB, 4 KiB), dimension, and multivector vs fixed-size. Assert rows_per_fetch * row_bytes <= RAW_VECTOR_FETCH_BYTES and the in-flight count. This alone catches the original bug (block size in bytes used as a row count).
  • take_vectors_stream should take the fetch as a parameter instead of calling Dataset::take_rows itself. A test then passes a fake fetch that counts concurrent calls, and asserts it never exceeds prefetch. That catches a return to buffered(io_parallelism).
  • slice_evenly: assert the slice count and sizes. regroup_by_bytes already has a unit test.

Then move the full-scale test out of PR CI, either to a benchmark or a nightly job.

主要言語
Rust
スター
7.3k
フォーク
929
平均マージ
2日 22時間
マージ済み PR(30日)
572

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

lance-format/lance のほかの issue

lance-format/lance の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。