Skip to content

fulltext2: reuse prefix iterator posting offsets - #29696

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/issue-29205-m1-delivery
Oct 10, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/issue-29205-m1-delivery

Conversation

@VioletQwQ-0

@VioletQwQ-0 VioletQwQ-0 commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • Improvement

Which issue(s) this PR fixes:

Related to #29205 (partial optimization; does not close the issue).

What this PR does / why we need it:

M1 reuses the posting-directory offset already returned by the loaded FST prefix iterator, avoiding a second exact-key FST lookup. It retains dictionary traversal order, positional merging, the dense-prefix bitset, MAX-over-expanded-term scoring, and the existing index format. No metadata decoder, streaming search, missing-term shortcut, or BOW algorithm change is included.

Regression coverage compares built, heap-loaded and mmap-loaded representations, BM25/TfIdf score bits, scored/unscored prefix clauses, mixed star/exact phrases, update/delete visibility, malformed offsets and concurrent readers. A literal-start oracle checks mixed-phrase TF independently. A SQL BVT adds a nonempty mixed CJK prefix phrase.

Current-head evidence binding after upstream CI cleanup fix

Head b8a50bd121d104061cc13e55bade0a11ef6af239 normally merges upstream main 4942f889ef08ae26b2ebeb02a1eda11634eb83fd, including the shardservice listener/constructor cleanup fixes in #29708 and #29676. The M1 FULLTEXT2 and tokenizer source is unchanged from 4640004eae5294dc8c0964d260868edb507df1f0; the final feature delta remains the same six files. No independent shardservice patch or P/S prototype was added to this PR.

Fresh native Darwin/ARM64 Go1.27.1 checks on the merged tree: full FULLTEXT2 package with vet (319 top-level tests), full package race with vet (318), concurrent-reader race stress (100 repetitions), and full shardservice package with vet under short/matrixone_test/set-coverage conditions (73) all PASS. The targeted TestRead/TestServiceCloseListener/TestServiceCloseErrors coverage run also PASS. The local coverage scope is four related packages, not the all-repository Linux CI scope. Whitespace checks PASS. Required new-head remote CI remains pending; no rerun of the known failing old head was requested. Prior SQL BVT and v5/v6 measurements remain bound to b0cdac6e303f9723fed075f45040f7cbd9e8e02d / Go1.27.0 and are reused only for unchanged behavior, not relabeled as Go1.27.1 or current-head binary measurements. DF172 means high-hit, not high-density mixed-phrase coverage. No new remote experiment was run for this synchronization.

Current-head CI disposition

Run37911762603 attempt1, prior head4640004e: FAILURE, retained as historical evidence. The UT Coverage job fails at pkg/shardservice/TestRead with a Goetty listener leak-check failure, causing the aggregate coverage and CI Required failures. Ordinary Ubuntu UT, shared build, SCA, executed Compose PROXY and Pessimistic BVT jobs are SUCCESS.

Source attribution is now established: the old head starts remote.server but never closes it in service.Close, while its fixture calls leaktest.AfterTest immediately instead of deferring it. Issue #29709 records the same listener leak / TestRead failure independently of M1. PR #29708, merged as ca5008de9aa1569504d593350ed92059217c85e4, fixes endpoint cleanup and the fixture; #29676 adds construction ownership/idempotent Close. Both are present in the new merged main. This is a known independent lifecycle defect, not a failure declared flaky from an ARM64 pass. Fresh local tests support the repair, but new exact-head Linux CI is still required.

New-head MatrixOne ALL CI run37968177551, head b8a50bd121d104061cc13e55bade0a11ef6af239: attempt1 FAILURE; attempt2 IN_PROGRESS; required CI is not green. Attempt1 shared build, Ubuntu UT Coverage, merged Coverage and both Compose PROXY/Pessimistic BVT jobs succeeded. SCA job113947837893 and Ubuntu UT job113947837905 failed during actions/checkout with interrupted Git transport/peer termination (UT also reports curl receive error56/early EOF), before their analysis/test commands executed; CI Required failed its dependency AND gate. This is a checkout/setup failure, not an SCA finding or a product test failure. After inspecting every completed failure and verifying the unchanged OPEN Ready exact head, only failed jobs were retried once. Attempt2 UT job113972071978 and SCA job113972072235 are now running; no code was changed for the retry, and no old-head run was retried. The original run was triggered by the normal push, not manual dispatch.

