Pass schLayout.packPlacementStrategy through to the schematic packer#2361
Closed
matthewhardern wants to merge 1 commit into
Closed
Pass schLayout.packPlacementStrategy through to the schematic packer#2361matthewhardern wants to merge 1 commit into
matthewhardern wants to merge 1 commit into
Conversation
Read schLayout.packPlacementStrategy (or the top-level shortcut) in convertTreeToInputProblem and pass packPlacementStrategy:"force_directed" into the matchpack InputProblem. Default keeps greedy. End-to-end (bench-core-fd.ts): 50 resistors schematic layout drops from ~4.6s to ~45ms (103x), all placed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Reads
schLayout.packPlacementStrategy(or the top-level shortcut) when building the matchpackInputProblemfor match-adapt schematic layout, so a board can opt into the force-directed packer:This is the end-to-end wiring for tscircuit/tscircuit#3208. Measured by rendering N bare resistors, schematic layout goes from this:
Default stays greedy unless the prop is set, so nothing changes for existing designs. The packer runs behind a validate-then-fall-back-to-greedy gate in
calculate-packing, so it cannot produce a worse layout than today.Testing
bun test,bunx tsc --noEmit. Addedbench-core-fd.tsfor the end-to-end numbers above.Part of tscircuit/tscircuit#3208. Depends on the
calculate-packing,matchpack, and@tscircuit/propsPRs.Dependencies and CI
This is the top of a four-repo chain and depends on calculate-packing#94, matchpack#116, and props#681. Until those merge and publish and core's dependencies are bumped,
type-checkhere stays red because the published@tscircuit/matchpack,calculate-packing, and@tscircuit/propsdo not yet expose theforce_directedstrategy. Merging in dependency order resolves it.