tscircuit-performance-improvement-workflow
Skill101 starsChanged 3 months agoMITView on GitHub
Dataset- and location-agnostic loop to improve the tscircuit autorouter's solve performance. Primary target is lowering P50 and P95 solve time on a user-chosen dataset, but any rise in solve rate (Completed %) always wins. Asks the user which dataset and where to run (local vs Blacksmith), then drives baseline → idea backlog → one git worktree + subagent per idea → re-benchmark → keep/reject, serializing benchmark runs locally and parallelizing them on Blacksmith CI.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- blacksmith-testboxSkill
- tscircuit-create-solverSkill
- tscircuit-visualizationSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Run from the repo root with Bun.
- Very specific: line 49
Default solver (no positional arg): AutoroutingPipelineSolver4.
- Very specific: line 52
No average-solve-time column exists — the only avg shown is Avg Via (via count, a quality metric).
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
tscircuit performance improvement workflow
Run from the repo root with Bun. Datasets are git deps, so bun install must succeed before benchmarking.
Inputs (ask the user FIRST, record both in process.md)
<chosen-dataset>— one ofdataset01|zdwiel|srj05|srj11|srj12|srj13|srj14|srj15|srj16|srj18. Defaultdataset01.<run-location>—localorblacksmith. Selects the concurrency rule (below).
Keep-rule (defined here once; steps reference it)
Primary goal: lower P50 and P95 on <chosen-dataset>. Decision ladder for each change:
Completed %↑ → keep. Overrides everything — keep even if P50/P95/Relaxed DRC Pass %/Avg Via/avg solve time worsen. More solves always wins.Completed %flat → keep only if P50 ↓ AND P95 ↓ with no regression in solve rate, avg solve time,Avg Via, or DRC (Relaxed DRC Pass %).- Otherwise (
Completed %↓, or nothing improved, or a regression with no solve-rate gain) → reject. - Mixed/ambiguous (e.g. P50 ↓ but P95 ↑,
Completed %flat) → operator judgment; log numbers + reasoning.
Concurrency rule (defined here once)
--concurrency $(( $(nproc)/2 )) (min 1) caps worker threads within one run; never use all cores. Default if unset is full core count, so always set it. Number of runs at once depends on <run-location>: local → one ./benchmark.sh at a time (serialize; concurrent local runs corrupt timings and clobber the shared benchmark-result.* files); blacksmith → parallel runs are fine (each gets its own cloud env).
Files (repo root; scratch — do NOT commit unless asked)
idea.md— backlog. Each idea: a title,state(tobedone|in-progress|done|rejected),hypothesis(why it lowers P50/P95 or raisesCompleted %),risk(what it might regress).process.md— running log: inputs, commands, raw benchmark numbers, comparisons, decisions.
Steps
- Collect Inputs.
- Baseline. Clean checkout of
origin/main, then benchmark<chosen-dataset>; record P50 / P95 /Completed %/Relaxed DRC Pass %/ avg solve time under a "Baseline" heading.git fetch origin && git checkout -B perf-baseline origin/main && bun install CPUS=$(( $(nproc)/2 )); [ "$CPUS" -lt 1 ] && CPUS=1 ./benchmark.sh --dataset <chosen-dataset> --concurrency "$CPUS" - Idea backlog. Populate
idea.mdwith ideas in statetobedone. - Per idea, via a subagent. Mark
in-progress; the subagent worktrees offorigin/main, implements, benchmarks<chosen-dataset>at the same CPU budget (obeying the Concurrency rule), logs raw results toprocess.md, then applies the Keep-rule: markdone, or markrejected(with reason) and discard.git worktree add -b perf/<slug> ../ar-<slug> origin/main && cd ../ar-<slug> && bun install # implement, then benchmark as in step 1 # on reject: git worktree remove ../ar-<slug> --force && git branch -D perf/<slug> - Report. In
process.md, summarize baseline-vs-best deltas for<chosen-dataset>(<run-location>noted):Completed %first, then P50/P95, plusAvg Via, avg time, DRC.
Benchmark reference
./benchmark.sh [solver|all] [scenario-limit] --concurrency <n> --effort <n> --dataset <chosen-dataset>- Default solver (no positional arg):
AutoroutingPipelineSolver4. - Output: stdout table +
benchmark-result.txt/benchmark-result.json(+ HTML snapshot) at repo root. - Metric map: P50 →
P50 Time(summary[].p50TimeMs); P95 →P95 Time(summary[].p95TimeMs); solve rate →Completed %(summary[].completedRateLabel); DRC →Relaxed DRC Pass %(summary[].relaxedDrcRateLabel). - No average-solve-time column exists — the only avg shown is
Avg Via(via count, a quality metric). Derive avg time by averagingtests[].elapsedTimeMsfrombenchmark-result.jsonover succeeded samples. - Blacksmith only: in a PR, exact
/benchmarkruns dataset01, while exact/benchmark-alldispatches separate cloud runs for dataset01, srj18, srj19, srj20, srj21, and srj23. PR comment arguments are unsupported.
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.

