Repository navigation
perf(ivfflat): fuse filtered include index reads - #28139
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
40d1ec4 to
516d674
Compare
516d674 to
ad04a74
Compare
ad04a74 to
4cdbd4a
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-review of exact head a51969dd979974c394340006d32ad6b8c0e20745 against merge-base e7bb0572235ec4bac81eb098eb0ad8900f0065ab, including the prior review findings, the new bounded-candidate implementation, the versioned RFC, and both exact-head CA 10M artifacts from run 33941908938.
The previous O(N) scratch blocker is fixed correctly. The row/distance companion is now a bounded max heap, preserves the physical-row ordinal, handles strict descending input in O(K), and remains consistent with the shared distance cutoff. I did not find a new functional, ownership, or cleanup failure in that delta.
Two approval blockers remain:
-
[P1 performance/unhappy path] The exact-head run does not execute the RFC acceptance protocol, and p50 masks a severe first-query path. The RFC requires one warm-up followed by three measured rounds per cell. The artifact has no warm-up event and includes rounds 1-3 directly in the summary. On attempt 2, INCLUDE round 1 at 1% takes about 247.95s / 157.20s / 117.47s for K=1/10/100, while rounds 2-3 take only about 67-127ms. PRE has the same cold-cache shape; POST does not. The median therefore passes every <=10x gate, but the first filtered query remains at or above the original minutes-long symptom and the claimed warm acceptance was not actually run. Please either run the specified warm-up plus three measured rounds and record cold-start separately, or revise the design and acceptance criteria to explicitly own and bound this cold-start behavior. A p50 from two warm samples plus one multi-minute cold sample is not sufficient operational evidence for this storage hot path.
-
[design gate] The reviewable artifact is still self-declared
Status: drafted, and both the RFC table and PR body still say the exact-head evidence is pending. The downloaded exact-head artifacts already contain the useful table: attempt 2 INCLUDE p50 is 67.9-266.5ms and all nine performance ratios pass; INCLUDE returns K rows in every cell. The overall red result is caused only by the validator incorrectly requiring approximate PRE/POST modes to return K rows, not by an INCLUDE cardinality failure. Reuse that evidence rather than rerunning blindly, but update the versioned RFC/PR with the exact results, explain the validator-contract failure, close the cold-start decision above, and advance the RFC to the repository accepted in-progress state before implementation approval.
Current MatrixOne PR CI is green. The failed CA job itself is not being treated as a product failure; the blockers are the uncharacterized minutes-long cold path and the still-open mandatory design/acceptance record.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-reviewed response commit 90b5416a73b458cf710525104d84ab17feb47208 against the previously reviewed a51969dd979974c394340006d32ad6b8c0e20745.
The documentation-only delta correctly imports the exact-head p50/cardinality/recall table and explains that the job's terminal red result is the approximate PRE/POST validator contract, not an INCLUDE failure. It does not close the remaining performance/unhappy-path blocker:
- The RFC still requires “three measured rounds after one warm-up,” but run
33941908938did not emit/execute a separate warm-up and summarized rounds 1–3 directly. Its first filtered query remains multi-minute (approximately 247.95s, 157.20s, and 117.47s for INCLUDE at 1% with K=1/10/100), followed by 67–127ms warm samples. The new RFC table reports only p50 and does not disclose or disposition that cold path, while calling the run exact-head acceptance. Thus the median still hides the user-visible first-query symptom and the recorded procedure still does not match the stated acceptance protocol.
Please either (a) reuse the existing artifact but explicitly record the cold samples, explain why this cold behavior is outside this change's contract, and make the acceptance wording honest about the missing warm-up; or (b) run the stated warm-up + three measured rounds and separately bound/record cold-start behavior. Also advance the RFC from self-declared drafted once that decision is independently accepted. No code rerun is needed merely for this documentation-only response.
The O(K) implementation fix and all nine warm p50 ratios remain accepted; I found no new functional or ownership issue in this delta.
REQUEST_CHANGES.
90b5416 to
c492e55
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-review of exact head c492e554eb201fa00deaf4205956a3728278d3a2 against base/merge-base 2f11b2bd48a0f3971bc76cfeeb384ae6bfe84593.
The new commit correctly discloses every observed cold INCLUDE sample and stops presenting the three-round p50 as a completed warm-up protocol. I also verified with range-diff that the preceding eight implementation/test/RFC patches are patch-equivalent to the already reviewed series through 90b5416a73, and the base advance did not modify any affected owner file. The prior O(N) retention bug remains fixed; filter-before-heap ordering, bounded O(K) winner state, optional-reader fallback, error cleanup, and current functional tests remain accepted. Current MatrixOne CI is green, and I found no new code-level correctness, resource, or liveness blocker.
One objective design/evidence gate remains:
- The RFC is still
Status: drafted. Its Verification and acceptance section explicitly says run33941908938did not execute the required one-warm-up-plus-three-measured-round protocol, is diagnostic only, and leaves cold-start performance unaccepted until that protocol is run. The final section repeats that required operational acceptance evidence is unavailable. This conflicts with the PR body's “Design and acceptance” claim and means the PR's own R3 hot-path acceptance contract is not satisfied. Repository RFC process also requires a reviewed RFC to advance toin-progressbefore implementation proceeds.
Please make the record coherent in one of two ways: (1) run the stated protocol, report warm and cold separately, then advance the independently accepted RFC status; or (2) obtain an explicit owner decision that the existing two warm observations per cell plus the disclosed cold-path parity are sufficient for this PR, revise the RFC/PR acceptance wording to that actual merge contract, track the intentionally out-of-scope cold bound separately, and set the RFC to in-progress. No implementation rewrite or duplicate package/CI rerun is requested for this documentation-only response.
REQUEST_CHANGES until the RFC status and its declared performance gate agree with evidence that actually exists.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-review of exact head 7ae4090 against base/merge-base ffabe50: APPROVE.
Design decision: I independently accept docs/rfcs/20260904_ivfflat_filtered_include_topk.md at this exact revision for its stated filter-before-heap, bounded winner retention and optional fused-reader contract. The RFC is now in-progress and the previously missing warm-up acceptance protocol is evidenced below. This review supplies the independent decision that the author correctly did not self-certify. Wider per-request cache pinning is an explicit tradeoff under existing ObjectIO capacity policy; this is not approval of a new aggregate admission controller, a cold-start latency SLA, or exact ANN recall.
I read every changed hunk across all 15 files and traced the request eligibility/prefix and residual filters, optional-reader dispatch and fallback, persisted/in-memory handling, physical-row mapping, bounded companion/global heaps, deferred projection, cache release, batch/result cleanup and merge-reader terminal paths. The previous O(N) accepted-candidate retention remains fixed by the O(K) companion heap, including descending input and preserved input-row ordinals. Unsafe ranges, DESC and membership-specific policy remain outside filtered storage Top-K eligibility. No new verified blocker was found in the reachable IVFFLAT path. No wire/catalog/storage format, plugin registration, authentication, background worker or new concurrent ownership model is introduced.
The old performance blocker is closed with independently downloaded artifact 10037522712 from mo-auto-test run 34172928231/job 101896622990. Its manifest identifies MatrixOne c492e55 and lane c7a9608a43711b0db3407dd36fb44836aa67a81b. Raw JSONL contains 108 query events: every one of 27 mode/selectivity/K cells has one warmup event and three measured events. Summary completion and database cleanup are complete, with no gate failures. INCLUDE returns K in every measured sample and all nine ratios are 0.23-0.92, below the declared 10x limit. The RFC and PR tables match the artifact. Selective cold INCLUDE remains approximately 256.9/186.7/128.0 seconds at 1% for K=1/10/100; it is disclosed separately and excluded from the explicitly warm acceptance, not hidden in p50 or claimed solved.
Evidence reuse is justified, not a new exact-head scale run: range-diff proves all nine preceding implementation/test/RFC patches equivalent to the c492e55 series, with only the tenth documentation update new. I inspected the base-side owning-path delta: the exact-key search optimization does not change the prefix/filtered Top-K path measured here. Prior accepted focused/full five-package and INCLUDE functional evidence is reused on that basis; current exact-head MatrixOne ALL CI run 34183828404 is successful, and git diff --check passes. I did not rerun native tests, race suites or CA 10M locally.
| Resource closure | Result |
|---|---|
| Q1 | Fused IOVector release stays scoped; copied predicate/deferred destinations stay caller-owned; scan errors clean current and accumulated batches; merge-reader errors/exhaustion retire children. |
| Q2 | No new goroutine, queue, lock or independent wait protocol; existing contextual ObjectIO calls and synchronous block-local work remain the termination boundaries. |
| Q3 | Winner state O(K), row mapping bounded by block rows, one fused block request pins P+1+D columns; concurrent wider pins and disclosed cold behavior remain operational capacity considerations. |
Non-blocking follow-up: preserve the cold-start observations in subsequent capacity work and do not present these warm ratios as an end-to-end cold-query improvement or an exact-recall guarantee.
Merge Queue Status
This pull request spent 1 hour 4 minutes 9 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #27891
What this PR does / why we need it:
Fuses supported persisted IVFFLAT INCLUDE filtered Top-K reads while retaining the generic-reader fallback.
Design and acceptance
in-progressunderdocs/rfcs/README.md; independent design approval remains an external review state and is not self-certified here.CA 10M acceptance
The protocol was executed successfully on the original implementation head
c492e554eb201fa00deaf4205956a3728278d3a2in run/job https://github.com/matrixorigin/mo-auto-test/actions/runs/34172928231/job/101896622990, using lane revisionc7a9608a43711b0db3407dd36fb44836aa67a81b. The artifact is https://github.com/matrixorigin/mo-auto-test/actions/artifacts/10037522712.It contains one recorded cold/warm-up query plus three measured rounds for each of the 27 mode/selectivity/K cells (108 query events total), with cold-start data separate and no validator gate failures. The table reports measured-round p50 as
latency ms / rows / recall; the ratio is INCLUDE against the faster PRE/POST result for that cell.All nine INCLUDE ratios are within the
<=10xgate and every measured INCLUDE cell returned K rows. Approximate PRE/POST short rows are retained as observed behavior underprobe_limit=10, not treated as an INCLUDE failure.The same artifact records cold results separately for all 27 cells. The selective INCLUDE 1% cold samples are 256.9 s / 186.7 s / 128.0 s for K=1/10/100. This change does not claim a cold-start latency SLA; the cold path is disclosed for operations and future capacity work rather than hidden by the measured p50.
The final pushed head is
7ae4090054c8747dd05a069f546495b5a595f785. The nine implementation/RFC commits are patch-equivalent to the previously reviewed series bygit range-diff; the tenth commit is this documentation update, and the final rebase introduced no change to the PR production hunks. The exact-head artifact is therefore reused with its source and rebase evidence stated explicitly.Validation
.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=180s -run <14 focused tests> ./pkg/objectio/ioutil ./pkg/objectio ./pkg/vectorindex/ivfflat ./pkg/vm/engine/readutil ./pkg/vm/engine/tae/blockio7ae4090; no failure is currently reported.