Skip to content

fix: ClassifyLoops' loop bisector keeps its B-rep edits (#681 site 2) - #827

Merged
bherbruck merged 4 commits into
tangency-labs:mainfrom
erlis:fix/loop-bisector-live-brep
Oct 25, 2026
Merged

bherbruck merged 4 commits into
tangency-labs:mainfrom
erlis:fix/loop-bisector-live-brep

Conversation

@erlis

@erlis erlis commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Site 2 of the split agreed on #681, coordinated with @brett19 on #717. It takes off the loop-bisector known mismatches that #717 and #718 parked.

What. SmFace::ClassifyLoops' loop bisector (sms_FindAndClassifyLoopBisector) ran IsSeam on a private b.clone() and each CurveOnClassify on a fresh snapshot. Upstream runs both on the face's own B-rep: IntersectTSBound → ComputeUVPoint (bOKToMakeUVTrimCurve=TRUE) makes the missing UV trims, and SetUVTrimCurve resets the vertex/face gaps. In the port those edits were lost. Now:

  • The bisector's IsSeam and classifications share one CurveOnClassifyCache snapshot, threaded through classify_loops and SetProps_Stage3 as crate-private _cached variants (CurveOnClassifyCache::snapshot gives IsSeam the same snapshot). The public classify_loops, set_props_stage3 and find_and_classify_loop_bisector(_into) keep a private cache, so they behave as before.
  • The healer's in-place SetProps (set_props_with_query_gaps) runs the seam classifications and ClassifyLoops on that one snapshot. It copies the snapshot's UV trims, tolerance growth and gap caches back with apply_uv_trim_updates, as IsInnerShell does since fd54ae4. set_props_with_seam takes the cache instead of a seam closure, so both stages share it.
  • HealData::cache_face_props_stage3 takes &mut Brep and uses that in-place SetProps; its callers already hold the B-rep mutably.

Known mismatches. Of the 49 entries listed for this cause:

  • 37 removed: heal.heal_data_p1 28 and topology.brep_p1 9 now match C++ bit for bit, including port: topology.face_p4 (stacked on #693, merged with main) #718's file_plane_circ, file_plane_circ_rebuild_reverse and plane_circ_heal.
  • 12 kept (topology.brep_p10), with an updated reason and a new plan/findings.md entry. They take the in-place path: instrumented, gen0165 and read_Fillet_bottle reach set_props_with_query_gaps Stage3 → classify_loops_cached. Their first differences are unchanged except gen0040's. Reading the bisector's UV guess on the snapshot changed none of them, so their cause is something else and I haven't traced it. This includes the three with port: topology.face_p4 (stacked on #693, merged with main) #718's HasSeamProblem caveat.

Difftest (full sweep, main 92454ca vs this branch): 0 failed on both sides. 37 cases go known mismatch → pass, with no other transitions.

28 heal.heal_data_p1 | known_mismatch -> pass | e.g. box_stage2_stage3_done_op_19
9  topology.brep_p1  | known_mismatch -> pass | e.g. Mouse_heal
base:   PARTIAL heal.heal_data_p1 cases=495 passed=456 failed=0 deferred=11 max_rel_err=1e0 known_mismatch=28
branch: PARTIAL heal.heal_data_p1 cases=495 passed=484 failed=0 deferred=11 max_rel_err=0e0
base:   PARTIAL topology.brep_p1 cases=2627 passed=2587 failed=0 deferred=15 max_rel_err=1e0 rejected=16 known_mismatch=9
branch: PARTIAL topology.brep_p1 cases=2627 passed=2596 failed=0 deferred=15 max_rel_err=0e0 rejected=16
base:   PARTIAL topology.brep_p10 cases=1404 passed=1380 failed=0 deferred=4 rejected=7 known_mismatch=13
branch: PARTIAL topology.brep_p10 cases=1404 passed=1380 failed=0 deferred=4 rejected=7 known_mismatch=13

(The remaining deferrals in those units are blocked by other units.)

Checks (VM): fmt; clippy with and without difftest/cpp; cargo test -p solidcore (2126 passed); wasm; cargo test --profile difftest -p difftest --features cpp; the full sweep.

🤖 Generated with Claude Code

erlis and others added 4 commits October 24, 2026 12:00
SmFace::ClassifyLoops' loop bisector (sms_FindAndClassifyLoopBisector)
ran IsSeam on a private clone of the B-rep and each CurveOnClassify on a
fresh snapshot, so the UV trim curves upstream's IntersectTSBound ->
ComputeUVPoint makes on the face's own B-rep, and the gap caches
SetUVTrimCurve resets, were lost. The bisector's IsSeam and
classifications now share one CurveOnClassifyCache snapshot, threaded
through classify_loops and SetProps_Stage3 (crate-private _cached
variants; the public entry points keep a private one). The healer's
in-place SetProps (set_props_with_query_gaps, now also used by
CacheFaceProps_Stage3) runs the seam classifications and ClassifyLoops on
that one snapshot and copies its UV trims, tolerance growth and gap caches
back to the B-rep (apply_uv_trim_updates, as IsInnerShell does since
fd54ae4).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With ClassifyLoops' loop bisector keeping its B-rep edits, heal.heal_data_p1
(28) and topology.brep_p1 (9) match C++ bit for bit. The 12
topology.brep_p10 cases listed for the same reason still differ: they take
the in-place path, so their entries stay with an updated reason and a new
findings entry (cause not traced).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
GitHub reports a conflict in plan/findings.md, whose merge=union attribute
its own check ignores (AGENTS.md); the local merge keeps both sides' entries.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@bherbruck bherbruck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved by the automated first-pass review: CI green, mergeable, no CI/build/dependency file changes, no red-flag patterns in added code (process/network/env/unsafe outside FFI/blobs/hidden unicode), 0 known-mismatch entries added. Logic is gated by CI and the difftest merge queue.

@bherbruck
bherbruck added this pull request to the merge queue Oct 25, 2026
Merged via the queue into tangency-labs:main with commit 9353a11 Oct 25, 2026
8 checks passed
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.

2 participants