Running Tests
brendanhasz/probflow
Run Python unit test suites strictly using the uv package manager and pytest.
A skill your agent uses when asked to reproduce a bug, verify a nightly CI failure, or confirm a failure still exists on latest source.
$ npx skills add intel/torch-xpu-ops --skill fix-reproduce -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install intel/torch-xpu-ops fix-reproduce --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/intel/torch-xpu-ops.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/fix-reproduce .claude/skills/fix-reproduce && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "fix-reproduce" agent skill from https://github.com/intel/torch-xpu-ops/tree/main/.claude/skills/fix-reproduce into .claude/skills/fix-reproduce/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fix-reproduce", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/intel/torch-xpu-ops/tree/main/.claude/skills/fix-reproduceType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add intel/torch-xpu-ops --skill fix-reproduce -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install intel/torch-xpu-ops fix-reproduce --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/intel/torch-xpu-ops.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/fix-reproduce .agents/skills/fix-reproduce && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "fix-reproduce" agent skill from https://github.com/intel/torch-xpu-ops/tree/main/.claude/skills/fix-reproduce into .agents/skills/fix-reproduce/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fix-reproduce", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add intel/torch-xpu-ops --skill fix-reproduce -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install intel/torch-xpu-ops fix-reproduce --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/intel/torch-xpu-ops.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/fix-reproduce .cursor/skills/fix-reproduce && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "fix-reproduce" agent skill from https://github.com/intel/torch-xpu-ops/tree/main/.claude/skills/fix-reproduce into .cursor/skills/fix-reproduce/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fix-reproduce", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/intel/torch-xpu-ops.git --path .claude/skills/fix-reproduce--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add intel/torch-xpu-ops --skill fix-reproduce -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install intel/torch-xpu-ops fix-reproduce --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/intel/torch-xpu-ops.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/fix-reproduce .gemini/skills/fix-reproduce && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "fix-reproduce" agent skill from https://github.com/intel/torch-xpu-ops/tree/main/.claude/skills/fix-reproduce into .gemini/skills/fix-reproduce/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fix-reproduce", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install intel/torch-xpu-ops fix-reproduceInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add intel/torch-xpu-ops --skill fix-reproduce -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/intel/torch-xpu-ops.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/fix-reproduce .github/skills/fix-reproduce && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "fix-reproduce" agent skill from https://github.com/intel/torch-xpu-ops/tree/main/.claude/skills/fix-reproduce into .github/skills/fix-reproduce/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fix-reproduce", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add intel/torch-xpu-ops --skill fix-reproduce -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install intel/torch-xpu-ops fix-reproduce --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/intel/torch-xpu-ops.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/fix-reproduce .opencode/skills/fix-reproduce && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "fix-reproduce" agent skill from https://github.com/intel/torch-xpu-ops/tree/main/.claude/skills/fix-reproduce into .opencode/skills/fix-reproduce/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fix-reproduce", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
fix-reproduceA skill your agent uses when asked to reproduce a bug, verify a nightly CI failure, or confirm a failure still exists on latest source.
Fix Reproduce is an agent skill from intel/torch-xpu-ops, published by the product's own GitHub organization. Use when asked to reproduce a bug, verify a nightly CI failure, or confirm a failure still exists on latest source. Verifies whether a bug still reproduces before an orchestrator commits time to a fix. Runs a three-stage fallback (nightly wheel - source build - CI environment alignment) and returns REPRODUCED / NOTREPRODUCED / NOREPRODUCER / CANNOTVERIFY. Called by the issue-handler orchestrator.
Its SKILL.md is about 7.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Testing & QA, covering Failing and flaky tests and Unit testing. It works with pytest and PyTorch. The licence is Apache-2.0.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit abf22c9. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gitpythonghpipdockerpytestpip3curlbashjqFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
download.pytorch.orggha-artifacts.s3.amazonaws.comgithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Fix Reproduce loads about 7.7k tokens when it runs. Until then it costs about 105 tokens; SKILL.md has 2,984 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from intel/torch-xpu-ops at commit abf22c9, republished under its Apache-2.0 licence (© intel). 2,984 words, ~7,691 tokens.
.claude/skills/fix-reproduce/SKILL.md (or your agent's skills folder).Runs a test and determines whether the bug reproduces. Uses a three-stage approach: nightly wheel first (fast), source build at CI commit second (precise), CI environment alignment third (last resort).
The orchestrator decides what to do with the output — this skill only reports the result.
reproducer_command — the sequence of shell commands that triggers the
failure. Any of the forms below is valid; Stage 1's "Reproducer forms"
section routes execution:
pytest ... invocation:
pytest -v test/xpu/test_ops.py::TestFooXPU::test_bar_xpu_float32python -c "..." snippet or a single python script.py line.git clone, pip install, followed by the actual failing command.Missing or unrunnable inputs return NO_REPRODUCER up-front — see
"## Preflight" below. Non-NO_REPRODUCER verdicts come from the
Stage 1/2/3 execution flow.
Providers (set by the orchestrator, not this skill):
issue-triage from the reproducer section
(via issue-handler).stage — which reproduction path to run. Default auto.
auto — run the full three-stage fallback chain (nightly → source_build →
ci_env). Used by orchestrators that need a definitive verdict.nightly — only run Stage 1 (nightly wheel). PASS returns
NOT_REPRODUCED(checked_stages=[nightly]) immediately; do NOT fall through
to source build or ci_env. Cheapest option — suitable for a fast "does this
still reproduce on latest nightly?" answer.ci_commit — upstream commit hash from the CI report. Only used as a
fallback base when origin/main fails to build (optional; ignored when
stage=nightly).
pytorch_dir — path to a local PyTorch checkout (optional). Used
whenever Prepare determines needs_tree=yes (any pytest form with a
repo-relative path) as well as by Stage 2's source build. If absent,
clone to <torch-xpu-ops-repo-root>/agent_space_xpu/pytorch/
(agent_space_xpu/ is the gitignored scratch dir at the torch-xpu-ops
repo root — see the containing repo's AGENTS.md).
ci_repo — which CI to align against in Stage 3: pytorch or
torch-xpu-ops. Optional; when absent, Stage 3 infers from the
reproducer path (see "Determine ci_repo" in Stage 3).
NO_REPRODUCER is a pre-execution verdict — the skill decides that
there is nothing to run before touching any stage. Every other verdict
(REPRODUCED / NOT_REPRODUCED / CANNOT_VERIFY) comes from Stage 1/2/3
execution.
reproducer_command present? If missing or empty:
NO_REPRODUCER(reason=no_command). Stop.
If the input is a stack trace without a command, the orchestrator should
not call this skill in the first place (that is issue-triage's
reproduction_missing=yes case); if it slips through, this check
catches it.
The pytest collected 0 items check happens in Prepare below, after
the source tree it needs to run against is in place.
Some reproducer forms need a pytorch source tree even at Stage 1
(nightly wheel path) — either because the test file lives inside
pytorch/test/ or because it lives under torch-xpu-ops/test/xpu/
and imports common test utilities via
sys.path.append("../../../../test/functorch") relative paths that
only resolve from <pytorch_dir>/third_party/torch-xpu-ops/test/xpu/.
Set needs_tree from the reproducer form:
| Reproducer form | needs_tree |
|---|---|
pytest, path is repo-relative (test/xpu/..., test/...) | yes |
pytest, bare node id without a file path (TestFoo::test_bar) | yes — pytest rootdir discovery needs the tree |
| pytest, path is absolute and exists on disk | no |
python -c "..." / python /abs/path/script.py | no |
| shell block (issue body: clone + install + run) | no — the block does its own setup |
If needs_tree=no, skip this section and go to Stage 1.
If pytorch_dir was provided as input: git -C $pytorch_dir fetch origin.
If not provided, clone into the torch-xpu-ops repo's gitignored scratch dir. Resolve the path explicitly rather than relying on cwd:
XPU_OPS_ROOT=$(git -C <path-to-torch-xpu-ops-checkout> rev-parse --show-toplevel)
pytorch_dir="$XPU_OPS_ROOT/agent_space_xpu/pytorch"
if [[ ! -d "$pytorch_dir/.git" ]]; then
git clone --filter=blob:none https://github.com/pytorch/pytorch.git "$pytorch_dir"
fi
git -C "$pytorch_dir" fetch origin
git -C "$pytorch_dir" checkout --detach origin/main
git -C "$pytorch_dir" submodule update --init --recursiveThe tree is not built here — Stage 1 uses the nightly wheel for the runtime; the source tree only supplies test files and support modules. Stage 2 reuses the same tree and builds it there.
If the reproducer targets test/xpu/..., make the working torch-xpu-ops
tree available at $pytorch_dir/third_party/torch-xpu-ops. The build's
dev-override recipe (symlink or replace-clone) applies; see
xpu-build-pytorch. From here on, Stage 1's cwd for pytest is
$pytorch_dir/third_party/torch-xpu-ops/test/xpu/.
Regardless of needs_tree, if reproducer_command matches the pytest
form (starts with pytest, python -m pytest, or is a bare pytest
node id), run:
pytest --collect-only <node_id>Cwd:
needs_tree=yes → from the tree just prepared (for test/xpu/...
targets, that's $pytorch_dir/third_party/torch-xpu-ops/test/xpu/)needs_tree=no → from any non-pytorch directory (the reproducer's
absolute path resolves on its own)Output shows collected 0 items? → NO_REPRODUCER(reason=collected_zero).
Stop. Do not fall through to Stage 2 — the source tree is the same
across stages, so a collect-miss at Stage 1 will miss at 2 and 3 too.
Non-pytest forms have no equivalent pre-execution check.
Most failures reproduce here. Start here before doing anything heavier.
Three forms; each dispatches differently in "Run test" below:
reproducer_command starts with pytest,
python -m pytest, or is a bare pytest node id
(.../test_foo.py::TestBar::test_baz). The collect-only check
(see "## Prepare" above) has already run.python -c "..." or
python path/to/script.py.git clone + pip install + the failing command.
Split it into setup steps (everything before the failing
command) and the reproduce step (the last command that
exercises the failing path). Only the reproduce step's outcome
determines the verdict; setup-step failures return
CANNOT_VERIFY(stage=<current>, blocker=<the failing setup step>).The Working directory and Use the test's own assertion rules below apply to all three forms.
Always reproduce against the latest available XPU nightly. Do not reuse a
stale wheel from a previous session — a bug may already be fixed in a newer
nightly, and re-verifying an old wheel produces misleading REPRODUCED
results.
# Query available versions (informational — pip install --upgrade below
# will pick a resolvable one, which may lag the newest entry here by a
# day when the index metadata refreshes before all wheels land).
pip3 index versions torch --pre \
--index-url https://download.pytorch.org/whl/nightly/xpu
pip3 install --pre --upgrade torch torchvision torchaudio \
--index-url https://download.pytorch.org/whl/nightly/xpuPost-install, check that torch, torchvision, torchaudio are all
from the same day — pip's resolver can leave a mixed set (either torch
older than the auxiliary wheels, or the reverse). If they diverge,
uninstall all three and reinstall together:
pip3 uninstall -y torch torchvision torchaudio
pip3 install --pre torch torchvision torchaudio \
--index-url https://download.pytorch.org/whl/nightly/xpuRecord the exact wheel version used (python -c "import torch; print(torch.__version__)") in the reproduce output and in any issue comment,
so downstream stages and re-verifications know which nightly was tested.
Do NOT run the nightly-wheel reproducer with cwd inside any pytorch
source checkout. Python resolves import torch against the local torch/
package before site-packages, so it will load the in-tree torch/_C.so
built at whatever revision that tree happens to be — typically stale
relative to the installed wheel — and fail with
ImportError: undefined symbol: .... Either cd $(mktemp -d) (or any
non-pytorch dir) before running, or invoke the reproducer with an
absolute path from outside the tree.
Applies when the reproducer targets a test under torch-xpu-ops/test/xpu/.
Prepare has already ensured the pytorch tree exists at $pytorch_dir
with the working torch-xpu-ops tree at
$pytorch_dir/third_party/torch-xpu-ops. Invoke the reproducer from
$pytorch_dir/third_party/torch-xpu-ops/test/xpu/ — the relative
sys.path.append("../../../../test/functorch") in those tests only
resolves from that cwd.
The pytorch tree does NOT need to be built for the nightly-wheel path — the wheel provides the runtime, the source tree only supplies test files and support modules.
When writing a standalone reproducer for a TestCase.assertEqual
failure, use the test's own assertion. Do NOT substitute
torch.allclose, torch.equal, or bare == — they have different
(usually stricter) default tolerances and will manufacture false
positives.
If the failure log says AssertionError: Tensor-likes are not close,
the assertion is torch.testing._comparison.assert_close, which has
dtype-specific defaults (bf16: rtol=0.016, atol=1e-5). Reproduce
through assert_close or via TestCase.assertEqual:
import sys; sys.path.insert(0, "<pytorch>/test")
from torch._dynamo.test_case import TestCase # or the base class the failing test uses
class T(TestCase):
def test_x(self, device):
...
self.assertEqual(out_ref, out)
T().test_x(device='xpu')Run according to the reproducer form matched in "Reproducer forms":
Pytest form: run the pytest invocation. Result interpretation:
FAILED → REPRODUCED.
all skipped by @skipIfXpu → the marker is likely hiding the
actual failure. Temporarily remove it in place, re-run once to
check what happens without the skip, then revert the file so no
change escapes this skill:
# Remove @skipIfXpu from the target test file(s), then:
pytest <node_id>
# Regardless of outcome, revert:
git checkout <test_file>If the re-run FAILs → REPRODUCED (the skip was hiding it). If it
PASSes → treat as PASSED per the Decision table. Only return
CANNOT_VERIFY when the skip is environmental (not an XPU marker,
e.g. @skipIf(not has_cuda) shielding an unavailable dep).
xfailed → treat as FAILED (REPRODUCED).
PASSED → per the Decision table below.
Python one-liner / shell block: run the command (or the reproduce step extracted from the shell block, per "Reproducer forms"). Result interpretation:
CANNOT_VERIFY(stage=nightly, blocker=<...>). Do NOT
report REPRODUCED on a setup or infra failure.all skipped / xfailed do not apply to these forms — they are
pytest-specific concepts.
| Result | Condition | Action |
|---|---|---|
CANNOT_VERIFY | env problem (wheel install failed, runtime missing) | Report to orchestrator, stop |
REPRODUCED | FAILED | Return REPRODUCED(stage=nightly, refined_command=...) |
| → stage 2 | PASSED and stage=auto | Proceed to source build at origin/main to confirm |
NOT_REPRODUCED | PASSED and stage=nightly | Return NOT_REPRODUCED(checked_stages=[nightly]) — do NOT fall through |
Nightly passing is not conclusive — it may lag behind CI. Build from
origin/main to verify. Even when the failure came from a specific CI
commit, we only consider fixes on top of origin/main — downstream
stages branch off it.
If Prepare (above) already ran (needs_tree=yes), $pytorch_dir is
detached at origin/main with submodules initialized — skip to
"Build and run".
Otherwise (Prepare was skipped because needs_tree=no), run Prepare's
"Get the pytorch tree" recipe now: resolve $pytorch_dir (from input
or $XPU_OPS_ROOT/agent_space_xpu/pytorch), clone if missing, fetch,
checkout --detach origin/main, submodule update --init --recursive.
Leave HEAD detached at origin/main at exit (the ci_commit fallback
below re-detaches to a different sha; downstream stages branch off
whatever this stage settled on).
Load the xpu-build-pytorch skill and follow it for the build. Do not
hand-roll the build here.
If the origin/main build fails for a reason unrelated to the bug
(broken trunk, upstream infra issue, etc.) and ci_commit is
available, fall back once:
git -C $pytorch_dir checkout --detach $ci_commit
git -C $pytorch_dir submodule update --init --recursiveRebuild via xpu-build-pytorch. If this succeeds, proceed with the
test on ci_commit and record base=<ci_commit_sha> in the output so
the orchestrator branches its fix off the same base. If the fallback
build also fails, escalate as
CANNOT_VERIFY(blocker=trunk and ci_commit both fail to build)
rather than silently reproducing on some other base.
Then run the reproducer following the form-specific rules in Stage 1 "Run test" (pytest interpretation vs python/shell interpretation).
Applies only when stage=auto — stage=nightly returns at Stage 1.
| Result | Action |
|---|---|
CANNOT_VERIFY | Report to orchestrator, stop |
REPRODUCED | Return REPRODUCED(stage=source_build, base=origin/main|<ci_commit_sha>, refined_command=...) |
PASSED | Proceed to stage 3 |
Only reached when nightly wheel and source build at origin/main both
pass. The failure may be specific to the CI environment: wheels built
under CI toolchain, XPU/oneAPI stack pinned to a specific version,
environment variables set by CI.
Both pytorch/pytorch and torch-xpu-ops run their XPU tests inside
a container (declared as container: image: in the workflow yaml).
When this skill is invoked from within CI (e.g. via @torchxpubot fix), the agent is already inside that container — kernel modules,
/dev/dri, oneAPI stack, and python are already the CI ones. This
stage does not docker pull or docker run. It aligns the
installed wheels + pytorch source checkout to the CI wheel, then runs
the reproducer directly.
The skill logs the CI image reference it identified (for context in the report), but does not exec into it.
Stage 2 may have left behind build/, torch/lib/*.so, or a modified
third_party/xpu.txt from the dev-override. Left in place, Python
will pick the host-built (stale-relative-to-CI-wheel) torch/_C.so
off sys.path and error with undefined symbol before the
reproducer runs.
# Restore xpu.txt to origin's pinned commit (in case Stage 2 rewrote it).
git -C "$pytorch_dir" checkout -- third_party/xpu.txt
# Discard stage-2 build outputs. `git clean` does not recurse into
# nested repositories by default, so third_party/torch-xpu-ops (a
# separate git repo) is preserved without needing `-e`.
git -C "$pytorch_dir" clean -fdxAlternatively, run the reproducer with cwd outside $pytorch_dir
(e.g. cd /tmp) so import torch resolves against site-packages,
matching Stage 1's "Working directory" rule. Do at least one.
ci_repoPick which CI to align against based on the reproducer:
| Reproducer clue | ci_repo |
|---|---|
Path contains test/xpu/ or torch-xpu-ops | torch-xpu-ops |
Path is pytorch/test/... or absolute path inside a pytorch tree | pytorch |
Ambiguous / python -c snippet with no path | try torch-xpu-ops first, fall back to pytorch |
The orchestrator may also pass ci_repo explicitly; when set, use it
and skip the heuristic.
ci_repo=torch-xpu-opsWheels come from intel/torch-xpu-ops's own build workflow and stay on
GitHub Actions artifact storage. Fetch via gh run download, not S3.
The build job lives in _linux_build.yml (a reusable workflow called
by pull.yml and nightly_ondemand.yml). It uploads the artifact
Torch-XPU-Wheel-<pr|sha>-<runid>-<attempt>[-category].
# Nightly is the primary source (fresh main-branch build every night).
# Fall back to pull.yml when nightly has been failing for a stretch —
# pull.yml runs on PRs against main and its wheels are close enough for
# CI-env alignment.
RUN=$(gh run list --repo intel/torch-xpu-ops \
--workflow nightly_ondemand.yml \
--status success --limit 1 \
--json databaseId,headSha,createdAt)
if [[ "$RUN" == "[]" ]]; then
RUN=$(gh run list --repo intel/torch-xpu-ops \
--workflow pull.yml \
--status success --limit 1 \
--json databaseId,headSha,createdAt)
fi
# Empty here → report CANNOT_VERIFY per the paragraph below (do not
# `exit`; the skill returns a verdict, it does not terminate the shell).
RUN_ID=$(jq -r '.[0].databaseId' <<<"$RUN")If both queries return empty: CANNOT_VERIFY(stage=ci_env, blocker=no_recent_successful_torch-xpu-ops_run).
CI_ENV_DIR="$XPU_OPS_ROOT/agent_space_xpu/ci_env"
WHEELS_DIR="$CI_ENV_DIR/wheels"
rm -rf "$WHEELS_DIR" && mkdir -p "$WHEELS_DIR"
# Artifact name is Torch-XPU-Wheel-<pr|sha>-<runid>-<attempt>[-category].
# `gh run download -n <name>` requires exact name; use pattern instead.
# If the run uploaded multiple category variants (target/baseline via
# `_linux_build.yml`'s `category` input), --pattern pulls all of them
# and the flatten below will clobber same-named wheels. In that case
# pass --name <specific-artifact> to pick one variant.
gh run download "$RUN_ID" --repo intel/torch-xpu-ops \
--pattern 'Torch-XPU-Wheel-*' --dir "$WHEELS_DIR"
# gh unpacks each artifact into its own subdir; flatten:
find "$WHEELS_DIR" -mindepth 2 -name '*.whl' -exec mv {} "$WHEELS_DIR" \;
# Empty here → CANNOT_VERIFY(stage=ci_env, blocker=no_wheel_in_artifact).
# Do not `exit`; return the verdict via the skill's Output section.
find "$WHEELS_DIR" -maxdepth 1 -name '*.whl' | grep -q .For torch-xpu-ops the test container is
intelgpu/ubuntu-24.04-lts2:2523.40 (see
.github/workflows/_linux_ut.yml). Record the tag for the report;
do not pull. Kept for local-investigation convenience (someone
reproducing outside CI can docker run this image manually) — the
skill itself relies on the Assumption above.
ci_repo=pytorchWheels come from pytorch/pytorch's xpu workflow and land on
gha-artifacts S3.
xpu workflow runAccept only runs where every linux-*/ build job succeeded — partial
runs still upload partial artifacts.
# Match by display name first; fall back to path in case pytorch/pytorch
# renames the workflow's `name:` field (the file path is more stable).
WF_ID=$(gh api "repos/pytorch/pytorch/actions/workflows?per_page=100" --paginate \
--jq '.workflows[] | select(.name=="xpu" or .path==".github/workflows/xpu.yml") | .id' \
| head -1)
RUN_ID=""
for page in 1 2 3 4 5; do
while IFS=$'\t' read -r rid _ _; do
conclusions=$(gh api \
"repos/pytorch/pytorch/actions/runs/$rid/jobs?per_page=100" --paginate \
--jq '.jobs[] | select(.name | test("^linux.*/ build$")) | .conclusion')
[[ -z "$conclusions" ]] && continue
grep -qv '^success$' <<<"$conclusions" && continue
RUN_ID=$rid; break 2
done < <(gh api \
"repos/pytorch/pytorch/actions/workflows/$WF_ID/runs?status=completed&per_page=20&page=$page" \
--jq '.workflow_runs[] | [.id, .head_sha, .created_at] | @tsv')
doneIf no qualifying run in the last 100: CANNOT_VERIFY(stage=ci_env, blocker=no_recent_successful_xpu_workflow_run).
build_envPer the Assumption above, the agent is already inside a compatible CI container — the image column below is a lookup for the report only, not a pull target. It is kept in case a local investigation (outside CI) wants to spin up the same image manually to reproduce; the skill itself does not use it.
pytorch/pytorch's xpu.yml currently defines only py3.10 linux builds:
| build_env | Hardware | Image (reference) |
|---|---|---|
linux-noble-xpu-n-py3.10 | PVC | ghcr.io/pytorch/ci-image:pytorch-linux-noble-xpu-n-py3-<docker-tree-hash> |
linux-noble-xpu-n-py3.10-client | BMG | ghcr.io/pytorch/ci-image:pytorch-linux-noble-xpu-n-py3-client-<docker-tree-hash> |
linux-jammy-xpu-n-1-py3.10 | PVC | ghcr.io/pytorch/ci-image:pytorch-linux-jammy-xpu-n-1-py3-<docker-tree-hash> |
-client suffix = BMG (client GPU); no suffix = PVC (datacenter).
Match the runner's hardware; default to PVC when unknown.
If xpu.yml grows a new build_env not covered here:
CANNOT_VERIFY(stage=ci_env, blocker=unknown_build_env=<name>). Do
not guess. When multiple envs match, iterate them in sorted order for
determinism.
<docker-tree-hash> is the git tree hash of .ci/docker/ at the run's
commit (see upstream _runner-determinator.yml "Compute .ci/docker
tree hash"). Only needed if the report wants a fully-qualified image
reference; skill does not pull the image.
Artifacts live at:
https://gha-artifacts.s3.amazonaws.com/pytorch/pytorch/<run_id>/<build_env>/artifacts.zipProbe availability with --range 0-0 -L (zero-byte GET); HEAD may be
rejected by some intermediaries in front of this bucket, byte-range
GET returns 200 or 206:
url="https://gha-artifacts.s3.amazonaws.com/pytorch/pytorch/$RUN_ID/$BUILD_ENV/artifacts.zip"
http_status=$(curl -s -o /dev/null -w "%{http_code}" --range 0-0 -L "$url")
# 200 or 206 -> ok; anything else -> skip this build_envDownload and extract:
CI_ENV_DIR="$XPU_OPS_ROOT/agent_space_xpu/ci_env"
WHEELS_DIR="$CI_ENV_DIR/wheels"
ARTIFACTS_ZIP="$CI_ENV_DIR/artifacts.zip"
rm -rf "$WHEELS_DIR" && mkdir -p "$WHEELS_DIR"
# --retry survives transient drops. A silent truncation of the 1.2 GB
# zip surfaces later as "cannot find zipfile directory" from unzip.
curl -sL -f --retry 3 --retry-delay 5 "$url" -o "$ARTIFACTS_ZIP"
# Layout varies: some build envs pack wheels under dist/, others at root.
unzip -o -j "$ARTIFACTS_ZIP" 'dist/*.whl' -d "$WHEELS_DIR" \
|| unzip -o -j "$ARTIFACTS_ZIP" '*.whl' -d "$WHEELS_DIR"
# Empty here → CANNOT_VERIFY(stage=ci_env, blocker=no_wheel_extracted).
find "$WHEELS_DIR" -maxdepth 1 -name '*.whl' | grep -q .Same for both paths. Uninstall any existing torch stack first — the Stage 1 nightly is still resident:
pip uninstall -y torch torchvision torchaudio pytorch-triton-xpu triton_xpu 2>/dev/null || true
pip install --force-reinstall "$WHEELS_DIR"/*.whlAlign the pytorch source tree to the wheel's commit so tests that
import support modules from pytorch/test/ see matching code (Prepare
left $pytorch_dir detached at origin/main, which is not the wheel's
commit):
TORCH_COMMIT_ID=$(python -c 'import torch; print(torch.version.git_version)')
git -C "$pytorch_dir" fetch origin
git -C "$pytorch_dir" checkout --detach "$TORCH_COMMIT_ID"
git -C "$pytorch_dir" submodule update --init --recursiveDo not shallow-fetch (--depth 1) here — pytorch's nested submodules
resolve against pins that require the full history to be reachable;
a shallow fetch surfaces later as "cannot find <sha>" in submodule update.
TORCH_COMMIT_ID (the wheel's build commit) is a temporary
alignment only — it makes pytorch/test/ support modules match the
installed wheel's binary so the test can run. It is not the fix
base and is never returned as base. Downstream fixes always branch
off origin/main (see Stage 2), so this stage still reports
base=origin/main; TORCH_COMMIT_ID stays internal to Stage 3.
For torch-xpu-ops test paths, ensure the working torch-xpu-ops tree is
at $pytorch_dir/third_party/torch-xpu-ops (Prepare already handled
this if needs_tree=yes; if it didn't, do it now via the
xpu-build-pytorch dev-override recipe).
Run in the current shell — no docker run wrapper. Working-directory
rule from Stage 1 applies: for torch-xpu-ops tests use
$pytorch_dir/third_party/torch-xpu-ops/test/xpu/; for a
non-test-file reproducer, cd /tmp (or any non-pytorch dir).
Result interpretation is the form-specific rule from Stage 1 "Run test" — pytest FAILED / all skipped / xfailed, or non-pytest exit code
From the CI job log, extract and align remaining differences:
--timeout, -x, specific env vars)ZE_AFFINITY_MASK,
PYTORCH_TEST_WITH_XPU, IS_XPU_CI, etc.)When aligning yields REPRODUCED, fold discovered pieces (env vars,
flags, cwd) into refined_command per its contract in the Output
section.
| Result | Action |
|---|---|
CANNOT_VERIFY | Report to orchestrator, stop |
REPRODUCED | Return REPRODUCED(stage=ci_env, base=origin/main, refined_command=...) — base is origin/main, not the wheel's TORCH_COMMIT_ID the tree is currently detached at |
PASSED | Return NOT_REPRODUCED(checked_stages=[nightly, source_build, ci_env]) — issue no longer exists; orchestrator reports to user or triage collects reason |
Return one of these to the orchestrator:
REPRODUCED
stage: nightly | source_build | ci_env
base: origin/main | <ci_commit_sha> # base for downstream build. Default origin/main (also for stage=ci_env). ci_commit_sha only when stage=source_build fell back to ci_commit. Stage 3's TORCH_COMMIT_ID wheel-alignment checkout is never returned as base.
refined_command: <single shell-executable string>Emit this block with the output above; the orchestrator appends it to the session comment.
<!-- agent:reproduce -->
## Reproduce
<one or two sentences: which build was used — nightly wheel version or
source sha — and which device.>
| Test case | Verdict | Observed |
|---|---|---|
| `test_foo_xpu_float8_e4m3fn` | REPRODUCED | `NotImplementedError: "bar_kernel" not implemented for 'Float8_e4m3fn'` |
<optional: one paragraph tying the signature to the CI job log, with a
link to the failing job; or naming what blocked a stage.>
*Automated by fix-reproduce.*One row per test case (for a batch, label rows by sub-item number:
4. \test_foo...`). Observed` is the one-line failure signature,
backticked — never a pasted traceback.
refined_command contract. A single shell-executable string that,
run by itself, reliably triggers the failure. A downstream skill (a
fix-verifier, a skip-list per-entry runner, etc.) invokes it directly
(e.g. via bash -c "$refined_command") after applying a candidate fix
to check whether the failure is gone. Consequences:
ZE_AFFINITY_MASK=0 pytest ...), a required cwd goes as a
cd <dir> && prefix.git clone, pip install,
wheel-download, etc. that appeared in the input shell block are
excluded. The caller has already paid that cost; refined_command
should re-trigger the failure, not re-provision the environment.docker run wrapper. Stage 3 runs the reproducer directly in
the current shell (the CI job is already inside its container, and
the caller of refined_command runs from an equivalent env). If the
caller needs container-level isolation, that is its concern, not
refined_command's.-sv, --timeout <N>, or -x that Stage 1 used to get a
usable failure signal. For the shell-block form, refined_command is
the extracted "reproduce step" (usually the last line), not the
whole block.python -c "..." (double quotes),
not python -c '...'. Downstream callers wrap the string in
bash -c "$refined_command"; single-quoted python payloads compose
poorly through that wrapping.NOT_REPRODUCED
checked_stages: [nightly] | [nightly, source_build, ci_env]
reason: <what was checked and confirmed to pass>
NO_REPRODUCER
reason: no_command | collected_zero
(returned when either no reproducer_command was provided, or pytest
reports `collected 0 items` for the provided command)
CANNOT_VERIFY
stage: nightly | source_build | ci_env
blocker: <what went wrong>The orchestrator decides the next step based on this output.
© intel, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/fix-reproduce of intel/torch-xpu-ops.
Open the folder on GitHubat commit abf22c9
Fix Reproduce next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Fix Reproduce this skillintel/torch-xpu-ops | 115 | — | ~7.7k | Automated safety check: Pass | Apache-2.0 | |
| Running Testsbrendanhasz/probflow | 175 | — | ~657 | Automated safety check: Pass | MIT | |
| ONNX Runtime Test Runnermicrosoft/onnxruntime | 22k | — | ~1.8k | Automated safety check: Pass | MIT | |
| Designing TestsCloudAI-X/claude-workflow-v2 | 1.4k | 1 repos | ~1.5k | Automated safety check: Pass | MIT | |
| ONNX Runtime GPU Transformers Testsmicrosoft/onnxruntime | 22k | — | ~2.9k | Automated safety check: Pass | MIT | |
| Slow TestsUKGovernmentBEIS/inspect_ai | 3k | — | ~1.4k | Automated safety check: Pass | MIT |
brendanhasz/probflow
Run Python unit test suites strictly using the uv package manager and pytest.
microsoft/onnxruntime
Runs and debugs ONNX Runtime tests: Google Test executables for C++ and unittest or pytest for Python, with filters and build-directory guidance.
CloudAI-X/claude-workflow-v2
Designs and implements testing strategies for any codebase. An agent skill from CloudAI-X/claude-workflow-v2.
microsoft/onnxruntime
Runs the ONNX Runtime transformers Python tests against a GPU wheel and proves the cuDNN flash attention path was used rather than a silent fallback.
UKGovernmentBEIS/inspect_ai
Run the gated test classes that plain pytest skips (slow Docker/sandbox tests, live model-provider API tests, flaky tests, trio variants).
AbdelStark/worldforge
A skill your agent uses when selecting, running, or fixing WorldForge validation: pytest, coverage, ruff, generated provider docs, MkDocs strict build, package contract, CI failures, and release…
intel/torch-xpu-ops
Select the Intel GPU device to use when a system has multiple Intel GPU devices.
intel/torch-xpu-ops
Check PyTorch ciflow/xpu (xpu.yml) on the main branch, collect the failing XPU test cases from the most recent completed run(s), analyze the ROOT CAUSE of each failure with AI, and produce a list…
intel/torch-xpu-ops
Convert PyTorch ATDISPATCH macros to ATDISPATCHV2 format in ATen C++ code.
intel/torch-xpu-ops
Review pull requests for XPU operator or backend code. An agent skill from intel/torch-xpu-ops.
intel/torch-xpu-ops
Guide users through creating Agent Skills for Claude Code. An agent skill from intel/torch-xpu-ops.
intel/torch-xpu-ops
Read the evidence a nightly UT run produced, decide which failures share a root cause and which are machine breakage rather than product bugs, and write one issue draft per root cause to drafts.json.
Categories
A skill your agent uses when asked to reproduce a bug, verify a nightly CI failure, or confirm a failure still exists on latest source. Fix Reproduce is an agent skill from intel/torch-xpu-ops, published by the product's own GitHub organization. Use when asked to reproduce a bug, verify a nightly CI failure, or confirm a failure still exists on latest source.
Fix Reproduce fits situations like: asked to reproduce a bug; verify a nightly CI failure; confirm a failure still exists on latest source.
Run `npx skills add intel/torch-xpu-ops --skill fix-reproduce -a claude-code`. Or copy the skill folder (.claude/skills/fix-reproduce in intel/torch-xpu-ops) into .claude/skills/fix-reproduce in your project. Claude Code loads it when a task matches its description.
Run `npx skills add intel/torch-xpu-ops --skill fix-reproduce -a codex`. Or copy the skill folder (.claude/skills/fix-reproduce in intel/torch-xpu-ops) into .agents/skills/fix-reproduce in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add intel/torch-xpu-ops --skill fix-reproduce -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fix-reproduce, .gemini/skills/fix-reproduce, .github/skills/fix-reproduce and .opencode/skills/fix-reproduce in your project.
Going by SKILL.md and its folder, Fix Reproduce needs the command-line tools its instructions call (git, python, gh, pip, docker and pytest). Our summary lists: Python 3.
SKILL.md names 3 domains. In commands or code: download.pytorch.org, gha-artifacts.s3.amazonaws.com and github.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Fix Reproduce is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 7.7k tokens (SKILL.md is roughly 31k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Fix Reproduce: Running Tests (brendanhasz/probflow, 175 stars), ONNX Runtime Test Runner (microsoft/onnxruntime, 22k stars), Designing Tests (CloudAI-X/claude-workflow-v2, 1.4k stars) and ONNX Runtime GPU Transformers Tests (microsoft/onnxruntime, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
intel (a GitHub organization, an official publisher) maintains it in intel/torch-xpu-ops, which has 115 GitHub stars. The repository holds 29 skills in this directory. The repository was last updated on October 10, 2026.
Source: intel/torch-xpu-ops on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.