Skip to content

Compute large pad bounds without spreading coordinate arrays into Math.min/max - #259

Open
ugin-man wants to merge 2 commits into
tscircuit:mainfrom
ugin-man:koyo/large-pad-bounds-20260909
Open

ugin-man wants to merge 2 commits into
tscircuit:mainfrom
ugin-man:koyo/large-pad-bounds-20260909

Conversation

@ugin-man

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

Copy link
Copy Markdown

getPadsBoundingBox flattens two coordinates per pad and spreads the resulting arrays into Math.min/Math.max. A 100,000-pad list exceeds Node 22.16.0's function-argument limit and throws RangeError even though its bounds are finite.

Accumulate extrema directly without temporary global coordinate arrays or input-size-dependent argument lists. Preserve the empty fallback, offsets and half-sizes, original sparse-array hole behavior, and existing endpoint/NaN semantics. The input is not mutated. This is large-input robustness, not a claim that ordinary small component footprints fail.

Six focused cases execute the SHA-verified actual helper (original blob b87bf94e1e6cca008c5810e88a9105d8107f37d7). Node 22.16.0 with type stripping: 1 failure / 5 passes before; 6 passes after. They cover 100,000 pads, empty/non-origin geometry, holes, frozen pad geometry and numeric controls. Only local test-runner and explicit .ts import paths were adapted; the production helper was not mocked. Committed tests use InputPad's declared fields.

Base: 32dad82. Separate from sparse connection indexing #258; no packing rules, dependencies or snapshots changed. Upstream Bun/type/format checks are not yet verified at submission. No browser, package-build or general application-speed claim. 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:13pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview 1019db58 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