@tscircuit/fanout-solver 0.0.51 → 0.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +57 -44
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -16,7 +16,7 @@ and treats each bus-layer decision atomically.
16
16
  - Detects rectangular pad footprints through obstacle `componentId` metadata,
17
17
  including perimeter packages and two-pad passives.
18
18
  - Handles multiple mixed footprints inside one shared breakout boundary.
19
- - Routes perimeter and inner-matrix pads; the benchmark connects every pad.
19
+ - Routes perimeter and inner-matrix pads.
20
20
  - Uses `sharedBoundary` as the common exit rectangle. Without one, it infers a
21
21
  shared rectangle around the source footprints selected for the buses, without
22
22
  expanding that boundary to include destination footprints.
@@ -280,53 +280,66 @@ parameters. Each sample has one shared boundary around all of its footprints,
280
280
  and component bounds come from the exact footprinter-generated copper pad
281
281
  extents.
282
282
 
283
- ## SRJ29 benchmark
283
+ ## Dataset 31 benchmark
284
284
 
285
- The repository loads all 200 samples from the derivative
286
- [`tscircuit/dataset-srj29-bga-decoupling`](https://github.com/tscircuit/dataset-srj29-bga-decoupling)
287
- as a pinned development dependency. The adapter keeps the complete obstacle
288
- field, including opposite-layer capacitor pads and bodies. VCC and GND are
289
- grouped onto opposite boundary corridors, while the capacitor pad remains the
290
- downstream endpoint of every power connection; a local capacitor or plane via
291
- alone cannot count as a solved BGA pin. Remaining edge signals are grouped by
292
- direction. Every adapted problem uses the same six-layer stackup (`top`,
293
- `inner1` through `inner4`, and `bottom`) so benchmark improvements are directly
294
- comparable.
295
-
296
- Run the full benchmark with:
285
+ Run `./benchmark.sh` (or `bun run benchmark`) to benchmark **only the 12 AM62L
286
+ directional cases** from
287
+ [`tscircuit/dataset-fanout31-am62l`](https://github.com/tscircuit/dataset-fanout31-am62l).
288
+ The upstream revision is pinned in `scripts/generate-repro/package.json` and
289
+ recorded in every report. Other datasets remain available for regression tests
290
+ and the debugger, but have no benchmark commands or workflows.
297
291
 
298
292
  ```sh
299
293
  ./benchmark.sh
294
+ ./benchmark.sh --list
295
+ ./benchmark.sh --sample 11-left-center
296
+ ./benchmark.sh --concurrency 8 --sample-timeout-seconds 300
300
297
  ```
301
298
 
302
- Use `--sample sample001`, `--limit 10`, or
303
- `--max-layer-combinations 16` for shorter runs. Samples run one at a time by
304
- default and print progress as they finish. `--concurrency 8` runs isolated
305
- samples in parallel, and `--sample-timeout-seconds 600` prevents a difficult
306
- sample from blocking the remaining work. Each run writes the full ordered
307
- results to `benchmark-results/srj29.json` and
308
- `benchmark-results/srj29.md`. A row is marked solved only when every input
309
- connection has a validated breakout and an independent physical-copper audit
310
- proves that the emitted wires, vias, and same-net pads connect every original
311
- endpoint on compatible layers. A second independent audit checks every emitted
312
- trace and via against different-net pads, obstacles, traces, and vias on every
313
- physical layer in its span. Reaching an arbitrary boundary point, retaining an
314
- unrouted endpoint in the output JSON, or emitting copper with a DRC violation
315
- does not count. The report separates fanout-prefix completion from physically
316
- connected original connections so partial progress remains visible without
317
- overstating it as a solution. Partial solutions are reported as benchmark
318
- results instead of failing the command. `bun run benchmark:srj29` is an alias
319
- for the same command.
320
-
321
- The `SRJ29 Benchmark` GitHub Actions workflow runs the complete dataset on a
322
- Blacksmith 32-vCPU ARM runner with 32 sample processes by default. It can be
323
- started manually with an optional sample id, or for a pull request by adding
324
- `[BENCHMARK TEST]` to its title. The workflow publishes the Markdown summary and
325
- uploads both reports as an artifact.
326
-
327
- Run `bun run start` and inspect the SRJ29 fixtures to step through the selected
328
- sample. The derivative dataset also publishes dedicated Cosmos pages for the
329
- first ten samples.
299
+ Before timing the solver, the benchmark renders the selected upstream TSX/core
300
+ circuits and captures their exact fanout-solver constructor inputs into
301
+ `benchmark-results/inputs/<sample-id>.json`. Each case retains all 135 AM62L
302
+ connections, 573 pad obstacles, nine DDR buses, 102 plane drops, and the original
303
+ clearance, differential-pair, and length-skew constraints. The timed workers run
304
+ **this checkout's solver**, not the upstream package's released solver.
305
+ To capture the inputs without solving, use `bun run generate:dataset31`.
306
+ The optional `--dataset dataset31` flag is accepted for explicit CI invocation;
307
+ other dataset selections are rejected.
308
+
309
+ Each sample runs in an isolated process, with up to four concurrent processes
310
+ locally and a **120-second hard timeout** by default. A synchronous solver hang,
311
+ exception, or unsolved case does not prevent later samples from running.
312
+ Assignment budgets and circuit constraints remain at each sample's defaults;
313
+ `--max-layer-combinations` explicitly overrides only the search budget.
314
+
315
+ The ordered `benchmark-results/benchmark.json` and `benchmark.md` reports contain
316
+ the solver commit, dataset revision, configuration, solve totals, every sample's
317
+ status and timing, and partial routing/validation counts. Reports are saved after
318
+ every completed sample, including the total selected count to identify incomplete runs.
319
+ Timed-out workers do not retain their in-flight routing counts.
320
+ Compare reports with the same budgets to track progress. Solved means validated
321
+ AM62L fanout, not RAM fanout or downstream inter-chip routing. Partial, error,
322
+ and timeout rows are benchmark results (exit 0); invalid CLI arguments or report
323
+ I/O failures are command failures (nonzero exit).
324
+
325
+ ### PR comment trigger
326
+
327
+ Once `.github/workflows/benchmark.yml` is on the default branch, a repository
328
+ writer can comment **`/benchmark`** on an open PR. The workflow captures that
329
+ PR's exact head SHA, runs all 12 dataset 31 samples on a **32-vCPU Blacksmith ARM**
330
+ runner, then updates a status comment with solve totals, per-sample results,
331
+ and a link to the complete JSON/Markdown reports and captured inputs. The Actions
332
+ UI also supports a manual run, optionally supplying an open PR number. No custom
333
+ bot token is required.
334
+
335
+ The runner defaults to 32 processes and a 120-second per-sample deadline; set
336
+ repository variables `BENCHMARK_CONCURRENCY` and
337
+ `BENCHMARK_SAMPLE_TIMEOUT_SECONDS` to change these. PR code runs with a read-only
338
+ token and no persisted checkout credentials. A separate job uses the trusted
339
+ workflow revision to validate report data and post comments; it never executes
340
+ PR code. The trusted renderer rejects legacy or mixed-dataset reports, so PR
341
+ comments contain only dataset 31 results. Only exact commands from non-bot users
342
+ with current write, maintain, or admin access are accepted.
330
343
 
331
344
  ## Dataset 02
332
345
 
@@ -479,8 +492,8 @@ bun run render:dataset
479
492
  bun run start
480
493
  ```
481
494
 
482
- The benchmark runs every sample in all datasets and reports footprint, pad,
483
- connection, routing, and layer-assignment metrics. `bun run start` opens the
495
+ The benchmark runs only the 12 dataset 31 AM62L cases and reports solve counts,
496
+ validation, and timing. `bun run start` opens all regression
484
497
  datasets in the standard tscircuit solver debugger. `bun run
485
498
  render:dataset` writes `graphics-debug` PNGs under one subdirectory per dataset,
486
499
  with a red shared boundary, gray component courtyards, and green fanout-exit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/fanout-solver",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "description": "BGA fanout solver with coordinated bus-layer escapes for SimpleRouteJson",
5
5
  "module": "lib/index.ts",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "test": "bun test",
33
33
  "benchmark": "bun benchmarks/run-benchmark.ts",
34
34
  "generate:repro04": "bun scripts/generate-repro/generate-repro04.tsx",
35
- "benchmark:srj29": "./benchmark.sh",
35
+ "generate:dataset31": "bun scripts/generate-repro/generate-dataset31.tsx",
36
36
  "render:dataset": "bun scripts/render-dataset-pngs.ts",
37
37
  "format": "biome format --write .",
38
38
  "format:check": "biome format ."