Skip to content

IndexSearchScan for all index searches; remove the search TVFs (#27453) - #29746

Merged
XuPeng-SH merged 37 commits into
matrixorigin:mainfrom
cpegeric:bug_27453
Oct 12, 2026
Merged

XuPeng-SH merged 37 commits into
matrixorigin:mainfrom
cpegeric:bug_27453

Conversation

@cpegeric

@cpegeric cpegeric commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #27453

What this PR does / why we need it:

Every index search (ivfflat, hnsw, cagra, ivfpq, fulltext2, classic fulltext) now plans and executes through one plan node, IndexSearchScan, instead of per-algorithm table functions.

  • Plan node. IndexSearchScan carries per-algorithm algo_options (JSON ScanOptions under <algo>/plugin/plan), named algo_exprs, a query payload (vector or string), a candidate limit, and the source/hidden-table ObjectRefs. A dedicated MORPC protocol version gates the wire change, one bump for all six index algorithms; remote dispatch to an older CN fails instead of misreading the plan.
  • Readers. Each algorithm's search lives in a plugin reader (<algo>/plugin/search) behind searchplugin hooks (NewReader, parallel, explain, candidate budget, EmptyScan). The readers are ported from the TVF executors, preserving the TVFs' search behavior (SearchInto, streaming, probe tail, guards).
  • EXPLAIN. Plans show Vector Index Scan on <idx> or Fulltext Index Scan on <idx>; BVT plan directives and results are updated.
  • Publication fulltext. Publisher identity for subscriber MATCH travels on IndexSearchScan.SourceTable / HiddenTables, so TableFunction.fulltext_source_ref / fulltext_index_ref (fix: support fulltext scans over publications #26702) are removed and their proto field numbers reserved.
  • Removed TVFs. hnsw_search, cagra_search, ivfpq_search, fulltext2_search and fulltext_index_scan are removed with their builders, executors and tests; they are no longer callable from SQL. *_create, fulltext2_compact and fulltext_index_tokenize are unchanged.
  • cuVS fix. Brute force / IVF-Flat / IVF-PQ filled result slots past the allowed count with filtered or deleted rows; a host post-filter now pads them with sentinels (C++ tests for all index types).

Hybrid queries that combine a fulltext MATCH with a vector ORDER BY on the same table plan as a fulltext scan joined with a vector scan, with the fulltext side runtime-filtering the vector side (verified for classic fulltext and fulltext2 with ivfflat). The hybrid shapes reported in the issue comments (fulltext + HNSW with a constant, fulltext2 + ivfflat + an extra join) are planner capability gaps that predate this change and are out of scope here.

Tests

  • Unit tests across the touched packages; new/changed code coverage 89.6% (GPU build).
  • BVT: vector, fulltext, fulltext2 and publication-subscription cases, plus GPU cagra/ivfpq cases.
  • fulltext.sql: the stored TF-IDF score 1.6311431 was stale; the correct score is 2.0 (reproduced by running the EXPLAIN VERBOSE SQL). mo-tester rounds float comparisons to the coarser precision, which is why the stale value passed on main.

🤖 Generated with Claude Code

cpegeric and others added 8 commits October 8, 2026 09:45
…rsion107 (matrixorigin#27453)

VectorIndexScan becomes IndexSearchScan (VectorIndexTableRef ->
IndexHiddenTableRef, query_vector -> query_payload, node type
INDEX_SEARCH_SCAN) as the one access-path node for every vector and
fulltext index. Field numbers are unchanged.

The ivfflat-only fields 12-15 (initial_probe_count, first_round_limit,
bucket_expand_step, threads_search) are reserved. Static algorithm
settings travel in algo_options, encoded by the algorithm's planner
and decoded by its reader (ivfflat.ScanOptions); row-dependent ones in
named algo_exprs, folded or evaluated per row by vectorscan and handed
to the reader as search.Request.AlgoValues.

Shared code no longer reads ivfflat fields: local parallelism and
distributed PRE ask the plugin (search.ParallelHooks.CanParallelize),
EXPLAIN asks for the algorithm's settings (search.ExplainHooks), and
expression walkers use IndexSearchScanExprs.

MORPCVersion107 gates the contract: a pipeline carrying an
IndexSearchScan, as a data source or in APPLY, requires 107 on its
destination, and multi-CN placement fails when a worker is older.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…atrixorigin#27453)

hnsw top-k plans as an INDEX_SEARCH_SCAN instead of a FUNCTION_SCAN of
hnsw_search; the join on the primary key and the score sort are
unchanged, and a provider row drives the search through CROSS APPLY as
for ivfflat. The node carries the semantic k, the post-filter flag and
the hnsw search threads in algo_options.

pkg/indexplugin/search/planreader is the engine.Reader of an index
search that produces ranked chunks through a Searcher, emitting the
shared pkid/score/include schema. The hnsw Searcher runs one usearch
search of the cached index (snapshot-keyed as before).

Shared code keys on the algorithm's capabilities instead of on
ivfflat:
- search.CandidateBudgetHooks lets an algorithm size its post-filter
  budget; hnsw keeps overfetch.PostFilterLimit, ivfflat keeps
  FilteredPostModeLimit.
- IndexSearchScanPartitioned (the plugin has ParallelHooks) gates the
  multi-CN placement and AP exec-type rules; an unpartitioned search
  plans and runs like the table function it replaces, in one local
  scope, and a small top-k stays TP.
- resultColumnSourceFromIndexSearchScan resolves the shared schema of
  every algorithm.

EXPLAIN shows "Vector Index Scan on <index>" for hnsw; the BVT regex
assertions follow it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ed count

When fewer rows pass (user filter AND NOT deleted) than the requested k,
cuVS brute force and IVF-Flat fill the remaining result slots with
excluded rows instead of sentinels, so a filtered query could return rows
that fail its predicate and a soft-deleted row could reappear.

Move IVF-PQ's host-side post-filter into gpu_index_base_t
(apply_host_post_filter_locked / apply_host_mask_post_filter) and apply
it in the brute-force and IVF-Flat search paths. A raw result position not
set in the mask becomes (-1, FLT_MAX). It runs after the GPU search; the
user-filter mask already carries the deletes, so only the deletes-only
path takes a shared_lock.

Tests: filtered and deletes-only searches with fewer allowed rows than k,
for brute force, IVF-Flat, IVF-PQ and CAGRA.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
vector_ivfpq_ddl set kmeans_train_percent and ivfpq_max_index_capacity
with SET. Session values reach only the CREATE INDEX build; they are not
stored in algo_params, so the background REINDEX after ALTER TABLE ran
with the default kmeans_train_percent (10%), trained on 2 of 20 rows and
returned ties. The settings are now CREATE INDEX options, which every
rebuild reads from algo_params. vector_cagra_ddl gets the same change for
max_index_capacity.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
cagra and ivfpq sort rewrites now emit INDEX_SEARCH_SCAN instead of the
cagra_search / ivfpq_search table functions. applyCuvsIndexSearchScan
builds the shared shape: device filter JSON for INCLUDE / primary-key
predicates, distance predicates on the search node FilterList, JOIN on
pk, SORT on score. Static settings (threads, batch window, multi-GPU
simulation, base column type, filter JSON, nprobe) ride algo_options.

New search plugins (cagra/plugin/search, ivfpq/plugin/search) port the
table functions' search: same veccache.Cache.Search call, index and
table config, query-type and dimension checks, f16 decode and zero-limit
default. The cuVS search is GPU-only (search_gpu.go); a CPU build
returns NotSupported. Candidate over-fetch uses PostFilterLimit.

scan_options.go of every vector index now lives in
<algo>/plugin/plan; codecs use sonic. The ivfpq searcher keeps the
table function's vector-type check and passes nprobe through tblcfg.

TestRequiredIVFWorkersRequireProtocol107 pins gpu_mode off so it holds
in GPU builds. GPU BVT explain assertions match "Vector Index Scan on".

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…n#27453)

MATCH over a classic fulltext or a fulltext2 index now plans an
INDEX_SEARCH_SCAN instead of the fulltext_index_scan / fulltext2_search
table functions; EXPLAIN labels it "Fulltext Index Scan". The pattern is
the query payload, the zero-relevance guard of a threshold known only at
EXECUTE an algo expression, the pushed limit the candidate limit, and the
static settings (table config, mode, INCLUDE/pk predicates, score range,
source/index tables) ride algo_options. Stats are the table function's.

Readers (port the table functions' search, unchanged in behaviour):
- fulltext2 (pkg/fulltext2/plugin/search): SearchInto for a pushed
  limit, the streaming Emit producer otherwise, the self-completing json
  probe tail, INCLUDE columns by name.
- classic (pkg/fulltext/plugin/search): the engine moved verbatim into
  Scan, shared with the direct-SQL fulltext_index_scan table function,
  which now only parses its arguments. Publisher reads route through the
  scan's source and index references.

Framework:
- A nil CandidateLimit is no limit; the query payload may be a string.
- Statement-level scalars that ConstantFold leaves unfolded (a bare
  prepared parameter or user variable) are evaluated once.
- EmptyScanHooks runs for a NULL query or a dropped runtime filter, so
  the guard and the pattern checks keep the table functions' order;
  Request.MembershipFilterPassed carries a PASSed membership filter.
- engine.TableDefAt / SameTableSchema and fulltext.BuildMembershipFilter
  / CheckZeroRelevanceGuard move to shared packages.

BVT: fulltext plan assertions match "Fulltext Index Scan on"; affected
results regenerated. fulltext.result, fulltext_bm25.result and
gojieba.result also record the current scores (e.g. 2.0, = 2*log10(10)^2
with 10 indexed documents); the stored ones were stale and passed only
because mo-tester rounds to the coarser value's precision.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
)

hnsw_search, cagra_search, ivfpq_search and fulltext2_search are no longer
emitted by the planner; every index search runs through IndexSearchScan.
Remove their plan builders, registrations, executors and tests, and the
fulltext2 probe-tail remote fence. fulltext_index_scan stays for direct SQL.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…trixorigin#27453)

Classic fulltext MATCH runs through IndexSearchScan, which carries the
publisher identity on IndexSearchScan.SourceTable / HiddenTables, so the
internal fulltext_index_scan TVF and its TableFunction fulltext_source_ref /
fulltext_index_ref fields are dead. Remove the TVF, its planner builder and
executor, and reserve the proto fields. The TVF's behavioral tests move onto
the classic reader. pub_sub_fulltext asserts the function is not callable.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…pq (matrixorigin#27453)

hnsw, cagra and ivfpq no longer run as table functions, so they join ivfflat
in the early vector rewrite (LogicalSearchHooks.BuildLogicalSearch). A query
with a MATCH filter and a vector Top-K now plans the vector search scan first
and the fulltext rewrite then serves the MATCH on the same scan, so both
indexes are used. The vector side post-filters its candidates.

docs/design/20261008-index-search-scan.md records the as-built design of the
issue proposal and the hybrid claims; vector_hybrid_fulltext(.sql, _gpu.sql)
are the black-box tests for them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…er (matrixorigin#27453)

hnsw, cagra and ivfpq only post-filter their candidates, so a selective MATCH
returned fewer than k rows (0 of 3 on a MATCH keeping 4 of 200 rows). Like a
membership join, a scan with a fulltext MATCH filter now admits only ivfflat;
the others keep the exact sort over the fulltext hits, as before. Their early
pass path stays behind the gate. The design doc and the hybrid BVT cases state
and test the resulting behavior.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the design gate at bb56c5afe8f059bfef0f4d759c076b6ca2393470, against current main d2a0055ebe1a0b2423368e046c1812c18f6face8. REQUEST_CHANGES: the design/acceptance contract needs closure before implementation approval.

This is a major architectural migration, not a mechanical rename: six algorithms move through new reader hooks and a changed wire node; five callable SQL search TVFs are removed, protobuf fields are retired, and GPU result filtering changes. The complete Git range contains 286 files (the PR metadata file list stops at 100). I read the versioned as-built design, the owning issue's full proposal/comments and its attached design, the review history, and the protocol/request/reader boundaries needed to establish scope. I have not claimed a full 286-file implementation review or runtime regression.

[P2] Close and record the design contract for the breaking migration. docs/design/20261008-index-search-scan.md is explicitly an as-built description. It explains the hooks, hybrid choices and new-to-old CN rejection, but neither it nor the original proposal closes:

  • supported mixed-version operation in both directions, the intended availability/failure behavior during upgrade and rollback, and the migration/deprecation contract for stored/user SQL referencing the removed TVFs;
  • the actual per-reader ownership and terminal sequence for partial initialization, cancellation, producer failure, early consumer exit and prepared reuse, including bounded no-LIMIT/probe-tail buffering and where those guarantees live after migration;
  • measurable acceptance for the changed search hot paths. The original proposal explicitly requires ivfflat/fulltext2 filtered Top-K comparison against main; the PR reports functional/coverage/GPU tests but provides no corresponding benchmark result or explicit approved replacement for that requirement.

Please extend the stable versioned design with these decisions and their focused validation criteria/evidence, and link the exact design revision and a distinct design-review decision before resuming implementation approval. The earlier general APPROVE at a49603eb33 is acknowledged; its empty body does not identify a separate design decision or close the missing contracts above. This does not require a new RFC or a human-only review rule. It follows .agents/skills/mo-dev/references/feature-design-review.md for a cross-subsystem, public/wire/lifecycle refactor.

Accepted scope decisions: registry-based shared search dispatch is the right existing owner; avoiding a separate hybrid operator is sensible. I am not reopening the documented exact-sort fallback for HNSW/CAGRA/IVFPQ under MATCH, nor asking this PR to solve the pre-existing extra-JOIN/provider capability gaps. Consequently, not every issue-comment scenario is implemented; those remaining limitations are explicitly scoped out. There are no prior inline review threads. CI success is recorded, but it cannot establish an unspecified rollout/resource/performance acceptance contract.

Implementation, test, documentation and generated-code changes are inventoried separately; moves/deletions are not treated as proof of simplification. Detailed implementation/test-oracle closure remains pending the design gate, as required by the repository review workflow. No product code was modified and no subagent was used.

cpegeric and others added 5 commits October 9, 2026 18:36
…of IndexSearchScan (matrixorigin#27453)

The design doc records the decisions the design review asked for: no
mixed-version operation in either direction and no fallback; no deprecation
path for the removed search table functions; where each reader lifecycle
guarantee lives and what covers it; no benchmark recorded. Status: awaiting
design approval.

A newer CN accepted an older coordinator's ivfflat node, whose reserved
fields it dropped, unless an operator lowered the protocol version. The
receiver now refuses an index search scan without algo_options, which every
planner of this version sets.

Black-box tests for the new claims: a two-CN cluster refuses an index search
placed on a CN reporting an older protocol version and returns the exact rows
once it is current; the removed functions fail directly and in CREATE VIEW;
prepared ivfflat, hnsw, fulltext and fulltext2 searches return the reference
rows at every re-execution.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…a test (matrixorigin#27453)

Add black-box claims for the rank-mode clause and the join/provider scope,
a unit test for a removed search table function reaching a newer CN, and
narrow the statements no test covers.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…vectorscan (matrixorigin#27453)

Production code and tests refer to vectorscan.IndexSearchScanProtocolVersion,
so a renumber before merge is a one-line change.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@cpegeric

cpegeric commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@XuPeng-SH thanks. The design gate is closed in docs/design/20261008-index-search-scan.md at b1a60cce33. Every claim names its test, and statements no test covers say "code review".

Mixed version, upgrade and rollback (section "Compatibility and rollout"). Decision: mixed-version operation is not supported in either direction, and there is no fallback. Index search fails until every CN runs this version.

  • New coordinator, older CN: the coordinator refuses the placement before dispatch. Covered by a two-CN black-box test (claim 7, pkg/tests/sqlintegration/multicn/index_search_protocol_test.go).
  • Older coordinator, newer CN: writing that test found that a newer CN accepted an older coordinator's ivfflat node. The receiver now refuses an index search scan from an older version (TestRemoteIndexSearchScanFromOlderVersionIsRefused). A pipeline carrying a removed search table function fails to prepare (TestPrepareRemovedSearchTableFunction).
  • Removed TVFs: they were planner-internal, so there is no deprecation or migration path. Direct calls and views fail (claim 8).

Reader lifecycle (section "Reader lifecycle"): partial initialization, cancellation, producer failure, early close, prepared reuse, and no-LIMIT / probe-tail buffering (channel capacity 4). Each item names its owner and the unit test that covers it, or "code review" where none does. Prepared re-execution is black-box tested (claim 9).

Performance (section "Performance"):

  • cuVS IVF-PQ, at 1M rows, dim 768, k=20, against main: recall@20 0.8297 vs 0.8269, warm QPS 409.4 vs 399.1, p50 18.0 vs 19.1 ms. This run has no filter and no deleted rows. The native change (a host re-check of results from a bitset search) runs only with a filter or deleted rows, and is covered by the cgo/cuvs/test filter and delete tests, not by this benchmark.
  • Classic fulltext and fulltext2, readers ported from their table functions. Ranked MATCH … IN BOOLEAN MODE LIMIT k at k=10/100/1000, on 50K chunks of English Wikipedia (dump part 1), two rounds each against main d2a0055ebe. Each latency is within the range of main's two rounds or below it, except fulltext2 at k=100 in round 1 (1.75 vs 1.46 ms; 1.33 ms on both in round 2).
  • ivfflat: not benchmarked, a recorded decision. Its search calls are unchanged; the change on its path is decoding its settings from algo_options once per reader.

New since your review: claim 10 (the rank-mode clause) and claim 11 (the extra-JOIN and provider shapes you scoped out), both black-box tested.

Status: awaiting design approval from fengttt.

@XuPeng-SH

Copy link
Copy Markdown
Contributor

Design phase reviewed at b1a60cce33be53508a49f881da9a9efdd7adc032: PASS for the design contract; implementation approval remains pending.

The versioned design now records both-direction mixed-version rejection and rollback behavior, removal of internal search TVFs without a compatibility path, reader owners and terminal paths, and concrete validation scope. I accept registry-owned search dispatch, composition of existing vector/fulltext rewrites, and the explicitly scoped exact-sort/provider/JOIN limitations. The original performance requirement has an explicit replacement decision: ported fulltext paths are compared against main; ivfflat keeps its search calls and gains once-per-reader option decoding. This is accepted as a scoped tradeoff, not a blanket performance guarantee. The unfiltered IVF-PQ benchmark does not establish the cost of the changed filtered/deleted-row post-filter, and its p99 does not show improvement.

This records a distinct design review of docs/design/20261008-index-search-scan.md at the revision above, satisfying the design-first phase without adding a human-only approval requirement. The author's separately requested fengttt approval is not being impersonated. I am now checking implementation, lifecycle, query semantics, tests and performance against these decisions; this comment is not an implementation APPROVE.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep implementation review: REQUEST_CHANGES at b1a60cce33be53508a49f881da9a9efdd7adc032. Reviewed directly, without subagents.

The previous design-gate finding is closed by the updated contract and the separate design PASS. The registry/reader ownership direction is reasonable: generic execution dispatches through plugin hooks; algorithm options and folded expressions belong to their plugins; the existing APPLY/reader boundaries own per-query execution. This review has one remaining P2 finding: complete retirement of the replaced search-TVF budget/state/wire/test chain (inline).

Scope and engineering quality: the full Git range has 291 files, not the 100-file metadata preview. Production: 112 files, +3,653/-3,635; tests/results: 175 files, +9,789/-7,641; design documentation: 1 file, +256; generated protobuf: 3 files, +2,383/-2,611. I assessed those categories separately and traced renamed/moved readers back to the deleted TVFs; file movement is not counted as simplification. Reviewed planner gating/composition, prepared expression ownership, snapshot/subscription identity, partial reader initialization and cleanup, streaming cancellation/drain, APPLY reuse, protocol send/receive rejection, and the GPU result-mask/delete changes. The inline finding comes from following the retired responsibility chain past the new callers.

Validation on this head:

  • Native CGo build passed. Complete local suites passed for classic fulltext search, fulltext2 search, shared planreader, HNSW search, and vectorscan.
  • An additional reviewer-only MySQL-session test passed (19.646s): IVF/HNSW prepared execution across three query vectors, LIMIT/OFFSET changes, wrong-dimension failure followed by successful reuse, with an independent unindexed-table result oracle. Both fulltext variants passed prepared term changes, empty results, OFFSET and no-LIMIT count checks against known source rows.
  • Targeted compile/protocol checks passed (1.383s), including older-sender refusal, APPLY, partition transport/rollback and empty-scan hooks. The two-CN SQL refusal/recovery test passed (10.950s).
  • Required CI is successful at this exact head; the existing UT and BVT results were reused for broader coverage.

Performance/evidence boundary: no TP regression was demonstrated. Ordinary non-index-search TP queries do not enter the new reader or native result-filter loops. The GPU host recheck adds work proportional to returned query/candidate slots when a filter/delete mask is present. The author's unfiltered IVF-PQ benchmark does not measure that changed path; its p99 is also not a no-regression guarantee. Fulltext comparison data and the explicit absence of an ivfflat benchmark are recorded in the design. I did not run GPU binaries or performance benchmarks on this macOS CPU host.

Comment closure: the earlier rollout, removed-TVF, lifecycle and performance-contract questions now have explicit answers. Mixed-version rejection/no fallback and the documented hybrid/rank-mode/JOIN limitations are accepted scope decisions, not newly reported defects. The new cleanup finding remains open; implementation approval is withheld for that concrete design/test-quality issue.

Comment thread pkg/sql/plan/apply_indices_hnsw.go Resolved
cpegeric and others added 2 commits October 9, 2026 22:36
…unction index state (matrixorigin#27453)

The index search scan computes the candidate budget at execution
(vectorscan + CandidateBudgetHooks / overfetch). Remove the planner's SQL
over-fetch expression, IndexTableConfig.PostFilterOverFetch, the
table-function operator's IndexReaderParam/RuntimeFilterSpecs with their
encode/decode (pipeline.TableFunction fields 7 and 8 reserved), and the
FUNCTION_SCAN LIMIT stats branch. Cover the budget at the request boundary.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
With lists=5 over 21 rows, GPU (cuVS) k-means can leave an empty centroid
nearest the query, so the nprobe=1 POST search returns nothing and the
case's analyze assertion fails on GPU builds. Two lists separate the near
cluster from the far row, which is the shape the case describes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@aunjgr aunjgr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE the documented IndexSearchScan migration at e8d49ec against declared base/merge-base d2a0055. No confirmed blocker in the reviewed design/reader/protocol and retirement boundaries.

The separate design PASS at b1a60cc closes the previously reported contract gate; I verified that decision rather than treating an empty general approval as the design artifact. The current document's awaiting-approval line is stale relative to that technical design disposition; the separately requested maintainer approval is not impersonated by this review.

Reviewed the shared request/reader ownership, execution-generation cleanup, fulltext streaming/tail cancellation owners, publisher/snapshot identity, empty-scan hook and partial parallel-reader cleanup boundaries. Registry-owned dispatch and existing APPLY/engine-reader owners are appropriate; hybrid composition does not add a separate state machine. Checked the latest retirement increment against its replacement consumers: removed TVF budget construction/state/encoding/statistics and old tests are replaced by runtime candidate-budget and prepared-limit boundary controls. Pipeline fields7/8/9/10 and names are reserved; no legacy state is forwarded through ordinary table functions. The extreme/zero/prepared limits retain their saturating budget semantics.

Evidence reused: exact-head required CI, including native-build jobs, UT/SCA/coverage and proxy/pessimistic BVT is green. The author and prior implementation review supply public prepared/reuse, protocol refusal, hybrid/publication and reader tests; those runtime runs are not represented as my own execution. This pass is focused independent verification of the contracts and current retirement delta, not exhaustive recertification of every hunk in the approximately290-file migration. No fresh native GPU, SQL cluster or performance run was executed locally. Diff whitespace reports trailing spaces in generated fulltext result lines; this is nonblocking fixture formatting, not a correctness finding.

Accepted limits remain explicit: no mixed-version availability/fallback, removed SQL TVFs have no migration path, HNSW/CAGRA/IVF-PQ use exact sorting under MATCH, and additional JOIN/provider shapes remain outside scope. The unfiltered IVF-PQ benchmark does not validate the changed filtered/deleted-slot host pass or establish a p99 improvement; no broader GPU/performance guarantee is made.

cpegeric and others added 2 commits October 11, 2026 17:51
# Conflicts:
#	pkg/defines/const.go
#	pkg/sql/plan/apply_indices_cagra.go
#	pkg/sql/plan/apply_indices_ivfpq.go
#	pkg/sql/plan/coverage_regression_test.go
#	test/distributed/cases/fulltext/fulltext.result
#	test/distributed/cases/fulltext/fulltext_bm25.result
#	test/distributed/cases/fulltext/gojieba.result
…atrixorigin#27453)

Main's matrixorigin#29147 case asserted the removed hnsw_search table function; on this
branch HNSW searches through IndexSearchScan.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 431090430dee8c5a9904cdc0b53f42b2e70058fc

Assessment: needs_validation

职责归属与统一 reader 的设计合理,历史两条评审意见已闭环。未确认本次引入的具体代码缺陷;GPU 验证证据尚不足,不能判定通过。

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

Validation:

  • 恢复前次 attempt:patch SHA-256 完全一致,复用已完成检查,未重复运行。

  • 审查范围共 300 文件:生产代码 114、测试及结果 182、文档 1、生成代码 3;核对规划入口、预算计算、prepared 重用、列裁剪、快照及发布者身份、取消清理、协议兼容和旧 TVF 退役。

  • 设计意见 4231712436 由补充合同及独立设计 PASS 闭环;清理意见 4234126482 由旧预算、状态、传输和统计分支删除及替代测试闭环。

  • 复用当前 HEAD 的 CPU UT、SCA、覆盖率、native build,以及 PROXY/PESSIMISTIC 多 CN BVT 成功结果。

  • 复用生成协议检查 exit 0:字段迁移、退役字段号保留和无关消息一致性通过。

  • 当前 native provenance 检查 exit 1:缺少 artifact stamp,因此未运行本地 CGo/GPU 测试。源码保持干净且 HEAD 匹配。

  • 详细记录保存在 attempt-2/review-record.json,逐文件分类保存在 attempt-2/review-inventory.json。

Limitations:

  • 仍需可追溯至当前语义输入的 Linux GPU 验证:CAGRA/IVF-PQ reader 的 -tags gpu 测试、cuVS 过滤及删除测试和相关 GPU BVT。冻结材料中的笼统 GPU 测试声明缺少明确运行版本、选择范围及终态;CPU CI 无法替代。

  • 冻结材料未包含关联 issue [Feature Request]: Index Scan node to consider Vector and Fultlext Index as a whole #27453 的完整正文及讨论,只能核对 PR、设计和评审中重述的需求。

  • 无过滤的 IVF-PQ benchmark 未覆盖新增过滤/删除结果检查路径,不能据此宣称该路径没有性能退化。

@mergify

mergify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-12 01:42 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in-place
  • 🚫 Left the queue — 2026-10-12 02:51 UTC · at b3dcc5c29fe4ae90be47f3f015498a4c9609b737

This pull request spent 1 hour 9 minutes 14 seconds in the queue, with no time running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

  • Mergify Merge Protections
  • CI Required

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Requeued — the merge queue status continues in this comment ↓.

@mergify

mergify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-12 10:20 UTC · Rule: main · triggered by @cpegeric with the merge queue checkbox
  • 🚫 Left the queue — 2026-10-12 10:26 UTC · at e147780effe4a84bd9333d662b456cff175b0795

This pull request spent 5 minutes 57 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

merge conflict between base and head

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@mergify

mergify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-12 14:18 UTC · Rule: main · triggered by @cpegeric with the merge queue checkbox
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-10-12 14:47 UTC · at 5371c01c804d736aabb4ba24598a787174127e11

This pull request spent 29 minutes 15 seconds in the queue, with no time running CI.

Reason

Pull request #29746 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

This branch was previously deployed

1 inactive deployment
ci — 5371c01c Deployed Oct 12, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/api-change kind/enhancement kind/refactor Code refactor size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants