Repository navigation
fix(lint): bring the cpu tidy lane back to its baseline - #1785
Merged
Merged
Conversation
lusoris
force-pushed
the
fix/cpu-tidy-regressions
branch
from
October 1, 2026 23:47
e996bf4 to
ac97a4d
Compare
* fix(picture_pool): declare callback error code const to resolve misc-const-correctness * fix(model): use std::cmp_greater_equal for buffer size check in read_json_model * fix(test): resolve implicit widening and function size in test_psnr_hvs_score * refactor(test): split pool return check into helper in test_read_pictures_failure_ownership * fix(cli): replace runtime assert with explicit guards in FrameReader * docs: record T-TIDY-CPU-LANE-ABOVE-BASELINE-2026-10-02 resolution and rebase note * docs: regenerate the indexes and the citation map after rebasing
lusoris
force-pushed
the
fix/cpu-tidy-regressions
branch
from
October 1, 2026 23:55
ac97a4d to
a16253b
Compare
This was referenced Oct 2, 2026
lusoris
added a commit
that referenced
this pull request
Oct 2, 2026
* fix(cli): restore the read-ahead's invariant assertions A lint cleanup (#1785) replaced the seven assert()s of FrameReader and release_fetched_picture() by early returns and folded conditions. The clang-tidy finding behind it (misc-static-assert, cert-dcl03-c) is a false positive of clang-tidy 22 on glibc 2.44 hosts: glibc's C++ assert macro expands to a conditional with a constant arm, and the check then fires for every runtime assert. The CI image (glibc 2.39) reports none, so the committed baseline was right. The replacements changed what a broken invariant does: publish() dropped the frame, wait_for_free_slot() ended the reader as if the stream were over, start() and next() returned silently. All seven assertions and <cassert> are back; the other four files of #1785 keep their fixes. test_cli_frame_reader_asserts_contract lists all seven on master and none here, and reports two planted replacements. Debug build with the assertions active: fast suite 232 of 232, CLI on the Netflix pair exits 0. Closes T-CLI-FRAME-READER-ASSERTS-REPLACED-2026-10-02 and defers T-TIDY-GLIBC-244-STATIC-ASSERT-FALSE-POSITIVE-2026-10-02. * docs: regenerate the indexes and the citation map after rebasing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bring the CPU clang-tidy lane back to its baseline of zero regressions.
The local merge train does not run the clang-tidy ratchet, and PRs landed on 2026-10-01 raised the CPU lane above its baseline by 13 findings across 5 files. All 13 findings have been resolved via refactoring without raising any baseline and without adding any uncited
NOLINTcomments.Baselined Findings & Origin PRs
core/src/picture_pool.cpp(+1 finding)• Finding:
misc-const-correctnessat line 76 (int errcould be declaredconst).• Origin PR: PR perf(sycl): preallocate pinned host pictures for zero-copy 4K CLI upload (ADR-1410) #1693 (commit
67169ca4c).• Fix: Declared
const int err = munmap(...)indefault_picture_free.core/src/read_json_model.cpp(+1 finding)• Finding:
modernize-use-integer-sign-comparisonat line 72 ((size_t)sz >= buf_szcompares signed and unsigned integers).• Origin PR: PR port(upstream): avoid submodel name truncation in read_json_model (#1428) #1671 (commit
70a7c3c84).• Fix: Used C++20
std::cmp_greater_equal(sz, buf_sz)to compare signedoff_twith unsignedsize_tsafely.core/test/test_psnr_hvs_score.c(+3 findings)• Findings: 2x
bugprone-implicit-widening-of-multiplication-result(lines 53, 56:w * h * sizeof(float)evaluated as 32-bit before widening to 64-bitsize_t); 1xreadability-function-size(96 lines exceeds 80-line threshold).• Origin PR: PR perf(sycl,hip): compact nonzero terms before psnr_hvs readback (ADR-1397) #1733 (commit
2a3661c6f).• Fix: Explicitly cast leading dimension
(size_t)w * h * sizeof(float). Extracted buffer allocation and synthetic pattern generation into static helperalloc_test_buffers, reducingtest_psnr_hvs_scoreto 47 LOC.core/test/test_read_pictures_failure_ownership.c(+1 finding)• Finding:
readability-function-size(84 lines exceeds 80-line threshold).• Origin PR: PR fix(core): vmaf_read_pictures owns its pictures on every return (ADR-1431) #1752 (commit
b57f27201).• Fix: Extracted picture pool ownership verification loop into static helper
verify_pictures_returned_to_pool, reducing test function length to 54 LOC.core/tools/vmaf.cpp(+7 findings)• Findings: 7x
cert-dcl03-c,misc-static-assert(runtimeassert()statements triggered static assert check recommendations).• Origin PR: PR perf(cli): read each input on its own thread, two frames ahead of scoring #1635 (commit
49de09bbd).• Fix: Replaced
assert()assertions inFrameReader::read_framewith explicit runtime boundary checks returningEINVAL, adhering to project error-handling standards.Verification
•
scripts/ci/tidy-ratchet.py --lane cpu --build-dir build --allow-slack:• 0 regressions over baseline (exit code 0).
• Total warnings down to 470 (baseline is 474).
• Zero uncited NOLINTs.
•
python3 scripts/ci/run_meson_test.py -- -C build --suite=fast: 228/228 tests passed.•
python3 scripts/ci/run_meson_test.py -- -C build: 243/243 tests passed (1 skipped).•
vmafCLI output on Netflix reference pair (src01_hrc00_576x324.yuvvssrc01_hrc01_576x324.yuv): JSON output byte-identical before and after (excluding non-deterministic runtime"fps"field).•
scripts/ci/check-state-md-rows.sh: All 1,028 rows clean.• Pre-push hooks: mkdocs strict build, Praetor HISS invariant checks, dedupe scan, and security audit all passed.
Bug-status hygiene (ADR-0165)
docs/state.mdupdated in this PR:T-TIDY-CPU-LANE-ABOVE-BASELINE-2026-10-02opened and closed in this PR with before/after counts and root cause analysis (local merge train lacks clang-tidy ratchet gate).Netflix golden-data gate (ADR-0024)
assertAlmostEqual(...)score in the Netflix golden Python tests.Deep-dive deliverables (ADR-0108)
AGENTS.mdinvariant note — no rebase-sensitive invariants.changelog.d/fixed/cpu-lane-tidy-regressions.mdadded.docs/rebase-notes.md.Reproducer