chore: remove unused flatten_layers_to_masks pass - #1247
Open
detail-app[bot] wants to merge 1 commit into
Open
detail-app[bot] wants to merge 1 commit into
detail-app[bot] wants to merge 1 commit into
Conversation
Comment on lines
-462
to
-465
| pub fn flatten_layers_to_masks<S, L>( | ||
| doc: &mut Document<S, L>, | ||
| resolution: Resolution, | ||
| ) -> Result<(), AccuracyError> |
There was a problem hiding this comment.
🟡 Public flattening API disappears
External users calling flatten_layers_to_masks lose the public function without a compatibility path. process remains public, so direct callers stop compiling after upgrading.
Prompt for agents
The published pcb-ir crate exposes dialects::ipc::process publicly, making flatten_layers_to_masks callable by downstream crates despite its lack of a root re-export. Preserve compatibility, preferably by retaining and deprecating the function before a planned breaking release. If immediate removal is required, treat it as a public API break and coordinate the crate version and migration documentation accordingly.
Was this helpful? React with 👍 or 👎 to provide feedback.
Build Performance
Measured with hyperfine. Times show median ±stddev. |
This branch has not been deployed
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.


Remove the
flatten_layers_to_masksfunction frompcb-ir's IPC processpipeline, along with its four dedicated tests in
process.rsand theflatten-specific block in
gerber/export.rs'sreal_board_export_parseback_and_svg_paths_smoketest (whosecompose_for_renderinghalf is retained).This pass had no production callers. Its only production caller — the
--flatrender option inipc2581 render— was deliberately removed in#1026, replaced by instance-aware artwork lowering. The remaining
call-sites were all tests, which don't count as production consumers.
processis also the only sibling module inipc/mod.rswithout apub usere-export, soflatten_layers_to_maskswas never part of theadvertised external API. The
FeatureKind::FlattenedBucketenum variant(now never constructed) is left in place in
feature.rsto avoid abreaking change to the public enum.
History
Dead Code PRs can be configured here.
Note
Low Risk
Dead-code deletion with no production callers; behavior of Gerber export and live IPC pipelines is unchanged aside from removed test coverage for the flatten pass.
Overview
Removes the dead
flatten_layers_to_masksIPC process pass, which lowered each layer to artwork, composed a single unioned fill mask per layer, rewrote features asFeatureKind::FlattenedBucket, and cleared placement groups. Nothing in the repo calls it anymore after the old--flatrender path was dropped.process.rs: deletes the public function and four unit tests (mask union, stroke expansion, cutouts, placement groups). Test imports are trimmed soFeatureKindis only pulled in where still needed.gerber/export.rs: shortensreal_board_export_parseback_and_svg_paths_smokeby dropping the flatten-and-SVG block; thecompose_for_rendering→ artwork → mask → SVG path stays.FeatureKind::FlattenedBucketremains on the public enum but is never constructed, avoiding a breaking API change.Reviewed by Cursor Bugbot for commit 77e0b2f. Bugbot is set up for automated code reviews on this repo. Configure here.