Validation on the prior measured head b0cdac6 (reused for unchanged behavior)

  • Native macOS ARM64 CGo build with Go 1.27.0: PASS; package build and vet: PASS.
  • Full pkg/fulltext2 tests: PASS (319 top-level tests).
  • Full package race: PASS (318 top-level tests); concurrent-reader race stress: PASS, 100 repetitions.
  • git diff --check: PASS.
  • Prefix-enumeration microbenchmark, three repetitions: allocation 108,408 -> 67,128 B/op (-38.1%); allocations 1,644 -> 1,437/op. Baseline timing was unstable, so this is not a query-speedup claim.
  • Prior b0cdac6 exact-head CI 37757547715: SUCCESS, including CI Required, Ubuntu UT, shared Linux build, SCA, both multi-CN Compose BVT jobs and coverage. This is not current-head CI. The superseded run37743249778 failed in concurrent classic FULLTEXT snapshot restore round2 with context canceled; the later success alone does not establish its root cause.
  • The changed fulltext2_cjk_boolean_prefix SQL case actually executed in Compose BVT: 33 successful checks, zero failed/ignored/abnormal.
  • Fresh Linux Go1.27.0 native build and loaded100k corpus: baseline/M1 frozen188-query TopK PK/score-bit digests match. An independently selected nonempty mixed star/exact control has matching complete PK/TF/score evidence. Four precheck/streaming variants also pass loaded-index TF and BM25/TfIdf equivalence, but remain test-only and outside this PR.

Historical v5 controlled performance supplement (2026-10-09)

Completed continuation v5 on shared mo-55: candidate b0cdac6e303f9723fed075f45040f7cbd9e8e02d, baseline dce60631f8c857ae730a4d2f328df5962e4f2a8d, native Linux/amd64 Go1.27.0, loaded100k corpus in ten10k segments, frozen188-query ngram natural_mixed pack, search-only, C1/GOMAXPROCS4. Fixed-count measurements, not 180-second SQL/nightly QPS. Three alternating baseline→M1 / M1→baseline / baseline→M1 pairs; every full-pack cell completes22,560 requests, every nonempty control cell completes10,000 requests.

Workload Pair Baseline seconds M1 seconds Elapsed reduction
Complete188 pack 1 41.689 31.554 24.31%
Complete188 pack 2 66.891 31.302 53.20% — unstable baseline, not a reliable speedup claim
Complete188 pack 3 41.142 31.041 24.55%
Nonempty mixed-phrase control 1 13.963 10.063 27.93%
Nonempty mixed-phrase control 2 14.169 10.018 29.30%
Nonempty mixed-phrase control 3 13.642 9.858 27.74%

Go allocated bytes/request decrease25.64–25.65% for the full pack and29.25% for the nonempty control. All28 configured cells returned PASS; phase reached complete/exit0, final frozen hashes passed, unit exited successfully/MainPID0, peak cgroup memory1.55GiB. Validator checks source/input/variant/request coverage and result-count equivalence. Earlier loaded-index PK/score-bit parity is separate correctness evidence, not inferred from timing.

Classification: PASS_EXPLORATORY, full-pack timing stability INCONCLUSIVE. Baseline full-pack spread62.58% versus M1 spread1.65%; nonempty spreads3.86%/2.08% pass the15% stability check. During the full run, host vmstat recorded average iowait17.8% and maximum68%. This establishes interference risk, not the precise cause of pair2. Pair2 is retained explicitly, not silently dropped to manufacture a stable series. No clean-host/full SQL/nightly acceptance is claimed.

The16 factorial cells are single-pass, test-only direction probes on the M1 head. P=missing-exact precheck; S=streaming. Empty-query gains primarily follow P, not S alone. Nonempty and dense-prefix controls remain nonempty across all variants. The dense control has no baseline-arm pair in this run, and is not the required baseline/M1 high-hit non-regression evidence. P/S are not part of this PR and are not approved for production by these results.

Raw evidence retained under mo-55 task root ft2-m1-delivery-20261008T073424Z/performance-evidence-v5; previous v1-v3 interrupted evidence remains separate. Sanitized detailed metrics and identity hashes are in the accompanying PR comment.

Measured-head CR performance supplement v6 (2026-10-09)

Fresh BC/CB/BC pairs on the same frozen baseline/candidate binaries and original100k/ten-segment index completed18 measurement cells/255,360 requests, plus two independent full-result high-hit mixed-phrase oracle executions. No new production commit or rebuild.

Workload Pair/order Baseline s M1 s Elapsed reduction Go bytes/request reduction
Complete 188-query packet 1 BC 41.139 31.109 24.38% 25.64%
Complete 188-query packet 2 CB 41.197 31.133 24.43% 25.63%
Complete 188-query packet 3 BC 41.136 31.172 24.22% 25.64%
High-hit star+exact mixed phrase (DF172) 1 BC 10.701 8.696 18.73% 15.21%
High-hit star+exact mixed phrase (DF172) 2 CB 10.710 8.699 18.78% 15.21%
High-hit star+exact mixed phrase (DF172) 3 BC 10.703 8.705 18.67% 15.21%
Dense single-prefix / TopK100 control 1 BC 25.743 15.878 38.32% 30.24%
Dense single-prefix / TopK100 control 2 CB 25.746 15.880 38.32% 30.24%
Dense single-prefix / TopK100 control 3 BC 25.695 15.871 38.23% 30.24%

All groups pass the original15% stability criterion: maximum within-arm spread0.202%. High-hit mixed phrase has live global DF172 and matching complete baseline/M1 PK/TF/score-bit digests; both it and the paired dense single-prefix control return TopK100 on every measured request. Stable v5 one-hit mixed controls and unchanged exact-head CI/race/BVT evidence are reused. The old unstable v5 pack and candidate-only factorial controls remain historical exploratory evidence, not passing halves of v6.

Same native Linux/amd64 Go1.27.0, ngram/natural_mixed, BM25/TopK100, C1/GOMAXPROCS4, search-only/fixed-count/warmup contract. This is repeatable scoped kernel performance evidence on shared mo-55, not exclusive-host, full230万-corpus,180-second SQL/nightly or TKE QA acceptance. The packet is predominantly zero-result on this subset; independent nonempty/high-hit controls prevent presenting it as high-density coverage.

Runtime receipts retain active/terminal6GiB/noSwap/CPU400%/45min/stop15s/control-group limits. Guard600 samples, no additional swap-out, all capacity floors satisfied, zero OOM/kill/max events, task peak1.39GiB, completion/exit0, guard/sampler joined, exact cgroup absent and retained owned unit stopped. Frozen binaries/inputs/index verified before/after. Raw results remain in the private v6 evidence directory; metrics, identities and requirements are in the CR response comment.

QA required / evidence still pending

QA required: yes. Loaded-index parity, real SQL BVT, repeatable v6 full-pack comparisons and actual paired high-hit mixed/single-prefix controls are complete on measured head b0cdac6 and reused only for unchanged behavior. Formal reviewer acceptance, new-head required CI, current Go1.27.1 binary performance and Artifact-only TKE focused/weekly QA remain pending. The old coverage failure has the upstream lifecycle-fix disposition described above, not a retroactive PASS. V6 supplies the missing scoped developer performance evidence; v5's unstable timing and incomplete dense comparison remain accurately classified. Earlier v3 stopped below its25GiB disk floor and remains excluded; v5 used the author's explicit20GiB disk-reserve relaxation with all other resource/ownership gates unchanged.

The first measurement wrapper was stopped after finding a selector-scoping defect, before dense probes ran. Its successor regression proves all four variants retain the same dense control and caller selector state. Original interrupted evidence is preserved. Only this task's reproducible Go caches were reclaimed; corpus, indexes, binaries, source and evidence remain intact.

Measured baseline is dce6063 and measured candidate is b0cdac6. The delivery-time main snapshot1a008879 advanced only Go1.27.1 and associated documentation, not FULLTEXT2/native code; it is historical, not today's main. Experimental v5/v6 evidence remains frozen on those measured binaries and Go1.27.0. The current head merges main4942f889 and uses Go1.27.1; historical measurements are not current-head acceptance. Dense prefix/position materialization remains intentionally unchanged.

Self-review checked callback/mmap lifetime, iterator close/error handling, offset bounds, traversal/scoring order and all changed callers. The experimental precheck/streaming harness is intentionally excluded from this PR.

Review sequencing

Ready for code review at the author's request; not full QA/merge acceptance. The v6 measured-head188-query series is complete and time-stable across all three pairs; actual high-hit mixed and dense single-prefix baseline/M1 controls also pass. These developer performance requirements are supplied for XuPeng-SH re-review, not self-approved or waived. The measured b0 head's required CI was successful; the subsequent464 head's coverage failure is fixed via the upstream main merge and retained as historical FAIL. New exact-head CI and formal reviewer acceptance remain pending. Full TKE weekly integration remains later QA, not a prerequisite for code review.

V5 completed normally after the author relaxed only the task-specific disk floor to20GiB. Limits remained aggregate6GiB memory, swapmax0, CPU400%, GOMAXPROCS4,45-minute service deadline and exact-unit cleanup. No129 access or workload was performed. XuPeng-SH's outstanding performance review is not marked resolved by this evidence update.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@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 review of b0cdac6 against dce6063: REQUEST_CHANGES for one outstanding validation gate. No blocking correctness defect was confirmed in the six-file patch.

[P2] Complete the explicitly retained paired-query performance acceptance.
The PR's Review sequencing section makes current-head paired 188-query measurements and representative nonempty/high-hit non-regression checks merge gates. Its current evidence still stops during the first candidate cell because of the preserved disk floor. The prefix-enumeration benchmark supports lower allocation (108,408 -> 67,128 B/op), and frozen query/score-bit digests support semantic parity, but neither is the promised complete paired-query runtime/non-regression result. Supply the completed, comparable baseline/M1 results under the same corpus, selectors, scorer, build and machine, including nonempty mixed-phrase/dense controls; explain any material regression. Historical/interrupted cells must stay separate. This does not require full TKE weekly integration before review and does not request changes to the measurement resource floor.

Implementation and design:

  • This is a focused optimization of an existing traversal contract, not a new algorithm/storage/lifecycle feature requiring an additional design document.
  • The iterator already yields the same posting-directory offset used by LookupLoaded. Direct decoding reuses decodeTermEntry and its bounds, retains dictionary order and MAX-over-expanded-term scoring, and preserves the positional merge and dense-prefix bitset.
  • All three changed production callers were traced, including the unchanged exact lookup, build-side PrefixRange, phrase fallback, global DF/liveness and serializer/loaded representation. The unsigned offset bound also precedes int conversion.
  • No second index format, decoder, cache, background worker or scoring path is introduced.
Closure Result
Q1 ownership Iterator closes through defer on completion/error; term strings are owned copies; posting views remain within the existing segment/cache lifetime. Query materialization does not mutate shared loaded metadata.
Q2 termination Finite iterator traversal, synchronous callbacks, no new wait/retry dependency; iterator errors retain the callers' existing error disposition.
Q3 live memory Removes the expanded-term slice/second FST lookup; existing per-query bitmap/position materialization remains. The dense positional path is not falsely claimed bounded to a small constant.

Test/QA assessment:
Read every changed hunk and the complete 319-line test addition plus SQL/result delta. Built/heap/mmap parity, BM25/TfIdf score bits, scored/unscored/weighted clauses, independent literal-start TF, malformed offset, update/delete visibility and concurrent readers cover distinct boundaries. Small fixtures and the new nonempty SQL control are appropriate; the benchmark is explicitly separate from functional assertions. Reused the author's exact-content full package/race/stress and loaded-corpus evidence; no duplicate full suite was launched. Whitespace passes.

The latest CI Required run 37757547715 is successful; the superseded failure from run 37743249778 is not a current CI blocker. There are no prior substantive review threads. Production delta is +68/-42, tests/results +330/-2, docs 0. The code review is favorable; the formal decision remains request changes until the PR's outstanding performance acceptance is completed.

@VioletQwQ-0

Copy link
Copy Markdown
Collaborator Author

Exact-head performance supplement — M1 v5 (2026-10-09)

Following the performance validation request from @XuPeng-SH, the current-head controlled series has now completed 28/28 cells, with phase PASS/complete/exit0, successful final hash checks and task termination (MainPID=0). This is PASS_EXPLORATORY, not complete performance/QA acceptance; two specific merge-gate gaps remain below.

Frozen experiment

  • Candidate: b0cdac6e303f9723fed075f45040f7cbd9e8e02d; baseline: dce60631f8c857ae730a4d2f328df5962e4f2a8d.
  • Native Linux/amd64 Go 1.27.0, shared mo-55, 100,000 original-corpus documents, ten 10k loaded segments. Same prebuilt baseline/candidate binaries and index; no rebuild between arms.
  • ngram natural_mixed, frozen 188-query packet; positional/BM25/TopK100 search-only, C1/GOMAXPROCS4, no profiling overhead. Preparsed structures retain the production search/global-statistics path; this excludes parser construction and SQL/server/client costs.
  • Every selected query is warmed, with total warmup at least 10 seconds; fixed-count cells, not a 180-second nightly client window. Each pack cell executes 188×120=22,560 requests; each independent nonempty control executes 10,000. Pair order B→M1, M1→B, B→M1, sequential fresh processes.
  • Aggregate 6 GiB cgroup, swapmax0, CPU400%, 45-minute service bound, 15-second owned stop. Only free-disk reserve was explicitly relaxed by the author from 25 to 20 GiB. Peak cgroup memory: 1,669,189,632 bytes (~1.55 GiB); no resource-stop receipt.

All three pairs (no interrupted/historical cells included)

Workload Pair/order Baseline elapsed (s) M1 elapsed (s) Elapsed reduction Go bytes/request reduction
Complete188 pack 1 B→M1 41.689 31.554 24.31% 25.6405%
Complete188 pack 2 M1→B 66.891 31.302 53.20%* 25.6518%
Complete188 pack 3 B→M1 41.142 31.041 24.55% 25.6487%
Nonempty mixed phrase 1 B→M1 13.963 10.063 27.93% 29.2481%
Nonempty mixed phrase 2 M1→B 14.169 10.018 29.30% 29.2481%
Nonempty mixed phrase 3 B→M1 13.642 9.858 27.74% 29.2481%

*Pair2 is an unstable baseline observation, not a trustworthy53% optimization claim. Full-pack baseline spread is62.58%, M1 spread1.65%; the complete three-pair timing series fails the15% stability criterion. Nonempty baseline/M1 spreads are3.86%/2.08% and pass. The host's697 vmstat samples show average iowait17.8%, maximum68%, with brief swap activity; these describe interference risk, not proven causality for pair2. We retain all pairs and do not discard pair2 to manufacture a passing stable series. First/third-pair24.3–24.6% reductions are observations, not a certified whole-pack speedup.

The evidence validator checks exact source, packet and selector identities, all configured requests/query coverage,10 loaded segments, variant identities and result-count/per-query equivalence. Earlier frozen loaded-index complete PK/TF/score-bit parity remains separate correctness evidence. Go allocated bytes/request improve consistently (full-pack baseline ~1.7446MB vs M1 ~1.2972MB); this does not cover native allocations or imply equivalent RSS reduction.

Test-only direction probes (not production changes)

P=missing-exact precheck, S=streaming. Four variants were run once for each control; they are not a stable algorithm ranking.

Control M1 M1+P M1+S M1+P+S
q104, zero results, ms/request 70.669 16.677 70.850 17.090
q167, zero results, ms/request 67.008 0.0150 70.426 0.0158
Nonempty,1 returned, ms/request 0.9866 0.9867 0.9482 0.9491
Dense-prefix control, TopK100 returned, ms/request 1.6112 1.5787 1.5891 1.6131

The zero-result improvements follow P; S alone does not improve these representatives. Single-prefix dense controls intentionally retain the existing dense fast path, so near-identical results do not validate streaming on dense mixed phrases. All four variants here run on the candidate head: this table does not provide a baseline/M1 dense/high-hit non-regression pair. Empty-query results cannot be generalized to the packet or nonempty/high-hit traffic. P/S remain outside this PR.

Remaining review/QA gates

  1. Full-pack baseline/M1 timing must be comparable and repeatable; v5 completes coverage but fails that stability gate. Investigate interference before any follow-up measurement; no automatic retry was launched.
  2. Add an actual baseline/M1 dense mixed-phrase/high-hit control pair. Candidate-only factorial controls cannot close this requirement.
  3. Real SQL/Artifact-only TKE focused and weekly integration remain NOT_RUN. This supplement neither resolves the outstanding review nor requests merge/queue admission.

The latest exact-head CI 37757547715 is SUCCESS, including CI Required and Ubuntu UT. It supersedes the previously described CI blocker, without proving the root cause of the older context-canceled failure. PR Ready state and head are unchanged.

Evidence identity and retention
  • 100k TSV SHA256: eaa37328d81eedecf1b8e526d88d2c8fe3b9b7b92e05edbea4731520701cad3b.
  • 188-query packet SHA256: a73f75109c0d460d020f2c587aec997fc7edd47150b46633535511cf28f91e94.
  • Independent nonempty-control file SHA256: 5cb3dca605486ce0c70ecf07c6d07135768168f1593afbb871dc6ce36a584214.
  • V5 wrapper/helper frozen manifest SHA256: 3d3235ad9edf1a684bec6a5ee80cd62124054d64dc8114110b32feaa9df76841.
  • Ordered segment-hash list (index.sha256) SHA256: 4abdb34bfb8de6a50a6d89af2aae4f5848317cc684fb063253b3502b8b5c3516.
  • Validated structured summary SHA256: 4fac0f8be0b394476b658c16fd7abd7d11f8dfaaf367d01cd99b1899064f2641.
  • Private evidence scope: mo-55 task ft2-m1-delivery-20261008T073424Z/performance-evidence-v5, with configs, result JSON, resource samples, final hash checks and termination receipt. Reviewer-readable compact metrics are reproduced above; raw artifacts remain private, not uploaded to an unrelated CI run or publicly claimed available.
  • V1-v3 partial/interrupted evidence is preserved separately and excluded. No raw corpus/query text, credentials or business logs are included in this comment. No129 workload was started.

@VioletQwQ-0

Copy link
Copy Markdown
Collaborator Author

Response to performance CR — completed exact-head v6 controls

@XuPeng-SH, this supplies the outstanding paired-query/non-regression evidence from your P2 review. There is no new production commit: candidate remains b0cdac6e303f9723fed075f45040f7cbd9e8e02d; baseline remains dce60631f8c857ae730a4d2f328df5962e4f2a8d. The implementation, ordinary/race/BVT tests and successful exact-head CI are unchanged.

Requirement-by-requirement closure

  1. Comparable complete188 packet: all six fresh arms completed 188×120=22,560 requests each. BC/CB/BC order, same frozen production binaries, data/index, selectors, scorer and machine; no interrupted/historical arm is pooled into v6. All three pairs are retained and both arms pass the original15% within-arm stability criterion.
  2. Nonempty mixed phrase: the stable v5 one-hit mixed control is reused unchanged. Additionally, a new real-corpus high-hit mixed query genuinely has star+exact slots and live global DF172 across all ten segments. Before timing, separately executed baseline/M1 loaded-index oracles agree on all172 PK/score-bit results and every segment's complete PK/TF digest. No corpus injection or index rebuild occurred.
  3. High-hit/dense non-regression: the mixed control and the original dense single-prefix control each have three real baseline/M1 pairs, not candidate-only factorial measurements. Both return TopK100 on every measured request and all paired count/query identities agree. The single-prefix control does not assert an uncapped DF or certify streaming on dense mixed phrases; P/S remain outside this PR.
  4. Repeatability / any regression: all three groups have within-arm spread below0.21%; every observed pair improves elapsed time and allocated Go bytes. No material regression was observed in these controls. This is bounded evidence for these query shapes, not every possible query/index/topology.
  5. Historical separation: v5 remains exploratory with its62.58% full-pack baseline spread and its candidate-only dense probes. None of v1–v5 is retroactively relabeled or used as a timed half of v6.

All v6 measurements

Workload Pair/order Baseline s M1 s Elapsed reduction Go bytes/request reduction
Complete 188-query packet 1 BC 41.139 31.109 24.38% 25.64%
Complete 188-query packet 2 CB 41.197 31.133 24.43% 25.63%
Complete 188-query packet 3 BC 41.136 31.172 24.22% 25.64%
High-hit star+exact mixed phrase (DF172) 1 BC 10.701 8.696 18.73% 15.21%
High-hit star+exact mixed phrase (DF172) 2 CB 10.710 8.699 18.78% 15.21%
High-hit star+exact mixed phrase (DF172) 3 BC 10.703 8.705 18.67% 15.21%
Dense single-prefix / TopK100 control 1 BC 25.743 15.878 38.32% 30.24%
Dense single-prefix / TopK100 control 2 CB 25.746 15.880 38.32% 30.24%
Dense single-prefix / TopK100 control 3 BC 25.695 15.871 38.23% 30.24%
Workload Baseline spread M1 spread
Complete 188-query packet 0.147% 0.202%
High-hit star+exact mixed phrase (DF172) 0.090% 0.102%
Dense single-prefix / TopK100 control 0.199% 0.057%

Measured scope: native Linux/amd64 Go1.27.0, shared mo-55, original100k documents in ten loaded10k segments, ngram/natural_mixed, positional BM25/TopK100, C1/GOMAXPROCS4 search-only. Same fixed-count harness, all selected queries warmed and >=10s warmup per fresh process. There are18 measurement cells/255,360 requests and two separate full-result mixed-phrase oracle executions. All expected queries/cycles completed, count digests were independently reconstructed, and final frozen-wrapper/input/binary/index checks passed. The complete frozen packet is predominantly zero-result on this subset (186/188 queries), which is why separate nonempty/high-hit controls are retained.

