Skip to content

Build strong-pin neighbor lists without scanning every possible pin pair - #258

Open
ugin-man wants to merge 2 commits into
tscircuit:mainfrom
ugin-man:koyo/sparse-strong-pin-index-20260909
Open

ugin-man wants to merge 2 commits into
tscircuit:mainfrom
ugin-man:koyo/sparse-strong-pin-index-20260909

Conversation

@ugin-man

@ugin-man ugin-man commented Sep 8, 2026

Copy link
Copy Markdown

getPinIdToStronglyConnectedPinsObj scans every possible pair even when pinStrongConnMap is sparse. Index pin positions, collect actual connected pairs from the map entries, then visit those pairs in the original pin order.

Preserve neighbor-array ordering, output-key insertion order, ChipPin object identity, two-way edge deduplication, and disabled/self/dangling-edge behavior. Checking every hyphen split retains the original helper's behavior for IDs containing hyphens, including keys that match more than one valid pair. This is a performance change to own-entry connection maps, not a new connectivity rule.

Verification on the SHA-verified original helper (1de2bd971737c3bd53549d671b4f20a899276908):

  • Four committed behavior tests pass before and after, including 1,500 pins, ordering, identity, ambiguous hyphens, disabled/dangling edges, and input preservation.
  • A separate deterministic comparison of 1,000 generated inputs matched complete Object.entries results and neighbor order.
  • Local Node 22.16.0 benchmark, 1,500 pins / 750 disjoint edges, one warm-up per version and seven interleaved trials: median 1032.15 ms before / 0.734 ms after. This is a synthetic helper-level sparse-graph measurement, not an end-to-end layout or Bun speedup guarantee. CI contains no timing threshold.

Local tests execute the actual type-stripped modules; only runner/import-path adaptations were made, and the committed files additionally receive formatting. Indexes add O(pins + discovered pairs) storage; dense graphs and very long identifiers have different costs. Separate from pin-owner indexing #191 and whole-network merging #252. No solver geometry, dependency or snapshot change.

Base: 32dad82. Upstream Bun/type/format CI not yet verified; no browser or build result claimed. Prepared with ChatGPT assistance and the account owner's authorization; no manual human testing claimed.

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
matchpack Ready Ready Preview Sep 8, 2026 9:09pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview e4c63904 Deployed Sep 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant