Skip to content

test: reduce GPU vector CDC wait overhead - #28872

Closed
Lundomn wants to merge 2 commits into
matrixorigin:mainfrom
Lundomn:codex/ci-test-time-optimization
Closed

Lundomn wants to merge 2 commits into
matrixorigin:mainfrom
Lundomn:codex/ci-test-time-optimization

Conversation

@Lundomn

@Lundomn Lundomn commented Sep 14, 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 #28849 (GPU vector test portion)

What this PR does / why we need it:

This PR handles the GPU-vector test portion of issue #28849. The ten GPU SQL/BVT cases use bounded readiness contracts for asynchronous CDC and vector-cache state, so test execution can progress from observable readiness instead of relying on unnecessary long waits. The original scenarios, final vector probes, retry behavior, and .result oracles are preserved.

Summary

This PR is GPU-only and changes only the ten GPU vector SQL/result pairs plus the GPU case README and GPU-only design section.

  • Async and load cases use bounded readiness gates for committed CDC/storage progress.
  • The four delete cases first wait on committed CDC-tail metadata, then use bounded exact-match vector readiness. This prevents an exact probe from re-caching a pre-commit index snapshot before the deleted row and survivor/untouched ids are observed.
  • Cross-CN vector-cache freshness remains eventual; this PR does not claim an instant global refresh.

Scope

Changed paths are limited to the ten GPU vector SQL/result pairs, the GPU case README, and the GPU-only design section. No unrelated paths are included.

Validation

  • All ten SQL/result pairs remain present; no business case or final vector oracle was removed.
  • The candidate is based on the latest main; the diff/name audit, whitespace check, and GPU-case static checks pass.
  • CI required checks pass, including Ubuntu/x86 UT, Linux/arm64 SCA, Shared Build, Coverage, and multi-CN BVT.
  • CUDA execution, teardown and same-instance reruns, and same-host base/candidate timing, occupancy, failure-rate, and CN-topology evidence still need to be collected on an x86_64 NVIDIA host such as the Y7000P. No local macOS result is presented as GPU evidence.

@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.

GPT-6 medium deep review at exact head 4686c5c.

REQUEST_CHANGES — CUDA validation and performance evidence are still outstanding. Ten GPU cases have changed readiness metadata, but CUDA execution and before/after timings are not available; CPU CI alone does not validate the CUDA path. Please attach CUDA execution and comparable timing evidence before treating the CI wait reduction as verified.

The CI artifact records an existing Arrow case at 297.06 s, including about 258.6 s of cluster admission; this does not establish a PR-caused race slowdown. Its merged subtests were 0.70 s and 0.46 s. No measured new race-UT slowdown is established, but the missing CUDA validation remains a blocker.

@aptend aptend 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 completed at exact head 4686c5c against exact base and merge-base f9a4444. I read the complete review/comment/thread history and every changed hunk. I found two blockers.

  1. The new metadata gate does not actually synchronize the delete cases with vector-cache invalidation. In vector_cagra_delete.sql lines 63-78 and vector_ivfpq_delete.sql lines 65-80, the initial vector query loads the pre-delete index into the cache, the wait only observes that a new cdc_tail chunk committed, and the next query assumes the old cache has already been evicted. The producer orders these operations the other way: cagra Sync.Save commits through runSqls at pkg/vectorindex/cagra/sync.go:362, then only calls veccache.Cache.Remove at line 373; IVFPQ has the same gap at pkg/vectorindex/ivfpq/sync.go:308-315. A concrete one-CN interleaving is: the CDC transaction commits, the wait query sees max(chunk_id) advance and returns 1, the writer is descheduled before Cache.Remove, and the final search reaches pkg/vectorindex/cache/cache.go:569-606, which uses the resident entry without an inline generation check and can return deleted id 5. On another CN the local Remove does not evict the remote cache at all; remote freshness is only eventual housekeeping. The two sharded-delete files have the same issue. Therefore this condition proves durable storage catch-up, not the search-readiness contract formerly approximated by the sleep. Please wait on an observable cache-generation/eviction boundary, or otherwise couple readiness to invalidation, and validate the four delete cases repeatedly on CUDA.

  2. Required CUDA validation and performance evidence is absent. This PR changes ten GPU-only cases specifically to reduce their wait time, and both issue 28849 and docs/design/UT_EXECUTION_AND_FIXTURE_OPTIMIZATION.md:62 require same-runner CUDA before/after evidence for wall time, GPU occupancy, and failure rate. The exact-head GitHub checks are CPU-only, so they neither execute these case changes nor establish that the new waits select valid metadata on the deployed GPU topology. Please attach normal-comparison CUDA runs of all ten changed cases plus comparable before/after timing evidence.

What did close: the static audit confirms ten bounded wait directives, no target SLEEP(30), and all 48 vector probes plus corresponding result commands remain. The Arrow fixture consolidation preserves the disabled-gate and distributed-fallback policies as named subtests; exact-head standard CI and the reported focused Arrow race run are valid evidence for that closure. git diff --check passed. The focused test/CI maintenance scope is exempt from the mandatory feature-design gate, but its own stated CUDA acceptance criterion is still unmet.

@Lundomn
Lundomn force-pushed the codex/ci-test-time-optimization branch from 4686c5c to fd4dcf4 Compare September 15, 2026 07:51
@Lundomn
Lundomn requested a review from aunjgr as a code owner September 15, 2026 07:51
@matrix-meow matrix-meow added size/XL Denotes a PR that changes [1000, 1999] lines and removed size/L Denotes a PR that changes [500,999] lines labels Sep 15, 2026
@Lundomn

Lundomn commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Scope correction after the GPU/CPU split: the PR has been rebuilt as GPU-only at cddb4838e. The previous scope note is superseded and is not part of the current PR.

The current diff contains only the ten GPU vector SQL/result pairs, the GPU case README, and the GPU-only design note. The four delete cases now wait for committed CDC-tail metadata before bounded exact-match vector readiness, preventing a pre-commit index snapshot from being re-cached. Cross-CN cache freshness remains an explicit CUDA validation item.

@Lundomn
Lundomn force-pushed the codex/ci-test-time-optimization branch from fd4dcf4 to 79e642c Compare September 15, 2026 08:29
@Lundomn Lundomn changed the title test: reduce CI wait overhead for vector cases test: reduce GPU vector CDC wait overhead Sep 15, 2026
@matrix-meow matrix-meow added size/L Denotes a PR that changes [500,999] lines and removed size/XL Denotes a PR that changes [1000, 1999] lines labels Sep 15, 2026

@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.

GPT-6 medium deep review at exact head cddb483.\n\nP2 — required CUDA execution and performance evidence is missing. All ten GPU cases change synchronization and expected readiness output, but the exact-head CI invocation inspected test/distributed/cases and excludes these GPU cases. Without normal-comparison CUDA execution, functional correctness and the claimed wait reduction are not validated.\n\nPlease provide named exact-head runs for all ten cases, normal result comparison, teardown checks, same-instance reruns, and same-host base/candidate wall-time, GPU-occupancy, and failure-rate measurements with CUDA/build configuration and CN topology.

@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.

[P2] The changed GPU synchronization contracts still lack CUDA execution evidence.

At cddb483, all ten GPU SQL/result pairs change waits/readiness outputs. The new metadata gates and cache probes depend on real asynchronous build/CDC/cache behavior; ordinary CPU CI does not execute test/distributed/gpu_cases. The PR body and GPU design section explicitly say same-host CUDA functional/timing/occupancy/failure-rate evidence remains uncollected.

Before accepting the test change, provide named normal-comparison CUDA runs for all ten cases, teardown and same-instance reruns, plus baseline/candidate timing under the same native/CUDA configuration and CN topology. Keep the final vector result oracles; metadata progress alone is not proof of per-CN cache freshness.

This is an objective validation gap, not an allegation that the bounded polls are known to fail. Reviewed the wait-contract changes and retained scenario inventory; green CPU CI is not presented as GPU proof. No GPU environment or container was started.

@Lundomn Lundomn left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

nothing

@cpegeric cpegeric 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.

did you have GPU for testing? If you don't have GPU, you cannot fix this BVT.

@Lundomn

Lundomn commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@cpegeric Thanks for pointing this out. I have an NVIDIA RTX 4060 and attempted to run the CUDA GPU BVTs, but the run did not produce a valid result.

@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is closed, so it cannot be queued. Reopen it to get the box back.

@XuPeng-SH XuPeng-SH closed this Nov 22, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement kind/test-ci size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants