Skip to content

feat: add native TPC-H workload tools for MO and DuckDB - #30588

Merged
mergify[bot] merged 16 commits into
matrixorigin:mainfrom
aunjgr:feature/tpch-compare-workload
Oct 20, 2026
Merged

mergify[bot] merged 16 commits into
matrixorigin:mainfrom
aunjgr:feature/tpch-compare-workload

Conversation

@aunjgr

@aunjgr aunjgr commented Oct 19, 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:

Related to #30569.

What this PR does / why we need it:

Add a standalone native TPC-H workload module for MatrixOne and DuckDB. Prepare one recorded DBGEN/QGEN dataset per scale and render the same qualification query parameters for both engines. The canonical schema includes the PARTSUPP and LINEITEM composite primary keys, and Q15 retains its create/select/drop view lifecycle with private names and failure cleanup.

Use the MO MySQL driver and the pinned official DuckDB 1.5.6 driver with one bounded typed result-consumption path. Drain results through EOF, propagate cursor and cleanup errors, record native versions and settings, and retain dataset, executable and capture identities. Enable parallel native CSV reading explicitly in both engines and record schema, loading, statistics and checkpoint time separately. Benchmark loading ends after checkpointing; it performs no input rehashing, table-content scans, catalog comparisons or relationship checks. Every MO connection sets agg_spill_mem to 2 GiB and records its effective value. This worker threshold operates within the original total application memory allowance.

Keep correctness tests and explicitly requested diagnostic commands separate from benchmark execution. These helpers cover native schema domains and key order, exact strings and decimal expressions, declared division tolerances, duplicate multiplicity, result ordering, legal LIMIT ties and independent SF1 reference rules. They are never an automatic benchmark gate. Include the methodology and a focused CI job for this isolated module; engine execution code and MO's main dependency graph are unchanged.

Validation

  • The native MO session-setting diagnostic recorded agg_spill_mem=2147483648; its SF100 Q18 operator profile reported no spill under the existing eight-core / 32 GiB envelope. This is separate diagnostic evidence, not a new full-campaign score.
  • Standalone module tests, vet and repository-configured golangci-lint passed.
  • A two-row native DuckDB regression confirms that bulk loading accepts unordered input without running correctness scans.
  • Existing tiny tests retain schema-drift, VARCHAR-space, input-identity, LIMIT-membership and cleanup coverage as separate correctness tests.
  • Earlier standalone SF1 correctness checks passed for both engines, including all eight tables, their relationships and all 22 query results. These checks are separate historical evidence and are not part of future benchmark runs.

Design

The methodology is in docs/design/mo-duckdb-tpch-benchmark.md, revision 0.6. The user explicitly requested removing correctness verification from benchmark scripts. No replacement checksum or sampling pass is introduced. Generated datasets, databases and raw captures remain outside Git.

@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 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 211e028955096447270885cf73ac97c427850e3c

Review completed. Read the assessment.

@XuPeng-SH

XuPeng-SH commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · superseded

Commit: 211e028955096447270885cf73ac97c427850e3c

"interrupted"

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

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

Commit: 211e028955096447270885cf73ac97c427850e3c

Assessment: request_changes

Reviewed the complete 14-file delta. The standalone module and shared typed-consumption path are reasonable, but input identity and LIMIT qualification have confirmed correctness gaps. Production SQL paths and the main dependency graph are unchanged.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1

  • P2 optools/tpch_compare/worker.go:118: Run operation=verify after a table input and the corresponding database contents have changed, while dataset.json retains the original input hash.
    Impact: Verification succeeds and certifies the original dataset identity although the checked data differs. Verify input hashes for the verify operation, or validate them while consuming the files.
    Evidence: loadDataset enables input hashing only for operation=load. TestReviewVerifyRejectsChangedInputIdentity reproduced this through runWorker with a real DuckDB fixture: FileID.verify rejected the changed region.tbl, but runWorker returned success with cleanup=complete and the original manifest identity.

  • P2 optools/tpch_compare/main.go:118: Compare two qualification Q3 captures containing 11 identical, correctly ordered rows, despite the manifest specifying LIMIT 10.
    Impact: The CLI reports a successful comparison for results that violate the known query contract. Enforce qualification LIMIT bounds, distinguish unlimited diagnostic receipts, and connect the existing membership validator to the comparison path.
    Evidence: TestReviewCompareRejectsRowsBeyondQualificationLimit reproduced the false pass through cli. compareCaptures never checks q.Limit, and validateLimit has only test callers. A separate control proved both legal tied subsets pass validateLimit while the CLI rejects them without a way to supply the unlimited-reference proof.

Validation:

  • Preflight passed; the pinned DuckDB native dependency graph and task-local Go environment were inspected, and go mod verify passed.

  • All nine existing module tests passed through the assigned test-exec. Receipt: checks/1792404102901743293-4.json; log: module-tests.log.

  • An added diagnostic test file, supplied through a Go overlay without changing source, reproduced both findings. Two regression assertions failed and the LIMIT control passed. Receipt: checks/1792404237359035433-3.json; log: review-regressions-final.log.

  • Source fingerprints, commands, exits and retained logs were reconciled in /home/xupeng/.local/state/mo-bot/jobs/9ae8df51c6f28cca82fd5f3b/attempt-1/review-evidence-audit.json. The frozen checkout remains clean.

Limitations:

  • The supplied evidence reports successful harness CI, but local_validation is empty. The PR's claimed real SF1 runs lack retained artifact pointers and were not independently verified; local checks used small fixtures.

  • Linked issue #30569's body was not supplied. Its requirements were assessed through the PR description and included design.

  • No performance campaign was run. Capture and comparison overhead remains unmeasured; controlled measurement and profiling are follow-up scope.

@aunjgr

aunjgr commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Addressed both findings from the request-changes assessment in commit 76a0815 (current main merged in 345d7fa).

  • verify now checks the input hashes before opening the database. A real persistent DuckDB regression changes both region.tbl and the database contents while keeping the original manifest; the unchanged control passes and the changed input is rejected.
  • Qualification comparison now rejects rows beyond the declared LIMIT and rejects unlimited/mixed receipt variants as qualification. --left-unlimited / --right-unlimited connect the membership validator: the paired full results must agree, match dataset/build/query identities, and prove each selected multiset legal. Proof receipts may cover just the affected limited queries.

Both original false passes reproduced before the patch. All 11 module tests, including 22 CLI scenarios, pass; race, vet, repository-configured lint, package-graph verification, and the pre-push gate pass. The revised comparator also passed all 22 retained real SF1 captures. The PR description now includes their local paths and SHA-256 identities; those artifacts are local to the benchmark workstation.

@mergify

mergify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-19 16:51 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🚫 Left the queue — 2026-10-19 17:06 UTC · at e871d635b97080387f7ac3a4476fe3a7348942db

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

Reason

The pull request #30588 has been manually updated

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

@XuPeng-SH

XuPeng-SH commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · superseded

Commit: e871d635b97080387f7ac3a4476fe3a7348942db

Review belongs to an older commit; it is not a review of the current head.

@mergify mergify Bot removed the queued label Oct 19, 2026
@aunjgr aunjgr changed the title feat: add TPC-H workload qualification for MO and DuckDB feat: add native TPC-H workload tools for MO and DuckDB Oct 19, 2026
@mergify mergify Bot added the queued label Oct 19, 2026
@mergify

mergify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-19 18:07 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🚫 Left the queue — 2026-10-19 18:08 UTC · at 3877c07485cb3f52efee15a093aef10c78d2c668

This pull request spent 1 minute 8 seconds in the queue, with no time running CI.

Reason

The pull request #30588 has been manually updated

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

@mergify

mergify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-19 18:59 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-20 01:35 UTC · at 7c146f4adbf068dd0c06b377157cfb7d7698b1eb · squash

This pull request spent 6 hours 35 minutes 37 seconds in the queue, including 48 minutes 12 seconds running CI.

Required conditions to merge

This branch was previously deployed

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

Labels

kind/feature size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants