Stabilize Coverity Scan triage and document known false positives - #164
Open
antonwolfy wants to merge 1 commit into
Open
Stabilize Coverity Scan triage and document known false positives#164antonwolfy wants to merge 1 commit into
antonwolfy wants to merge 1 commit into
Conversation
antonwolfy
requested review from
jharlow-intel,
ndgrigorian,
vlad-perevezentsev and
xaleryb
as code owners
August 24, 2026 11:43
antonwolfy
force-pushed
the
coverity-triage-policy
branch
4 times, most recently
from
August 24, 2026 13:27
da7f337 to
1ace711
Compare
Pin Cython in the Coverity Scan workflow (only) so the generated mklrand.cpp is byte-stable between scans. Coverity derives CIDs from a hash of the analyzed code, so an unpinned Cython bump regenerates the file, resets every CID, and silently discards prior triage on the Cython-boilerplate false positives. Production builds keep Cython unpinned in pyproject.toml, so this does not affect shipped wheels or Python support. Add coverity/README.md recording the known false-positive families in generated code (DEADCODE / UNUSED_VALUE / CHECKED_RETURN / OUT_OF_BOUNDS), the verification of the High-severity _seed_impl OOB finding, the real INTEGER_OVERFLOW fix (gh-156), and a review checklist that keeps first-party src/*.cpp and __pyx_pf_* bodies in scope rather than blanket-excluding the generated unit.
antonwolfy
force-pushed
the
coverity-triage-policy
branch
from
August 24, 2026 14:19
1ace711 to
e4a5188
Compare
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
Coverity Scan runs weekly against
mkl_random. The overwhelming majority of findings are in the Cython-generatedmklrand.cpp, not in code we maintain — boilerplate artifacts (DEADCODE / UNUSED_VALUE / CHECKED_RETURN) produced by Cython's single-source-for-many-build-configs templating.We hit a concrete failure mode: a new Cython release regenerated
mklrand.cpp, which churned the Coverity CIDs across the generated unit and silently dropped all prior triage on the boilerplate — the whole noise set reappeared under new CID numbers, alongside one new High-severity finding that turned out benign on inspection.This PR makes triage durable and records the policy so the noise stays filtered while real signal keeps getting reviewed.
Changes
cython==3.3.0in.github/workflows/coverity.yml). A Cython version bump regeneratesmklrand.cppwholesale (renamed helpers, reshuffled lines), which churns CIDs and their triage; pinning keeps the generated code stable between scans. The pin takes effect because the build runs with--no-build-isolation. Production builds leave Cython unpinned inpyproject.toml, so shipped wheels and Python-version support are unaffected. Bumping the pin is a deliberate act that will require re-triaging the boilerplate.coverity/README.md, a triage guide with three parts:mkl_random/src/and__pyx_pf_*bodies in scope rather than blanket-excluding the generated unit._seed_implOUT_OF_BOUNDS finding (guarded 2-tuple unpack — false positive).cov-manage-emithard-exclude left disabled by default.Rationale
We deliberately do not hard-exclude the generated translation unit: that would also drop the
__pyx_pf_*bodies and could hide a genuine.pyx-logic bug. The chosen approach cuts the recurring noise (CID stability via the pin + a documented triage policy) while preserving coverage of the hand-written C++, where a real defect is most likely to appear.Changelog
Added a
Changedentry under[dev].