Skip to content

chore(tidy): make cert-err33-c a hard stop in .clang-tidy - #2259

Merged
lusoris merged 2 commits into
masterfrom
chore/tidy-cert-err33-errors
Oct 6, 2026
Merged

lusoris merged 2 commits into
masterfrom
chore/tidy-cert-err33-errors

Conversation

@lusoris

@lusoris lusoris commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes T-CERT-ERR33-SWEEP: promotes cert-err33-c (an ignored return value of a standard-library call) to WarningsAsErrors in .clang-tidy, as ADR-0694 asked once the violations were swept.

  • Measured, not assumed: full runs of every lane in the dev container (scripts/dev/tidy-lane.sh --jobs 4 <lane>, clang-tidy 22.1.8, master 1ec97c450): cpu 0 findings, sycl 0 (491 translation units), cuda 475 findings and none is cert-err33-c (504 TUs), hip 0 (505 TUs); the last arm64 report has none. The four sites of core/src/feature/adm.c the row named were fixed by the ADR-1142 cleanups.
  • Check proven to fire: a planted fclose(f); exits 0 with cert-err33-c as a warning and 1 with --warnings-as-errors=cert-err33-c (host clang-tidy 23.1.1).
  • docs/development/tidy-ratchet.md states the new hard stop; no baseline changes (all counts unchanged, so no --write).
  • The Metal lane cannot run on this host; the rebase note of the Metal tidy batch records it at zero findings.

Reproducer

scripts/dev/tidy-lane.sh --jobs 4 sycl && python3 - <<'PY'
import json, os
d = json.load(open(os.path.expanduser('~/.cache/vmafx-tidy-lanes/tidy-ratchet-sycl.json')))
print(d['total_warnings'], json.dumps(d['diagnostics']).count('err33'))
PY

Deliverables (ADR-0108)

  • Research digest — no digest needed: trivial.
  • Decision matrix — no alternatives: only-one-way fix (ADR-0694 decided it).
  • AGENTS.md invariant note — no rebase-sensitive invariants.
  • Reproducer / smoke-test command — above.
  • CHANGELOG fragment — changelog.d/changed/tidy-cert-err33-errors.md.
  • Rebase note — no rebase impact: one line of .clang-tidy.
  • Docs — docs/development/tidy-ratchet.md.
  • State — row moved to Recently closed in docs/state.md.

tidy: cpu, cuda, hip, sycl lanes measured whole; no native file touched.

…acOS LTO keeps libc's close() (#2234)

* fix(feature): name the CPU extractors' close callbacks close_fex so macOS LTO keeps libc's close()

test_adm_coverage crashed with SIGSEGV on every macOS leg since #2208 gave
a case a stderr capture that calls close(). Under lldb on the hosted runner
the faulting function is an extractor's static close(VmafFeatureExtractor *)
called with the file descriptor; the debug build without LTO passes.

macOS's <unistd.h> declares close() with an assembler label, so in a
full-LTO link (the release default) the IR linker keeps the declaration and
a static close of another module apart without renaming the static, and both
emit as _close: every C-library close() in the merged module branches into
an extractor. The fdopen() failure paths of libvmaf.c, cambi.c and svm.cpp
make that call too. glibc has no label, so Linux never showed it.

The 17 callbacks are close_fex, the GPU twins' naming; nothing else changes.
test_libc_named_internal_functions refuses a static C function named after a
C library or POSIX function and reports the 17 on master.

* test(ci): stub node in test-dedupe-gate.sh to isolate governance sequence

test-dedupe-gate.sh verifies the standardsctl governance sequence and that dedupe scan failure is propagated by make verify-all. When verify-all gained the praetor documentation gates (docs-lint, docs-figures), make started executing node to lint all markdown files, causing timeouts and failures under host load. Stub node in the temporary directory alongside standardsctl so the unit contract test evaluates only the dedupe sequence.
* chore(tidy): make cert-err33-c a hard stop in .clang-tidy

ADR-0694 asked for cert-err33-c in WarningsAsErrors once its violations were
swept. The ADR-1142 cleanups did that sweep: a full run of the cpu, cuda, hip
and sycl lanes in the dev container (clang-tidy 22.1.8) reports no cert-err33-c
diagnostic, and the last arm64 report has none. The check is promoted now, so
a new unchecked fclose() or fputs() fails Tidy Changed instead of joining a
baseline. A planted fclose(f); gives exit 0 as a warning and exit 1 with the
promotion.

Closes T-CERT-ERR33-SWEEP.
@lusoris
lusoris force-pushed the chore/tidy-cert-err33-errors branch from 9ff7c6e to f327a87 Compare October 6, 2026 11:23
@lusoris
lusoris merged commit f327a87 into master Oct 6, 2026
5 of 89 checks passed
@lusoris
lusoris deleted the chore/tidy-cert-err33-errors branch October 6, 2026 11:24
@github-actions github-actions Bot added the type:chore Maintenance, no user-visible change label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:chore Maintenance, no user-visible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant