Repository navigation
Add a placement fitness report - #400
Merged
Merged
Conversation
Closed
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.
What this changes
This PR adds an electrical placement report to the placement engine. It
does not move parts, change the placer, rank candidates, gate the export, or
touch routing. It makes placement quality measurable.
The report has four dimensions:
or load capacitor to the anchor pin that claimed it. Limits are 3 mm for
decoupling and 5 mm for rail/load/orphan; a part's
max_distance_mmoverrides the default.
excluding passives within 2 mm of a connector.
MatingFacerotates with the placement; an undeclared part uses the nearestedge; a body outside the outline reports a negative inset and fails.
saturating at 55 % occupancy and never gating.
Each metric is normalized to
[0, 1]; the 0–100 composite is the equal-weightmean over the metrics that could be measured. Missing metrics are renormalized
and named in
assumptions.gate_failuresis reported separately and is notfolded into the score.
The MCP
synth_describe_placementresponse merges the report, so an agentsees it.
describe_placementitself and the placer's refine loop areunchanged.
What this improves
The current placement review answers "does this board look structurally
believable?" and returns
visual_score: 100,requires_revision: falseonboards that are electrically poorly placed. This PR replaces that blind spot
with a number and a breakdown.
Concretely, on
upstream/main:sensor_loggerenv_loggersecure_trackerfeather_m4_expressThat changes what the system can do:
check.
sensor_loggeris support andmating;
env_loggeris mostly support;feather_m4_expressis support by awide margin.
synth_describe_placementnow carries theblock, so an agent can make a targeted move and re-measure. Previously it
had no electrical measurement at all.
carry almost all of the 77 gate failures (
feather_m4_express24,sensor_logger10,env_logger9,iot_sensor_board8, thesensor_loggerfixture 8,edge_jst_connectors6,secure_tracker4).measured against a fixed baseline instead of passing because the visual
review is green.
8 / 6 / 5 → 0 / 0 / 3gate failures on the reference boards because thisreport existed. It could also see the trade-off: routing went
1 / 1 / 2 → 1 / 5 / 3, which is why that repair is not part of this PR.What this does not improve
before.
feather_m4_express,sensor_loggerorenv_logger.This is a measurement PR. It makes the next placement PR provable rather than
a matter of opinion.
Qualification
cargo test -p synth-place— 114 tests pass.cargo test -p synth-mcp --lib describe_placement— the MCP responsecarries the block.
cargo test -p synth-place --test fitness corpus_report -- --ignored --nocapture): 62 example/fixture designs placed, 0 placementfailures, 47 with zero gate failures and 15 with at least one. Metric
coverage is corpus-limited: 8 support, 8 mating, 15 rail, 29 area; most
fixtures are parser or error cases.
Normal tests cover the report contract, deterministic JSON, support distance
changing when a capacitor is stranded, a body outside the outline failing
mating with a negative inset, the rail ratio rising when a passive enters the
top strip, missing metrics in assumptions, the MCP response, and an empty
board scoring zero.
Notes
docs/placement-fitness.md.placement report came from reviewing the Copperhead tool; no Copperhead
source, identifier, comment or constant is reproduced.
project requires it.