Allow selecting the force_directed packing strategy via InputProblem#116
Closed
matthewhardern wants to merge 1 commit into
Closed
Allow selecting the force_directed packing strategy via InputProblem#116matthewhardern wants to merge 1 commit into
matthewhardern wants to merge 1 commit into
Conversation
|
@matthewhardern is attempting to deploy a commit to the tscircuit Team on Vercel. A member of the Team first needs to authorize it. |
Thread an optional packPlacementStrategy:"force_directed" through InputProblem into PartitionPackingSolver + SingleInnerPartitionPackingSolver. Default (undefined) keeps the greedy outline packer unchanged; when set, packing routes through calculate-packing's gated pack() (force-directed + validate + greedy fallback). Fixes the O(n^3) blowup behind tscircuit#3208: a 100-resistor LayoutPipelineSolver run drops from ~5.1s to ~3ms, 0 overlaps, all placed. spike-matchpack-fd.ts: head-to-head verification via the real field.
804a92f to
85618de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Threads an optional
packPlacementStrategy: "force_directed"throughInputProbleminto the two packing solvers (PartitionPackingSolverandSingleInnerPartitionPackingSolver). When set, packing routes throughcalculate-packing's gatedpack()(force-directed with a validate-then-fall-back-to-greedy safety net); when unset, the existing greedy strategies are used exactly as before.This is what lets the schematic layout pipeline opt into the faster packer behind tscircuit/tscircuit#3208. On a 100-resistor
LayoutPipelineSolverrun, packing drops from about 5 seconds to a few milliseconds with all parts placed and no overlaps.Purely additive and default-off, so current behavior is unchanged.
Testing
bun testfor the packing solvers. Addedspike-matchpack-fd.tsfor a head-to-head check via the real field.Part of tscircuit/tscircuit#3208. Builds on the
calculate-packingPR that adds theforce_directedstrategy; the@tscircuit/propsandcorePRs expose it as a board prop.Dependencies and CI
This builds on calculate-packing#94, which adds
force_directedtoPackPlacementStrategy. Until #94 is merged and published and this repo's calculate-packing dependency is bumped, thetype-checkjob here stays red because the published types do not includeforce_directedyet. That is merge ordering, not a problem with this change.The failing
testjob is unrelated to this PR: it is acircuit-to-svgdependency drift (convertCircuitJsonToSchematicSimulationSvgis no longer exported), which also affects a fresh run ofmain.