Skip to content

ci(tidy): read every translation unit with a clang-tidy lane or list it with a reason (ADR-1142) - #2101

Merged
lusoris merged 2 commits into
masterfrom
rc3-tidy-coverage
Oct 5, 2026
Merged

lusoris merged 2 commits into
masterfrom
rc3-tidy-coverage

Conversation

@lusoris

@lusoris lusoris commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Every tracked C, C++, CUDA, HIP, Objective-C++ and Metal translation unit is to be read by a clang-tidy lane or excepted with a reason and an expiry (ADR-1762, popup "Gated debt first", 2026-10-05). 107 of 759 translation units were read by no lane. This PR is the lane half: the readable units join lanes. The check and the exception entries (the .metal kernels, fixtures, Windows-only files, Pelorus mirror) come in a follow-up PR that also writes tidy-baseline-metal.json from the first hosted macOS run.

  • cpu lane configures the embedded MCP server (-Denable_mcp=true and its three transports); the hosted Tidy Ratchet job repeats the options.
  • New clang lane (clang-22 from apt.llvm.org, -Dfuzz=true) measures the five libFuzzer harnesses and core/src/read_json_model.c; gcc cannot configure the fuzz option.
  • New macOS metal lane (workflow tidy-metal.yml, Homebrew llvm@22, Xcode SDK) measures core/src/metal/, core/src/feature/metal/ and four Metal-only tests.
  • tidy-ratchet.py: --select (file or directory), and a scoped write records the units it measures.
  • Findings fixed: 169 in the MCP sources and tests (use-nullptr blocks citing ADR-1138, one uninitialised sockaddr_in, split test functions, memcpy instead of an out-of-range enum cast, a bounded drain loop, two cited setenv NOLINTs), 7 in the fuzz harnesses, 18 in read_json_model.c.

Type

  • build / ci — tooling / infra

Checklist

  • Commits follow Conventional Commits.
  • Lint: scripts/dev/tidy-lane.sh in the dev container, clang-tidy 22.1.8: cpu scoped write for 60 units (0 findings, baseline total unchanged at 70, owned by refactor(core): bring the cpu clang-tidy lane to zero findings (ADR-1142) #2078), clang 0, cuda/hip/sycl one unit each at 0; clang-format clean; make-level pre-commit gates pass.
  • Tests: test_tidy_ratchet.py, test_tidy_scoped_write.py, test_tidy_lane_container.py, test_write_compile_commands.py; test_mcp_smoke and test_mcp_stop_idempotent pass.
  • No SIMD or GPU code path changed; no score moves.
  • New files carry SPDX headers.
  • Not breaking.
  • ADR-1762 added with its index fragment.

Bug-status hygiene

  • docs/state.md: T-TIDY-UNREAD-TRANSLATION-UNITS-2026-10-05 opened here; closed by the follow-up PR.

Netflix golden-data gate

  • I did not modify any assertAlmostEqual(...) score in the Netflix golden Python tests.

Deep-dive deliverables

  • Research digest — no digest needed: lane configuration and a coverage check.
  • Decision matrix — in ADR-1762 ## Alternatives considered.
  • AGENTS.md invariant note — no rebase-sensitive invariants beyond the rebase note.
  • Reproducer / smoke-test command — below.
  • CHANGELOG fragment — changelog.d/changed/tidy-coverage-every-translation-unit.md.
  • Rebase note — docs/rebase-notes.md, "Every translation unit is read by a tidy lane".

Reproducer

scripts/dev/tidy-lane.sh clang    # expect exit 0, 0 findings
scripts/dev/tidy-lane.sh --only core/src/mcp/mcp.c cpu   # expect 0 findings

Known follow-ups

Breaking changes / migration

None.

@lusoris
lusoris force-pushed the rc3-tidy-coverage branch 3 times, most recently from 0c46ba2 to f17c8c7 Compare October 5, 2026 14:30
xxxxxxxxxxxxx and others added 2 commits October 5, 2026 16:46
#2134)

* fix(tester): keep the lines that name a failure in the hardware report

The Apple M4 Pro report of #2118 could not say why two things failed. Its
Metal equivalence errors on the 1080p checkerboards kept only the last stderr
line of the vmaf run, a SpEED warning printed while closing, after the message
that named the -EINVAL. And test_metal_ssimulacra2_parity was a bare `fail`
with eight passing cases: the program died on a signal in its ninth case, and
the unit-test runner recorded neither the signal nor the case.

A failed vmaf run's error now keeps, after the head line (exit status, the
signal's name for a crash, the last line), every distinct `problem ...`,
`error: ...` and libvmaf ERROR / WARNING line, at most 20 lines and 4 KB.

A unit-test program that is killed by a signal, times out, is stopped at the
output limit, or exits with a failure status without reporting a failing case
gets a line in unit_tests.reason naming what happened and the case or test it
was in; in a program that prints @case lines, the case that started without a
verdict becomes `fail` with `no verdict printed: ...`. A timeout keeps the
cases printed before it. The terminal summary prints the reason of a failing
suite. The report schema is unchanged.

State: T-TESTER-REPORT-DROPS-FAILURE-CAUSE-2026-10-05 opened and closed.
…it with a reason (ADR-1142) (#2101)

* ci(tidy): read the embedded MCP server, the fuzz harnesses and the Metal host code with clang-tidy (ADR-1142)

The cpu lane configures the MCP server and its three transports; a new clang
lane builds the libFuzzer harnesses, which gcc cannot configure, and measures
only them; a macOS metal lane reads the Objective-C++ Metal host code.
tidy-ratchet.py gains --select, and a scoped write records the files it
measures. The MCP sources, their tests and three fuzz harnesses reach zero
findings.

Migration: none

* ci(tidy): measure the Metal host code in its own macOS workflow and record the new translation units (ADR-1142)

The macOS lane moves out of the Lint workflow into tidy-metal.yml, which runs
weekly, on a pull request that touches the Metal host sources, and on
dispatch. The cpu, cuda, hip and sycl baselines record the translation units
they now read (scoped writes, no count changes), the clang lane ends at zero,
and --select takes a file or a directory.

Migration: none

* docs(tidy): record ADR-1762, the lane list and the coverage state row

Documents the clang and metal lanes, the coverage rule and its exception
list in docs/development/tidy-lanes.md, adds ADR-1762, the changelog
fragment, the rebase note and the state row.

Migration: none

* ci(tidy): record the translation units the cpu and sycl lanes now read (ADR-1142)

Scoped writes on the rebased baselines: the MCP sources and tests, two Metal
host-replay tests for the cpu lane and test_sycl_motion_five_frame_window for
the sycl lane. No count changes.

Migration: none

* docs(tidy): move the coverage check and the exception list out of the lane PR (ADR-1142)

The lane half stands alone; the check and its exception entries land in
a follow-up that reuses the shared lint exception list.

Migration: none

* docs: regenerate the indexes and the citation map after rebasing
@lusoris
lusoris force-pushed the rc3-tidy-coverage branch from f17c8c7 to 483c827 Compare October 5, 2026 15:05
@lusoris
lusoris merged commit 483c827 into master Oct 5, 2026
5 of 80 checks passed
@lusoris
lusoris deleted the rc3-tidy-coverage branch October 5, 2026 15:05
@github-actions github-actions Bot added the type:ci CI and infrastructure label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:ci CI and infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants