Repository navigation
Conversation
[ghstack-poisoned]
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - Ready for human review:
Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/202952
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 77ddd45 with merge base cb9eb4b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
[ghstack-poisoned]
## Linked issue or supporting maintainer Supported by izaitsevfb ## BC-breaking? No ## Summary (human written only) Force the model to fanout to make single run captures all the issues ## Agent details (if applicable) > *This section was drafted with an AI assistant (Claude Code) and reviewed by the author.* **Problem.** Independent first reviews of the same PR at the same commit find different issues. On 12 PRs reviewed 10 times each, one run finds about 46% of the distinct issues the 10 runs find together (58% of the blocking ones); the count levels off near 51 issues (36 blocking). **Why.** The skill asks for 3-8 overlapping sub-agents, but only as a suggestion for "medium" PRs and when unsure. In practice reviews are a single pass: 3 of 33 runs of the weekly eval on GitHub Actions spawned any sub-agent, and the same 3 of 33 locally. Putting the rule only in the skill was not enough: the agent still skipped it (0-1 sub-agents per run). **Change.** - `SKILL.md`: Step 2 always spawns four reviewers in parallel (correctness; tests; API and compatibility; conventions), whatever the PR's size; Step 5 always fact-checks with at least one agent. - `hardened-pr-review-run.yml`: a short "Fan-out" section in Stage A's appended system prompt that requires the Step 2 fan-out. **Results** (12 PRs, same commit and inputs as the baseline): | | issues per PR | of the baseline's known issues | of its blocking issues | new issues per PR | minutes / review | Stage A cost / review | |---|---|---|---|---|---|---| | one run today | 2.3 | 48% | 59% | - | ~1 | $0.54 | | one run with this change | 4.8 | 77% | 83% | 1.1 | ~9 | $4.15 | | 10 runs today (plateau) | 5.1 | 100% | 100% | - | - | ~$5.40 | Averages over the 10 PRs with at least one issue in some run (the other 2 had none in any baseline run). The new issues have not been fact-checked separately; some are low-confidence nits. Every run with this change spawned 5-7 sub-agents. **Trade-off.** About 8x the Stage A cost and longer reviews, in exchange for coverage close to ten runs of today's review. Stage A has no time-budget hook; its limit is the 35-minute step timeout. Stage A took at most 13.9 minutes on the 12 eval PRs, and 11.5 to 19.6 minutes on four larger PRs (42-117 KB diffs, up to 23 files), with 6-7 sub-agents each. **Test plan.** ``` python -m unittest discover -s scripts/pr_review -p 'test_*.py' # 544 tests OK ``` Eval: ciforge `run_local_eval.py` on the `pre_agent` dataset (12 PRs), 10 baseline runs per PR at the parent commit, 1 run per PR with this change; findings matched across runs with ciforge `consistency.py`'s pairing judge. ghstack-source-id: 51b5828 Pull-Request: #202952
## Linked issue or supporting maintainer Supported by izaitsevfb ## BC-breaking? No ## Summary (human written only) Force the model to fanout to make single run captures all the issues ## Agent details (if applicable) > *This section was drafted with an AI assistant (Claude Code) and reviewed by the author.* **Problem.** Independent first reviews of the same PR at the same commit find different issues. On 12 PRs reviewed 10 times each, one run finds about 46% of the distinct issues the 10 runs find together (58% of the blocking ones); the count levels off near 51 issues (36 blocking). **Why.** The skill asks for 3-8 overlapping sub-agents, but only as a suggestion for "medium" PRs and when unsure. In practice reviews are a single pass: 3 of 33 runs of the weekly eval on GitHub Actions spawned any sub-agent, and the same 3 of 33 locally. Putting the rule only in the skill was not enough: the agent still skipped it (0-1 sub-agents per run). **Change.** - `SKILL.md`: Step 2 always spawns four reviewers in parallel (correctness; tests; API and compatibility; conventions), whatever the PR's size; Step 5 always fact-checks with at least one agent. - `hardened-pr-review-run.yml`: a short "Fan-out" section in Stage A's appended system prompt that requires the Step 2 fan-out. **Results** (12 PRs, same commit and inputs as the baseline): | | issues per PR | of the baseline's known issues | of its blocking issues | new issues per PR | minutes / review | Stage A cost / review | |---|---|---|---|---|---|---| | one run today | 2.3 | 48% | 59% | - | ~1 | $0.54 | | one run with this change | 4.8 | 77% | 83% | 1.1 | ~9 | $4.15 | | 10 runs today (plateau) | 5.1 | 100% | 100% | - | - | ~$5.40 | Averages over the 10 PRs with at least one issue in some run (the other 2 had none in any baseline run). The new issues have not been fact-checked separately; some are low-confidence nits. Every run with this change spawned 5-7 sub-agents. **Trade-off.** About 8x the Stage A cost and longer reviews, in exchange for coverage close to ten runs of today's review. Stage A has no time-budget hook; its limit is the 35-minute step timeout. Stage A took at most 13.9 minutes on the 12 eval PRs, and 11.5 to 19.6 minutes on four larger PRs (42-117 KB diffs, up to 23 files), with 6-7 sub-agents each. **Test plan.** ``` python -m unittest discover -s scripts/pr_review -p 'test_*.py' # 544 tests OK ``` Eval: ciforge `run_local_eval.py` on the `pre_agent` dataset (12 PRs), 10 baseline runs per PR at the parent commit, 1 run per PR with this change; findings matched across runs with ciforge `consistency.py`'s pairing judge. ghstack-source-id: 51b5828 Pull-Request: #202952
[ghstack-poisoned]
## Linked issue or supporting maintainer Supported by izaitsevfb ## BC-breaking? No ## Summary (human written only) Force the model to fanout to make single run captures all the issues ## Agent details (if applicable) > *This section was drafted with an AI assistant (Claude Code) and reviewed by the author.* **Problem.** Independent first reviews of the same PR at the same commit find different issues. On 12 PRs reviewed 10 times each, one run finds about 46% of the distinct issues the 10 runs find together (58% of the blocking ones); the count levels off near 51 issues (36 blocking). **Why.** The skill asks for 3-8 overlapping sub-agents, but only as a suggestion for "medium" PRs and when unsure. In practice reviews are a single pass: 3 of 33 runs of the weekly eval on GitHub Actions spawned any sub-agent, and the same 3 of 33 locally. Putting the rule only in the skill was not enough: the agent still skipped it (0-1 sub-agents per run). **Change.** - `SKILL.md`: Step 2 always spawns four reviewers in parallel (correctness; tests; API and compatibility; conventions), whatever the PR's size; Step 5 always fact-checks with at least one agent. - `hardened-pr-review-run.yml`: a short "Fan-out" section in Stage A's appended system prompt that requires the Step 2 fan-out. **Results** (12 PRs, same commit and inputs as the baseline): | | issues per PR | of the baseline's known issues | of its blocking issues | new issues per PR | minutes / review | Stage A cost / review | |---|---|---|---|---|---|---| | one run today | 2.3 | 48% | 59% | - | ~1 | $0.54 | | one run with this change | 4.8 | 77% | 83% | 1.1 | ~9 | $4.15 | | 10 runs today (plateau) | 5.1 | 100% | 100% | - | - | ~$5.40 | Averages over the 10 PRs with at least one issue in some run (the other 2 had none in any baseline run). The new issues have not been fact-checked separately; some are low-confidence nits. Every run with this change spawned 5-7 sub-agents. **Trade-off.** About 8x the Stage A cost and longer reviews, in exchange for coverage close to ten runs of today's review. Stage A has no time-budget hook; its limit is the 35-minute step timeout. Stage A took at most 13.9 minutes on the 12 eval PRs, and 11.5 to 19.6 minutes on four larger PRs (42-117 KB diffs, up to 23 files), with 6-7 sub-agents each. The rule is in the shared skill, so it also applies to local `/pr-review` runs and to `@claude` reviews that have the Agent tool. **Test plan.** ``` python -m unittest discover -s scripts/pr_review -p 'test_*.py' # 544 tests OK ``` Eval: ciforge `run_local_eval.py` on the `pre_agent` dataset (12 PRs), 10 baseline runs per PR at the parent commit, 1 run per PR with this change; findings matched across runs with ciforge `consistency.py`'s pairing judge. ghstack-source-id: acdb5e2 Pull-Request: #202952
## Linked issue or supporting maintainer Supported by izaitsevfb ## BC-breaking? No ## Summary (human written only) Force the model to fanout to make single run captures all the issues ## Agent details (if applicable) > *This section was drafted with an AI assistant (Claude Code) and reviewed by the author.* **Problem.** Independent first reviews of the same PR at the same commit find different issues. On 12 PRs reviewed 10 times each, one run finds about 46% of the distinct issues the 10 runs find together (58% of the blocking ones); the count levels off near 51 issues (36 blocking). **Why.** The skill asks for 3-8 overlapping sub-agents, but only as a suggestion for "medium" PRs and when unsure. In practice reviews are a single pass: 3 of 33 runs of the weekly eval on GitHub Actions spawned any sub-agent, and the same 3 of 33 locally. Putting the rule only in the skill was not enough: the agent still skipped it (0-1 sub-agents per run). **Change.** - `SKILL.md`: Step 2 always spawns four reviewers in parallel (correctness; tests; API and compatibility; conventions), whatever the PR's size; Step 5 always fact-checks with at least one agent. - `hardened-pr-review-run.yml`: a short "Fan-out" section in Stage A's appended system prompt that requires the Step 2 fan-out. **Results** (12 PRs, same commit and inputs as the baseline): | | issues per PR | of the baseline's known issues | of its blocking issues | new issues per PR | minutes / review | Stage A cost / review | |---|---|---|---|---|---|---| | one run today | 2.3 | 48% | 59% | - | ~1 | $0.54 | | one run with this change | 4.8 | 77% | 83% | 1.1 | ~9 | $4.15 | | 10 runs today (plateau) | 5.1 | 100% | 100% | - | - | ~$5.40 | Averages over the 10 PRs with at least one issue in some run (the other 2 had none in any baseline run). The new issues have not been fact-checked separately; some are low-confidence nits. Every run with this change spawned 5-7 sub-agents. **Trade-off.** About 8x the Stage A cost and longer reviews, in exchange for coverage close to ten runs of today's review. Stage A has no time-budget hook; its limit is the 35-minute step timeout. Stage A took at most 13.9 minutes on the 12 eval PRs, and 11.5 to 19.6 minutes on four larger PRs (42-117 KB diffs, up to 23 files), with 6-7 sub-agents each. The rule is in the shared skill, so it also applies to local `/pr-review` runs and to `@claude` reviews that have the Agent tool. **Test plan.** ``` python -m unittest discover -s scripts/pr_review -p 'test_*.py' # 544 tests OK ``` Eval: ciforge `run_local_eval.py` on the `pre_agent` dataset (12 PRs), 10 baseline runs per PR at the parent commit, 1 run per PR with this change; findings matched across runs with ciforge `consistency.py`'s pairing judge. ghstack-source-id: acdb5e2 Pull-Request: #202952
[ghstack-poisoned]
## Linked issue or supporting maintainer Supported by izaitsevfb ## BC-breaking? No ## Summary (human written only) Force the model to fanout to make single run captures all the issues ## Agent details (if applicable) > *This section was drafted with an AI assistant (Claude Code) and reviewed by the author.* **Problem.** Independent first reviews of the same PR at the same commit find different issues. On 12 PRs reviewed 10 times each, one run finds about 46% of the distinct issues the 10 runs find together (58% of the blocking ones); the count levels off near 51 issues (36 blocking). **Why.** The skill asks for 3-8 overlapping sub-agents, but only as a suggestion for "medium" PRs and when unsure. In practice reviews are a single pass: 3 of 33 runs of the weekly eval on GitHub Actions spawned any sub-agent, and the same 3 of 33 locally. Putting the rule only in the skill was not enough: the agent still skipped it (0-1 sub-agents per run). **Change.** - `SKILL.md`: Step 2 always spawns four reviewers in parallel (correctness; tests; API and compatibility; conventions), whatever the PR's size; Step 5 always fact-checks with at least one agent. - `hardened-pr-review-run.yml`: a short "Fan-out" section in Stage A's appended system prompt that requires the Step 2 fan-out. **Results** (12 PRs, same commit and inputs as the baseline): | | issues per PR | of the baseline's known issues | of its blocking issues | new issues per PR | minutes / review | Stage A cost / review | |---|---|---|---|---|---|---| | one run today | 2.3 | 48% | 59% | - | ~1 | $0.54 | | one run with this change | 4.8 | 77% | 83% | 1.1 | ~9 | $4.15 | | 10 runs today (plateau) | 5.1 | 100% | 100% | - | - | ~$5.40 | Averages over the 10 PRs with at least one issue in some run (the other 2 had none in any baseline run). The new issues have not been fact-checked separately; some are low-confidence nits. Every run with this change spawned 5-7 sub-agents. **Trade-off.** About 8x the Stage A cost and longer reviews, in exchange for coverage close to ten runs of today's review. Stage A has no time-budget hook; its limit is the 35-minute step timeout. Stage A took at most 13.9 minutes on the 12 eval PRs, and 11.5 to 19.6 minutes on four larger PRs (42-117 KB diffs, up to 23 files), with 6-7 sub-agents each. The rule is in the shared skill, so it also applies to local `/pr-review` runs and to `@claude` reviews that have the Agent tool. **Test plan.** ``` python -m unittest discover -s scripts/pr_review -p 'test_*.py' # 544 tests OK ``` Eval: ciforge `run_local_eval.py` on the `pre_agent` dataset (12 PRs), 10 baseline runs per PR at the parent commit, 1 run per PR with this change; findings matched across runs with ciforge `consistency.py`'s pairing judge. ghstack-source-id: ad75d92 Pull-Request: #202952
[ghstack-poisoned]
## Linked issue or supporting maintainer Supported by izaitsevfb ## BC-breaking? No ## Summary (human written only) Force the model to fanout to make single run captures all the issues ## Agent details (if applicable) > *This section was drafted with an AI assistant (Claude Code) and reviewed by the author.* **Problem.** Independent first reviews of the same PR at the same commit find different issues. On 12 PRs reviewed 10 times each, one run finds about 46% of the distinct issues the 10 runs find together (58% of the blocking ones); the count levels off near 51 issues (36 blocking). **Why.** The skill asks for 3-8 overlapping sub-agents, but only as a suggestion for "medium" PRs and when unsure. In practice reviews are a single pass: 3 of 33 runs of the weekly eval on GitHub Actions spawned any sub-agent, and the same 3 of 33 locally. Putting the rule only in the skill was not enough: the agent still skipped it (0-1 sub-agents per run). **Change.** - `SKILL.md`: Step 2 always spawns four reviewers in parallel (correctness; tests; API and compatibility; conventions), whatever the PR's size; Step 5 always fact-checks with at least one agent. - `hardened-pr-review-run.yml`: a short "Fan-out" section in Stage A's appended system prompt that requires the Step 2 fan-out. **Results** (12 PRs, same commit and inputs as the baseline): | | issues per PR | of the baseline's known issues | of its blocking issues | new issues per PR | minutes / review | Stage A cost / review | |---|---|---|---|---|---|---| | one run today | 2.3 | 48% | 59% | - | ~1 | $0.54 | | one run with this change | 4.8 | 77% | 83% | 1.1 | ~9 | $4.15 | | 10 runs today (plateau) | 5.1 | 100% | 100% | - | - | ~$5.40 | Averages over the 10 PRs with at least one issue in some run (the other 2 had none in any baseline run). The new issues have not been fact-checked separately; some are low-confidence nits. Every run with this change spawned 5-7 sub-agents. **Trade-off.** About 8x the Stage A cost and longer reviews, in exchange for coverage close to ten runs of today's review. Stage A has no time-budget hook; its limit is the 35-minute step timeout. Stage A took at most 13.9 minutes on the 12 eval PRs, and 11.5 to 19.6 minutes on four larger PRs (42-117 KB diffs, up to 23 files), with 6-7 sub-agents each. The rule is in the shared skill, so it also applies to local `/pr-review` runs and to `@claude` reviews that have the Agent tool. **Test plan.** ``` python -m unittest discover -s scripts/pr_review -p 'test_*.py' # 544 tests OK ``` Eval: ciforge `run_local_eval.py` on the `pre_agent` dataset (12 PRs), 10 baseline runs per PR at the parent commit, 1 run per PR with this change; findings matched across runs with ciforge `consistency.py`'s pairing judge. ghstack-source-id: 3b0dc79 Pull-Request: #202952
[ghstack-poisoned]
## Linked issue or supporting maintainer Supported by izaitsevfb ## BC-breaking? No ## Summary (human written only) Force the model to fanout to make single run captures all the issues ## Agent details (if applicable) > *This section was drafted with an AI assistant (Claude Code) and reviewed by the author.* **Problem.** Independent first reviews of the same PR at the same commit find different issues. On 12 PRs reviewed 10 times each, one run finds about 46% of the distinct issues the 10 runs find together (58% of the blocking ones); the count levels off near 51 issues (36 blocking). **Why.** The skill asks for 3-8 overlapping sub-agents, but only as a suggestion for "medium" PRs and when unsure. In practice reviews are a single pass: 3 of 33 runs of the weekly eval on GitHub Actions spawned any sub-agent, and the same 3 of 33 locally. Putting the rule only in the skill was not enough: the agent still skipped it (0-1 sub-agents per run). **Change.** - `SKILL.md`: Step 2 always spawns four reviewers in parallel (correctness; tests; API and compatibility; conventions), whatever the PR's size; Step 5 always fact-checks with at least one agent. - `hardened-pr-review-run.yml`: a short "Fan-out" section in Stage A's appended system prompt that requires the Step 2 fan-out. **Results** (12 PRs, same commit and inputs as the baseline): | | issues per PR | of the baseline's known issues | of its blocking issues | new issues per PR | minutes / review | Stage A cost / review | |---|---|---|---|---|---|---| | one run today | 2.3 | 48% | 59% | - | ~1 | $0.54 | | one run with this change | 4.8 | 77% | 83% | 1.1 | ~9 | $4.15 | | 10 runs today (plateau) | 5.1 | 100% | 100% | - | - | ~$5.40 | Averages over the 10 PRs with at least one issue in some run (the other 2 had none in any baseline run). The new issues have not been fact-checked separately; some are low-confidence nits. Every run with this change spawned 5-7 sub-agents. **Trade-off.** About 8x the Stage A cost and longer reviews, in exchange for coverage close to ten runs of today's review. Stage A has no time-budget hook; its limit is the 35-minute step timeout. Stage A took at most 13.9 minutes on the 12 eval PRs, and 11.5 to 19.6 minutes on four larger PRs (42-117 KB diffs, up to 23 files), with 6-7 sub-agents each. The rule is in the shared skill, so it also applies to local `/pr-review` runs and to `@claude` reviews that have the Agent tool. **Test plan.** ``` python -m unittest discover -s scripts/pr_review -p 'test_*.py' # 544 tests OK ``` Eval: ciforge `run_local_eval.py` on the `pre_agent` dataset (12 PRs), 10 baseline runs per PR at the parent commit, 1 run per PR with this change; findings matched across runs with ciforge `consistency.py`'s pairing judge. ghstack-source-id: 5a8c65c Pull-Request: #202952
Withdrawn: the automated review of 77ddd45 found nothing blocking.
|
|
||
| A sub-agent does not see your system prompt, so give every reviewer, and every other sub-agent you spawn, the diff (its file path, or the diff itself when it is command output) and where the checkout is, and any rules your system prompt sets about untrusted pull request content, verbatim. When they return, review the diff yourself as well. Their reports are candidates, not findings: Step 4 merges them and Step 5 checks them. | ||
|
|
||
| Review every changed file covered by a `REVIEW.md` with its rules applied, including any rules they relax. With the fan-out, the reviewers above do this; without it, apply them yourself. |
There was a problem hiding this comment.
do we have any estimate on that?
How many of the fanned-out review's findings are correct? The eval reports how many of the baseline runs' issues one run finds, but not how many of its own findings hold up. (ai-generated section)
The Results table scores one fanned-out run against the issues ten baseline runs found together: 77% of them found, plus 1.1 new issues per PR, which the description says were not fact-checked separately and include some low-confidence nits. The skill treats every finding as a must-fix (Review Philosophy 5), so each extra finding the review posts asks the author for a change. If a real share of the extra ~2.5 findings per PR are wrong, the change buys fewer misses with more incorrect change requests, and the coverage numbers alone cannot show which way that nets out. A hand check of the fanned-out run's findings on the 12 eval PRs (valid, invalid, nit) would answer it.
There was a problem hiding this comment.
I ran the correctness judge on one fan-out run and one baseline run of the 12 eval PRs:
| One run | Findings | Correct | Incorrect/hallucinated | Unverifiable |
|---|---|---|---|---|
| baseline | 25 | 96% | 0 | 1 |
| fan-out | 53 | 92% | 0 | 4 |
| fan-out, issues no baseline run found | 13 | 85% | 0 | 2 |
The judge caught 40/40 planted false findings. Severity is the weaker part in both arms: most correct blocking findings rate as minor fixes or nits (12/13 baseline, 18/24 fan-out), so I'd treat severity calibration as a follow-up.
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
## Linked issue or supporting maintainer Follow-up to #202615 and #202952. ## BC-breaking? No. ## Summary (human written only) Sync with PR #202615 on removing tests review from review agent ## Agent details (if applicable) #202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed. The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. This change removes the contradiction; whether it lowers that share is for the production numbers to show. Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other. | | main | This change | |---|---|---| | Findings asking for tests the PR lacks | 8 | 0 | | Findings about how the PR's tests are written | 27 | 39 | | All findings | 152 | 163 | | Blocking findings | 46 | 50 | | Reviews requesting changes | 10 of 10 | 10 of 10 | The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic), and that part would still be raised under the exception. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . # local replays, once per arm (--main 47ffd6f for main): python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir> ``` This PR was authored with the help of an AI assistant (Claude). ghstack-source-id: d8fdcf1 Pull-Request: #203491
…the goalposts (#202634) ## Linked issue or supporting maintainer Part of pytorch/test-infra#9243 ## BC-breaking? No. ## Summary (human written only) Everytime the review agent is running, it introduces some new blockers regardless of what has been ficed and what has been asked by the author to ignore. ## Agent details (if applicable) On a re-review, the pr-review skill re-reviews the whole PR from scratch, and "Everything is a must-fix" turns every new observation into a blocker, so a PR whose author fixes each round's findings can still collect new blockers every round (pytorch/test-infra#9243; on #199555 the production review raised 1, 2, 2, 5, 6, 5, 4, 7, 5, 6, 7, 7, 6, 6, 7, 5 blocking findings over 16 rounds). This adds "Re-reviews converge" to "Earlier Automated Findings": settle the earlier blocking findings first (report one still present again as a continuing finding, drop one fixed or convincingly answered); review what changed since the last review in full; on code the last review covered and that has not changed since, raise a new blocking finding only for a defect with a concrete failure and say why it was not raised before; keep earlier non-blocking points non-blocking unless the code got worse or the concrete failure that rule requires can now be shown. Supporting changes in the same file: - The commit the last review saw comes from its body header ("Automated review of <sha>"), which every review has; `/tmp/pr-interdiff.txt` holds the changes since then when present, and modes with git can run `git diff <sha> HEAD`. Code whose change status the reviewer cannot tell is reviewed as changed, so a missing interdiff costs convergence, not recall. - "Covered" excludes files an earlier review named as not reviewed (early posts under the Time Budget) and code whose earlier findings were left out (`truncated`, or a body that says some findings did not fit); those get a first review, and so does the whole PR when the reviewer cannot tell which code an omitted finding was about. - An unaddressed maintainer comment still always blocks, whatever code it is on. - "Everything is a must-fix" now says exceptions are marked where they apply (runner naming and workflow REVIEW.md advisories already are) and names re-reviews among them, and the skill says to write "non-blocking" in such points, keep them out of the Recommendation's justification, and not recommend Request Changes when only non-blocking points remain. Without that, stage B and post_review.py post every finding as blocking under a Request Changes verdict. - With fan-out (#202952), the four reviewer sub-agents review the full diff and do not apply these rules, so the main agent does: on a re-review each reviewer marks its candidates as on changed or unchanged code, Step 4 applies "Re-reviews converge" to every merged finding before writing it up, and Step 5's fact-check requires rule 3's concrete failure for a new blocking finding on covered code. - Stage B's prompt says a point the review labels non-blocking is minor, never major, and that a review whose points are all non-blocking gets ready_for_human_review even under Request Changes, so a non-blocking point is never posted as a blocker, whatever the Recommendation. Evaluation: local replays of #199555 rounds 9-11 with production's prompts and models, 3 runs each, every round given the previous round's findings from the same run, as production gives them. Blocking findings in rounds 10 and 11, compared with that run's previous review (matched by an LLM judge): | | Round 10 (author added code) | Round 11 (10 changed lines) | |---|---|---| | Today's skill | 7: 2 new, 2 previously non-blocking | 7: 1 new, on unchanged code | | This change, with an interdiff | 8: 4 new, all on the code added in that round | 8: 0 new, 0 previously non-blocking | The hardened workflow does not provide `/tmp/pr-interdiff.txt` yet; without it the skill compares the earlier findings' code with HEAD. Providing it is a follow-up. One PR and three runs: a signal, not a measurement. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . lintrunner -a .agents/skills/pr-review/SKILL.md ``` This PR was authored with the help of an AI assistant (Claude). Pull Request resolved: #202634 Approved by: https://github.com/izaitsevfb
## Linked issue or supporting maintainer Follow-up to #202615 and #202952. ## BC-breaking? No. ## Summary (human written only) Sync with PR #202615 on removing tests review from review agent ## Agent details (if applicable) #202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed. The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. This change removes the contradiction; whether it lowers that share is for the production numbers to show. Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other. | | main | This change | |---|---|---| | Findings asking for tests the PR lacks | 8 | 0 | | Findings about how the PR's tests are written | 27 | 39 | | All findings | 152 | 163 | | Blocking findings | 46 | 50 | | Reviews requesting changes | 10 of 10 | 10 of 10 | The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic), and that part would still be raised under the exception. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . # local replays, once per arm (--main 47ffd6f for main): python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir> ``` This PR was authored with the help of an AI assistant (Claude). ghstack-source-id: 8210062 Pull-Request: #203491
## Linked issue or supporting maintainer Follow-up to #202615 and #202952. ## BC-breaking? No. ## Summary (human written only) Sync with PR #202615 on removing tests review from review agent ## Agent details (if applicable) #202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", which asks for the judgement #202615 removed. This drops "missing coverage" from that brief, so the brief matches #202615 again; the rest of the brief is unchanged. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . ``` This PR was authored with the help of an AI assistant (Claude). ghstack-source-id: 57eabaa Pull-Request: #203491
## Linked issue or supporting maintainer Follow-up to #202615 and #202952. ## BC-breaking? No. ## Summary (human written only) Sync with PR #202615 on removing tests review from review agent ## Agent details (if applicable) #202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed. The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. Per review, the share with at least one blocking missing-test finding was 24% before #202615, 26% between #202615 and #202952, and 36% after #202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show. Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other. | | main | This change | |---|---|---| | Findings asking for tests the PR lacks | 8 | 0 | | Findings about how the PR's tests are written | 27 | 39 | | All findings | 152 | 163 | | Blocking findings | 46 | 50 | | Reviews requesting changes | 10 of 10 | 10 of 10 | The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic), and that part would still be raised under the exception. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . # local replays, once per arm (--main 47ffd6f for main): python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir> ``` This PR was authored with the help of an AI assistant (Claude). ghstack-source-id: 8210062 Pull-Request: #203491
## Linked issue or supporting maintainer Follow-up to #202615 and #202952. ## BC-breaking? No. ## Summary (human written only) Sync with PR #202615 on removing tests review from review agent ## Agent details (if applicable) #202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed. The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. A test the PR deletes without explaining why is still a finding: asking to restore it is not asking for more tests. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. Per review, the share with at least one blocking missing-test finding was 24% before #202615, 26% between #202615 and #202952, and 36% after #202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show. Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other. | | main | This change | |---|---|---| | Findings asking for tests the PR lacks | 8 | 0 | | Findings about how the PR's tests are written | 27 | 39 | | All findings | 152 | 163 | | Blocking findings | 46 | 50 | | Reviews requesting changes | 10 of 10 | 10 of 10 | The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic) and one is about tests the PR deleted; both would still be raised under the final wording. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . # local replays, once per arm (--main 47ffd6f for main): python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir> ``` This PR was authored with the help of an AI assistant (Claude). ghstack-source-id: d4c0d17 Pull-Request: #203491
## Linked issue or supporting maintainer Follow-up to #202615 and #202952. ## BC-breaking? No. ## Summary (human written only) Sync with PR #202615 on removing tests review from review agent ## Agent details (if applicable) #202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed. The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. A test the PR deletes without explaining why is still a finding: asking to restore it is not asking for more tests. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. Per review, the share with at least one blocking missing-test finding was 24% before #202615, 26% between #202615 and #202952, and 36% after #202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show. Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other. | | main | This change | |---|---|---| | Findings asking for tests the PR lacks | 8 | 0 | | Findings about how the PR's tests are written | 27 | 39 | | All findings | 152 | 163 | | Blocking findings | 46 | 50 | | Reviews requesting changes | 10 of 10 | 10 of 10 | The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic) and one is about tests the PR deleted; both would still be raised under the final wording. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . # local replays, once per arm (--main 47ffd6f for main): python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir> ``` This PR was authored with the help of an AI assistant (Claude). ghstack-source-id: 7c08175 Pull-Request: #203491
#203491) ## Linked issue or supporting maintainer Follow-up to #202615 and #202952. ## BC-breaking? No. ## Summary (human written only) Sync with PR #202615 on removing tests review from review agent ## Agent details (if applicable) #202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed. The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. A test the PR deletes without explaining why is still a finding: asking to restore it is not asking for more tests. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. Per review, the share with at least one blocking missing-test finding was 24% before #202615, 26% between #202615 and #202952, and 36% after #202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show. Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other. | | main | This change | |---|---|---| | Findings asking for tests the PR lacks | 8 | 0 | | Findings about how the PR's tests are written | 27 | 39 | | All findings | 152 | 163 | | Blocking findings | 46 | 50 | | Reviews requesting changes | 10 of 10 | 10 of 10 | The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic) and one is about tests the PR deleted; both would still be raised under the final wording. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . # local replays, once per arm (--main 47ffd6f for main): python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir> ``` This PR was authored with the help of an AI assistant (Claude). Pull Request resolved: #203491 Approved by: https://github.com/huydhn
## Linked issue or supporting maintainer Supported by izaitsevfb ## BC-breaking? No ## Summary (human written only) Force the model to fanout to make single run captures all the issues ## Agent details (if applicable) > *This section was drafted with an AI assistant (Claude Code) and reviewed by the author.* **Problem.** Independent first reviews of the same PR at the same commit find different issues. On 12 PRs reviewed 10 times each, one run finds about 46% of the distinct issues the 10 runs find together (58% of the blocking ones); the count levels off near 51 issues (36 blocking). **Why.** The skill asks for 3-8 overlapping sub-agents, but only as a suggestion for "medium" PRs and when unsure. In practice reviews are a single pass: 3 of 33 runs of the weekly eval on GitHub Actions spawned any sub-agent, and the same 3 of 33 locally. Putting the rule only in the skill was not enough: the agent still skipped it (0-1 sub-agents per run). **Change.** - `SKILL.md`: Step 2 always spawns four reviewers in parallel (correctness; tests; API and compatibility; conventions), whatever the PR's size; Step 5 always fact-checks with at least one agent. - `hardened-pr-review-run.yml`: a short "Fan-out" section in Stage A's appended system prompt that requires the Step 2 fan-out. **Results** (12 PRs, same commit and inputs as the baseline): | | issues per PR | of the baseline's known issues | of its blocking issues | new issues per PR | minutes / review | Stage A cost / review | |---|---|---|---|---|---|---| | one run today | 2.3 | 48% | 59% | - | ~1 | $0.54 | | one run with this change | 4.8 | 77% | 83% | 1.1 | ~9 | $4.15 | | 10 runs today (plateau) | 5.1 | 100% | 100% | - | - | ~$5.40 | Averages over the 10 PRs with at least one issue in some run (the other 2 had none in any baseline run). The new issues have not been fact-checked separately; some are low-confidence nits. Every run with this change spawned 5-7 sub-agents. **Trade-off.** About 8x the Stage A cost and longer reviews, in exchange for coverage close to ten runs of today's review. Stage A has no time-budget hook; its limit is the 35-minute step timeout. Stage A took at most 13.9 minutes on the 12 eval PRs, and 11.5 to 19.6 minutes on four larger PRs (42-117 KB diffs, up to 23 files), with 6-7 sub-agents each. The rule is in the shared skill, so it also applies to local `/pr-review` runs and to `@claude` reviews that have the Agent tool. **Test plan.** ``` python -m unittest discover -s scripts/pr_review -p 'test_*.py' # 544 tests OK ``` Eval: ciforge `run_local_eval.py` on the `pre_agent` dataset (12 PRs), 10 baseline runs per PR at the parent commit, 1 run per PR with this change; findings matched across runs with ciforge `consistency.py`'s pairing judge. Pull Request resolved: pytorch#202952 Approved by: https://github.com/izaitsevfb, https://github.com/albanD
…the goalposts (pytorch#202634) ## Linked issue or supporting maintainer Part of pytorch/test-infra#9243 ## BC-breaking? No. ## Summary (human written only) Everytime the review agent is running, it introduces some new blockers regardless of what has been ficed and what has been asked by the author to ignore. ## Agent details (if applicable) On a re-review, the pr-review skill re-reviews the whole PR from scratch, and "Everything is a must-fix" turns every new observation into a blocker, so a PR whose author fixes each round's findings can still collect new blockers every round (pytorch/test-infra#9243; on pytorch#199555 the production review raised 1, 2, 2, 5, 6, 5, 4, 7, 5, 6, 7, 7, 6, 6, 7, 5 blocking findings over 16 rounds). This adds "Re-reviews converge" to "Earlier Automated Findings": settle the earlier blocking findings first (report one still present again as a continuing finding, drop one fixed or convincingly answered); review what changed since the last review in full; on code the last review covered and that has not changed since, raise a new blocking finding only for a defect with a concrete failure and say why it was not raised before; keep earlier non-blocking points non-blocking unless the code got worse or the concrete failure that rule requires can now be shown. Supporting changes in the same file: - The commit the last review saw comes from its body header ("Automated review of <sha>"), which every review has; `/tmp/pr-interdiff.txt` holds the changes since then when present, and modes with git can run `git diff <sha> HEAD`. Code whose change status the reviewer cannot tell is reviewed as changed, so a missing interdiff costs convergence, not recall. - "Covered" excludes files an earlier review named as not reviewed (early posts under the Time Budget) and code whose earlier findings were left out (`truncated`, or a body that says some findings did not fit); those get a first review, and so does the whole PR when the reviewer cannot tell which code an omitted finding was about. - An unaddressed maintainer comment still always blocks, whatever code it is on. - "Everything is a must-fix" now says exceptions are marked where they apply (runner naming and workflow REVIEW.md advisories already are) and names re-reviews among them, and the skill says to write "non-blocking" in such points, keep them out of the Recommendation's justification, and not recommend Request Changes when only non-blocking points remain. Without that, stage B and post_review.py post every finding as blocking under a Request Changes verdict. - With fan-out (pytorch#202952), the four reviewer sub-agents review the full diff and do not apply these rules, so the main agent does: on a re-review each reviewer marks its candidates as on changed or unchanged code, Step 4 applies "Re-reviews converge" to every merged finding before writing it up, and Step 5's fact-check requires rule 3's concrete failure for a new blocking finding on covered code. - Stage B's prompt says a point the review labels non-blocking is minor, never major, and that a review whose points are all non-blocking gets ready_for_human_review even under Request Changes, so a non-blocking point is never posted as a blocker, whatever the Recommendation. Evaluation: local replays of pytorch#199555 rounds 9-11 with production's prompts and models, 3 runs each, every round given the previous round's findings from the same run, as production gives them. Blocking findings in rounds 10 and 11, compared with that run's previous review (matched by an LLM judge): | | Round 10 (author added code) | Round 11 (10 changed lines) | |---|---|---| | Today's skill | 7: 2 new, 2 previously non-blocking | 7: 1 new, on unchanged code | | This change, with an interdiff | 8: 4 new, all on the code added in that round | 8: 0 new, 0 previously non-blocking | The hardened workflow does not provide `/tmp/pr-interdiff.txt` yet; without it the skill compares the earlier findings' code with HEAD. Providing it is a follow-up. One PR and three runs: a signal, not a measurement. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . lintrunner -a .agents/skills/pr-review/SKILL.md ``` This PR was authored with the help of an AI assistant (Claude). Pull Request resolved: pytorch#202634 Approved by: https://github.com/izaitsevfb
pytorch#203491) ## Linked issue or supporting maintainer Follow-up to pytorch#202615 and pytorch#202952. ## BC-breaking? No. ## Summary (human written only) Sync with PR pytorch#202615 on removing tests review from review agent ## Agent details (if applicable) pytorch#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. pytorch#202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement pytorch#202615 removed. The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. A test the PR deletes without explaining why is still a finding: asking to restore it is not asking for more tests. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before pytorch#202615, 13% between pytorch#202615 and pytorch#202952, and 13% after pytorch#202952. Per review, the share with at least one blocking missing-test finding was 24% before pytorch#202615, 26% between pytorch#202615 and pytorch#202952, and 36% after pytorch#202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show. Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other. | | main | This change | |---|---|---| | Findings asking for tests the PR lacks | 8 | 0 | | Findings about how the PR's tests are written | 27 | 39 | | All findings | 152 | 163 | | Blocking findings | 46 | 50 | | Reviews requesting changes | 10 of 10 | 10 of 10 | The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic) and one is about tests the PR deleted; both would still be raised under the final wording. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . # local replays, once per arm (--main 47ffd6f for main): python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir> ``` This PR was authored with the help of an AI assistant (Claude). Pull Request resolved: pytorch#203491 Approved by: https://github.com/huydhn
## Linked issue or supporting maintainer Supported by izaitsevfb ## BC-breaking? No ## Summary (human written only) Force the model to fanout to make single run captures all the issues ## Agent details (if applicable) > *This section was drafted with an AI assistant (Claude Code) and reviewed by the author.* **Problem.** Independent first reviews of the same PR at the same commit find different issues. On 12 PRs reviewed 10 times each, one run finds about 46% of the distinct issues the 10 runs find together (58% of the blocking ones); the count levels off near 51 issues (36 blocking). **Why.** The skill asks for 3-8 overlapping sub-agents, but only as a suggestion for "medium" PRs and when unsure. In practice reviews are a single pass: 3 of 33 runs of the weekly eval on GitHub Actions spawned any sub-agent, and the same 3 of 33 locally. Putting the rule only in the skill was not enough: the agent still skipped it (0-1 sub-agents per run). **Change.** - `SKILL.md`: Step 2 always spawns four reviewers in parallel (correctness; tests; API and compatibility; conventions), whatever the PR's size; Step 5 always fact-checks with at least one agent. - `hardened-pr-review-run.yml`: a short "Fan-out" section in Stage A's appended system prompt that requires the Step 2 fan-out. **Results** (12 PRs, same commit and inputs as the baseline): | | issues per PR | of the baseline's known issues | of its blocking issues | new issues per PR | minutes / review | Stage A cost / review | |---|---|---|---|---|---|---| | one run today | 2.3 | 48% | 59% | - | ~1 | $0.54 | | one run with this change | 4.8 | 77% | 83% | 1.1 | ~9 | $4.15 | | 10 runs today (plateau) | 5.1 | 100% | 100% | - | - | ~$5.40 | Averages over the 10 PRs with at least one issue in some run (the other 2 had none in any baseline run). The new issues have not been fact-checked separately; some are low-confidence nits. Every run with this change spawned 5-7 sub-agents. **Trade-off.** About 8x the Stage A cost and longer reviews, in exchange for coverage close to ten runs of today's review. Stage A has no time-budget hook; its limit is the 35-minute step timeout. Stage A took at most 13.9 minutes on the 12 eval PRs, and 11.5 to 19.6 minutes on four larger PRs (42-117 KB diffs, up to 23 files), with 6-7 sub-agents each. The rule is in the shared skill, so it also applies to local `/pr-review` runs and to `@claude` reviews that have the Agent tool. **Test plan.** ``` python -m unittest discover -s scripts/pr_review -p 'test_*.py' # 544 tests OK ``` Eval: ciforge `run_local_eval.py` on the `pre_agent` dataset (12 PRs), 10 baseline runs per PR at the parent commit, 1 run per PR with this change; findings matched across runs with ciforge `consistency.py`'s pairing judge. Pull Request resolved: pytorch#202952 Approved by: https://github.com/izaitsevfb, https://github.com/albanD
…the goalposts (pytorch#202634) ## Linked issue or supporting maintainer Part of pytorch/test-infra#9243 ## BC-breaking? No. ## Summary (human written only) Everytime the review agent is running, it introduces some new blockers regardless of what has been ficed and what has been asked by the author to ignore. ## Agent details (if applicable) On a re-review, the pr-review skill re-reviews the whole PR from scratch, and "Everything is a must-fix" turns every new observation into a blocker, so a PR whose author fixes each round's findings can still collect new blockers every round (pytorch/test-infra#9243; on pytorch#199555 the production review raised 1, 2, 2, 5, 6, 5, 4, 7, 5, 6, 7, 7, 6, 6, 7, 5 blocking findings over 16 rounds). This adds "Re-reviews converge" to "Earlier Automated Findings": settle the earlier blocking findings first (report one still present again as a continuing finding, drop one fixed or convincingly answered); review what changed since the last review in full; on code the last review covered and that has not changed since, raise a new blocking finding only for a defect with a concrete failure and say why it was not raised before; keep earlier non-blocking points non-blocking unless the code got worse or the concrete failure that rule requires can now be shown. Supporting changes in the same file: - The commit the last review saw comes from its body header ("Automated review of <sha>"), which every review has; `/tmp/pr-interdiff.txt` holds the changes since then when present, and modes with git can run `git diff <sha> HEAD`. Code whose change status the reviewer cannot tell is reviewed as changed, so a missing interdiff costs convergence, not recall. - "Covered" excludes files an earlier review named as not reviewed (early posts under the Time Budget) and code whose earlier findings were left out (`truncated`, or a body that says some findings did not fit); those get a first review, and so does the whole PR when the reviewer cannot tell which code an omitted finding was about. - An unaddressed maintainer comment still always blocks, whatever code it is on. - "Everything is a must-fix" now says exceptions are marked where they apply (runner naming and workflow REVIEW.md advisories already are) and names re-reviews among them, and the skill says to write "non-blocking" in such points, keep them out of the Recommendation's justification, and not recommend Request Changes when only non-blocking points remain. Without that, stage B and post_review.py post every finding as blocking under a Request Changes verdict. - With fan-out (pytorch#202952), the four reviewer sub-agents review the full diff and do not apply these rules, so the main agent does: on a re-review each reviewer marks its candidates as on changed or unchanged code, Step 4 applies "Re-reviews converge" to every merged finding before writing it up, and Step 5's fact-check requires rule 3's concrete failure for a new blocking finding on covered code. - Stage B's prompt says a point the review labels non-blocking is minor, never major, and that a review whose points are all non-blocking gets ready_for_human_review even under Request Changes, so a non-blocking point is never posted as a blocker, whatever the Recommendation. Evaluation: local replays of pytorch#199555 rounds 9-11 with production's prompts and models, 3 runs each, every round given the previous round's findings from the same run, as production gives them. Blocking findings in rounds 10 and 11, compared with that run's previous review (matched by an LLM judge): | | Round 10 (author added code) | Round 11 (10 changed lines) | |---|---|---| | Today's skill | 7: 2 new, 2 previously non-blocking | 7: 1 new, on unchanged code | | This change, with an interdiff | 8: 4 new, all on the code added in that round | 8: 0 new, 0 previously non-blocking | The hardened workflow does not provide `/tmp/pr-interdiff.txt` yet; without it the skill compares the earlier findings' code with HEAD. Providing it is a follow-up. One PR and three runs: a signal, not a measurement. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . lintrunner -a .agents/skills/pr-review/SKILL.md ``` This PR was authored with the help of an AI assistant (Claude). Pull Request resolved: pytorch#202634 Approved by: https://github.com/izaitsevfb
pytorch#203491) ## Linked issue or supporting maintainer Follow-up to pytorch#202615 and pytorch#202952. ## BC-breaking? No. ## Summary (human written only) Sync with PR pytorch#202615 on removing tests review from review agent ## Agent details (if applicable) pytorch#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. pytorch#202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement pytorch#202615 removed. The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. A test the PR deletes without explaining why is still a finding: asking to restore it is not asking for more tests. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before pytorch#202615, 13% between pytorch#202615 and pytorch#202952, and 13% after pytorch#202952. Per review, the share with at least one blocking missing-test finding was 24% before pytorch#202615, 26% between pytorch#202615 and pytorch#202952, and 36% after pytorch#202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show. Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other. | | main | This change | |---|---|---| | Findings asking for tests the PR lacks | 8 | 0 | | Findings about how the PR's tests are written | 27 | 39 | | All findings | 152 | 163 | | Blocking findings | 46 | 50 | | Reviews requesting changes | 10 of 10 | 10 of 10 | The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic) and one is about tests the PR deleted; both would still be raised under the final wording. Test plan: ``` python3 -m unittest discover -s scripts/pr_review -t . # local replays, once per arm (--main 47ffd6f for main): python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir> ``` This PR was authored with the help of an AI assistant (Claude). Pull Request resolved: pytorch#203491 Approved by: https://github.com/huydhn
Stack from ghstack (oldest at bottom):
Linked issue or supporting maintainer
Supported by izaitsevfb
BC-breaking?
No
Summary (human written only)
Force the model to fanout to make single run captures all the issues
Agent details (if applicable)
Problem. Independent first reviews of the same PR at the same commit find different issues. On 12 PRs reviewed 10 times each, one run finds about 46% of the distinct issues the 10 runs find together (58% of the blocking ones); the count levels off near 51 issues (36 blocking).
Why. The skill asks for 3-8 overlapping sub-agents, but only as a suggestion for "medium" PRs and when unsure. In practice reviews are a single pass: 3 of 33 runs of the weekly eval on GitHub Actions spawned any sub-agent, and the same 3 of 33 locally. Putting the rule only in the skill was not enough: the agent still skipped it (0-1 sub-agents per run).
Change.
SKILL.md: Step 2 always spawns four reviewers in parallel (correctness; tests; API and compatibility; conventions), whatever the PR's size; Step 5 always fact-checks with at least one agent.hardened-pr-review-run.yml: a short "Fan-out" section in Stage A's appended system prompt that requires the Step 2 fan-out.Results (12 PRs, same commit and inputs as the baseline):
Averages over the 10 PRs with at least one issue in some run (the other 2 had none in any baseline run). The new issues have not been fact-checked separately; some are low-confidence nits. Every run with this change spawned 5-7 sub-agents.
Trade-off. About 8x the Stage A cost and longer reviews, in exchange for coverage close to ten runs of today's review. Stage A has no time-budget hook; its limit is the 35-minute step timeout. Stage A took at most 13.9 minutes on the 12 eval PRs, and 11.5 to 19.6 minutes on four larger PRs (42-117 KB diffs, up to 23 files), with 6-7 sub-agents each. The rule is in the shared skill, so it also applies to local
/pr-reviewruns and to@claudereviews that have the Agent tool.Test plan.
Eval: ciforge
run_local_eval.pyon thepre_agentdataset (12 PRs), 10 baseline runs per PR at the parent commit, 1 run per PR with this change; findings matched across runs with ciforgeconsistency.py's pairing judge.