Bug B: profile_extrude has no inlier-coverage gate #48
Labels
No labels
blocked:needs-decision
blocked:preflight
bug
in-progress
in-progress
lint-cleanup
needs-decompose
quickfix
triage-approved
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/pc2cad#48
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Strategy gap: profile_extrude has no inlier-coverage gate
What is missing
derive_profile_operationsemits aprofile_extrudeprimitive with adepth that may be silently wrong. The current depth heuristic (when no
axial cone/cylinder is available) is "10% of the polygon's largest XY
extent" — see the original bug description in pc2cad#24 bug 2 / #39.
That heuristic produced a 0.01 m thick plate on a 1–2 mm slab.
There is no metric anywhere in
pc2cad.pythat says "thisprofile_extrude accounts for ≥95% of the polygon's inlier points
within tolerance". Without that gate, a profile_extrude is emitted
regardless of whether it explains the input points.
This is a strategy gap (no quality metric exists for
profile_extrude), not a function bug (the function works as designed).
Sample
samples/strategy_plate_with_hole.ply(7000 points, σ=0.2 mm)Parametric ground truth (build123d):
build123d bbox Z extent)
samples/specs/strategy_plate_with_hole_spec.pyWhat a real fix has to produce
Add
inlier_coverage(profile_extrude, polygon_points, tolerance) -> floatthat returns the fraction of polygon inliers within tolerance ofthe extruded surface. Gate the emit of profile_extrude on coverage ≥
0.95 (configurable via
FitConfig). Expose the metric throughfit_primitives's return value so callers and tests can inspect it.Acceptance — agentic / visual verification
The command must exit 0 (coverage ≥ 0.85). The closing comment must
include:
/tmp/bug_B_plate/side_by_side.pngmetrics.json0.01 × 10 = 0.1 mm) is now rejected by the coverage gate —
show the test that asserts coverage drops below 0.95 and the gate
reverts to the 10%-of-extent fallback (or whatever fallback the
implementer chose).
A commit that ships a coverage-metric helper but does not wire it into
derive_profile_operationsis not a real fix — the metric mustactually be the gate.
Why this is a strategy gap and not a function bug
This bug was filed originally as pc2cad#24 bug 2 and decomposed to
pc2cad#39, but the body described the symptom (depth source wrong)
without naming the missing capability (no inlier-coverage metric).
Closing this bug requires the metric to exist AND be the gate AND be
demonstrably correct on the synthetic plate sample.
Related
How to regenerate the sample
Cross-references — related strategy bugs
This bug is part of a four-bug batch on the pc2cad reconstruction
strategy gaps. They are designed to be solved together because each
one's verification gate depends on the harness from Bug D and the
synthetic samples from Bug A.
Closing this bug requires running the verification commands in its body
and attaching the resulting side-by-side PNGs to the closing comment.
Closing any of A/B/C without Bug D's harness producing falsifiable
evidence is a workaround, not a fix.