This closes the previously missing repeatable scoped kernel comparison; it is not clean-host, 180-second SQL/nightly QPS, full-corpus or TKE QA acceptance. Host monitoring recorded mean idle87.3%, mean iowait4.45%, max iowait13%. Other users' work was not stopped or modified. Stable paired timing does not imply an exclusively owned server.

Runtime/provenance/terminal evidence

The original native build records and hashes are reused, rather than recompiling. Both worktree tracked contents are clean at their pinned SHA; test-only untracked harness files are explicitly retained. Go build metadata, immutable test-binary hashes, harness/input manifests and all ten segment hashes are recorded and rechecked.

The new run-active and terminal retained unit records bind actual limits: aggregate6GiB memory, MemorySwapMax0, CPU400%, RuntimeMax45min, stop15s, KillModecontrol-group. Continuous guard/sampler remained alive through every cell and were joined at exit. Six hundred capacity samples stayed above memory10GiB/disk20GiB floors, with zero additional host swap-out; the20GiB floor is the previously authorized reserve relaxation. Peak task memory1,493,839,872 bytes (~1.39GiB); memory.events has zero OOM/kill/max events. Completion is PASS/complete/exit0, MainPID0/Resultsuccess. Independent inspection found the exact task cgroup absent, stopped only the retained owned unit, and confirmed post-stop cgroup absence. No source, corpus, index, raw result or foreign resource was deleted.

The independent metrics validator has eight passing regression tests covering wrong source/digest, incomplete requests, score mismatch, insufficient high-hit DF, unstable timing and visible regression. Its verdict keeps run completion, timing stability and observed non-regression separate; reviewer acceptance is not inferred from a wrapper PASS.

Evidence identity / retention

  • Baseline.test SHA256: 71f8e7d45a824bfe6e678fc4312ae218ffa2e5124ec0f167d0ee25f90e4b066e.
  • Candidate.test SHA256: 84a853e030ec1085b1a3727edb02cc260ba873fb7dbb3e02cd89f6952b4e9638.
  • Frozen188 packet SHA256: a73f75109c0d460d020f2c587aec997fc7edd47150b46633535511cf28f91e94.
  • Mixed control SHA256: 7e56e22af2f57abdbb28a833b74e15e42ffc8e59b9c18f22daee939f6b4fd17d.
  • Ordered index-hash manifest SHA256: 4abdb34bfb8de6a50a6d89af2aae4f5848317cc684fb063253b3502b8b5c3516.
  • Frozen execution wrapper SHA256: ff191a9961fb8b3e0b1a356d19a6804cdc60ce324bf37d1263784c6df0df3dae.
  • Private remote evidence: ft2-m1-delivery-20261008T073424Z/cr-performance-20261009T0839-v6; independently downloaded raw JSON/configs/guard logs, build/active/terminal records and local summary are retained. Sanitized numerical evidence is reproduced here; raw corpus/query text and credentials are not published, and raw evidence is not claimed available in an unrelated Actions artifact.

Latest exact-head CI37757547715 is SUCCESS. Required developer performance controls are now supplied for re-review; formal CHANGES_REQUESTED is not dismissed or self-resolved. Artifact-only TKE focused/weekly remains later QA/NOT_RUN, as distinguished in your review. Ready/head unchanged. No129 contact/workload, no TKE dispatch, no automatic retry, and no merge/queue admission.

@VioletQwQ-0
VioletQwQ-0 requested a review from XuPeng-SH October 9, 2026 09:00
@VioletQwQ-0

Copy link
Copy Markdown
Collaborator Author

Follow-up cleanup pushed as 4640004eae5294dc8c0964d260868edb507df1f0.

  • Moved both legacy prefixTerms collectors into prefix_postings_test.go after confirming that all callers are tests or the baseline benchmark. Their bodies are unchanged, so the old-path oracle remains independent of forEachPrefixPosting.
  • Retained production PrefixRange and the build-side path. No decoder, iterator, traversal, scoring, query, storage-format, precheck/streaming or BOW behavior was changed.
  • Fresh native macOS ARM64 / Go 1.27.0 checks: full pkg/fulltext2 tests, focused prefix/dictionary tests, production-only build, go vet, baseline/candidate benchmark smoke and git diff --check: PASS. Benchmark smoke is not new timing evidence.

The v6 performance response remains bound to measured head b0cdac6e303f9723fed075f45040f7cbd9e8e02d. It is reused for this helper-only cleanup because production function bodies and frozen experiment inputs are unchanged; no new-head binary measurement or new remote experiment is claimed. DF172 is a high-hit control, not high-density mixed-phrase coverage. The paired dense single-prefix control is separate. The predominantly zero-result 100k packet is not full-corpus SQL/nightly acceptance.

Current-head CI will be reported separately; the older successful run is not relabeled as current-head CI. The outstanding formal review is left to the reviewer, and TKE QA remains pending. No 129/TKE or new mo-55 experiment was launched for this cleanup.

@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 re-review of b8a50bd against merge-base 4942f88. APPROVE. Reviewed directly, without subagents.

The previous P2 paired-query performance requirement is closed by the v6 evidence: #29696 (comment) . All three alternating pairs complete the frozen 188-query pack and the independently selected high-hit mixed-phrase and dense single-prefix controls. Reported within-arm spread is below 0.21%; observed elapsed reductions are 24.22–24.43%, 18.67–18.78% and 38.23–38.32%, respectively. The mixed control has live DF172, matching full PK/TF/score-bit oracles and TopK100 in both arms. The previously unstable v5 result and candidate-only factorial experiments are correctly kept separate.

Evidence scope is explicit: measured baseline dce6063 and candidate b0cdac6, Linux/amd64 Go1.27.0, 100k original documents/ten segments, C1/GOMAXPROCS4, search-only. I verified the subsequent FULLTEXT2 changes only move unchanged legacy collectors into test code; search, decoder, index/writer and scoring bodies remain unchanged, and the current base integration does not change that algorithm. The measured behavior is reusable for this scoped optimization. Those numerical results are author-supplied historical-binary evidence, not a fresh Go1.27.1 benchmark, full SQL/TP throughput, clean-host certification, full-corpus or TKE QA claim. No new remote workload was run by this review.

Design/ownership: read every hunk in all six files and traced all three production callers, the unchanged exact lookup and FST serializer, build/heap/mmap representations, global DF, phrase fallback, update/delete liveness and cache/segment lifetime. The writer stores the same posting-directory offset returned by FST iteration; both paths use the existing decodeTermEntry. The unsigned bounds check precedes conversion to int. Dictionary order, MAX-over-expanded-term scoring, TF/position semantics and the existing single-prefix bitmap are preserved. There is no new format, cache, state machine, decoder or execution owner.

Unhappy paths: iterator Close is deferred for exhaustion and errors; strings are owned copies; transient posting views remain inside the existing segment/cache lifetime. Error results are discarded by the same boolean/phrase owners. Traversal and callbacks are synchronous and finite, with no new waits or retries. Removing term collection and redundant FST.Get reduces work; dense positional materialization remains an acknowledged existing cost, not a claimed constant-size bound.

Independent boundary challenge and test quality: the empty/absent/multi-CJK prefixes and malformed MaxUint64 offset are checked against the unchanged exact-lookup path; built/heap/mmap results, both scorers, weighting/unscored clauses, literal-start TF and update/delete visibility have distinct oracles. Concurrent-reader and race evidence remains applicable to unchanged production bodies. The current exact-head CI run 37968177551 selects pkg/fulltext2 in the light -race stage and finishes with status 0. Its Compose artifact explicitly executes fulltext2_cjk_boolean_prefix.sql: 33/33 passed, zero failures/ignored/abnormal. The earlier 100-repeat reader stress is reused; no redundant full suite was launched.

Increment: implementation 3 files +60/-64; tests/fixtures 3 files +362/-2; documentation 0. Of the test growth, 31 lines are the relocated independent legacy collectors, not new coverage or a net-code reduction. Retiring them from production is appropriate because their remaining consumers are the oracle/benchmark; retaining PrefixRange is necessary for the live build-side path. Small fixtures and the nonempty public SQL control cover actual changed behavior. No remaining blocking comment, correctness defect, lifecycle issue or unjustified complexity was established. Full deployment/TKE QA remains outside this code-review approval.

@mergify mergify Bot added the queued label Oct 10, 2026
@mergify

mergify Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-10 00:59 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-10-10 01:06 UTC · at 51f691329bf5cef1a9f0b392234b1ecf69728822

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

Reason

Pull request #29696 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 — 51f69132 Deployed Oct 10, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants