npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tscircuit/high-density-a01

v0.0.37

Published

A high density zero-obstacle solver

Readme

@tscircuit/high-density-a01

A high density zero-obstacle solver

This is a @tscircuit/solver-utils BaseSolver-compatible solver with the following properties:

  • Multi-layer
  • Grid-based
  • Supports High Density Types from tscircuit-autorouter
  • Rip'n'Replace with History (@tscircuit/hypergraph-inspired)
  • Via Penalty and Trace Penalty Map

Usage

The package exports the solver classes directly:

import {
  HighDensitySolverA03,
  HighDensitySolverA05,
} from "@tscircuit/high-density-a01"

A03

Use HighDensitySolverA03 for the baseline high-density solver:

const solver = new HighDensitySolverA03({
  nodeWithPortPoints,
  highResolutionCellSize: 0.1,
  highResolutionCellThickness: 8,
  lowResolutionCellSize: 0.4,
  traceThickness: 0.1,
  traceMargin: 0.15,
  viaDiameter: 0.3,
  viaMinDistFromBorder: 0.15,
  maxCellCount: 200_000,
  stepMultiplier: 4,

  hyperParameters: {
    shuffleSeed: 0,
    ripCost: 8,
    ripTracePenalty: 0.5,
    ripViaPenalty: 0.75,
    viaBaseCost: 0.1,
    greedyMultiplier: 1.5,
  },

  // Optional initial penalty map
  // initialPenaltyFn: ({ x, y, px, py, row, col, region }) => ...
})

solver.solve()
const routes = solver.getOutput()

A05

Use HighDensitySolverA05 when you want A03-style routing plus route normalization and force-directed reflow after each solved route:

const solver = new HighDensitySolverA05({
  nodeWithPortPoints,
  highResolutionCellSize: 0.1,
  highResolutionCellThickness: 8,
  lowResolutionCellSize: 0.4,
  traceThickness: 0.1,
  traceMargin: 0.15,
  viaDiameter: 0.3,
  viaMinDistFromBorder: 0.15,

  // A05 defaults
  postRouteSegmentCount: 16,
  postRouteForceDirectedSteps: 20,

  // Initial border-avoidance bias
  borderPenaltyStrength: 0.25,
  borderPenaltyFalloff: 0.12,
})

solver.solve()
const routes = solver.getOutput()

Notes:

  • HighDensitySolverA05 uses the same routing hyperparameters as A03 by default.
  • postRouteSegmentCount counts vias toward the total segment budget.
  • The default A05 initial penalty map discourages routing too close to the node border. Set borderPenaltyStrength: 0 to disable that bias.
  • Providing initialPenaltyFn overrides the built-in A05 border penalty.
  • The output routes preserve the exact user-provided endpoints.

How it works

For A03/A05, we form a two-resolution grid using highResolutionCellSize, highResolutionCellThickness, and lowResolutionCellSize.

We compute the initial penalty map from initialPenaltyFn. This function sets an additional cost of traversal for a cell. It receives x/y in board coordinates, and px/py in [0,1] relative to the node bounds.

We shuffle the trace order based on the shuffle seed.

We run an A* search for each path from the start to the end. During exploration, we consider both used and unused cells. Used cells incur rip costs and trace/via penalties, while vias allow moving between any available layers. A path that rips the same trace only pays ripCost once, so the search tracks which traces have already been ripped along that candidate path.

When we reach the end of a path, we mark that route as solved and apply its occupied cells to the congestion structure. Vias occupy more cells based on viaDiameter. If a solved route displaced other routes, those routes are ripped out and added back to the unsolved queue.

For A05, after each solved route we:

  1. Normalize all solved routes to a fixed total segment count.
  2. Run a force-directed reflow pass over the solved route set.
  3. Rebuild occupancy from the updated geometry before routing the next trace.

This creates additional room for later routes at the cost of extra per-route work.

Benchmarks

Useful benchmark commands:

bun run scripts/run-dataset02-benchmark-a03.ts --concurrency=4
bun run scripts/run-dataset02-benchmark-a05.ts --concurrency=4

A05 tuning examples:

bun run scripts/run-dataset02-benchmark-a05.ts --concurrency=4 --border-penalty-strength=0.25 --border-penalty-falloff=0.12
bun run scripts/run-dataset02-benchmark-a05.ts --concurrency=4 --rip-cost=8 --greedy-multiplier=1.5

high-density-a02

The high-density-a02 solver is a variant that uses an inner and outer grid to reduce the number of cells while still allowing high density edges

a02