Skip to content

Reuse sorted edge projections and completed rectangle expansion searches - #164

Merged
imrishabh18 merged 8 commits into
mainfrom
perf/index-quantized-edge-blockers
Oct 20, 2026
Merged

imrishabh18 merged 8 commits into
mainfrom
perf/index-quantized-edge-blockers

Conversation

@imrishabh18

@imrishabh18 imrishabh18 commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Aligned edges previously repeated blocker clipping and sorting after each spatial lookup. This change shares sorted projections per exact line, reuses completed rectangle-expansion queries, maintains full-stack blockers incrementally, and avoids allocating layer intersections for rectangles that do not overlap. Edge tasks use traversal ordinals so shared work preserves the original candidate precedence and float representation.

Rectdiff-only solve measurements at d3a8b09:

Rectdiff workload Original 215284c Final d3a8b09 Less solve time
dataset01, 85 boards 2.237 s 1.767 s 21.0%
dataset18, 16 boards 5.823 s 4.372 s 24.9%
dataset24, 26 boards 32.447 s 21.207 s 34.6%
bugreport109 93.970 s 5.384 s 94.3%

Local Linux x64, Bun 1.3.14, same host and inputs, RectDiffPipeline with maxGapFillPasses: 4. One warmup per revision, then two ABBA cycles: four measured passes per revision. Values are means of summed solve() time across each workload. Input cloning, explicit GC and output hashing are outside the timed solve; every pass verifies the complete ordered mesh JSON hash.

Full Pipeline9 board109 Original dependency Updated dependency Reduction
Topology time 94.728 s 5.948 s 93.7%
Full solve time 459.909 s 382.218 s 16.9%
Mean peak routing RSS 2595.6 MiB 2536.6 MiB 2.3%

Board109 uses fresh-process full Pipeline9 ABBA runs on the same Linux x64 host, Bun 1.3.14, effort 1 and cacheProvider: null: two processes per revision. All four complete routed-JSON hashes match, with all 349 endpoint pairs routed, 349 traces, 414 vias and zero relaxed DRC errors. Each process audits its input, resolved rectdiff source and Git revisions.

Validation at d3a8b09:

  • 110 tests pass, one existing skip; existing SVG snapshots unchanged. Local types, build and formatting pass. Upstream CI and consumer CI, including all nine consumer test shards, are green.
  • Complete ordered mesh JSON matches the original 215284c dependency for all 127 dataset01/18/24 boards plus board109.
  • Independent exact comparisons pass for 30,000 ordered edge-candidate arrays and 1,500 expansion inputs, including tiny/reversed extents, missing layers and signed zero.
  • A regression test covers negative width, height and both for obstacles and hard placements. Only ranking-index box bounds are canonicalized; exact distances still use the original raw rectangles.
  • The expansion regression fixture emits the same 6×6 rectangle with 11 searches per layer instead of 80.

Consumer PR3135 pins this revision at 2a436ee. Final same-machine Pipeline9 benchmarks were run after all CI checks passed: dataset01, dataset18, dataset24. Topology time is lower by 10.6%, 21.3% and 27.0%, respectively, with zero routing-outcome changes. Because topology accounts for roughly 1–2% of the latter datasets, those gains produce much smaller overall-routing changes. Dataset24 still has its existing seven timeouts and two DRC issues.

Full-pipeline RAM results are mixed. Dataset24's final P50/P80/P90 peak RSS improve 4.8%/1.5%/4.8%, but dataset18 P50 increases 6.9%, and dataset24 sample 010 increases 679.3→775.7 MiB (+14.2%) in the official ARM run. Separate fresh-process ABBA checks under Bun 1.4.2/x64 preserve identical routes and measure about 2.6% higher mean peak RSS for samples 010 and 020; the larger gaps appear downstream after topology. Source review found no new persistent cache/index retention path, but does not establish the cause. These measurements remain a limitation: no universal memory-parity or per-board overall-time claim is made.

@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
rectdiff Ready Ready Preview Oct 20, 2026 6:20am UTC

Request Review

@imrishabh18 imrishabh18 changed the title perf: index quantized blockers during edge seeding Index topology edge seeding and exact distance ranking Oct 19, 2026
}
blockerIndex.finish()
}
const queryBlockers = (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some handbook compliance cleanup

@ShiboSoftwareDev ShiboSoftwareDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@imrishabh18 imrishabh18 changed the title Index topology edge seeding and exact distance ranking Reuse sorted edge projections and completed rectangle expansion searches Oct 20, 2026
@imrishabh18
imrishabh18 merged commit cdf1786 into main Oct 20, 2026
5 checks passed
@imrishabh18
imrishabh18 deleted the perf/index-quantized-edge-blockers branch October 20, 2026 09:48
@tscircuitbot

Copy link
Copy Markdown
Contributor

Thank you for your contribution! 🎉

PR Rating: ⭐⭐⭐
Impact: Major

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


This branch was successfully deployed

1 active deployment
Preview — d3a8b095 Deployed Oct 20, 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.

5 participants