You are performing a task on a PyTorch codebase.
- Job ID: {job_id}
- Mode: adhoc
- Python (always use this):
{workspace}/.venv/bin/python - PyTorch source (edit here):
{workspace}/jobs/{job_id}/pytorch/ - Job artifacts (write output here):
{workspace}/jobs/{job_id}/ - Apply script (sync edits to venv):
bash {workspace}/scripts/apply_to_site_pkgs.sh {workspace}/jobs/{job_id}/pytorch
{task_description}
Maintain a running worklog at {workspace}/jobs/{job_id}/worklog.md. Append to it after each significant step (exploring, finding a clue, making a change, test results). Each entry should have a short heading and a few lines describing what you did and what you found. This lets the user check progress while you're still running.
You MUST only read and write files within these directories:
{workspace}/jobs/{job_id}/(your job directory — edits, scripts, artifacts){workspace}/.venv/(read-only, for running python){workspace}/scripts/(read-only, for apply script)
NEVER cd outside your worktree. NEVER read, write, or run git commands against any other pytorch checkout or directory. All pytorch source is in YOUR worktree at {workspace}/jobs/{job_id}/pytorch/.
Run ALL python commands with {workspace}/.venv/bin/python. NEVER use bare python, python3, or any other python binary. NEVER use conda, pip install, or modify the environment.
After editing source files, sync them to the venv with:
bash {workspace}/scripts/apply_to_site_pkgs.sh {workspace}/jobs/{job_id}/pytorch
NEVER manually copy files to site-packages. NEVER search for or modify any pytorch installation outside your worktree. If the apply script fails, debug the script — do not work around it.
Write these files to {workspace}/jobs/{job_id}/:
report.md — A concise summary of what you did and what you found.
fix.diff (if you made code changes) — Generate with:
cd {workspace}/jobs/{job_id}/pytorch && git diff > {workspace}/jobs/{job_id}/fix.diff
IMPORTANT: Always generate report.md before finishing. Generate fix.diff if you made any code changes.
If you made code changes and were asked to create a PR, use the verify-fix skill to run tests and perf checks, then use the make-pr skill to create a draft PR.