pyperformance-worker-run

A procedure for running one pyperformance benchmark in its real worker process. A worker is the separate process that actually executes the benchmark.

In plain words
What is it for?
Use it to debug one benchmark, verify CinderX JIT setup, inspect inherited environment variables, or investigate worker-only failures.
Why use it?
It helps reproduce a single performance issue or crash while checking that settings, libraries, and runtime options reach the process that runs the test.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/sisibeloved/cpython-optimize-skill/pyperformance-worker-run
Any agent
npx skills add sisibeloved/cpython-optimize-skill --skill pyperformance-worker-run
Clone the repo
git clone --depth 1 https://github.com/sisibeloved/cpython-optimize-skill

Made for: Claude Code, Codex.

Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,195 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.01195
Opus 5 $0.00020 $0.00598
Sonnet 5 $0.00008 $0.00239
Haiku 4.5 $0.00004 $0.00120

Measured 2d ago against content hash e4a269a64f47, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pyperformance-worker-run scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (references/pyperformance-run-realenv.sh, references/run-benchmark-worker-realenv.sh, scripts/benchmark_harness.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cpython-optimize-skill/skills/pyperformance-worker-run/SKILL.md · 59 lines

How it starts

The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pyperformance Worker Run

负责单 benchmark L2 复现,是 crash、HIR、JIT 分析的真实命令来源。

三类测试边界

  • RuntimeTests 是功能测试,失败时先回到 cpython-runtime-test-run
  • test_cinderx/lib test 是集成测试,失败时不要用 pyperformance 结果遮盖。
  • pyperformance 是性能测试;功能测试和集成测试未过时,只能输出调试观察,不能输出可提交性能结论。

Worker 架构 Checklist

  • 先读取 ../using-cpython-optimize/references/pyperformance-env-contract.md,确认 driver、manager、worker 和 bench_command() 子进程看到的环境变量一致。
  • 使用真实 run_benchmark.py --worker,不要用交互式 import 替代。
  • python -m pyperformance run 不是单进程执行:先有 driver/manager,再进入 benchmark worker;bench_command() 还可能生成下一层子进程。
  • sitecustomizeLD_LIBRARY_PATHPYTHONPATH、插件开关、JIT flags 必须传到真实 worker。
  • CinderX worker 必须能看到系统 site-packages:确认 worker venv 的 pyvenv.cfginclude-system-site-packages = true,或用等价 PYTHONPATH 把系统 site-packages 放进 worker 环境。
  • CinderX .pth 必须安装在 worker 可见的 site-packages,且指向当前 candidate 的 CinderX;记录 .pth 路径和内容摘要。
  • 判断 CinderX JIT 是否启用必须在 worker 内取证:import cinderximport _cinderxcinderx.__file__cinderx.get_import_error()cinderx.is_initialized(),并和 jit.log/HIR 中的目标 benchmark 本体对应。
  • Python baseline 不应误继承 CinderX 安装;如果故意比较 CinderX baseline,必须在口径里写清。
  • --inherit-environ 至少继承代理、LD_LIBRARY_PATHPYTHONPATH、插件开关和 JIT 关键变量。
  • validation-skill-router deny 了 worker/helper 命令,不要改用简化命令绕开;先补齐 pyperformance-env-contract.md 要求的 worker venv / .pth / --inherit-environ / JIT 初始化证据,再用 CPYTHON_OPTIMIZE_HOOK_ACK=1 前缀重试同一条真实 worker/helper 命令。
  • 不能在未完成前置证据时提前加 CPYTHON_OPTIMIZE_HOOK_ACK=1;ACK 只表示已经确认真实 worker 环境可用。
  • 分析阶段只增减 debug 变量,尽量保持同一真实 worker 命令。

快速 L2 命令形态

优先用仓库或容器内已有 bm/test-benchmark 快速脚本做 L2 复现,形态保持抽象:

BENCHMARK=<benchmark-selector> WARMUP=<n> PYTHONJITAUTO=<threshold> DIAG=0 /scripts/test-benchmark.sh
  • DIAG=0 是非 debug 性能口径;只有 crash、HIR、JIT 日志定位时才切 DIAG=1
  • 快速 L2 可用于验证方向、复现异常或生成 worker 命令;正式性能结论仍要回到 pyperformance-suite-run 的非 debug 正式命令。
  • 文档和报告只写 <benchmark-selector><result.json> 等占位,不硬编码具体 pyperformance 用例名或文件名。

故障排查 Checklist

Read the full file on GitHub · 59 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 59 lines · 40 tokens per session scan A e4a269a64f47

Subscribe to this mod's changes

pyperformance-worker-run is a skill published in the GitHub repository sisibeloved/cpython-optimize-skill (2 stars, last pushed 4d ago), licensed MIT. It adds 40 tokens to every session and 1,195 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens