Skip to content

Avoid provably futile PMI layout compiles - #2197

Merged
pzfreo merged 3 commits into
mainfrom
perf/pmi-layout-preflight
Oct 6, 2026
Merged

pzfreo merged 3 commits into
mainfrom
perf/pmi-layout-preflight

Conversation

@pzfreo

@pzfreo pzfreo commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

This PR removes two kinds of futile full drawing compile from automatic PMI layout without adding a runtime cap or relaxing the finished-drawing acceptance checks.

  1. Reject a scale before rendering when the bare front+side row or front+plan column cannot fit on the whole page even with zero gutters and no annotations. On the GRM-03 Specify PMI fixture this skips the impossible 10:1 A4 candidate: 38.9s before, 15.3s after, with the same selected A4 2:1 drawing and diagnostics.
  2. Only a table committed before source PMI/GD&T placement may trigger a source-drop measured repack. Late general notes, gear tables and hole tables fit around existing annotations and cannot have caused an earlier source drop. The Authored AP242 location to a pocket wall (75 +0.1/0) is neither drawn nor reported #2192 Specify plate was needlessly repacking because its remote general-notes table existed; early manufacturing schedules remain tagged and retain the repack path.

End-to-end on the #2192 Specify plate from the linked gist: 94.5s with normal automatic PMI layout, no algorithmic time limit. It selects A1 1:1 and honestly reports the four remaining source-PMI drops. The successful drawing is not claimed complete. One full assembly still costs about 19-22s, and the bounded arrangement/scale/page checks each require a rendered candidate. This PR does not change which checks can accept a candidate.

Focused geometry, table-trigger and real-PMI tests pass; scripts/pr-check --static passes. Based on merged #2193.

Base automatically changed from fix/pmi-pocket-wall-witness to main October 6, 2026 09:14
@pzfreo
pzfreo force-pushed the perf/pmi-layout-preflight branch from cfdbfbd to 1b5aca2 Compare October 6, 2026 10:34
@pzfreo pzfreo changed the title Skip impossible PMI scale layouts before rendering Avoid provably futile PMI layout compiles Oct 6, 2026

@pzfreo pzfreo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Reviewed the two performance changes against ADR 2/5 and the fixed first-/third-angle projection topology. No blocking findings. The scale preflight is a necessary geometric bound (full-page bare spans only), and the repack trigger now excludes tables placed after source PMI/GD&T, which cannot cause their earlier drops. The added tests cover pairwise fit and table-order behavior; targeted tests and static checks passed. The full Ubuntu matrix is still running, so this is a code review, not a CI-green merge recommendation yet.

@pzfreo
pzfreo enabled auto-merge (squash) October 6, 2026 11:02
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.

1 participant