ut-check
Skill121 starsChanged 5 months agoApache-2.0View on GitHub
Analyze UT (unit test) results for a torch-xpu-ops PR. Use when asked to check test results, analyze CI failures, or evaluate test coverage for a PR. Produces a structured report of new failures, failure relevance, and new test coverage.
In this repository28 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- asm-source-mappingSkill
- at-dispatch-v2Skill
- auto-labelSkill
- extract-asm-onednnSkill
- extract-asm-syclkernel-aotSkill
- extract-asm-syclkernel-jitSkill
- extract-asm-tritonSkill
- extract-xpu-kernel-asmSkill
- fix-implementSkill
- fix-reproduceSkill
- fix-root-causeSkill
- fix-verifySkill
- issue-handlerSkill
- issue-triageSkill
- label-issueSkill
- oob-perf-analysisSkill
- pr-reviewSkill
- release-branchingSkill
- skill-writerSkill
- ut-issue-authoringSkill
- ut-refactor-reviewSkill
- xpu-alignmentSkill
- xpu-build-pytorchSkill
- xpu-ci-health-checkSkill
- xpu-ops-pr-creationSkill
- xpu-release-notesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Read the UT data JSON at the path given in the request (default /tmp/ut_data.json).
- Distinctive: line 75
Read the JSON. Understand the scope: failure count, changed files, new tests.
- Distinctive: line 90
If you change a classification, briefly say why.
- Very specific: line 94
Use new_tests_summary: passed, failed, skipped, not_run.
- Distinctive: line 99
Follow the output format below exactly.
- Very specific: line 104
If failures is empty and new_tests is empty, produce a concise report (New Failures: none.
- Very specific: line 106
If the data looks internally inconsistent (e.g.
- Distinctive: line 109
Do not invent a "Failure Relevance Analysis" for failures that are all clearly unrelated.
- Very specific: line 114
New failures: If more than 20, show the first 20, then add: ...
- Very specific: line 116
New/modified tests: If more than 20, show the first 20, then add: ...
- Distinctive: line 120
Always include the total count so the reader knows the full scope.
- Very specific: line 124
Every report MUST include: the New Failures section (with the Related to PR?
- Distinctive: line 158
Omit sections that have no content: If the PR adds no tests, omit "New Test Coverage".
- Distinctive: line 161
If a calling workflow explicitly requires a skill marker, append this exact literal final line: Custom skills applied: ut-check.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
UT Result Check Skill
Analyze unit test results for a torch-xpu-ops PR: identify new failures, assess whether they relate to the PR changes, and verify new test coverage.
Quick start
- Read the UT data JSON at the path given in the request (default
/tmp/ut_data.json). If it is missing or unreadable, say so and stop -- never reconstruct the data from elsewhere. - Analyze it following the workflow below. The data is self-contained; no sub-agents or extra CI queries are needed.
- Emit the report as your final message. The calling workflow posts it as the PR comment -- do not post a comment yourself.
Input
The UT data is provided as a JSON file (typically /tmp/ut_data.json) produced
by .github/scripts/bot_ut_check.py. The script already de-duplicates failures,
classifies each failure's relevance, summarizes new-test coverage, and computes
a baseline verdict. The JSON contains:
{
"pr_number": 1234,
"run_id": 56789,
"failures": [
{"category": "op_ut", "class": "a.b.TestFoo", "test": "test_bar",
"status": "failed", "message": "...", "relevance": "Related"}
],
"changed_files": {
"operator_source": ["src/ATen/native/xpu/Foo.cpp"],
"test_files": ["test/xpu/test_foo_xpu.py"],
"skip_lists": [],
"other": []
},
"new_tests": ["TestFoo::test_bar"],
"new_tests_summary": {
"passed": ["TestFoo::test_bar"],
"failed": [],
"skipped": [],
"not_run": []
},
"passed_tests_count": 12345,
"totals": {"test_cases": 0, "passed": 0, "skipped": 0,
"failures": 0, "errors": 0},
"verdict": "Safe to merge",
"verdict_reason": "No new failures detected."
}Ground Truth for New Failures
The authoritative source for new failures is the UT-Check-* artifacts
which contain <ut_job>/new_failures.csv. This CSV is produced by the CI
check job: ut_results.py identifies new failures (not in the known
issues list) and enriches them with error messages.
The UT-Data-* artifact holds the raw reports (junit/*.xml), and the
check's <ut_job>/cases/ut_failure_list.csv is the unfiltered failure list
(known failures included); bot_ut_check.py reads only new_failures.csv and
de-duplicates by
(category, class, test). If you ever see the same failure listed twice, treat
it as a single failure and note the collection anomaly.
Analysis Workflow
Step 1: Read the Data
Read the JSON. Understand the scope: failure count, changed files, new tests.
Step 2: Review / Refine Failure Relevance
Each failure already carries a deterministic relevance
(Related / Possibly related / Unrelated) computed from the changed files.
Trust it as a baseline, but refine using the error message and your judgment:
- Related -- failure is in a test module that directly tests an operator or test file this PR modifies.
- Possibly related -- failure is in a related subsystem or a plausible side effect of the change.
- Unrelated -- failure is in an unrelated module; likely pre-existing flake or infrastructure issue (e.g. missing shared library, download error).
If you change a classification, briefly say why.
Step 3: Evaluate New Test Coverage
Use new_tests_summary: passed, failed, skipped, not_run. Newly added
tests that FAILED or did NOT RUN are a concern and must be called out.
Step 4: Produce the Report
Follow the output format below exactly. Apply the truncation rules strictly.
Guardrails: Do Not Post Low-Quality Comments
- Never fabricate or guess counts. Report exactly what the JSON contains.
- If
failuresis empty andnew_testsis empty, produce a concise report (New Failures: none; Recommendation) rather than padding with empty tables. - If the data looks internally inconsistent (e.g. a failure count that seems
implausible for the diff, or
totalsmissing), state the uncertainty plainly in the Recommendation instead of asserting a confident verdict. - Do not invent a "Failure Relevance Analysis" for failures that are all clearly unrelated; a one-line grouping is enough.
Truncation Rules
- New failures: If more than 20, show the first 20, then add:
... and N more failure(s). See CI logs for the full list. - New/modified tests: If more than 20, show the first 20, then add:
... and N more new test(s). See CI logs for the full list. - Changed files: Summarize as counts per category.
Always include the total count so the reader knows the full scope.
Output Format
Every report MUST include: the New Failures section (with the Related to PR?
column), a New Test Coverage summary line with counts whenever the PR adds
tests, and a Recommendation with an explicit safe-to-merge verdict.
VERDICT: <one sentence — safe to merge or not, and why>
## UT Result Check: PR #<number>
### New Failures
<count> new failure(s) detected (not in known issues). / No new failures detected.
| Test | Category | Status | Related to PR? |
|------|----------|--------|----------------|
| `ClassName::test_name` | category | failed | Related / Possibly related / Unrelated |
...
### Failure Relevance Analysis
Brief explanation, grouping related failures together. Omit if there are no
failures or all are trivially unrelated (a one-line note then suffices).
### New Test Coverage
This PR adds/modifies **<N>** test(s): <p> passed, <f> failed, <s> skipped, <n> not run.
| New/Modified Test | Status |
|-------------------|--------|
| `ClassName::test_name` | PASSED / FAILED / SKIPPED / NOT RUN |
...
### Recommendation
**<Safe to merge | Likely safe to merge | Investigate before merging | Not safe to merge>.**
One-to-two sentence justification grounded in the failures and new-test results.Omit sections that have no content. If the PR adds no tests, omit "New Test Coverage". Always keep the "New Failures" and "Recommendation" sections.
If a calling workflow explicitly requires a skill marker, append this exact literal final line: Custom skills applied: ut-check.
Otherwise, keep the reply in the requested report format and do not force an extra trailing sentence.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

