[RFC] Scope and evidence rules for automated AI review of GCC patches
Uros Bizjak
ubizjak@gmail.com
Sun Dec 6 10:00:53 GMT 2026
Hi all,
Automated AI review tools such as Sashiko now comment on GCC patches.
They can find real problems, but they have no notion of scope. A human
reviewer asks whether this patch is correct and does what it claims. A
bot that keeps digging asks whether anything near this code is wrong,
and in a codebase with decades of accumulated assumptions that
question has no stopping point.
In my case, a small fix with a regression test led the bot to find a
series of issues in the surrounding pass, some of them unlikely ever
to be triggered. Findings cost the bot almost nothing, while every
dismissal costs the submitter real investigation time. Most of us are
volunteers, and the rational response to an open-ended audit is to
stop sending small fixes. I would like to propose some simple rules.
Principles:
A patch is judged on whether it fixes its stated problem without
introducing regressions.
Bot output is advisory, and humans decide.
The burden of proof is symmetric: a finding carries evidence, and a
dismissal only has to answer that evidence.
Classification of findings (tools should label them):
A. Patch defect: the patch is wrong, incomplete for its stated goal,
or regresses something. May block.
B. Directly affected: existing code whose behavior the patch changes,
e.g. a direct caller. May block if the patch makes it worse.
C. Pre-existing: present before the patch and not affected by it.
Never blocks, handled as follow-up.
D. Unsubstantiated: no concrete input, testcase or traced path. Never
blocks, can be ignored without investigation.
Requests for the review tool configuration:
Only class A and B findings may be marked as blocking. Class C
findings go into a separate non-blocking section, if reported at all.
A blocking finding must come with a concrete input or testcase, or at
least a traced path from the changed code to the misbehavior.
Each finding states its reachability: ordinary user code, a specific
target or option combination, or input that earlier passes or target
constraints rule out.
A review of a revised patch looks at the revision and still-open
findings. It does not start a new audit of the surrounding file or
pass.
The number of findings per review is bounded and ranked by severity
and reachability.
Submitter replies recognized as sufficient:
Valid, fixed (class A/B).
Valid, pre-existing, out of scope: "Present before this patch and not
affected by it, tracked as PR NNNNN" or "will follow up separately".
One PR per patch is enough for all class C findings.
Unreachable: one sentence naming what rules the scenario out.
False positive: one sentence on what the tool misread.
No evidence provided: no investigation needed.
Submitters are encouraged to state the intended scope in the cover
text, e.g. "This patch fixes X. Findings about unrelated pre-existing
behavior of this pass will be handled separately."
Reviewer and maintainer side:
A maintainer may approve a patch while class C and D findings remain open.
Reviewers should not relay unresolved bot findings as their own
requests unless they have verified them independently.
If a reviewer thinks a class C finding is worth fixing, they ask for a
follow-up and do not hold up the original patch.
This is not meant to discourage finding or reporting pre-existing
bugs, only to separate that from approval of an unrelated patch. It
changes nothing about testsuite requirements or maintainer approval,
and human reviewers remain free to raise broader concerns.
I suggest trying this for one release cycle and tracking the share of
findings by class, the number of review rounds before approval, and
contributor feedback on time spent answering findings. Then keep,
adjust or drop the rules based on the results.
Comments welcome, in particular from those who run or configure the
review tooling.
Thanks,
Uros
More information about the Gcc
mailing list