Skip to content

Add a migraphx code review skill - #5111

Open
pfultz2 wants to merge 14 commits into
developfrom
migraphx-code-review-skill
Open

Add a migraphx code review skill#5111
pfultz2 wants to merge 14 commits into
developfrom
migraphx-code-review-skill

Conversation

@pfultz2

@pfultz2 pfultz2 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Motivation

The review standard for this repo lives in three places — AGENTS.md, the
/migraphx-simplify quality checklist, and the expectations reviewers apply in
PR comments — and only the first two are written down. Applying all three by
hand on every branch is slow and uneven. This adds a /migraphx-code-review
skill that encodes the standard and runs it over a branch or PR.

Technical Details

  • .claude/skills/migraphx-code-review/SKILL.md — the skill. It fans out one
    agent per review angle (line-by-line diff scan, removed-behavior audit,
    cross-file tracing, per-language pitfalls, C/C++ API-ABI, IR contracts,
    conventions, test coverage, and precedent distilled from the review comments
    on PRs [AIMIGRAPHX-885] Add find_concat_same_input matcher #4891Avoid the output copy when the result is an aliased view #5108), then runs a verify pass that drops refuted candidates.
    Five effort levels (low through max) trade candidate count and
    precision-vs-recall bias for cost; low is a single inline pass with no
    subagents. Rules are read and quoted from AGENTS.md and
    /migraphx-simplify rather than restated, so the skill can't drift from
    them. --fix applies findings, --comment posts them inline on a PR, and
    --select filters what either one acts on.
  • .claude/mcp/select_findings.mjs — zero-dependency MCP stdio server backing
    --select with a checkbox dialog via MCP elicitation. Not registered by
    default; --select falls back to a plain multi-select prompt without it.
  • AGENTS.md — correct the make generate template path to tools/include/.
  • src/include/migraphx/program.hpp — clarify that program_file_version
    tracks the MXR format and is not bumped for operator changes.

Changelog Category

Add a CHANGELOG.md entry for any option other than Not Applicable

    • Added: New functionality.
    • Changed: Changes to existing functionality.
    • Removed: Functionality or support that has been removed. (Compared to a previous release)
    • Optimized: Component performance that has been optimized or improved.
    • Resolved Issues: Known issues from a previous version that have been resolved.
    • Not Applicable: This PR is not to be included in the changelog.

Follow the LLVM AI Tool Use Policy for contributions using AI.

Copilot AI lite review requested due to automatic review settings August 4, 2026 15:51
@pfultz2
pfultz2 requested review from a team and causten as code owners August 4, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new /migraphx-code-review Claude skill to standardize MIGraphX PR reviews across correctness, API/ABI, conventions, and test coverage, plus an optional MCP helper for interactively selecting which findings to act on. It also makes small documentation clarifications in repo guidance and the public program header.

Changes:

  • Add .claude/skills/migraphx-code-review/SKILL.md, encoding a structured multi-angle review process with optional --fix, --comment, and --select modes.
  • Add .claude/mcp/select_findings.mjs, a zero-dependency MCP stdio server to support a checkbox-based selection flow for --select.
  • Clarify documentation in AGENTS.md (template path) and src/include/migraphx/program.hpp (what program_file_version tracks).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/include/migraphx/program.hpp Clarifies that program_file_version is tied to MXR format changes, not operator changes.
AGENTS.md Fixes the documented template path used by make generate.
.claude/skills/migraphx-code-review/SKILL.md Introduces the new review skill definition and workflow, including --fix/--comment/--select.
.claude/mcp/select_findings.mjs Adds an optional MCP server to provide checkbox selection UX for finding selection.

@@ -0,0 +1,799 @@
---
description: "Code review the changed MIGraphX code for correctness bugs, language-specific pitfalls, C/C++ API-ABI breakage, missing test coverage, and convention violations, with a verify pass that drops false positives. The quality checklist is delegated to /migraphx-simplify rather than repeated. Effort levels low through max; --comment posts inline PR comments, --fix applies every class of finding including the quality cleanups. A bare --fix or --comment after a review already ran this session applies or posts that review's findings instead of reviewing again. --select opens a checkbox picker so only the chosen findings are fixed or posted."
allowed-tools: Bash(git diff:*), Bash(git status:*), Bash(git log:*), Bash(git show:*), Bash(git blame:*), Bash(git rev-parse:*), Bash(git merge-base:*), Bash(git branch:*), Bash(git fetch:*), Bash(gh pr view:*), Bash(gh pr diff:*), Bash(gh api:*), Bash(grep:*), Bash(find:*), Read, Grep, Glob, Edit, Agent, Skill, ReportFindings, AskUserQuestion, mcp__github_inline_comment__create_inline_comment, mcp__review-picker__select_findings
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop    #5111    +/-   ##
=========================================
  Coverage    93.26%   93.26%            
=========================================
  Files          623      623            
  Lines        32963    33097   +134     
=========================================
+ Hits         30741    30866   +125     
- Misses        2222     2231     +9     
Files with missing lines Coverage Δ
src/include/migraphx/program.hpp 100.00% <ø> (ø)

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gh-app-migraphx-bot-pr-write

gh-app-migraphx-bot-pr-write Bot commented Aug 4, 2026

Copy link
Copy Markdown
Test Batch New Rate (907ed0) Old Rate (3a503c)* Diff Status
torchvision-resnet50 64 3,325.18 3,264.92 1.85%
torchvision-resnet50_fp16 64 7,876.73 7,548.67 4.35%
torchvision-densenet121 32 2,491.07 2,483.99 0.28%
torchvision-densenet121_fp16 32 5,040.74 5,004.24 0.73%
torchvision-inceptionv3 32 2,077.02 2,058.51 0.90%
torchvision-inceptionv3_fp16 32 4,488.24 4,416.99 1.61%
cadene-inceptionv4 16 820.40 820.61 -0.03%
cadene-resnext64x4 16 781.46 782.78 -0.17%
slim-mobilenet 64 8,379.27 8,386.36 -0.08%
slim-nasnetalarge 64 228.75 228.86 -0.05%
slim-resnet50v2 64 3,190.65 3,180.91 0.31%
bert-mrpc-onnx 8 403.45 1,168.84 -65.48% 🔴
bert-mrpc-tf 1 481.82 498.63 -3.37%
pytorch-examples-wlang-gru 1 265.70 473.35 -43.87% 🔴
pytorch-examples-wlang-lstm 1 373.47 384.83 -2.95%
torchvision-resnet50_1 1 1,047.64 1,046.63 0.10%
cadene-dpn92_1 1 366.41 437.32 -16.21% 🔴
cadene-resnext101_1 1 363.99 365.89 -0.52%
onnx-taau-downsample 1 843.40 844.09 -0.08%
dlrm-criteoterabyte 1 32.37 32.42 -0.15%
dlrm-criteoterabyte_fp16 1 51.76 51.80 -0.09%
agentmodel 1 6,158.58 9,209.12 -33.13% 🔴
unet_fp16 2 58.33 58.80 -0.81%
resnet50v1_fp16 1 402.27 1,366.11 -70.55% 🔴
resnet50v1_int8 1 1,737.49 1,883.96 -7.77% 🔴
bert_base_cased_fp16 64 1,097.44 1,098.16 -0.07%
bert_large_uncased_fp16 32 345.57 345.59 -0.01%
bert_large_fp16 1 203.40 206.59 -1.54%
distilgpt2_fp16 16 2,027.60 2,092.89 -3.12%
yolov5s 1 151.84 558.33 -72.81% 🔴
tinyllama 1 8.52 45.83 -81.42% 🔴
vicuna-fastchat 1 24.02 44.20 -45.66% 🔴
whisper-tiny-encoder 1 295.20 411.87 -28.33% 🔴
whisper-tiny-decoder 1 407.98 408.48 -0.12%
llama2_7b 1 20.68 20.84 -0.74%
qwen1.5-7b 1 23.58 23.58 0.01%
phi3-3.8b 1 26.73 26.72 0.04%
llama3-8b 1 3.94 21.80 -81.91% 🔴
whisper-large-encoder 1 5.82 10.18 -42.78% 🔴
whisper-large-decoder 1 107.69 105.30 2.27%
mistral-7b 1 23.40 23.78 -1.60%
FLUX.1-schnell 1 126.49 755.22 -83.25% 🔴

Regressions detected 🔴

* No develop baseline was found for this PR's branch point; compared against the latest available develop run instead.

@gh-app-migraphx-bot-pr-write

gh-app-migraphx-bot-pr-write Bot commented Aug 4, 2026

Copy link
Copy Markdown
Test Status Result
bert-mrpc-onnx PASSED: MIGraphX meets tolerance
bert-mrpc-tf PASSED: MIGraphX meets tolerance
pytorch-examples-wlang-gru PASSED: MIGraphX meets tolerance
pytorch-examples-wlang-lstm PASSED: MIGraphX meets tolerance
dlrm-criteoterabyte PASSED: MIGraphX meets tolerance
agentmodel PASSED: MIGraphX meets tolerance
unet PASSED: MIGraphX meets tolerance
resnet50v1 PASSED: MIGraphX meets tolerance
bert_base_cased_fp16 PASSED: MIGraphX meets tolerance
bert_large_uncased_fp16 🔴 FAILED: MIGraphX is not within tolerance - check verbose output
bert_large PASSED: MIGraphX meets tolerance
yolov5s PASSED: MIGraphX meets tolerance
tinyllama PASSED: MIGraphX meets tolerance
vicuna-fastchat PASSED: MIGraphX meets tolerance
whisper-tiny-encoder PASSED: MIGraphX meets tolerance
whisper-tiny-decoder PASSED: MIGraphX meets tolerance
llama2_7b PASSED: MIGraphX meets tolerance
qwen1.5-7b PASSED: MIGraphX meets tolerance
phi3-3.8b PASSED: MIGraphX meets tolerance
llama3-8b PASSED: MIGraphX meets tolerance
whisper-large-encoder PASSED: MIGraphX meets tolerance
whisper-large-decoder PASSED: MIGraphX meets tolerance
mistral-7b PASSED: MIGraphX meets tolerance
FLUX.1-schnell PASSED: MIGraphX meets tolerance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants