Repository navigation
infra(ci): replay the conversion ratchet with clang in the sanitizer lane (#3118) - #3120
Conversation
…3118) The replay tool landed in #3119 with no caller. This adds the two pins the caller needs before it can be wired in: the verdict function behind the exit status (a finding and a group that did not parse are red, a ratcheted directory a lane tree does not build is not), and the compile database on the sanitizer configure line the replay reads. Red on master: ci/test_conversion_clang_replay.py cannot import exit_status and test_sanitize_harness' configure case reports '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON' not found.
…3118) Replaying this tree's unity groups with clang (#3119) reports eight sites the gcc configuration does not, all in directories the ratchet already covers: libobs/obs-source-transition.c.h:836 size_t -> enum obs_transition_target plugins/obs-filters/hdr-tonemap-filter.c.h:72,82 plugins/obs-filters/sdr-on-hdr-filter.c.h:67,74 plugins/linux-v4l2/v4l2-busy.c.h:168 int -> uint32_t plugins/linux-v4l2/v4l2-input.c.h:150 int -> enum video_range_type plugins/linux-pipewire/camera-portal.c.h:1062 Each is the explicit conversion the compiler already performed implicitly, so no value changes and no warning is disabled. Two of the four directories (libobs, obs-filters) are compiled by the macOS app lane, so these were escapes waiting for the next nightly rather than Linux-only curiosities. Verify: uv run --no-project ci/conversion_clang_replay.py --compdb build/compile_commands.json before (8 findings, 4 groups) and after (0).
…lane (#3118) The ratchet is checked by whichever configuration compiles the target, and every Linux one of those is gcc; gcc has no -Wimplicit-int-conversion and a narrower -Wsign-conversion set, so a target can pass its own gcc replay and still fail the nightly's AppleClang app build (#3084, #3090, #2921 in one week). The sanitizer asan job already builds the whole app on the PR that changes a ratcheted target (#2923, ci/conversion_ratchet.py), so it is the lane that can afford a second compiler. Its configure line now exports compile_commands.json, and one step replays every unity group with clang -fsyntax-only plus the three conversion groups: 73 groups in ~7 s, no build and no link. --allow-uncovered exists because the sanitizer configuration deliberately turns vlc, vst, webrtc and the decklink plugins off: those ratcheted directories have no group in the tree and are reported, not failed. A real finding or a group that did not parse is still red. The strict default stays for a full app tree.
The sanitizer tree configures zccache as CMAKE_C_COMPILER_LAUNCHER, so its compile database entries read "zccache <compiler> <flags> …". Replacing only the first token handed clang the real compiler path as an input file, so the lane would have failed on every group. Drop the leading non-flag tokens and pin it with a case over a launched entry.
|
Prediction from an independent tree, worth checking before the asan pass finishes: this lane will report 16 more sites than the eight this PR fixes, all in one file set. I had started the same wiring as a Tier 2 step and measured the replay on a full app tree (257 unity groups,
23 distinct sites in total, by directory: The |
zackees
left a comment
There was a problem hiding this comment.
Coordinator review: correct. This edits the existing sanitizers.yaml rather than adding a workflow file. Running the replay only on the asan pass pays for it once. --allow-uncovered is opt-in, so the unit test keeps the strict default. The launcher skip drops every non-flag token before the first flag, which handles zccache /usr/bin/cc, and the new test pins it. RED is recorded. The eight C fixes are the sites the replay reports. Watch the dispatched pass that the body says closes #3118.
|
Checked against the real lane before queueing — the prediction did not hold on this tree. The asan pass on So That makes the ratchet's own verdict the evidence here: 140 groups, 0 findings, 0 parse failures. I am not adding a baseline for a set the lane does not report. |
|
Handed off to the coordinator Queue position 1 ( Refs #3118 — the lane is wired, runs, and passes on its own tree; #3118 closes when this lands. |
The clang replay landed in #3119 with no caller. This wires it into the lane that
already builds the app for a ratchet change, and fixes the eight sites it reports
on today's tree.
Refs #3118. Closes it once the lane runs green on a dispatched pass.
RED
ci/test_conversion_clang_replay.pyon master cannot importexit_status, andci/test_sanitize_harness.pyreports'-DCMAKE_EXPORT_COMPILE_COMMANDS=ON' not found in [...](commit
5cd232a40).The replay over this checkout's configured tree (
build/compile_commands.json,73 unity groups) on master:
Two of the four directories (
libobs,obs-filters) are compiled by the macOSapp lane, so those were escapes waiting for the next nightly — the class that
cost the daily run
41083530569(#3084, #3090, #2921).GREEN
value changes, no
-Wno-*, no per-file exemption; all six files are productsources (no existing C test edited). Same command after:
replayed 73 group(s) ... 0 group(s) with conversion findings.sanitize.py's configure lineexports
compile_commands.json, and one step insanitizers.yamlrunsuv run --no-project ci/conversion_clang_replay.py --compdb "$SAN_OUT/build-asan/compile_commands.json" --allow-uncovered— ~7 s, nothingbuilt or linked. The asan pass is the lane
ci_scope.pyalready selects for aPR that changes a ratcheted target (bug: master's Sanitizers lane is red — asan finds 8 conversion sites the Tier 2 build never compiles, valgrind finds a v4l2 format mismatch #2923), so the PR that opts a target in
pays for its own clang check.
--allow-uncoveredis the lane's tolerance. The sanitizer configurationdeliberately turns vlc, vst, webrtc and the decklink plugins off, so those
ratcheted directories have no group in that tree: they are reported, not
failed. A finding or a group that did not parse is still red; the strict
default (every ratcheted directory covered) stays for a full app tree.
Evidence
uv run python -m unittest ci.test_conversion_clang_replay ci.test_sanitize_harnessfromci/uv run ci/local_gate.py --only self-test== self-test: okuv run ruff checkon the four touched Python filesclang-format --dry-run --Werroron the six C sourcesci-lint precheck4 violation(s), 364 approved exception(s), 2 needs_review, identical toorigin/master(diffed, no delta)Not verified locally, stated plainly: the replay inside the sanitizer image. This
checkout's compdb cannot parse four groups (
X11/X.h,va/va.hare not on itsinclude path — the same Nix deps gap #3119 recorded), so the local run reports 4
failed-to-parse; the sanitizer build configures those targets from the apt deps,
and the dispatched pass below is the acceptance evidence.
Acceptance
gh workflow run sanitizers.yaml --ref fix/3118-clang-replay-lane -f tools=asan— the new step must print
0 group(s) with conversion findingsand the job muststay green.
Not handed off: a workflow-graph change is watched through merge.