CI overview¶
Run the local gate before you push, then let CI repeat it. This page tells a contributor which checks exist, which of them block a merge, and where to find the detail. The authoritative trigger and gate behaviour lives in the workflow files under .github/workflows/; the topic pages linked below carry the long procedures.
Before you push¶
Run the local subset of CI. It catches the usual formatter, lint and fast-test failures in seconds, against a 10-minute CI round trip:
make verify-all # HISS/context/evidence, duplicate implementations, docs gate
make dedupe-check # fast standalone AST clone scan
make format-check # clang-format + black + ruff, no writes
make lint # configured native + Python, shell, Markdown, Go and docs checks
make test-fast
bash scripts/ci/twin-drift-check.sh # .c/.cpp twin drift + stale source refs (ADR-1135)
pre-commit run --all-files # if .pre-commit-config.yaml hooks are installed
The format-check and pre-commit pair catches roughly the same surface as the pre-commit job of lint-and-format.yml.
The Makefile governance targets (verify-all, compile-context, audit, hiss-coverage, dedupe-check) run the engine the repository pins through .config/praetor/engine.mk (make praetor-engine-path prints its path), never the binary on PATH (issue 3468).
The duplicate scan is deliberately separate from standardsctl audit: the audit baseline does not include AST clones. make verify-all, pre-commit, pre-push and the required Standards job therefore invoke standardsctl dedupe scan . explicitly. A finding is a hard failure; there is no origin, generated-code or historical-debt exemption.
| Topic | Page |
|---|---|
| Configure a lint build, read receipts, cppcheck models | Local lint |
| Whole-tree clang-tidy baselines and lanes | Tidy ratchet, measuring the lanes |
docs/state.md gates and rebase conflicts | state.md gates |
| Praetor documentation gate, text register, pin moves | Praetor gate |
| Display names of every check | CI job display names |
Workflows¶
The files under .github/workflows/ and what each is for. Which checks block a merge is decided by the aggregator; for the mapping of shortened names and conventions see CI job display names, and for every build lane, whether it is required and which ADR owns it, see ADR-1259.
Pull-request checks¶
| File | Purpose |
|---|---|
required-aggregator.yml | Single required-check aggregator (ADR-0313). |
ci-tier.yml | Reusable workflow every pull-request workflow calls first: decides the tier (ADR-2169); no trigger of its own. |
ci-escalate.yml | Re-runs the suite at the full tier when ci: full or autorelease: cut is applied (called from pr-label-lanes.yml); cancels every running run first and awaits them together within one 180-second bound, then re-runs them; names every run it could not re-run and then fails (ADR-3279). |
lint-and-format.yml Trivy | Trivy config + fs scans (ADR-3330). |
lint-and-format.yml | Pre-commit, clang-tidy (changed files plus the whole-tree ratchet, ADR-1142), cppcheck, mypy, registry validate, twin-drift gate (ADR-1135), buf lint + buf breaking on proto/ (API generation). |
lint-and-format.yml Spectral OpenAPI Lint | Spectral (spectral:oas) on api/openapi/ (API generation, ADR-3331). |
standards-gate.yml | Required HISS and context verification and the fail-closed duplicate-implementation scan. |
rule-enforcement.yml | ADR-0100, 0106, 0108 and 0165 process gates. |
tests-and-quality-gates.yml | Netflix golden, sanitizers, tiny-AI, MCP, coverage, assertion density, the test-suite registry and tooling suite (Tooling Tests) and the Python package suites (Python Package Tests (<suite>)); which job runs which test suite: test suites. |
security-scans.yml | Semgrep, CodeQL, Gitleaks, Dependency Review and the OpenSSF Scorecard PR policy (Scorecard PR Gate, ADR-1247). |
libvmaf-build-matrix.yml | Cross-platform, cross-backend libvmaf build matrix: 17 lanes, six of them required. |
build.yml | One all-backend build per OS (Linux Intel LLVM, macOS Clang+Metal, Windows MSVC+CUDA (full)), alongside the matrix; required since ADR-1297. |
go-ci.yml | Required Go modernization, vet, security scan, runner smoke and tests (ADRs 1238 and 1338). |
ffmpeg-integration.yml | FFmpeg plus libvmaf build (Linux GCC, macOS Clang, SYCL). |
ffmpeg-patch-stack.yml | Replays the cumulative FFmpeg patch series (see FFmpeg patch automation). |
ffmpeg-integration.yml job consumers | Unpatched upstream FFmpeg and GStreamer against the installed compat libvmaf.so.3, scores compared with the CLI and the base commit (full tier; see upstream consumers). |
sycl-parity.yml | SYCL parity on the self-hosted Intel Arc A380 runner (ADR-1177; see the runbook). |
docs.yml | Docs build, and the Doxygen build of the public C API (required since ADR-1297). |
docker-image.yml | Docker image build. |
release-dry-run.yml | Builds the release images and the vmaf-mcp distribution and SBOM without publishing (ADR-1595); required context Release Dry Run on pull requests (ADR-1687). |
windows-tester-bundle.yml | The Windows tester zips: the x64 zip on a pull request, all four on a push, published on dispatch; required context Windows Tester Zip (ADR-1687). |
dev-container-build.yml | PR-time build gate for dev/Containerfile (ADR-0819). |
helm-chart.yml | helm lint of the chart. |
rust-ci.yml | Rust crates: cargo fmt --all and clippy --workspace, cargo test --workspace, the golden smoke example and cargo-deny; the planner may skip the work, the gates vmafx-sys CI and cargo-deny are required. |
sanitizers.yml | Combined ASan and UBSan on full-tier pull requests and master pushes, TSan on master pushes, nightly fuzzing. |
praetor-docs.yml | Praetor's Documentation Governance gate for the docs:seo-portal facet; praetor-managed, not required. See Praetor gate. |
praetor-api.yml | Praetor's Go API Compatibility gate (go-apidiff over every Go module; no path filter). Praetor-managed; required through the aggregator (ADR-1506), its marker sits in standards-gate.yml. |
reuse.yml | Praetor's REUSE lint gate (reuse lint over the whole tree; no path filter), the one CI run of reuse lint. Written by praetor, its actions pinned to commits here; required through the aggregator (ADR-2784), its marker sits in standards-gate.yml. See Praetor gate. |
pr-type-label.yml | Derives a type:* label from the Conventional-Commit prefix of the PR. Runs on pull_request; a fork PR gets a notice and a maintainer adds the label by hand. |
Scheduled, release and watcher workflows¶
| File | Purpose |
|---|---|
nightly.yml | Nightly jobs, including the whole-tree clang-tidy ratchet of the cpu lane and the sweep of every other lane (ADR-2796). |
nightly-bisect.yml | Nightly bisect-model-quality smoke against a committed fixture timeline. |
fuzz.yml | Nightly libFuzzer smoke over every harness under core/test/fuzz/. |
scorecard.yml | Weekly OpenSSF Scorecard scan. |
e2e-k8s.yml | Kubernetes integration harness for the VMAFx runtime; schedule-gated, and called from pr-label-lanes.yml on a labelled pull request. |
release-please.yml | On each push to master: opens or updates the release PR, or creates the draft release (ADR-1127, ADR-1128). |
supply-chain.yml | Build provenance, Sigstore signing and SBOM when a release draft is published. |
dev-container-publish.yml | Builds, pushes and signs the canonical dev container image to GHCR, only into a private package (ADR-1564). |
docker-publish-production.yml | Builds, pushes, signs and SBOMs the production image on release publication. |
docker-publish-operator-node.yml | The same for the VMAFX Go service images. |
published-rc-licence-companions.yml | Manual: notices, <tag>-source companions and SBOMs for the images and release files published for 1.0.0-rc.1 and rc.2 (ADR-1578). |
docker-publish-tester.yml | Builds, tests, signs and attests the tester image; its pull-request run (the amd64 image) is the required context Tester Image (ADR-1687). |
macos-tester-bundle.yml | Builds, tests, attests and publishes the macOS arm64 tester bundle. |
upstream-watcher.yml | Polls FFmpeg master for upstream-blocked features (upstream watchers). |
upstream-ffmpeg-hip-hwdec-watcher.yml | Weekly watch for an FFmpeg ROCm/HIP hwdec context type (ADR-0448). |
upstream-netflix-955-watcher.yml | Watches Netflix/vmaf#1494, the upstream fix for #955 (ADR-0448). |
research-radar.yml | Weekly digest of changes in the public video-quality sources of the research radar (ADR-2171). |
Python type-check gate¶
Python Lint is a required, fail-closed check. It installs the reviewed requirements/locks/mypy.txt lock and runs the same merge-base gate as the local mypy-local pre-push hook:
The gate checks added, copied, modified, renamed and type-changed tracked *.py paths under ai/ and scripts/. It reports each finding that occurs more often than at the selected merge base, but an analysis crash, a missing tool, base or file, or an unattributable nonzero status fails the job. ai/src/ is checked separately with --explicit-package-bases so each module has one canonical identity.
Pull requests compare with origin/master. A master push compares with the event's previous commit, so hosted post-merge validation covers the pushed range. See ADR-1310 and the detailed hook contract.
Draft pull requests defer heavy CI¶
A draft PR cannot satisfy the required aggregator. Per ADR-0331, every pull_request-triggered workflow is gated to skip while the PR is a draft, except the aggregator, which explicitly fails drafts:
- each workflow's
pull_request:block liststypes: [opened, synchronize, reopened, ready_for_review]; - the first job of the workflow,
tier, carries anif:clause of the formgithub.event_name != 'pull_request' || github.event.pull_request.draft == falseand every other job needs it (ADR-2169; before that each job carried the clause itself). The workflows that cannot carry it are the two praetor-locked ones, listed under Which jobs run when.
What this means for contributors:
- A draft PR cannot satisfy the required aggregator. The aggregator starts and fails with a request to mark the PR ready. Heavy jobs remain skipped until ready-for-review, so skipped draft-era checks are never mistaken for completed validation.
- Promoting the draft to ready-for-review fires CI exactly once. GitHub's
ready_for_reviewevent re-triggers the workflows; latersynchronizeevents on the now-ready PR fire CI as before. - Pushing to
masteris unaffected. The job-levelif:clause short-circuits totruewhen there is no PR object (for example onpush:events).
To preview CI status before merging, mark the PR ready-for-review. You can flip back to draft afterwards; the next ready_for_review fires a fresh matrix.
Which jobs run when (ADR-2169)¶
A pull request does not owe the whole suite. The tier of an event decides which required contexts run; one file, .github/ci-tier.json, defines the tiers, and the workflows and the aggregator both read it.
| Event | Tier | What runs |
|---|---|---|
| Pull request from a fork | full | everything |
| Pull request from this repository (Renovate included) | light | lint, format, the fast suite and the governance gates |
Own pull request with the label ci: full | full | everything |
Release pull request (release-please-- branch, bot author or the maintainer account with a release-only diff) | release-light | Release Script Contract |
Release pull request with the label autorelease: cut | full | everything |
| Draft pull request | none | nothing, but the aggregator, which fails it |
Push to master, dispatch, schedule | full | everything |
| Push to another branch, push of a tag | none | nothing |
The light tier is every required context except the full_only list of ci-tier.json: the platform legs of the build matrix (the Ubuntu gcc+DNN and clang+DNN legs stay), the all-backend Build lanes, Windows and macOS legs, GPU builds, coverage, sanitizers, the dev container, docker image, FFmpeg integration, tester and release dry-run lanes, and the self-hosted hardware lanes. Those run on the master push, so a break in them is found there, after the merge train landed the change. To see one on a pull request, add the label ci: full.
An own pull request also escalates to the full tier automatically when any changed file matches full_paths in .github/ci-tier.json, when that tier definition changes, or when changed paths cannot be read from the API (audit; ADR-3536). Patterns use Python fnmatch.fnmatchcase (* crosses /, case-sensitive, full-string match), and scripts/ci/ci_tier.py --check-full-paths verifies in pre-commit and pre-push that every entry matches at least one tracked file. To add a path, append the explicit repository-relative path to full_paths in .github/ci-tier.json and verify with python3 -B scripts/ci/ci_tier.py --check-full-paths and python3 -B scripts/ci/tests/test_ci_tier.py.
Changing the tier definition owes full CI even when the change removes the last pattern, and that rule holds for exempt release pull requests too: a release branch touching .github/ci-tier.json runs the full tier even without autorelease: cut. Release branches also owe full CI when their changed paths cannot be fetched; an unavailable diff never earns the release exemption.
What a contributor sees:
-
Every workflow shows a job
CI tier (<workflow>) / Decide the CI tierfirst; the other jobs of the workflow appear when it completes (GitHub creates a job that needs another only then), and the aggregator waits for the tier decisions before it judges which contexts are missing. -
A job the tier does not run shows as skipped. The aggregator accepts a skipped or absent context the tier does not owe, and still fails one that ran and failed. The matrix legs of
libvmaf-build-matrix.ymlare the one place a job starts and stops: a matrix cannot be filtered per leg, so a full-tier leg on a light-tier pull request ends after a shallow checkout with a notice. The two rows ofwindows-gpu-buildhave the same shape (ADR-3279): the job starts on a light-tier pull request only when the diff selectswindows_msvc_sycl(or the planner job failed), theWindows MSVC+SYCLrow then builds, checks the installed library names and runs the two SYCL registration tests, and theWindows MSVC+CUDArow ends with the notice. That row's check is green without a build: the notice says whether MSVC+CUDA compiled. - Adding the label
ci: full(orautorelease: cutto the release pull request) makespr-label-lanes.ymlcallci-escalate.yml, which re-runs the latest run of each workflow on the head commit. Every re-run decides its tier again from the live labels, so the skipped jobs now run and the aggregator waits for them. Removing the label does not cancel anything; the next push is light again. A run that is still in progress is cancelled and awaited first; a run that completed in the meantime answers the cancel with 409, which is no error. A run that cannot be re-run is printed with its reason, the runs after it are still started, and the step then fails with the count: read the step's log for the workflows to re-run by hand. - The release pull request is refreshed on every merge to master. Without the cut label it runs
Release Script Contractonly, which is the check that proves the cut ran. The maintainer appliesautorelease: cutwhen the release is to be cut, and the full suite runs once on the exact head. - A pull request from a fork always runs the full tier: the head repository is compared with
github.repositoryinscripts/ci/ci_tier.py. - A branch named
release-please--...is not enough to be the release pull request:scripts/ci/release-pr-exempt.shchecks the author and, for the maintainer account, that the diff touches only release files (ADR-1151, ADR-1388). Anything else is an ordinary own pull request.
How a workflow takes part: its first job is tier, a call of ci-tier.yml. Light-tier jobs gate on needs.tier.outputs.light == 'true', full-tier jobs on needs.tier.outputs.full == 'true'; a planner workflow gates its impact job and its gate job, and a gate job is always() && needs.tier.outputs.<tier> == 'true'. The tier job also carries the draft gate of the previous section. The exceptions (jobs without the tier, each with a reason and an expiry) are the untiered_jobs of ci-tier.json: the aggregator, Release Script Contract, the label and escalation workflows, the opt-in e2e gate, and the praetor-managed praetor-api.yml and praetor-docs.yml. The last two are locked byte for byte by praetorctl audit. Since the pin 7458a220e1c9 (praetor#815) they push only on master and listen for opened, synchronize, reopened and ready_for_review, so they no longer start on a push to another branch. On a draft their first step fails closed and every later step is skipped: the job starts and reports a red check but does no work. A job-level gate cannot be added to a byte-locked file, so they stay in untiered_jobs, and test_praetor_managed_jobs_stop_on_a_draft_before_any_work holds the step shape. push_branch_exceptions is empty.
Adding a required context: add it to the aggregator required list and the # required-aggregator marker as before, and to full_only or always in ci-tier.json if it is not a light-tier context. The routing contract fails when the workflows and the file disagree.
The routing contract¶
scripts/ci/tests/test_ci_routing_contract.py is the proof. It builds synthetic events (own, fork, Renovate, release with and without the cut label, a person on a release branch name, draft, master push, a push to a feature branch, a tag, an unrelated label, an escalation label), works out with scripts/ci/ci_router.py which jobs of the real workflow files run (scripts/ci/ci_expressions.py evaluates the if: expressions as the Actions documentation defines them, and the tier decision is the real ci_tier.py), and compares that with ci-tier.json. Six more cases plant a defect in a copy of the workflows and require the contract to fail. To see what the contract checks against another tree, point it at a workflow directory:
CI_ROUTING_WORKFLOWS_DIR=<tree>/.github/workflows \
python3 -m unittest scripts.ci.tests.test_ci_routing_contract
The aggregator side is test_ci_aggregator_tier.py, the decision is test_ci_tier.py, and the escalation is test_ci_escalate.py, all in scripts/ci/tests/.
Pre-Commit scope (HISS-18)¶
The required Pre-Commit context of lint-and-format.yml checks a pull request on its own diff and the whole tree everywhere else. scripts/ci/precommit_scope.py picks the arguments and prints the reason:
| Event | Command | Why |
|---|---|---|
pull_request | pre-commit run --from-ref <base sha> --to-ref HEAD | each hook sees only the files the pull request changes, so a documentation-only change skips the C, Go and Rust hooks |
| push to master, release tag, schedule, dispatch | pre-commit run --all-files | the whole tree is re-proved after every landing |
| pull request with no usable base sha | pre-commit run --all-files | fail closed |
pull request that changes .pre-commit-config.yaml or a file a local hook's entry names | pre-commit run --all-files | a new or changed check can find defects in files the pull request never touched; on the diff alone check-fork-python-subprocess passed on #3237 and failed the master push |
| pull request whose file list git cannot read | pre-commit run --all-files | fail closed |
The job always runs and reports under the same name, so the required aggregator is unaffected; only the hook selection narrows. The heavy build matrices were already off a light-tier pull request (the tier above) or behind the impact planner (ADR-1140). Reproduce locally:
python3 scripts/ci/precommit_scope.py --event pull_request \
--base-sha "$(git merge-base origin/master HEAD)" --print
python3 -m pytest scripts/ci/tests/test_precommit_scope.py
test_precommit_scope.py covers the decision, the workflow (the job calls the script and keeps no literal --all-files; a planted copy with the old step must fail), the hook-input rule (the #3237 file list gets the whole tree, a scope without hook inputs is the planted regression) and the routing of a pull request against a master push.
Renovate¶
renovate.json runs in a weekly window (Monday before 6am, Europe/Vienna). A first catch-all rule puts every minor, patch, digest and pin update that no other rule groups into one pull request; the existing ecosystem rules keep their own groups, automerge and review settings; major updates stay individual and manual; rebaseWhen is conflicted, so a Renovate branch is not rebuilt each time master moves. Security updates (vulnerabilityAlerts) are opened at any time and are not grouped. Renovate pull requests come from this repository and run the light tier.
Gates judge their own matrix leg¶
A matrix job's needs.<job>.result is the aggregate of every leg, so a gate that reads it fails for a leg it does not name. The gates that share a matrix (Linux Intel LLVM, macOS Clang+Metal and Windows MSVC+CUDA (full) in build.yml; FFmpeg Ubuntu gcc and FFmpeg macOS clang in ffmpeg-integration.yml) therefore run scripts/ci/gate_leg_result.py with the name of their own <check name> work job. It reads the run's jobs (gh api repos/<repo>/actions/runs/<id>/jobs --paginate, which needs actions: read) and passes when the planner succeeded and either the leg was selected and concluded success, or it was not selected and is absent or skipped. A missing, unfinished or ambiguous own job fails. The gates pass --fetch, so the script reads the jobs itself: the jobs API can report a leg that has finished without a conclusion for a few seconds, so while the own job reads unfinished the script reads again, at most --attempts times (default 7) --interval seconds apart (default 10), and only then fails. A new gate on a shared matrix does the same; scripts/ci/tests/test_gate_leg_result.py fails on two gates that read one matrix job's aggregate.
CI impact routing (ADR-1140)¶
Required checks do not decide whether they apply from a workflow-level paths: or paths-ignore: filter. Every workflow that hosts a check named in required-aggregator.yml starts on every non-draft PR and every push to master; the first step of each required job runs the planner:
python3 scripts/ci/plan-ci-impact.py --event pull_request \
--base <base-sha> --head <head-sha> --github-output "$GITHUB_OUTPUT"
The planner diffs the event's exact revisions (the merge-base of head and base for a PR, the exact before..head for a push) and maps the changed paths onto the selectors declared in .github/ci-impact.json. There are 27 selectors:
| Selector | Owns | Gates |
|---|---|---|
c_core | core/, ffmpeg-patches/, model/, testdata/, golden fixtures | Build legs, sanitizers, cppcheck, assertion density, Tidy Ratchet |
python | python/, compat/, mcp-server/, tools/, dev-llm/, scripts/**/*.py, requirements/ | Inherited by the composite selectors below |
ai | ai/, model/ | Inherited by tiny_ai |
go | cmd/, pkg/, internal/, api/, proto/, gen/, *.go, go.mod | Inherited by go_checks |
golden_harness | c_core plus python | Netflix golden tests, coverage gate |
build_work | c_core plus everything under python/ and compat/, the build, pytest-timeout and tox lock files, and scripts/ci/prune-corrupt-fixtures.sh | Linux Intel LLVM, macOS Clang+Metal and Windows MSVC+CUDA (full) in build.yml; the Windows leg is the only place that runs the decorator tests on Windows, and the macOS leg runs tox -c python |
tiny_ai | c_core plus ai plus python | Tiny AI (DNN suite and ai/ pytests) |
go_checks | go plus c_core | Go vet, security scan, native and ORT smoke, and Go tests |
docs | docs/, mkdocs.yml, *.md, changelog.d/ | Docs build |
actions | .github/ | FFmpeg patch stack |
docker_image | c_core plus the Dockerfile and Python requirements | Docker image build |
dev_container | c_core, python, ai, go, shell plus dev/ | Dev container build |
doxygen | core/include/libvmaf/, the public-API Doxyfile | Doxygen public API |
helm | deploy/helm/ | Helm chart |
tester_image | docker/Dockerfile.tester, tools/rc1-tester/, the toolkit install scripts, build-config.env, the licence inputs; own paths only (ADR-1700) | Tester Image on full-tier and light-tier pull requests (ADR-1687, ADR-3554) |
windows_tester_zip | The Windows zip build scripts, its lock file and the Windows inputs under tools/rc1-tester/image/; own paths only (ADR-1700) | Windows Tester Zip (ADR-1687) |
windows_tester_zip_sycl | Everything windows_tester_zip owns, plus sycl-rows.json, prepare_build.py, build-config.env and the SYCL scratch ratchet list; own paths only (ADR-1700) | The x64 SYCL zip of Windows Tester Zip (ADR-2198) |
windows_msvc_sycl | C, C++ and header files under core/ (*.c, *.h, *.cpp, *.inc, *.h.in), the Meson files under core/, libvmaf-build-matrix.yml, werror-args.sh, check_msvc_library_names.py, run_meson_test.py and the build lock file; own paths only (ADR-1700) | Windows MSVC+SYCL on a light-tier pull request (ADR-3279) |
tidy_cuda | core/src/cuda/, core/src/feature/cuda/, the CUDA and GPU tests, core/src/dnn/ and the ratchet, lane baseline and lane scripts; own paths only (ADR-2796) | Tidy Lane (cuda) |
tidy_hip | core/src/hip/, core/src/feature/hip/, the HIP and GPU tests, the same lane infrastructure; own paths only | Tidy Lane (hip) |
tidy_sycl | core/src/sycl/, core/src/feature/sycl/, the SYCL and GPU tests, core/tools/vmaf_vpl*, the same lane infrastructure; own paths only | Tidy Lane (sycl) |
tidy_arm64 | core/src/feature/arm64/, core/src/arm/, the NEON and SVE tests, the aarch64 cross files, the same lane infrastructure; own paths only | Tidy Lane (arm64) |
tidy_clang | core/test/fuzz/, core/src/read_json_model.c, the same lane infrastructure; own paths only | Tidy Lane (clang) |
tidy_integrations | gstreamer/, ffmpeg-patches/src/, ffmpeg-patches/series.txt and its patches, build-config.env, the same lane infrastructure; own paths only (ADR-3379) | Tidy Lane (integrations) |
tidy_rust | core/src/rust/, core/src/feature/tad_rust.c, the core/test/test_*rust* tests, build-config.env, rust-toolchain.toml, the same lane infrastructure; own paths only (ADR-3380) | Tidy Lane (rust) |
tidy_metal | core/src/metal/, core/src/feature/metal/, the Metal tests, tidy-metal.yml, the ratchet and the Metal baseline; own paths only | Tidy Metal |
gstreamer_element | gstreamer/, core/, model/, ffmpeg-patches/src/vf_vmafx_options.h, docs/usage/gstreamer.md, scripts/codegen/, scripts/ci/vmafx_window_pooling.py, scripts/ci/werror-args.sh, the fixture script and its download helper, requirements/locks/build.txt, build-config.env, lint-and-format.yml; own paths only (ADR-3390) | GStreamer Element |
rust | bindings/, Cargo.*, core/src/feature/rust/ | Rust CI (path-filtered, not required) |
shell | *.sh | Not required, still path-filtered |
container | Dockerfile*, dev/, docker/, deploy/, .devcontainer/ | Not required, still path-filtered |
Steps gated on a selector that is not impacted are skipped and the job emits ::notice::<selector> not impacted (mode=... reason=...) before reporting success, so the aggregator always sees a real conclusion with a real reason.
No selector gates CodeQL. The C/C++, Python and Actions analyses run on every event, because GitHub's CodeQL check turns neutral when a category the base branch has is missing from the head (ADR-3294).
The planner fails closed. Each of these produces mode=full, which sets every selector true (the behaviour before ADR-1140):
- an unknown top-level path;
- any status other than add or modify (delete, rename, copy, mode change);
- a change to a CI-authority file (the map, the planner,
scripts/ci/**, the workflows hosting required contexts,.pre-commit-config.yaml,Makefile,.clang-tidyand the like); - a missing merge-base, a non-linear push or an over-large diff.
One declared exception (ADR-1700): a selector with "own_paths_only": true is not set by the fallback itself. When the changed paths are known, it is true only if one of them matches its own patterns; when they are not (a dispatch, a schedule, a diff that could not be read), it stays true. Only the tester selectors and the eight tidy_<lane> selectors carry it (ADR-2796), it needs patterns and no inherits, and test_ci_impact.py fails on any other use. A change under scripts/ci/ alone therefore runs every other gate and neither tester build.
Run it locally:
python3 scripts/ci/plan-ci-impact.py --event pull_request \
--base "$(git merge-base origin/master HEAD)" --head HEAD --print
python3 -m unittest scripts/ci/tests/test_ci_impact.py # map and tree contract
Adding a top-level directory or file? Add it to known_prefixes or known_files (and to a selector if a required check owns it); the contract test fails otherwise, because an unknown path would silently force full mode on every PR that touches it.
Pull-request runs and Renovate¶
A newer push to a pull request cancels the runs of the older push, and Renovate does not start rebase waves outside its schedule (ADR-3384).
- Every workflow with a
pull_request,pull_request_targetormerge_grouptrigger carries a workflow-levelconcurrencyblock whose group is the same for every push of one pull request and whosecancel-in-progressis true on a new push (forrequired-aggregator.ymlandrule-enforcement.yml, only asynchronizeevent cancels; other workflows keepcancel-in-progresstrue off master, as shown under "Master push runs" below). A workflow that cannot carry one is listed inUNSUPERSEDEDofscripts/ci/tests/test_master_concurrency_contract.pywith its reason; todaydocs.yml(per-job groups, the Pages deploy is never cancelled) andpr-label-lanes.yml(its called workflows keep their own groups). - In
required-aggregator.ymlandrule-enforcement.yml, same-headpull_requestevents (edited,reopened,ready_for_review) keepcancel-in-progressfalse (ADR-3557): a review bot edits the pull-request body seconds after each push, GitHub counts a cancelled check run in an earlier check suite on the head commit as blocking the merge even when a newer suite succeeds, and a pending same-head twin waits behind the running run (further pending aggregator edits collapse to the newest without creating check runs).rule-enforcement.ymlgives eacheditedrun its own group keyed ongithub.run_id, so no later edit (same second or not) replaces or cancels it;run-namekeeps thepull_request.updated_atstamp for aggregator correlation, and same-second edits sharing that stamp fail closed when an aggregator run lists bothRulesruns (ADR-3551); the required-checks aggregator section details the residual bounds. Every otherrule-enforcement.ymlevent shares one-headgroup per pull request: a later run there replaces a pending one, which creates no check runs. Enforced bysame_head_findings,pending_replacement_findingsandskip_findingsinscripts/ci/tests/test_master_concurrency_contract.py. GitHub orders the runs of a group by the time each starts waiting, not by the time its event was dispatched (GitHub's concurrency documentation), so a delayed run of an older head, or a re-run of an olderreopenedorready_for_reviewrun, can replace the pending run of the current head and leave that head without aRulesresult until the next event or push. When the current head shows noRulesresult, re-run the cancelledRulesrun of that head; never re-run aRulesrun of an older head. renovate.jsonsetsupdateNotScheduled: false: Renovate opens and rebases its branches only in its Monday schedule, at most two pull requests and three branches at once. Ticking a pull request's rebase box on the dependency dashboard still rebases it at once.- Check locally:
Master push runs¶
Master commits land every few minutes through a local merge train. A push to master must not cancel the runs of the previous master commit, or no master commit ever gets a complete verdict (ADR-1673).
- Every workflow triggered by a push to
masterputs the SHA in its group on master and keeps the ref elsewhere:
group: <name>-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
On a PR ref the group is still the ref and a newer push cancels the older run; on master each commit has its own group and nothing cancels it. - The merge train keeps one sentinel master commit's runs alive and cancels the other superseded master runs itself through the API. GitHub's per-ref cancellation is not involved on master. - The Required Checks Aggregator follows the same SHA group rule on master, and on a PR ref cancels only on synchronize (ADR-3557). Re-running the aggregator of an old master head no longer cancels the newest one. On a PR ref, re-running an older head's synchronize run still cancels the current head's run, while re-running an edited twin waits as pending. Every head of a pull request shares that ref group, so re-run a cancelled aggregator only when no aggregator run of the same pull request, on any head, is running or pending. - Blocks that must serialise keep their group and are listed with a reason in scripts/ci/tests/test_master_concurrency_contract.py: dev-container-publish.yml (registry publish), release-please.yml (one release PR per push), scorecard.yml (attestation publish) and the deploy job of docs.yml (one Pages deployment). - A new workflow that triggers on a push to master takes the SHA form or is added to that list with a reason. Run the check with python3 -B -m unittest scripts/ci/tests/test_master_concurrency_contract.py.
Merge queue¶
Every required-check workflow owed on merge_group listens for merge_group (types: [checks_requested], branches: [master]). The queue itself is switched on by the master ruleset merge_queue rule (ADR-3556). Once that rule is on, each queue entry runs these workflows on a synthetic refs/heads/gh-readonly-queue/master/... ref. Before it is on, nothing changes for pull requests.
Same-repository pull requests follow ADR-3556: adding to the queue requires repository write access, maintainers pin the head with gh pr merge <number> --match-head-commit <sha> or expectedHeadOid on enqueuePullRequest, and Train.guard plus all train actions refuse cross-repository pull requests (test_guard_refuses_cross_repository_prs in scripts/dev/tests/test_merge_train_guard.py). Under ADR-3610, a fork pull request enters the queue only after merge_train_guard.py admit-fork <number> --reviewed-head <sha> returns 0, and only pinned to that exact head without --auto (test_admit_fork_refuses_unreviewed_head, test_admit_fork_positive_receipt_never_merges_or_locks); afterwards, merge_train_guard.py queue-audit re-checks every queued fork entry against its live head and maintainer approval (test_audit_queue_and_cli; see Local merge-train control). Semgrep and CodeQL jobs retain security-events: write on merge_group under this rule. Semgrep scans the checkout in its pinned image without executing code from the change, so the same admission rule covers it. The merge group head includes queued diffs that can rewrite workflow conditions, permissions, guards and scripts, so in-file permission scoping is not the enforcement point. The provenance guard before hardware probes and hosted ARC routing provide a second barrier against an enqueue mistake. Workflow-token access to mergeQueue remains unproven until the first live merge group; lookup failures fail closed.
- The workflow contract refuses jobs on
merge_groupthat read a secret other thanGITHUB_TOKENor run self-hosted without an exclusion or the provenance guard in.github/actions/runner-probe/action.yml. - Every
merge_grouprun executes tierfull(scripts/ci/ci_tier.py) and the full impact plan (scripts/ci/plan-ci-impact.pyemitsevent-not-routed:merge_group). Required Checks AggregatorexemptspullRequestOnlycontexts plus both OpenSSF Scorecard gates onmerge_group:Scorecard PR Gaterequires a pull-request payload and already ran on the pull request, whileScorecard Master Gate(mergeGroupExempt) publishes default-branch Scorecard results and runs on themasterpush after the merge lands.- Publish, deploy, registry-push, release-signing, repository-write, and Pages steps keep their existing triggers and never run on
merge_group. - Jobs a pull request skips for runner cost (the three tester GPU image builds in
docker-publish-tester.ymlbuild-gpu) skip a merge group too and run on themasterpush after the merge only when that push selectstester_image(own_paths_onlyin.github/ci-impact.json). The workflowvalidatejob requiresimpact.outputs.selected, andbuild-gpurequiresvalidate. When the changed paths of the push are known, a merge limited to other paths, such ascore/, builds no tester GPU image; when the planner cannot read them, the selector stays set and the images are built.scripts/ci/tests/test_merge_group_workflow_contract.pyrefuses a guard that skipspull_requestwithout also skippingmerge_group. It also refuses adocker-publish-tester.ymlwherebuild-gpudropsvalidatefromneedsorvalidatedropsneeds.impact.outputs.selectedfromif. - Check the aggregator
merge_groupcases and workflow trigger contract locally withpython3 -m pytest -q scripts/ci/tests/test_aggregator_event_scope.pyandpython3 -m pytest -q scripts/ci/tests/test_merge_group_workflow_contract.py.
Required-checks aggregator¶
The single required check on master branch protection is the Required Checks Aggregator (ADR-0313). The required array in required-aggregator.yml is the merge gate in full: a check missing from it can be red while the merge button stays green (ADR-1297).
It runs on every PR and master push. Draft PRs fail immediately; ready PRs poll for the named sibling check runs to reach a terminal state and accept success, skipped or neutral per check. GitHub Actions check runs older than a 2-minute margin before the window anchor are excluded, so skipped draft-era checks cannot mask ready validation (ADR-3551): on pull_request edited events, where a title or body edit re-runs only the rule-enforcement.yml gates and leaves earlier build and test runs untouched, the anchor is the latest ready_for_review timeline event (or pull_request.created_at when never a draft); on every other event, the anchor is the aggregator run's own created_at. On edited events, workflows listed in editedRerunWorkflows (.github/workflows/rule-enforcement.yml) must also report from a current-edit run whose display_title starts with "[<pull_request.updated_at>] " (set via top-level run-name:): other Rules check suites on the same head SHA are excluded, and the aggregator fails closed when pull_request.updated_at is missing or when the Rules workflow does not start for the edit within the 2-minute registration grace. If two edits land in the same second and an aggregator run lists multiple Rules runs sharing the edit-stamp prefix (in any status), it fails closed at once and asks for another pull-request edit or a commit push. To catch a second same-second Rules run before passing on an earlier green one, an edited aggregator run keeps polling until a workflow-runs listing started after the 2-minute registration grace, though a duplicate registering after the grace is not seen by that aggregator run (its own Rules checks still report on the head commit). The later edit's aggregator run shares the aggregator concurrency group. If its pending run survives, it starts its own 2-minute grace after the earlier run leaves the group and fails closed when it lists both Rules runs. If the later run registers after that grace, or a third edit replaces the pending second look, the content guard in .github/actions/edit-supersede-guard/action.yml and scripts/ci/edit_supersede_guard.py fails an earlier Rules job when its event title, body or base differs from the live pull request. The earlier failed job then fails the aggregator instead of allowing a stale pass. The guard waits until five seconds after the event stamp, capped at 30 seconds, and reads the pull request once. A later edit made shortly before that read can be missed even when the API lags by less than five seconds, and an edit made after the read is not seen by that run; the Rules run of that later edit judges the current text. test_late_registering_same_second_edit_fails_on_superseded_rules_run in scripts/ci/tests/test_aggregator_edited_window.py covers delayed registration, and test_superseded_fails in scripts/ci/tests/test_edit_supersede_guard.py covers the guard decision. test_known_gap_third_edit_replaces_pending_second_look in scripts/ci/tests/test_master_concurrency_contract.py still pins the three-event concurrency path: a third edit can replace the pending second look. serial_second_look_findings in scripts/ci/tests/test_master_concurrency_contract.py pins the shared group and non-cancelling edited policy that allow a surviving pending second look. Because actions/runner converts any YAML string containing ${{ into one expression capped at 21,000 UTF-16 code units after .NET Char.IsWhiteSpace expression trimming, scripts/ci/check-workflow-size.py also checks every workflow scalar against that runner expression bound (scripts/ci/tests/test_check_workflow_size.py) alongside the 64 KiB file limit. scripts/ci/tests/test_aggregator_edited_window.py runs the embedded script across the edited-event window, stale-suite exclusion, boundary, draft-era exclusion and fail-closed API paths.
On a master push the aggregator reads only the push's own check runs: a check run whose check suite belongs to a pull-request workflow run on the same commit is left out. The merge train lands by fast-forward, so a landed commit is also the head of its pull request, and the train cancels that pull request's runs once it lands; without the filter those cancelled runs of the pull-request-only gates (Deliverables Checklist, docs/state.md Gate, Silent-Revert Guard and others) read as failures of every master push. A check run of a workflow run on another branch is left out too: release-please opens its release-notes branch at the master head, and the push runs there of the workflows without a branch filter are cancelled as superseded. A check run of a scheduled workflow run is left out as well: the daily FFmpeg Patch Stack run starts on whatever the master head is, and its gate job skips on schedule, so its newer skipped check run had replaced the push's own result. Check runs of other apps, such as code scanning, always count. A pull-request aggregator reads every check run on its head as before. scripts/ci/tests/test_aggregator_event_scope.py runs the embedded script on both events.
Every name the aggregator evaluates must report success on the head SHA (ADR-3293). A name no run reported, or one that was skipped, neutral or cancelled, fails the aggregator. Three exemptions are named in the script, and each lets a name stay absent or skipped, never failed: the names the run's CI tier does not owe, the pullRequestOnly names on a push or dispatch event, and a hardware lane whose operator switch is off. scripts/ci/tests/test_aggregator_absent_fails.py runs the embedded script against both rules.
The aggregator's GitHub API calls retry HTTP 5xx answers for 15 minutes; an exhausted retry fails as Transient GitHub API failure: and judges no check. Rate-limit responses wait for retry-after, the reset time, or exponential backoff, with at most six waits per call and 90 minutes across the script. An exhausted limit fails as GitHub API rate limit: and asks for a rerun without judging checks. Other API errors end the job immediately. Polling starts at 30 seconds, doubles when the judged checks are unchanged up to 240 seconds, and resets to 30 seconds on change. scripts/ci/tests/test_ci_aggregator_tier.py exercises 5xx handling; scripts/ci/tests/test_aggregator_rate_limit.py covers rate limits and polling.
Release legs¶
Three contexts gate what the release and tester workflows build on a pull request (ADR-1687). All three must report success; a missing or skipped one fails the aggregator.
| Context | Workflow | Does work when | Required on |
|---|---|---|---|
Tester Image | docker-publish-tester.yml | the planner selects tester_image | pull requests and master pushes |
Windows Tester Zip | windows-tester-bundle.yml | the planner selects windows_tester_zip | pull requests and master pushes |
Release Dry Run | release-dry-run.yml | always; scripts/ci/release-dry-run-plan.sh picks the groups | pull requests only (the workflow has no push trigger; on other runs the aggregator list pullRequestOnly lets it be absent or skipped) |
Windows MSVC+SYCL of libvmaf-build-matrix.yml is the second own-input lane (ADR-3279): a light-tier pull request that changes C, C++ or Meson files under core/ builds that one MSVC leg, checks its installed library names and runs its two SYCL registration tests (selector windows_msvc_sycl); Windows MSVC+CUDA and Windows ARM64 MSVC stay full-tier.
Dev Container Build of dev-container-build.yml is the third own-input lane (ADR-3338). On a light-tier pull request its planner reads the narrow selector dev_container_inputs: dev/**, .dockerignore, build-config.env, the workflow and the scripts its build job runs (build-dev-container-stage.sh, check-compose-dri-writable.sh, check-container-build.sh, check-dev-container-build-secret.py, docker-hub-mirror.sh) and install-cuda-toolkit.sh, which the Containerfile copies. A pull request that changes one of them builds the image, smoke-tests it and runs the release rehearsal; any other light pull request passes the check with a notice naming the reason. The full tier and the master push keep the broad selector dev_container, which also builds the image for the core, Python, AI, MCP and Go sources the image copies, supply-chain.yml and build-native-release-artifacts.sh. Add the label ci: full when a pull request changes one of those and needs the image built before it lands.
Tester Image of docker-publish-tester.yml is the fourth own-input lane (ADR-3554). On a light-tier pull request (Renovate digest updates included) its impact planner and Tester Image gate run on needs.tier.outputs.light == 'true', reading the own_paths_only selector tester_image (docker/Dockerfile.tester, tools/rc1-tester/, build-config.env, the toolkit install scripts, the licence inputs and the workflow). When selected, the amd64 tester image builds (including licence-texts, notices and licence-check) and runs its report before merging; otherwise the gate reports success with a skip notice. The Required Checks Aggregator also waits while any non-skipped delayedStrictDependencies work job of an own-input lane runs on the light tier, so a fast light-tier run cannot pass before a selected Tester Image build registers its gate check.
These three release-leg contexts live in full_only, with two declared own-input-lane exceptions (own_input_lanes of .github/ci-tier.json): Windows Tester Zip (ADR-2198) and Tester Image (ADR-3554), so a pull request from this repository also runs both, while each planner builds only what the diff touches. Selector windows_tester_zip builds the x64 zip; selector windows_tester_zip_sycl (everything the x64 zip reads, plus sycl-rows.json, prepare_build.py, build-config.env and the SYCL scratch ratchet list) adds the x64 SYCL zip. The arm64 and CUDA zips, Tester Image's arm64 leg and the macOS bundle still build on the master push or a dispatch only, which is why a cut checks them (scripts/release/check-candidate-legs.py, see the release guide). For the other contexts a pull request from this repository runs them only with the label ci: full (see Which jobs run when), and the master push is where they run for every change. An unselected tester run passes in about a minute. Which inputs select them and how to reproduce a failure: verifying the release and tester workflows.
On a push to master the two tester gates need the whole push run of their chain, so when the push touches their inputs the master aggregator waits for both image architectures and all four Windows zips, and a red push leg turns it red. That is intended (ADR-1687, confirmed in ADR-1700): a broken tester package on master is visible in the same place as every other red check.
Go checks¶
The go vet + go test job is required under ADR-1238. Its native build, security scan, runner smoke and tests run for Go or core and model inputs; unrelated documentation changes report success after an explicit impact notice. A failing gosec scan blocks merging even though it prevents later Go tests from running. The scan is make lint-go, the target make lint runs, so run it before pushing a Go change; its flags and the reason for each sit next to the target in the Makefile. It runs gosec twice: on hand-written code with every rule, then with generated files included and the .gosec.json configuration, so a finding in generated code also fails locally and is fixed in its generator. The job also starts on ready-for-review events, so draft-era results cannot replace the current validation run.
Before installing native build dependencies, the job runs go fix -diff ./... under the exact go.mod toolchain. Per ADR-1338, any available source rewrite is a blocking failure; CI never mutates the checkout. Run make go-fix, repeat if the Go tool reports cascading fixes, and finish with make go-fix-check locally.
The store tests start PostgreSQL in a container through testcontainers (cmd/vmafx-controller/internal/storetest, images pinned by digest). Before go test, the job runs scripts/ci/docker-hub-mirror.sh. The script adds https://mirror.gcr.io to the runner Docker daemon's registry-mirrors and restarts the daemon. It fails if docker info does not show the mirror. The change applies to every docker.io pull of the job, and Docker Hub's anonymous pull limit no longer fails the tests. The pinned digests stay valid, because the mirror serves the same content addresses. DOCKER_HUB_MIRROR overrides the mirror. scripts/ci/tests/test_docker_hub_mirror.py checks the daemon.json merge offline (--print). Golusoris uses the same pattern.
Docker Image Build (docker-image.yml) and Dev Container Build (dev-container-build.yml) run the same script before they build, so the base images of their Dockerfiles (ubuntu:26.04, rocm/dev-ubuntu-26.04) come through the mirror too, with Docker Hub as the fallback. A job container, a services image and a uses: docker:// step are pulled while the job is set up, before any step runs, so the daemon setting cannot reach them. Those references name the mirror directly with the same digest: the Semgrep job runs mirror.gcr.io/semgrep/semgrep, and the REUSE job runs reuse lint from mirror.gcr.io/fsfe/reuse. The WorkflowImages test in scripts/ci/tests/test_docker_hub_mirror.py fails when a workflow adds a Docker Hub reference in one of those three places; an image written as a ${{ }} expression is not checked. Actions that build their own Dockerfile at job setup, such as cargo-deny-action, still pull their base image from Docker Hub.
Hardware-dependent lanes¶
Two checks depend on self-hosted hardware. Both fail closed when their lane is enabled and accept a skip only while it is disabled.
| Check | Switch | While disabled | While enabled | Runbook |
|---|---|---|---|---|
SYCL Parity (Arc A380) (ADR-1177) | repository variable SYCL_ARC_RUNNER_ENABLED | An absent or skipped job is accepted. | The job must report success; a skip, which is what the loud probe failure in sycl-parity.yml produces when the runner is unregistered, offline or the probe token is rejected, fails the aggregator. | ci-self-hosted-sycl.md |
Coverage GPU (ADR-1319) | GPU_COVERAGE_ENABLED plus the complete self-hosted,linux,gpu-full online label set | Absence or skip is permitted. | Coverage GPU must report success; probe failure, absence, skip or neutral blocks the aggregator. | self-hosted-runner.md |
Coverage GPU is a distinct gpu-full capability: a hosted job checks the variable and the label set before the hardware job can be dispatched. The Arc-only runner must not be relabelled to satisfy this CUDA plus SYCL contract.
Twin-drift gate¶
core/ carries same-directory .c/.cpp twin pairs left by the C++23 migration (ADR-0729). Twice a fix landed on one twin and never reached the other, and twice a rename (mem.c to mem.cpp, dict.c to dict.cpp) left a stale path in a build file that only nightly or opt-in lanes configure. ADR-1135 turns both into a blocking, required check: Twin Drift (job twin-drift-check) in lint-and-format.yml, backed by scripts/ci/twin-drift-check.sh.
What fails¶
The gate fails when either holds:
- A same-directory
.c/.cpppair exists and one side is compiled by no build file (meson.build,setup.py,*.pyx), unless that side is listed inscripts/ci/twin-drift-allowlist.txtwith a reason. - Any build file names a source path (
.c .cpp .cc .cxx .cu .hip .m .mm .metal .pyx) that does not exist in the tree.
How references are resolved¶
| Build-file form | Resolution |
|---|---|
'../src/x.c', 'x.c' | relative to the build file's directory |
src_dir + 'x.c' | through the src_dir = './.../' assignment in the same file |
_m + '_parity.c' (prefix is not a literal directory) | suffix search over git ls-files; reported as NOTE |
os.path.join("..", "core", "x.c") | joined; identifiers resolve through assignments |
output: 'gen.c', '@PLAINNAME@.c' | skipped; generated files |
/abs/path.c | skipped; toolchain-provided |
# ... comments | ignored (quote-aware) |
Clearing a failure¶
- Stale source reference: fix the path in the build file. There is no allowlist for this class. If the parser genuinely cannot model a construct, append
# twin-drift-ignore: <reason>to that line; the reason is mandatory and the line is reported asNOTE. - Dead twin side: wire the side into a build file, delete it, or add a row
path reasonto the allowlist. Rows without a reason, rows whose file is gone, whose side is compiled again, or whose pair no longer exists fail the gate, so the allowlist cannot rot.
Sides compiled only by test or fuzz build files are printed as INFO (non-failing): that is the drift-risk shape to keep an eye on when touching one of them.
The local run is identical to CI, takes about two seconds, needs no build, and is also wired as a pre-push hook:
bash scripts/ci/twin-drift-check.sh
bash scripts/ci/tests/test-twin-drift-check.sh # 24 fixture cases
Lint, standards and bookkeeping gates¶
These sections keep their anchors for existing links; the content lives on the pages named here.
Whole-tree lint ratchet (ADR-1142)¶
CI bounds clang-tidy findings for every file with a per-lane baseline (scripts/ci/tidy-baseline-<lane>.json): a file may never exceed its baseline, and a cleaner file must tighten it in the same PR. The required context is Tidy Ratchet (the cpu lane). Every other lane is a required, path-routed check as well (ADR-2796): Tidy Lane (cuda), Tidy Lane (hip), Tidy Lane (sycl), Tidy Lane (arm64), Tidy Lane (clang), Tidy Lane (integrations) and Tidy Lane (rust) (legs of one job in lint-and-format.yml, measured in the pinned dev container) and Tidy Metal (tidy-metal.yml, a macOS runner). Each starts on every pull request and measures its lane only when the planner selects tidy_<lane>; a lane it did not measure says so and is checked by the nightly sweep, which runs all lanes on master and opens or updates one issue on drift. Rules, commands and exit codes are in Tidy ratchet; measuring is in measuring the lanes.
Carve-outs still open after ADR-1142¶
The open scope restrictions of the lint configuration (which paths Tidy Changed excludes, and what blocks each) are in the carve-out table of the tidy ratchet page.
Changed-files tidy jobs and the lanes they defer to (Q-341, Q-342)¶
Tidy Changed lints the changed C and C++ files that its CPU build can compile. scripts/ci/tidy_changed_route.py changed decides what happens to each changed file:
| Changed file | What the job does |
|---|---|
| Has a compile command in the CPU build | Lints it. |
Has no compile command, and a lane's measured_sources (scripts/ci/tidy-baseline-<lane>.json) lists it | Skips it and prints tidy-changed: skip <file>: measured by the <lane> lane(s). |
Has no compile command and a live entry in .config/lint-exceptions.d/clang-tidy-coverage.toml | Skips it and names the entry's expiry. |
| Has no compile command, no lane measures it, and it has no live exception | Fails, naming the file. |
| Header that a unit with a CPU compile command includes (directly or through other headers), or that nothing includes | Lints it on its own, as before. |
| Header that only units without a CPU compile command include | Follows those units through the same deferral, for example the device cell headers of core/test/. |
Tidy SYCL lints the changed SYCL sources with the SYCL build's compile database. Its selection includes the C sources of the SYCL device-frame lane (core/src/sycl/*.c) and the import tests (core/test/test_vmafx_import_sycl*.c). The wrapper parses every file as C++20, so a header that no C++ source includes (core/src/sycl/vmafx_sycl_internal.h, which uses C11 atomics) is linted through the C units of the SYCL build that include it, never on its own (tidy_changed_route.py sycl).
The routing's planted cases (scripts/ci/tests/test_tidy_changed_route.py: a file no lane measures fails, a file a lane measures is skipped with its lane named) run in the Tooling Tests job and in the test-tidy-changed-route hook.
Source ADR citations (ADR-1311, ADR-2200)¶
scripts/ci/check-source-adr-citations.py binds each plain ADR-NNNN in source and build files to the one file docs/adr/NNNN-*.md. It derives the binding from the tree on every run, so citing an ADR needs no registry edit; scripts/ci/source-adr-citations.json holds only the hand-written retired and fixtures records. The gate fails on a number that has no ADR file and no retirement record (file the ADR, or audit and record the retirement), on a retired number that has a file again, and on a fixture number cited outside its recorded paths.
Local lint build profile and receipts¶
make lint against a configured build, its receipt directory and the cppcheck model files are in Local lint.
Praetor documentation gate¶
make docs-lint and make docs-figures are praetor's Documentation Governance gate, and praetor owns several files byte for byte. See Praetor gate.
Moving the praetor pin¶
PRAETOR_REF in standards-gate.yml names the engine CI installs; the move procedure is in Praetor gate.
Resolving a docs/state.md rebase conflict¶
Run python3 scripts/dev/resolve-state-md-conflict.py docs/state.md mid-rebase; see state.md gates.
Bug-status hygiene gate (ADR-0165 / ADR-0334)¶
A fix: PR, a bug title or a close keyword must touch docs/state.md (rule 15 of the agent hard rules), or say no state delta: REASON in the body. See state.md gates.
Warnings are errors (ADR-2170, ADR-2828)¶
HISS-10 asks for zero warnings, so every CI lane that compiles C, C++, Rust or Go turns warnings into errors: the pull request that adds a warning fails the lane that prints it. Each lane spells its switch on the build command itself, where praetor's build-warnings gate (praetorctl audit, Praetor gate) reads it:
| Toolchain | Switch on the lane | Linker half |
|---|---|---|
| Meson (gcc, clang, icx/icpx, MinGW, cl.exe, icx-cl, nvcc, hipcc) | -Dwerror=true on meson setup (-Werror, /WX; core/src/meson.build adds --Werror all-warnings for nvcc and -Werror for hipcc) | $(scripts/ci/werror-args.sh true) beside it |
| CMake (the Level Zero loader the SYCL legs build) | -DCMAKE_COMPILE_WARNING_AS_ERROR=ON on the configure | none |
| A direct compile (the static pkg-config link smoke) | -Wall -Wextra -Werror, compiler named in the step's env | none |
Cargo (rust-ci.yml) | RUSTFLAGS: -D warnings on the job, beside cargo clippy -- -D warnings | none |
Go with cgo (go-ci.yml) | CGO_CFLAGS: -O2 -g -Wall -Werror on the job, beside go vet | none |
scripts/ci/werror-args.sh stays the one place that knows each linker's fatal-warnings switch. With true it prints -Dwerror=true again and -Dc_link_args / -Dcpp_link_args with -Wl,--fatal-warnings (GNU ld, lld, MinGW) or -Wl,-fatal_warnings (Apple ld64). On macOS the C++ link arguments also carry -no_warn_duplicate_libraries: Meson 1.12 detects the C++ standard library of the Objective-C++ (Metal) build by linking a probe with -lc++, which the clang++ driver adds again, and ld64's duplicate-library warning would fail meson setup ("Could not detect either libc++ or libstdc++"); core/src/metal/meson.build gives the project's own links the same switch. With msvc it prints -Dwerror=true alone: Meson adds -WX to every link.exe link itself. The MSVC legs run their steps under cmd, so a shell: bash step named Warnings-as-errors arguments (id: werror) calls the script and the configure step appends ${{ steps.werror.outputs.args }}; their literal sits on the first line of the meson setup command, because the gate does not read a cmd line continuation. lib.exe has no fatal-warnings switch in Meson. Release and container image builds do not use any of this: a compiler newer than the one a leg pins must not stop a release over a new diagnostic. The tidy and cppcheck lanes compile with the switch, and scripts/ci/write-compile-commands.py drops -Werror from the database those analysers read, so clang-tidy sees the flags it saw before.
A fix for a warning changes no computed value and suppresses nothing: no -Wno-*, no #pragma ... ignored, no flag removed to hide a class. A diagnostic that is a defect of the tool needs a declared exception (one file, one rule, a reason, an expiry). The HISS-10 exception list is empty (ADR-2828).
Lanes that are gated¶
Every lane praetorctl audit reads: 50 in 16 workflows (Meson 35, Cargo 7, CMake 5, Go 2, one direct compile).
| Workflow | Lanes | Toolchain family |
|---|---|---|
libvmaf-build-matrix.yml | every Linux and macOS row, Windows UCRT64, Windows MSVC+CUDA, Windows MSVC+SYCL, Windows ARM64 MSVC, the Level Zero builds and the static link smoke | gcc 14, clang 22, Apple clang, icx / icpx, MinGW gcc, MSVC cl.exe, icx-cl, nvcc, hipcc |
build.yml | Linux Intel LLVM, macOS Clang+Metal, Windows MSVC+CUDA (full), the Level Zero build | icx / icpx, Apple clang, MSVC, nvcc |
sanitizers.yml, tests-and-quality-gates.yml (sanitizer matrix) | ASan+UBSan, TSan, address, undefined, thread, nightly libFuzzer | clang 22, lld |
tests-and-quality-gates.yml | Netflix CPU golden, DNN, MCP smoke, coverage (gcov), coverage GPU | gcc, icx / icpx with nvcc |
lint-and-format.yml, tidy-metal.yml, security-scans.yml | the builds behind Tidy Changed, Tidy SYCL, Cppcheck, Tidy Metal and CodeQL C/C++ | gcc 15, icx, Apple clang, gcc |
nightly.yml, fuzz.yml, mini-retrain.yml, sycl-parity.yml | TSan, Netflix benchmark, libFuzzer, retrain CLI, Arc A380 parity | gcc, clang 22, icx |
go-ci.yml, rust-ci.yml | the libvmaf build, the cgo package, every cargo step and the Rust-extractor build | gcc, rustc, Go |
ffmpeg-integration.yml | the libvmaf builds (Ubuntu, macOS, SYCL, Windows MSVC), the Level Zero build and the upstream consumers' libvmaf at this commit and at the base commit | gcc, clang, icpx, MSVC |
windows-tester-bundle.yml | the Level Zero build | MSVC |
Builds outside the gate¶
| Build | Warnings | Why |
|---|---|---|
Dev Container Build (dev-container-build-work in dev-container-build.yml) | 204 on master 70d6dd0a5 | External packages compiled during container assembly (vpl-gpu-rt printing -Wstringop-overflow, and FFmpeg), plus GCC's LTO "serial compilation" note. Under ADR-2170 and ADR-2828, container and release image builds do not pass -Werror so that external dependency build diagnostics do not block environment assembly. All in-tree VMAFx sources compiled inside the repository are strictly gated with -Dwerror=true across CI compiler matrix legs (Build libvmaf in libvmaf-build-matrix.yml, Linux Intel LLVM / MSVC in build.yml, FFmpeg vmafx Filter in ffmpeg-patch-stack.yml), and the image build executes runtime smoke probes (vmaf --version, 48-frame CPU probe) before acceptance (T-CI-WARNINGS-NON-MSVC-LEGS-2026-10-07). |
| Release and tester images, release binaries | none measured | kept off warnings-as-errors by ADR-2170 (above) |
What has been proven¶
Each toolchain family failed a planted warning once and passed again once it was removed (2026-10-07, the same build directories configured with the gate's arguments): gcc, clang, the MinGW cross compiler, clang for aarch64 and icx / icpx for -Wunused-variable and -Wunused-function in a C and a C++ translation unit; nvcc (--Werror all-warnings, diagnostic #177-D) and hipcc (-Werror, -Wreturn-type) in a device kernel; GNU ld (--fatal-warnings, "requires executable stack"). Not proven on this host, only on the CI run of the pull request that gates them: Apple clang and ld64 (-fatal_warnings), and lld (--fatal-warnings, the sanitizer legs: the compiler half is proven by clang, no default-on lld warning was found to plant).
The MSVC legs were proven on CI, on throwaway branches of the gate commit dispatched with workflow_dispatch (2026-10-07). float planted = 0.1; in core/test/test_picture.c failed Windows MSVC+CUDA, Windows ARM64 MSVC and Windows MSVC+CUDA (full) with C4305 as error C2220 (runs 37635562015 and 37635566701); #pragma comment(linker, "/VMAFXPLANTEDDIRECTIVE") failed the test_picture.exe link of Windows MSVC+CUDA and Windows ARM64 MSVC with LNK4229 as error LNK1218 (run 37635571313). The gate commit itself passed all three legs with werror : true in the Meson summary, -WX on the link lines and no warning in the logs (run 37635551653: the Windows MSVC+CUDA build, and the Windows ARM64 MSVC build with its 355 fast tests; run 37635557102: the Windows MSVC+CUDA (full) build and its CPU tests).
The macOS Metal leg links every target with the Objective-C++ compiler, and Meson 1.12 then names -lc++ twice (224 ld64 warnings per run). The clang++ driver adds the library itself, so duplicates are harmless; core/src/metal/meson.build passes -Wl,-no_warn_duplicate_libraries to those links, with the reason beside it, and the leg is gated. The deliberate register spill of the SYCL self-test kernel is compiled through core/src/sycl/run_captured.py, which prints the device compiler's output only when the compile fails.
The lanes ADR-2828 gated (2026-10-09), proven on this host: gcc 15 in the dev image built the golden configuration (release, LTO, float, AVX-512) and the coverage configuration (gcov, DNN) clean with the gate's arguments, and failed both on a planted unused variable in core/src/libvmaf.c; gcc 16 built the Rust-extractor configuration (RUSTFLAGS: -D warnings) and the Level Zero loader 1.34.0 (-DCMAKE_COMPILE_WARNING_AS_ERROR=ON, which CMake turns into -Werror) clean; the cgo package failed a planted -Wunused-variable under CGO_CFLAGS=-O2 -g -Wall -Werror and both cargo workspaces a planted unused variable under RUSTFLAGS=-D warnings; the static link smoke compiles clean with -Wall -Wextra -Werror under gcc 13, 15 and 16.
On CI, a throwaway branch carrying int vmafx_planted_warning(void) { int unused; float narrowed = 0.1; ... } in core/src/libvmaf.c (2026-10-09) failed on the plant in every leg that compiled it: every Linux and macOS row of the build matrix, Windows UCRT64, Windows MSVC+CUDA and Windows ARM64 MSVC (C4101 and C4305 as C2220) and Windows MSVC+SYCL (icx-cl, -Wunused-variable as an error) in run 37856727687; Linux Intel LLVM and Windows MSVC+CUDA (full) in run 37856730893; Tidy Metal (Apple clang) in run 37856734080; the DNN and MCP smoke builds in run 37856740709. The same run stopped the macOS Clang+Metal leg at meson setup, which the ld64 switch above fixes; the static link smoke under -Wall -Wextra -Werror reported three -Wmaybe-uninitialized sites of the LTO archive (float_vif.c, speed.c, iqa/convolve.c through ssim.c), fixed at the source and reproduced and cleared with gcc 15 here.
The same plant on the rebased branch (2026-10-09, commit 43f1fe0b4) failed the remaining lanes once their own blockers were gone: macOS Clang+Metal, Linux Intel LLVM and Windows MSVC+CUDA (full) in run 37914112985; CodeQL C/C++ in run 37914119958; the Netflix golden, coverage, DNN, MCP smoke and the three sanitizer-matrix builds in run 37914123154; the FFmpeg Windows MSVC, Ubuntu, macOS and SYCL builds in run 37914126479; and every leg of the build matrix, macOS Metal included, in run 37914116846. The pull request's own run of the FFmpeg Windows MSVC job (job 113771388651) configured with werror : true, printed none of the pkg-config name warnings, and passed check_msvc_library_names.py --meson-log. The Arc A380 runner was offline, so SYCL parity and coverage GPU are proven by the SYCL and CUDA legs above until their next run.
Adding a leg¶
- Build the leg's configuration on a clean tree and count the warnings by unique (file, line, flag), not by lines of log (a header diagnostic repeats once per translation unit that includes it).
- Fix every site; run the Netflix golden gate and the fast suite.
- Spell the switch on its build command as the first table above says (
-Dwerror=true $(scripts/ci/werror-args.sh true)on ameson setup;werror: trueon a build-matrix row;werror: msvc, theid: werrorbash step and-Dwerror=trueon the firstmeson setupline for an MSVC leg), add it to the gated table, and runpraetorctl auditandpython3 -m unittest scripts/ci/tests/test_werror_args.py. The audit fails a lane it reads without the switch; the test fails a build-matrix row or an MSVC leg that is not gated. - Prove the gate once: plant
int planted(void) { int unused; return 0; }(for MSVC,float planted = 0.1;, C4305) in a throwaway branch and see the leg fail; record the run in the pull request.
Flaky legs (2026-09-04 audit)¶
An audit of CI runs on master across all workflows found two leg reliability issues, addressed under epic #1236. Counts were taken with gh run list --branch master --limit 40 on 2026-09-05:
| Leg | Symptom | Frequency | Cause | Status |
|---|---|---|---|---|
tests-and-quality-gates.yml / MCP Smoke (Embedded C + Python Server) | test_mcp_smoke TIMEOUT 60.04s, killed after test 15 (test_uds_roundtrip) | 1 of 40 master runs (27 passed, 11 cancelled, 1 failed) | stop_uds() closed the AF_UNIX listener without shutdown(); on Linux that never wakes a worker already blocked in accept(2), so pthread_join() hung. A race: only when the worker re-entered accept() before close(). | Real bug, fixed in ci/flaky-legs-1236 (T-CI-MCP-SMOKE-TIMEOUT-2026-09-04) |
build.yml / libvmaf-build-matrix.yml macOS brew install ... llvm | Homebrew bottle download failure | 0 of 40 build.yml runs (25 passed, 14 cancelled on master; 0 download failures) | GitHub-hosted runner network or Homebrew CDN | Infrastructure; hardened with a 3-attempt retry plus brew fetch --retry (T-CI-MACOS-BREW-LLVM-FLAKE-2026-09-04) |
release-please.yml | Fails on every master push | 3 of 3 master runs in the window | Missing GitHub App credentials | Infrastructure; tracked in #1289 |
| Every other workflow on master | None | 0 failures in the last 40 master runs (one CI run was cancelled by a superseding push, not failed) | n/a | Nothing to fix |
MCP smoke timeout (run 33916590280, commit 0a8727ca7)¶
The MCP Smoke (Embedded C + Python Server) job hit the 60-second Meson timeout during test_uds_roundtrip.
- Root cause: in
core/src/mcp/mcp.c,stop_uds()calledclose(server->uds_listen_fd)withoutshutdown(server->uds_listen_fd, SHUT_RDWR)first. On Linux, closing a listeningAF_UNIXstream socket does not unblock a concurrentaccept(2)in the worker thread (vmaf_mcp_uds_thread_main), leaving the thread asleep in the socket wait queue whilestop_uds()waited indefinitely onpthread_join(). - Measured passing distribution: across 20 iterations
test_mcp_smoketakes about 0.03 s (range 0.01 s to 0.05 s). The 60 s timeout was a true deadlock, not a slow test. - Fix:
shutdown(server->uds_listen_fd, SHUT_RDWR)beforeclose()instop_uds(), mirroring the existing SSE listener shutdown contract, plus defensive early-stop guards invmaf_mcp_uds_thread_main.
macOS Homebrew llvm download reliability (build.yml)¶
- Symptom: intermittent network dropouts or CDN blips when downloading large Homebrew bottles (such as
llvm, about 500 MB) on GitHub-hosted macOS runners. The audit of 40 recentbuild.ymlruns found 0 failures, so the baseline rate is low, but network flakiness is an established infrastructure failure mode. - Mitigation: the Homebrew installation in
build.ymlandlibvmaf-build-matrix.ymlruns in a 3-attempt retry loop with backoff (10 s, 20 s) and fallbackbrew fetch --retry.HOMEBREW_NO_AUTO_UPDATE=1andHOMEBREW_NO_INSTALL_CLEANUP=1are exported to avoid costly auto-updates and cleanup consuming runner time.
Other master workflow legs¶
The last 40 and 100 master runs across all workflows showed no other flaky test or build failure; the only other master failure was the release-please token permissions, tracked in #1289.
Job time limits cover their step limits (ADR-3367)¶
A step's timeout-minutes only holds when its job can run that long. On 2026-10-22 the MCP Smoke job had a 35-minute limit and its Install build deps step a 20-minute one: a slow package mirror took 19 minutes 59 seconds, inside the step's limit, and the job reached its own limit in the libvmaf build and was cancelled (job 119986586497). Tiny AI had the same shape at 45 minutes.
Size a job's limit as the sum of its step limits plus 1.25 times the longest healthy run of its other steps, measured on successful jobs:
| Job | Step limits | Longest healthy run of the other steps | Limit |
|---|---|---|---|
Tiny AI | 20 (apt) | 27.4 min, 38 jobs | 55 |
MCP Smoke | 20 (apt) | 22.1 min, 44 jobs | 55 |
scripts/ci/check_job_timeout_budget.py reads every workflow under .github/workflows/ and fails when a job's timeout-minutes is below the sum of its steps' timeout-minutes. A job without a limit counts as GitHub's 360 minutes; a limit written as an expression cannot be checked and fails the run. It runs in make lint-actions and as the check-job-timeout-budget pre-commit hook; scripts/ci/tests/test_check_job_timeout_budget.py plants a job below its step sum and checks that it is refused.
python3 scripts/ci/check_job_timeout_budget.py
python3 scripts/ci/tests/test_check_job_timeout_budget.py
The check sees only the step limits. The 1.25 margin for the uncapped steps is the author's measurement, written in the comment above each job's limit.
Steps that run llvm.sh download their compiler from apt.llvm.org, which the apt archive cache does not hold, so they take a common 10-minute limit: the slowest measured healthy run was 5.7 minutes (libvmaf-build-matrix.yml, 142 runs), and on 2026-10-23 a Tidy Ratchet install took 5.2 minutes and hit the 5-minute limit it had then (job 120415869295). The jobs holding such a step (Tidy Changed, Tidy Ratchet, Tidy SYCL, fuzz, the three sanitizer jobs) gained the same 5 minutes; clang-tidy-full already had the headroom.
Downloads and timeouts in test jobs (2026-10-10)¶
Three failures on master on 2026-10-10 had one shape: a required job failed on something no change had caused, and its re-run passed. Each is fixed where it started; the sections below say what a job must do so it stays fixed.
| Failure | Run | Cause | Fix |
|---|---|---|---|
test_crd_compat failed on Sanitizers (undefined) | 38069385197, attempt 1, commit 7c107bcec | The test downloaded Go modules into a cold cache; the module proxy dropped one stream (INTERNAL_ERROR) and nothing retried | Go modules before the suite |
test_vmafx_score timed out after 30 s on Sanitizers (thread) | 38075165924, attempt 1, commit 95132391c | The sanitizer legs ran every test with the timeout of an uninstrumented build | Sanitizer legs |
Dev Container Build and Coverage Gate could not download a fixture | 38055869167 and 38055869346 | The fixture host answered HTTP 504 for some minutes; one download retried for ten seconds, the other not at all | Fixture downloads |
Go modules before the suite¶
Four tests of the Meson suite run Go tooling: test_crd_generated_current and test_crd_compat (go tool controller-gen), test_proto_generated_current (buf and go tool protoc-gen-go*) and test_vmafx_score_contract (go test ./cmd/vmafx-server/). On a hosted runner the module cache is empty at the start of every job.
A job that runs the fast suite or the whole suite therefore has this step before the test step:
scripts/ci/prefetch_go_modules.py runs go mod download (every module go.mod requires, the tools' included, and the Go toolchain go.mod names when the installed one is older) and installs the pinned buf into the tool cache (go install, ~/.cache/vmafx-tools/buf-<version>/), where scripts/codegen/proto_generate.py finds it. Each download gets five attempts with waits of 10, 30, 60 and 120 seconds; a retry keeps what the attempts before it stored. When a download fails on every attempt the step fails and prints which download and the last error, so the job is red at the download and not inside a unit test. Without Go on PATH the step prints that and passes: the four tests then skip themselves (exit 77).
After the step the four tests need no network. That was measured with an empty module cache and GOPROXY=off after the prefetch (1.8 GB of modules, 64 s on a workstation). buf is installed, not run through go run, because go run <package>@<version> asks the module proxy for the module's versions on every run, also with a full cache.
Write the step the way the test step runs the suite: the same if:, the same shell:, and the same sudo form (sudo, sudo -E PATH="$PATH" or none). The module cache and the tool cache belong to a user; a prefetch as the runner user fills nothing the suite reads when the suite runs under sudo. scripts/ci/tests/test_meson_suite_go_prefetch.py refuses a suite step without such a step before it, and a script of the suite's tests that starts Go without being listed there.
Sanitizer legs¶
A test of core/test/meson.build has 30 seconds unless it sets its own timeout. Those values are sized for an uninstrumented build. Every Meson test run of a sanitizer build or a gcov (-Db_coverage=true) build passes --timeout-multiplier 3:
| Job | Workflow |
|---|---|
Sanitizers (address), Sanitizers (undefined), Sanitizers (thread) | tests-and-quality-gates.yml |
Sanitizers ASan+UBSan, Sanitizers TSan | sanitizers.yml |
ThreadSanitizer | nightly.yml (had the multiplier before) |
Coverage Gate, Coverage (GPU) | tests-and-quality-gates.yml (gcov, since 2026-10-17) |
make test-sanitizers, make coverage | Makefile (INSTRUMENTED_TEST_TIMEOUT_MULTIPLIER) |
The value comes from the durations of all tests in 15 job logs of 2026-10-10: the three matrix legs in three runs (11 logs with two re-run attempts, one of them the run that timed out) and the two jobs of sanitizers.yml in two runs. Without a multiplier these tests ran above half of their timeout:
| Test | Timeout | Slowest run | Share of the timeout | With the multiplier |
|---|---|---|---|---|
test_vmafx_score | 30 s | killed at 30.01 s (thread); 27.99 s finished (ASan+UBSan) | 1.00; 0.93 | 0.33; 0.31 |
test_metal_psnr_hvs_math | 120 s | 107.88 s (ASan+UBSan) | 0.90 | 0.30 |
test_cambi_stage_simd | 30 s | 18.88 s (thread) | 0.63 | 0.21 |
test_feature_score_fed_frame | 30 s | 16.04 s (undefined) | 0.53 | 0.18 |
test_model_collection_api | 30 s | 15.23 s (thread) | 0.51 | 0.17 |
The same test takes very different times on the same leg: test_vmafx_score ran 10.27 s, 20.25 s and 20.48 s on the thread leg before the run that killed it at 30 s, and test_vmafx_api_generator 8.00 s and 27.60 s. A timeout that the slowest finished run fills to 0.93 leaves no room for that spread. With the multiplier the slowest finished run of every test stays below a third of its timeout.
A multiplier for the leg was chosen over longer timeouts on the five tests: the slowdown comes from the instrumentation, not from those tests, and the next slow test would need the same edit after it has failed once. The job's own timeout-minutes still ends a run that hangs. scripts/ci/tests/test_sanitizer_suite_timeouts.py refuses a test run in a job with a -Db_sanitize= or -Db_coverage=true build that passes no multiplier or another value.
The coverage jobs joined on 2026-10-17. In the green coverage runs before, test_integer_adm_simd took 19.6 s to 19.8 s of its 30 s; on master run 39006126494 it reached 30 s and was killed. The Meson step then failed, every later step of the job was skipped, and the four Python coverage shards reported skipped. The step Assert every Python coverage shard passed now names the first earlier step that did not succeed (shard 1/4 outcome was skipped: step Meson-unit-suite outcome was failure), and scripts/ci/test_fail_closed_ci.py runs that step's script against planted outcomes.
Connection retries on downloads¶
On 2026-11-10 the Tidy Lane (cuda) job failed on its first attempt to fetch the apt.llvm.org signing key: curl: (7) Failed to connect to apt.llvm.org port 443. The fetch had --retry 3, but curl's --retry alone does not retry a failed connection, and --retry-connrefused adds only a refused one, not an unreachable network or host.
Every curl and wget HTTP(S) fetch in a shell script, workflow or container recipe retries connection failures:
- curl:
--retry N --retry-all-errors, with N positive. - wget:
--tries=N --retry-connrefused --retry-on-host-error, with N at least 2 because Wget counts total attempts, including the first. - APT in
scripts/dev/tidy-lane.sh:-o Acquire::Retries=N, with N a literal positive integer, on everyupdateandinstallcommand.
Retried downloads must write the body to a file before a consumer reads it. In curl 8.23.0, docs/cmdline-opts/retry-all-errors.md explains that curl clears partial output from its own output file before retrying; pipes, command capture and shell > redirection can instead append duplicate partial data. Wget follows the same file-first rule as a precaution; its pipe behavior on retry has not been measured. Header-only requests and explicit body disposal to /dev/null need no saved body.
Each site keeps its own --max-time and --connect-timeout bounds. scripts/ci/tests/test_fetch_connect_retry.py audits tracked sources offline and runs as the test-fetch-connect-retry pre-commit hook. Its option allow-list models value consumption and final flag state. Unknown options fail: add a row from curl 8.23.0 src/tool_getparam.c (the pinned source above) or the installed GNU Wget 1.25.0 wget --help, rather than silently accepting a new spelling.
Exemptions require an exact path, parsed URL and reason in ALLOWLIST; stale or ambiguous entries fail. Local health checks within bounded outer polls may need to fail fast. The ROCm layer download in scripts/ci/install-rocm-from-image.sh retries the whole curl, decompressor and tar pipeline up to LAYER_ATTEMPTS times; inner curl retries would append to the pipe, so this streaming fetch is exempt from both inner retries and file output. Each layer attempt obtains a fresh registry pull token before downloading.
Older curl stages use a bounded shell loop around the fetch plus an exact ALLOWLIST exemption instead of --retry-all-errors. In dev/Containerfile, the release-build stage uses manylinux_2_28 / AlmaLinux 8 curl 7.61.1; --retry-all-errors requires 7.71.0. Its NASM download uses --retry 3 --retry-connrefused inside a three-attempt loop, with a five-second delay between attempts. Each attempt writes /tmp/nasm.tar.xz through curl's --output; checksum verification, extraction and compilation follow success. The outer loop repeats the whole fetch for unreachable hosts or networks too.
OLD_CURL_STAGES in the same test module records (path, stage name, reason) for stages with older curl. The audit rejects --retry-all-errors on every parsed curl fetch from that stage's FROM ... AS <stage> to the next FROM, including exempt fetches. Missing files or stage names fail as stale entries. To cover another old-curl stage, add its exact path, stage name and measured curl version/unsupported flag to the table; give each loop-protected download an exact URL exemption with its retry bound. Keep the planted rejection, compatible-loop acceptance and next-stage boundary tests with this check.
Not covered: git clone and APT calls outside the tidy lane. Follow-up issue #3392 tracks these gaps; the tests whose docstrings start Known gap (#3392): replay both forms so the scanner's limits stay explicit.
Apt archive cache¶
Every job in tests-and-quality-gates.yml that runs apt-get install caches downloaded .deb package archives across workflow runs so that slow package mirror downloads do not eat into the apt step cap or trip the job limit.
The cache covers all eight apt-installing jobs in the workflow:
| Job | Name in workflow | Package list | Apt step cap | Job limit |
|---|---|---|---|---|
netflix-golden | Netflix CPU Golden | .github/apt/netflix-golden.txt | 28 min | 85 min |
compat-abi-parity | Compat ABI Parity | .github/apt/compat-abi-parity.txt | 10 min | 45 min |
sanitizers | Sanitizers (${{ matrix.sanitizer }}) | .github/apt/sanitizers.txt | 10 min | 30 min |
dnn | Tiny AI | .github/apt/tiny-ai.txt | 20 min | 55 min |
tooling-tests | Tooling Tests | .github/apt/tooling-tests.txt | 10 min | 35 min |
vmaf-tune-tests | Python Package Tests (vmaf-tune) | .github/apt/vmaf-tune-tests.txt | 20 min | 35 min |
mcp-smoke | MCP Smoke | .github/apt/mcp-smoke.txt | 20 min | 55 min |
coverage | Coverage Gate | .github/apt/coverage.txt | 35 min | 120 min |
Apt-installing jobs in other workflow files use the same cache, one pull request per workflow file:
| Workflow | Job | Package list | Apt step cap | Job limit |
|---|---|---|---|---|
build.yml | build-work (Ubuntu legs) | .github/apt/build-linux.txt | 26 min | 80 min |
docs.yml | doxygen-work | .github/apt/doxygen-work.txt | 5 min | 20 min |
fuzz.yml | fuzz | .github/apt/fuzz.txt | 5 min | 40 min |
go-ci.yml | go-ci | .github/apt/go-ci.txt | 9 min | 90 min |
lint-and-format.yml | cppcheck | .github/apt/cppcheck.txt | 5 min | 45 min |
lint-and-format.yml | clang-tidy | .github/apt/tidy-changed.txt | 5 min | 25 min |
lint-and-format.yml | clang-tidy-ratchet | .github/apt/tidy-ratchet.txt | 5 min | 45 min |
lint-and-format.yml | clang-tidy-sycl | .github/apt/tidy-sycl.txt | 5 min | 40 min |
mini-retrain.yml | mini-retrain | .github/apt/mini-retrain.txt | 5 min | 40 min |
nightly.yml | clang-tidy-full | .github/apt/clang-tidy-full.txt | 5 min | 60 min |
rust-ci.yml | rust-vmafx-sys-work | .github/apt/rust-vmafx-sys.txt | 16 min | 30 min |
sanitizers.yml | asan-ubsan | .github/apt/sanitizers-base.txt + .github/apt/sanitizers-llvm.txt | 5 min | 30 min |
sanitizers.yml | fuzz-nightly | .github/apt/fuzz-nightly.txt | 5 min | 50 min |
sanitizers.yml | tsan | .github/apt/sanitizers-base.txt + .github/apt/sanitizers-llvm.txt | 5 min | 35 min |
security-scans.yml | codeql-cpp | .github/apt/codeql-cpp.txt | 5 min | 55 min |
published-rc-licence-companions.yml installs its packages inside the release builder container, so it has no archive cache; its "Fetch the corresponding source" step is capped at 48 min (measured max 37.7 min) inside the 240-minute job limit.
Timeout budgeting rule¶
Timeouts follow ADR-3367 and the sizing rule:
- Step cap:
cap >= 1.25x measured slowest apt step(each restore and save step also has a 5-minute cap). - Job limit:
job limit >= sum of step caps + 1.25x the rest, where "the rest" is the longest measured healthy run of the uncapped steps.
scripts/ci/check_job_timeout_budget.py checks that every apt install step is capped and that every job limit covers the sum of its step caps.
Cache mechanism¶
The cache uses actions/cache/restore before the install step and actions/cache/save after the install step. The save runs only when the install step succeeded: an install cut off by its timeout leaves the archive directory empty, and an empty entry under the immutable key would be restored as a hit on every later run:
- Cache path:
${{ runner.temp }}/apt-archives - Cache key:
apt-<os>-<arch>-<job>-<hash of the package list>, fromrunner.os,runner.archandhashFiles(), where<job>is the job identifier matching.github/apt/<job>.txt.
How to bust: edit the corresponding job's package list file under .github/apt/<job>.txt. Because the cache key includes the hash of the package list file, any package addition, removal, or comment modification computes a fresh hash and fetches clean package archives from the mirrors.
Cache keys are immutable: when the mirror publishes a newer version of a listed package, apt downloads it and the cached copy is no longer used, so the hit rate falls until the list is next edited. APT::Keep-Downloaded-Packages is set in the step's apt configuration so the install leaves the archives in /var/cache/apt/archives to copy back.