Skip to content

ci: move gcc forward with the rest of the toolchain, and record it (ADR-1230) - #1395

Draft
lusoris wants to merge 1 commit into
masterfrom
ci/modern-gcc-toolchain
Draft

ci: move gcc forward with the rest of the toolchain, and record it (ADR-1230)#1395
lusoris wants to merge 1 commit into
masterfrom
ci/modern-gcc-toolchain

Conversation

@lusoris

@lusoris lusoris commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

The clang-tidy lanes install three toolchain components and treated them
inconsistently:

Tool ubuntu-24.04 ships What CI did Rationale in the workflow
clang 18 — can't parse the tree's C++26 installs clang-22 from apt.llvm.org yes, commented
meson 1.3.2 — predates c23 in c_std installs from PyPI yes, commented
gcc 14 used gcc-14 none

Two of three are deliberately pulled past the distro because the tree targets
C23/C++26 (ADR-0692). gcc was left at whatever the runner image shipped. No ADR
pins it — the only gcc-14 mention in docs/adr/ is an incidental line in a
VVenC changelog summary.

This stopped being cosmetic on #1392

The ratchet reported test_pooling_percentile.c: warnings 0 -> 1 (+1) while
Tidy Changed called the same file clean — same runner, same commit, and
that file is not in its exclusion list. It could not be reproduced on gcc-15 or
gcc-16; on both, the only warning was a glibc system-header diagnostic the
ratchet correctly discards.

The cause is structural: clang-tidy parses each TU against the system headers
the C compiler provides
, so a ratchet count depends on gcc's version as much
as on clang-tidy's — and the baseline recorded only clang_tidy_version.
Pinning gcc a major behind every developer's machine while recording nothing
about it makes such a disagreement unexplainable.

The report artifact made it worse: parse_diagnostics() already produces every
diagnostic and the script threw all but the count away, so "which warning?"
had no answer anywhere in CI's output.

Three changes

  1. gcc-15/g++-15 from ppa:ubuntu-toolchain-r/test on the clang-tidy
    lanes — the same treatment clang and meson already get.
  2. The ratchet records cc_version, read from the build directory's
    meson-info/intro-compilers.json so it's the compiler that actually
    produced compile_commands.json, and annotates a mismatch exactly as a
    clang-tidy mismatch already did.
  3. The --report artifact keeps every diagnostic as
    path:line:col: [check]. The baseline stays counts-only so it remains
    reviewable and doesn't churn on line-number shifts.

Reproducer / smoke-test command

meson setup core/build core -Denable_cuda=false -Denable_sycl=false -Db_lto=false
ninja -C core/build
python3 scripts/ci/tidy-ratchet.py --lane cpu --build-dir core/build \
  --only core/src/output.cpp --report /tmp/r.json
python3 -c "import json;d=json.load(open('/tmp/r.json'));print(d['cc_version']);print(len(d['diagnostics']),'diagnostics');print(d['diagnostics'][:3])"

Locally that prints cc (GCC) 16.2.1 20260810 and 29 diagnostics naming check
and location — the information #1392 needed and could not get.

⚠️ Requires a CI-side baseline regeneration

Counts under gcc-15's headers will not equal gcc-14's, so
scripts/ci/tidy-baseline-cpu.json is stale the moment this merges. It must be
rewritten from a CI run, never from a developer machine — a local --write
resolves enable_dnn=auto differently and would rebaseline unrelated files
against the wrong build. Expect this PR's own Tidy Ratchet to fail until that
happens; that failure is the point.

cc_version is optional on read, so the existing baseline loads unchanged and
simply doesn't trigger the mismatch warning until regenerated.

Deliberately out of scope

libvmaf-build-matrix.yml still pins gcc-14 across its legs. Bumping the
product build's compiler surfaces its own crop of new warnings across ten-plus
matrix legs and belongs in a PR whose CI failures are about exactly that.

Deep-dive deliverables (ADR-0108)

  • Research digest — no digest needed: the investigation is ADR-1230 ## Context, and its evidence is feat(core): add percentile pooling methods (median, perc5, perc10, perc20) (ADR-1181) #1392's own CI output.
  • Decision matrixADR-1230 ## Alternatives considered (five options, including the ubuntu-26.04 runner and baselining diagnostics).
  • AGENTS.md invariant note — no rebase-sensitive invariants.
  • Reproducer / smoke-test command — above.
  • Changelog fragmentchangelog.d/changed/1230-modern-gcc-toolchain.md, CHANGELOG.md regenerated.
  • Rebase note — no rebase impact: fork-local CI configuration and tooling, no upstream counterpart.

State (rule 13)

no state delta: CI toolchain configuration, no product bug opened or closed.

🤖 Generated with Claude Code

The clang-tidy lanes install three toolchain components and treated them
inconsistently. clang comes from apt.llvm.org at 22 because ubuntu-24.04 ships
18, which cannot parse the tree's C++26. meson comes from PyPI because the
distro's 1.3.2 predates `c23` in c_std. gcc was left at the image's gcc-14,
with no rationale in the workflow and no ADR pinning it -- the only mention of
gcc-14 in docs/adr/ is an incidental line in a VVenC changelog summary.

That stopped being cosmetic on PR #1392. The ratchet reported
test_pooling_percentile.c going 0 -> 1 while Tidy Changed -- which fails on ANY
warning and does not exclude that file -- called the same file clean, on the
same runner and commit. It could not be reproduced on gcc-15 or gcc-16.

The cause is structural: clang-tidy parses each TU against the system headers
the C compiler provides, so a ratchet count depends on gcc's version as much as
on clang-tidy's, and the baseline recorded only clang_tidy_version. Pinning gcc
a major behind every developer's box while recording nothing about it makes a
disagreement unexplainable.

Three changes:

  - the lanes install gcc-15/g++-15 from ppa:ubuntu-toolchain-r/test;
  - the ratchet records cc_version, read from the build directory's
    meson-info/intro-compilers.json so it is the compiler that actually
    produced compile_commands.json, and annotates a mismatch like it already
    does for clang-tidy;
  - the --report artifact keeps every diagnostic as `path:line:col: [check]`.
    parse_diagnostics() already produced them and the script discarded all but
    the count. The baseline stays counts-only so it remains reviewable and does
    not churn on line-number shifts.

Verified locally: the report now carries `cc (GCC) 16.2.1 20260810` and 29
diagnostics for output.cpp, naming check and location.

This requires a CI-side regeneration of tidy-baseline-cpu.json -- counts under
gcc-15's headers will not equal gcc-14's, and a local --write would resolve
enable_dnn=auto differently and rebaseline unrelated files against the wrong
build.

libvmaf-build-matrix.yml still pins gcc-14; moving it surfaces its own crop of
warnings across ten-plus legs and belongs in its own PR.

Refs: ADR-1230

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lusoris
lusoris force-pushed the ci/modern-gcc-toolchain branch from 86dffa8 to fc9a14c Compare September 7, 2026 16:19
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.

1 participant