Skip to content

Add TPC-Havoc correctness runs to the Presto nightly (CPU, GPU, GPU without CPU fallback) - #431

Open
karthikeyann wants to merge 2 commits into
rapidsai:mainfrom
karthikeyann:karthikeyann/tpc-havoc
Open

karthikeyann wants to merge 2 commits into
rapidsai:mainfrom
karthikeyann:karthikeyann/tpc-havoc

Conversation

@karthikeyann

@karthikeyann karthikeyann commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds TPC-Havoc correctness runs for Presto and runs them in the Presto nightly. TPC-Havoc is the 22 TPC-H base queries plus 220 rewritten variants of them (10 per query, generated by BenchBox) that must return the same results. It exercises query shapes and grammar that plain TPC-H doesn't, to track Presto GPU stability and coverage.

The general config fixes this work needed on a 256-core host (memory from MemTotal, worker nofile ulimits, task.max-drivers-per-task capped at 255) moved to #425. The CI runners are smaller, so this PR doesn't depend on it.

What's included

  • presto/scripts/run_tpc_havoc.sh and presto/testing/tpc_havoc/: the runner.
    • Runs all 242 queries one at a time against a running cluster. The SQL comes from a pinned BenchBox commit, so it is identical every run.
    • Checks each result's full values, not just row counts, against:
      • its base TPC-H query,
      • DuckDB on the same Parquet data (--duckdb-data-dir, with an optional result cache keyed by query, data dir and SQL),
      • optionally an earlier run (--reference-dir, e.g. GPU vs CPU).
    • known_issues.yaml lists the expected failures (query globs, engines, scale factors, message regex, optional minimal repro SQL), so the run exits 1 only on new failures.
    • Writes summary.json and summary.md (failures grouped by reason, with repro commands). run_tpc_havoc.sh only sets up the venv and waits for the worker; all other options go straight to run_tpc_havoc.py.
  • start_native_gpu_presto.sh --no-cpu-fallback: sets cudf.allow_cpu_fallback=false, so operators cuDF can't execute fail instead of quietly running on the CPU. Runner engine label: gpu-no-fallback.
  • Worker reasons: without CPU fallback the client only sees !isPureCpuOperator Replacement with cuDF operator failed. For that error the runner reads the worker log lines written while the query ran (presto/scripts/presto_logs/worker_*.log, waiting at most 2 s) and records what velox-cudf logged (Validation failed at function: ...) as worker_reason. Failures are grouped by its category, e.g. switch(...) becomes "multi-branch CASE (switch) expression not supported".
  • nightly_summary.py (standard library only): one Markdown summary of several runs, printed at the end of the job log and appended to the job summary.
    • A table per engine: ran OK, wrong results, errors, new and known failures.
    • Failures grouped by reason, new failures first. Each group lists the engines and queries, the error, the worker-log reason, a repro command, the minimal repro SQL if known, and one query's SQL.
    • A short Slack message: the table, new failures with repro commands, and known issues that now pass.
  • .github/workflows/presto-tpc-havoc.yml:
    • Generates SF10 data and registers and analyzes the tables once.
    • Runs CPU, GPU, and GPU without fallback on linux-amd64-gpu-rtxpro6000-latest-1 with the CUDA 13.1 image.
    • Fails only on new failures.
    • With post_to_slack (default false), posts the summary to #swrapids-velox-cudf-nightly. It uses the same action and webhook secret (SLACK_WEBHOOK_NIGHTLY_STATUS_URL) as nightly-status-report.yml. The secret is declared as an optional workflow_call secret.
  • presto.yml runs it next to presto-test, with the same needs and run_tests condition.
    • post_to_slack is github.event_name == 'schedule', so only the scheduled nightly posts (both the upstream and pinned variants); manual dispatches don't.
    • The webhook secret is passed explicitly. presto-nightly.yml already forwards secrets with secrets: inherit.

Example Slack message

From a live GPU-without-fallback run of queries 1, 5 and 16, with --known-issues '' so that every failure counts as new:

:red_circle: *TPC-Havoc SF10 (live, known issues disabled)*

Engine                  OK  Wrong  Errors  New
GPU no fallback      24/33      0       9    9

*New failures (action needed):*
• velox-cudf: Aggregation aggregation cannot be evaluated by cuDF (GPU no fallback: Q1_V6, Q16_V7)
   repro: `presto/scripts/start_native_gpu_presto.sh --no-cpu-fallback && presto/scripts/run_tpc_havoc.sh -s tpch_sf10 -e gpu-no-fallback -q Q1_V6`
• velox-cudf: multi-branch CASE (switch) expression not supported (GPU no fallback: Q1_V10, Q5_V10)
   repro: ...
• velox-cudf: avg does not support input type DECIMAL(15, 2) on cuDF (GPU no fallback: Q1_V8)
• velox-cudf: decimal constant expression not supported (GPU no fallback: Q5_V4)
• velox-cudf: element_at() not supported (GPU no fallback: Q16_V10)
• SYNTAX_ERROR: line N:N: Column 'revenue' cannot be resolved (GPU no fallback: Q5_V7)
• SYNTAX_ERROR: line N:N: Function list not registered (GPU no fallback: Q1_V7)

With the default known issues, the same run reports no new failures and lists the 7 known reasons only in the job summary.

Results (presto master b11f2053bbc, velox main b2bff1217, 1 worker, SF10)

Engine Ran OK Wrong results Errors
CPU 233 / 242 0 9
GPU (velox-cudf, CPU fallback on) 230 / 242 0 12
GPU, no CPU fallback 208 / 242 0 34
  • Every engine: 9 errors are SQL-dialect issues. They are BenchBox V7 variants: 7 reference SELECT aliases Presto can't resolve, 1 uses FILTER on a window function, and 1 uses DuckDB's list().
  • GPU only:
    • Q8_V10 and Q9_V10: on GPU, EXTRACT(YEAR …) comes out as INT16 instead of BIGINT, so a CASE mixing it with another BIGINT fails in cudf::copy_if_else.
    • Q7_V10: runs out of memory on GPU; it takes 2 s on CPU.
  • GPU without fallback: 25 cuDF coverage gaps, 13 of them multi-branch CASE.

All of these are listed in known_issues.yaml. GPU SF100 shows the same pass/fail set. At SF100 the DuckDB check of Q22 also differs: Presto rounds AVG(DECIMAL) to the input scale, while DuckDB uses DOUBLE. This is listed as a known engine difference.

Testing

  • Ran all 242 queries locally for CPU SF10/SF100, GPU SF10/SF100, and GPU-without-fallback SF10/SF100.
  • Live check of the worker reasons on a GPU worker without CPU fallback (queries 1, 5, 16). Every cuDF failure got its reason:
    • Q1_V6, Q16_V7: aggregation;
    • Q1_V8: avg over DECIMAL(15,2);
    • Q1_V10, Q5_V10: switch;
    • Q5_V4: decimal constant 0.0000;
    • Q16_V10: element_at.
  • tpc_havoc_runner_test.py: 25 tests pass in under a second.
  • pre-commit (ruff, codespell, zizmor) passes on the changed files.
  • The workflow has not run in CI yet.

Open questions

  • BenchBox is pinned to 172276a3, installed from a source archive. A local BenchBox fix for the Q16_V6 variant isn't upstream yet, so Q16_V6 is listed as a known issue.
  • The nightly runs TPC-Havoc for both the upstream and the pinned variant, so it posts two Slack messages each night. Is that OK, or should only one variant post?

@copy-pr-bot

copy-pr-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@karthikeyann
karthikeyann marked this pull request as ready for review October 12, 2026 14:08
@karthikeyann
karthikeyann requested a review from a team as a code owner October 12, 2026 14:08

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

Can we separate general fixes into a separate PR from the TPC-Havoc implementations?

Comment thread .github/workflows/presto-tpc-havoc.yml Resolved
Comment thread .github/workflows/presto-tpc-havoc.yml Resolved
@karthikeyann

karthikeyann commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

@bdice Split out as you asked. The general fixes are now in #425: memory from MemTotal and the GPU worker nofile limit were already there, and I added the 255-driver cap and the CPU worker nofile limit to it. This PR now has only the TPC-Havoc changes, plus the --no-cpu-fallback start option, which only TPC-Havoc uses. It does not depend on #425, since the CI runners have fewer than 256 cores.

@karthikeyann

karthikeyann commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@bdice Created issues facebookincubator/velox#19585 and facebookincubator/velox#19586 to track fixes for the GPU failures.

Run the BenchBox TPC-Havoc suite (22 TPC-H base queries plus 220
semantically equivalent variants) against a running Presto cluster and
validate every result by value against its base query, DuckDB on the
same Parquet data, and optionally an earlier run (e.g. GPU vs CPU).

- presto/scripts/run_tpc_havoc.sh + presto/testing/tpc_havoc/: runner
  with pinned BenchBox and a known-issues file (exit 1 only on new
  failures). Writes summary.json, summary.md (failures grouped by
  reason, with repro commands) and an HTML report; combined_report.py
  compares several runs in one HTML report.
- start_native_gpu_presto.sh --no-cpu-fallback
  (cudf.allow_cpu_fallback=false) to measure GPU coverage. The client
  then only sees "Replacement with cuDF operator failed", so the runner
  reads the reason velox-cudf logged from the worker log
  (worker_reason) and groups failures by it.
- nightly_summary.py: one Markdown summary of several runs (engine
  table, failures by reason with new ones first, repro commands, SQL)
  for the CI log and job summary, plus a short Slack message.
- .github/workflows/presto-tpc-havoc.yml: CPU, GPU and GPU without CPU
  fallback at SF10 on an RTX PRO 6000 runner with CUDA 13.1; fails only
  on new failures; posts the summary to Slack with post_to_slack.
  presto.yml runs it next to presto-test, and only the scheduled
  nightly posts to Slack.
…by-one count

The entry matched any Q22 mismatch against DuckDB at SF100. Match only the
known difference (one cell in the count column, off by exactly 1), so any
other Q22 difference is still reported as a new failure. Also document the
alternative fix (round AVG in the DuckDB reference SQL like Presto), which
is deliberately not applied so the difference stays visible.
@karthikeyann
karthikeyann force-pushed the karthikeyann/tpc-havoc branch from 3e39d06 to 1812534 Compare October 15, 2026 06:22
@copy-pr-bot

copy-pr-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

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

Comparing full answers across CPU, GPU, and strict GPU is useful coverage, and the narrowly scoped known-issue entries help keep the nightly actionable. One gap: when a requested DuckDB reference fails, _check_against marks the comparison 'not-validated', and _classify_failures doesn't count that as a failure. So execution can pass while the independent correctness check disappears. Could a missing requested reference make the run incomplete/non-green, with an explicit exception for known reference limitations? Comparing variants with their base is still useful, but the same engine can be wrong consistently across both.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants