Skip to content

Split the two un-batched amd_llvm_coverage s3 parallel stateless jobs into 2 batches - #116209

Merged
alexey-milovidov merged 12 commits into
ClickHouse:masterfrom
groeneai:split-coverage-s3-parallel-stateless-jobs
Oct 11, 2026
Merged

alexey-milovidov merged 12 commits into
ClickHouse:masterfrom
groeneai:split-coverage-s3-parallel-stateless-jobs

Conversation

@groeneai

@groeneai groeneai commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #114417
Related: #113414

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

Stateless tests (amd_llvm_coverage, AsyncInsert, s3 storage, parallel) and
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) are the only
coverage stateless parallel shards still running the whole suite un-batched, and they are the
two that hit the 9000 s job timeout: 43 runs reached the cap in 90 days, 30 reported as error
(18 on ParallelReplicas, 12 on AsyncInsert).

An at-cap kill is an unattributable red: the ordinary functional-test path passes
global_time_limit=0, so there is no graceful stop and praktika's watchdog SIGTERMs the
process group for exit -15 with zero failing tests. On the run that prompted this
(#114417 (comment)) the shard
reported 13153 of 13154 tests and died 184 s past budget. Runtime is drifting: March to August
the p99 of these shards went 5017 to 7551 s, and runs over 8000 s went 4 to 53.

prepare_stateful_data costs ~1431 s and is paid per shard, so the model is
setup + (total - setup)/N. N=2 puts the observed max at 5275 s, 59% of the cap, and at the
measured 507 s/month drift buys ~15 months of headroom. N=3 would cost 2862 extra
runner-seconds per workflow, and 3708b71 merged two-way stateless splits back into
single jobs, so I kept the count at the minimum.

Cost: 2 jobs become 4, i.e. +2 AMD_MEDIUM runners per PR and per master run.

The two sequential counterparts are left un-batched: their p99 is 3944 s and 3216 s.

Nothing is skipped: crc32 hash-batching is a total partition of the same test set and no test
carries the no-batch tag. Workflow YAML is regenerated, not hand-edited.

A residual I measured but am not fixing here: the 1431 s prepare_stateful_data runs on a job
started with --no-stateful. It is required today (121 stateless TPC-DS/TPC-H tests read
tpch./tpcds.), but it is the next-largest lever after this split.


Workflow [PR]
Sync PR [sync-upstream/pr/116209]

Version info

  • Merged into: 26.10.1.2110-master (included in 26.10 and later)

… into 2 batches

`Stateless tests (amd_llvm_coverage, AsyncInsert, s3 storage, parallel)` and
`Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel)`
are the only coverage stateless *parallel* shards that still run the whole
suite un-batched, and they are the two shards that hit the 9000 s job timeout:
21 at-cap runs in 90 days, every single one reported as `error`.

An at-cap kill is an unattributable red. The ordinary functional-test path
passes `global_time_limit=0`, so there is no graceful stop: praktika's job
watchdog SIGTERMs the process group and the job exits -15 with zero failing
tests. On PR ClickHouse#114417 head f1b87f1 the shard
reported 13153 of 13154 tests and died 184 s past its budget with one worker
still inside its last test.

Runtime is drifting: over Mar->Aug the AsyncInsert parallel shard's p99 went
4397 -> 5936 s (p50) and 5121 -> 7655 s (p99), and runs over 8000 s went from
0 in April to 127 in August, against a 9000 s cap.

`prepare_stateful_data` costs ~1431 s and is paid per shard, so the model is
`setup + (total - setup)/N`. N=2 puts the observed max at 5276 s (59% of the
cap) and, at the measured 507 s/month test-phase drift, buys ~15-18 months of
headroom. N=3 would cost 2862 extra runner-seconds per workflow for headroom
nobody has asked for, and 3708b71 merged two-way stateless splits back
into single jobs, so the batch count is kept at the measured minimum.

The two `sequential` counterparts are deliberately left un-batched: their p99
is 4071 s and 3296 s.

Cost: 2 jobs become 4, i.e. +2 AMD_MEDIUM runners per PR and per master run.

The per-batch coverage artifact names had to be generated rather than listed:
the four `_ft_s3*` entries in `LLVM_FT_ARTIFACTS_LIST` were hardcoded
singletons, unlike every sibling shard's generated list, and that list feeds
both `ArtifactConfigs.llvm_profdata_file` and `llvm_coverage_job.requires`.

Workflow YAML is regenerated, not hand-edited.
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Aug 24, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (Gate B) and adjudication

Gate B (independent cold re-review, codex, $10.94): 0 findings. Diffstat verified as the
intended change set (4 files, 198+/35-, 0 new untracked files). Its coverage statement: changed
Python definitions, generated job blocks, callers, batching and artifact paths, sibling shards,
existing coverage tests, plus generation equality, artifact providers and CRC32 partition
completeness.

My own cold review raised 4 findings, all in the PR-facing text rather than the change. All 4
AGREEd and corrected before this PR was opened.

# Finding Verdict Resolution
❌ The draft claimed "21 at-cap runs in 90 days, every one reported as error". Not reproducible, and the universal quantifier is false AGREE Corrected to the re-measured 43 at-cap runs / 90 d, 30 error (18 ParallelReplicas, 12 AsyncInsert). Two non-error at-cap runs verified individually: 015850ec0458113 (10220.6 s, success), 01349eb24bdff09 (10492.7 s, failure). The 21 looks like a 30 d count labelled 90 d
⚠️ The draft claimed p99 drift "5121 to 7655 s" and over-8000 s runs "0 to 127". Neither reproduces; March is 4, not 0 AGREE Corrected to p99 5017 to 7551 s and over-8000 s 4 to 53, both shards, DISTINCT (check_name, commit_sha, check_duration_ms). Recomputing the drift from the corrected series gives 506.7 s/month, so the 507 s/month sizing input and the N=2 conclusion are unchanged
💡 The two sequential p99s were given as 4071 / 3296 s AGREE Corrected to 3944 / 3216 s
💡 Internal evidence stated the per-shard split as "12 vs 9" AGREE Corrected to 18 / 12 in the internal record. The conclusion it supported (fix both shards, not only the one named in #114417) is unaffected

Verification I ran independently of the implementation, each with a live negative control so an
empty result means something:

  • Artifact registration. MISSING: [] / STALE: []. Control: dropping one flavor from the
    comprehension makes the oracle report the 2 missing names and makes praktika yaml exit 1.
  • YAML idempotency. Regenerating from a clean git archive export reproduces both workflow
    files byte-identically and touches no other workflow. Control: bumping the batch constant to 3
    changes them; restoring makes them identical again.
  • Aggregator wiring. Each new job id: 1 definition, 2 needs references (llvm_coverage,
    finish_workflow). Old ids referenced 0 times repo-wide. Job counts 175 to 177 (PR) and 163 to
    165 (master), i.e. exactly +2 each.
  • No coverage loss. crc32(name) % total over the real 14126 test names splits 7095/7031;
    no-batch-tagged tests: 0 (control no-random-settings: 525 files).
  • ci/tests/test_selected_tests_run.py, test_job_filtering.py, test_llvm_coverage_gate.py:
    105 passed. ruff clean on both changed files.

Session id: cron:clickhouse-review-slot-49:20260824-224900

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Aug 24, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate
# Check Answer
a Deterministic repro Yes. On pristine master, enumerating JobConfigs.functional_tests_jobs shows the 2 coverage s3-parallel shards running the whole 13154-test suite un-batched; the CI symptom is 43 at-cap runs in 90 days, 30 of them reported error.
b Root cause explained Suite volume under coverage instrumentation against a fixed 9000 s job cap, with the ordinary functional-test path passing global_time_limit=0 so there is no graceful stop: praktika SIGTERMs the process group, exit -15, zero failing tests.
c Fix matches root cause Divides the suite rather than moving the cliff. Raising the timeout was rejected as the primary fix because the measured 507 s/month drift eats any constant.
d Test intent preserved Nothing skipped, no assertion weakened, no test file edited. crc32 hash-batching is a total partition of the same test set, and 0 tests carry the no-batch tag.
e Both directions Base: 2 jobs, 0 batched. Fix: 4 jobs, all batched with correctly wired per-batch coverage artifacts.
f General across code paths Both un-batched shards are fixed, not only the one reported: ParallelReplicas has the worse record (18 vs 12 at-cap error runs). Verified from source that no third un-batched coverage parallel job exists.
g Generalizes across inputs All 4 batch/flavor combinations enumerated and artifact-checked. The 2 sequential counterparts are deliberately untouched (p99 3944 s and 3216 s).
h Backward compatible No setting, serialization format, or user-visible behavior changes. Job names change, which is inherent to a split and precedented 3 times in this file. Release, backport and nightly-coverage workflows are unaffected.
i Invariants preserved Every batch's coverage profile is declared in LLVM_FT_ARTIFACTS_LIST and consumed by the aggregator, verified with an oracle plus a negative control. YAML regeneration is idempotent, which is the predicate Config Workflow evaluates.

@clickhouse-gh

clickhouse-gh Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4e5b86e]

Summary: ✅


AI Review

Summary

This PR splits the two amd_llvm_coverage s3 storage, parallel stateless shards into 2 batches and updates the generated workflow/artifact wiring accordingly. The new job names and LLVM_COVERAGE_FILE_* artifacts are internally consistent, but the PR still leaves the split unvalidated on the change that introduces it because none of the coverage-equivalent jobs run for this diff by default.

Findings
⚠️ Majors
  • [dismissed by author -- https://github.com/Split the two un-batched amd_llvm_coverage s3 parallel stateless jobs into 2 batches #116209#discussion_r3887004944] [ci/defs/job_configs.py:936, ci/defs/job_configs.py:2225] The PR changes the source of truth for the coverage shards, but Praktika still does not exercise any coverage-equivalent path on this exact 4-file diff. Reproducing the production order on the current head shows every amd_llvm_coverage job is skipped by should_skip_job because ci/defs/defs.py / ci/defs/job_configs.py are not treated as ci-coverage, and then all four arm_binary replacements are dropped as Not affected by changed files and not required because the relevant digest configs do not include those source-of-truth files. That means the new _1/2 / _2/2 jobs can merge without ever being run once unless someone remembers to force an extra label/manual run. Suggested fix: either make the coverage-pipeline exception mark the replacement jobs affected for ci/defs/*.py changes, or add these source-of-truth files to the relevant digest configs so the coverage/replacement jobs actually run on PRs that rewire them.
Final Verdict

⚠️ Not ready as-is: the batching itself is wired consistently, but the changed-files filtering still prevents this PR from validating the new coverage shard topology on the introducing change.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 24, 2026
@groeneai groeneai mentioned this pull request Aug 24, 2026
1 task done
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @maxknv, could you review this? It hash-batches the two coverage s3-parallel stateless shards into 2, the only coverage parallel shards still running the whole suite, because they are the ones hitting the 9000 s job cap; I kept N at 2 rather than 3 since 3708b71 merged two-way stateless splits back into single jobs.

The only conflicts were the two praktika-generated workflow YAMLs. Both were
resolved by regenerating them from the merged ci/defs/ sources
(PYTHONPATH=./ci:. python3 -m praktika yaml), so they stay a pure function of the
job definitions instead of a hand-merge.

Master's own edits to the two carrier files (the Docs examples job, the SQLancer
arm_release parameter sets) merged cleanly and are untouched: the diff against
master is still exactly the four files of this PR, 198+/35-.
Master dropped WasmEdge from the coverage suite and renamed the constants and
artifact names of the old-analyzer + s3 + DBReplicated shards accordingly, which
collided with the two additions this branch makes next to them: the new
LLVM_FT_S3_PARALLEL_NUM_BATCHES constant and its import.

Both Python conflicts take master's renames and keep this branch's additions; the
+/- line set of the branch's Python delta is byte-identical before and after the
merge. The two GitHub workflow files are praktika output, so they were reset to
master's copies and regenerated with `PYTHONPATH=./ci:. python3 -m praktika yaml`
rather than hand-merged. The regenerated job-id sets differ from master's by
exactly the two un-batched coverage jobs removed and the four batched ones added,
in both workflows, so no job master added in the drift was dropped.
Comment thread ci/defs/job_configs.py Resolved
The two conflicts were in the generated `master.yml` and `pull_request.yml`; the
source of truth, `ci/defs/defs.py` and `ci/defs/job_configs.py`, merged cleanly.
Regenerated both with `python3 -m ci.praktika yaml` rather than hand-merging the
job lists, which is also what `Check Workflows` compares against. The result
carries this branch's batching - `stateless_tests_amd_llvm_coverage_asyncinsert_
s3_storage_parallel` and `..._parallelreplicas_s3_storage_parallel` each split
into `_1_2`/`_2_2` - and keeps master's own job list changes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Comment thread ci/defs/job_configs.py Resolved
The conflict was the generated `finish_workflow` `needs:` list: master dropped the
`ci_tests` lane with the removal of that job, while this branch splits two
llvm-coverage stateless jobs into batches. `ci/defs` merged cleanly, so the YAMLs
were regenerated with `python3 -m ci.praktika yaml` rather than hand-merging the
list - which is also what `Check Workflows` compares against.

The result keeps this branch's batching
(`..._asyncinsert_s3_storage_parallel_1_2`/`_2_2` and
`..._parallelreplicas_s3_storage_parallel_1_2`/`_2_2`), carries no `ci_tests`
lane, and differs from master only by this branch's own changes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Take master's LLVM_FT_S3_DB_REPL_* rename next to the added
LLVM_FT_S3_PARALLEL_NUM_BATCHES; regenerate the workflows from the
merged config.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only the generated workflows conflicted. They were reset to master's
copies and regenerated with `python3 -m praktika yaml`; ci/defs merged
cleanly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only the generated workflows conflicted. They were reset to master's
copies and regenerated with `python3 -m praktika yaml`; ci/defs merged
cleanly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov alexey-milovidov self-assigned this Oct 11, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 11, 2026
Merged via the queue into ClickHouse:master with commit 70da4c8 Oct 11, 2026
165 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). groeneai-origin-request PR origin: a maintainer pinged or directed groeneai manual approve Manual approve required to run CI pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants