Repository navigation
fix: an offset refuses an effectively zero approximation tolerance; the nightly's C++ crash is UB-291 (#2393) - #2733
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Thanks @aapolipponen, fuzz00167 is yours. A PR of ours on the same nightly (opening shortly as |
|
Thanks @jyviko. I'll cite tangency-labs/smlib#135 in the record, and park 00167 so it fits your fixture-name seeding once |
…he nightly's C++ crash is UB-291 (tangency-labs#2393) Nightly fuzz00167 (2026-11-04) crashed the C++: an approximation tolerance of -1e-300 becomes the offset B-rep's tolerance 1e-300 through fabs, a face build fails at that tolerance, BuildOffsetOfFaceuse ignores the failure, and the extension loop calls ReplaceSurface on the half-built face, whose surface has no owner (UB-291, tangency-labs/smlib#135). The Rust side returned Ok with a body of tolerance 1e-300, which fails the kernel's own check (test 0, tolerance below effective zero). check_resolvable now refuses a nonzero approximation tolerance at or below EFF_ZERO: OffsetFailure::ToleranceUnresolved, kind InvalidInput, naming the value. An exact zero still takes upstream's automatic tolerance. The C++ result is recorded as WR-749. Two static shells of a sheet whose own tolerance is 1e-15 now refuse where the C++ builds an invalid body; they are parked under WR-749. fuzz00167 is a fixture, parked under UB-291.
3896a81 to
58c0416
Compare
bherbruck
left a comment
There was a problem hiding this comment.
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.
Units: offset.offset_executive_p2
Fixes the nightly fuzz's C++ crash, fuzz00167 (run 41821585108, 2026-11-04), part of #2393. It builds on #2737, now merged, which made such crashes rejected cases and covers the other failures from that night.
The crash: UB-291 (tangency-labs/smlib#135)
An extended offset with an approximation tolerance of −1e-300 crashes the C++ in
SmBrep::ReplaceSurface(SmBrep.cpp:26589), called fromSmOffsetExecutive::DoExtendedOffset. Each step below was confirmed in gdb:SmZoneTol3dtakesfabs, so the offset B-rep's tolerance becomes 1e-300 (SmOffsetExecutive.cpp:1115).SetTolerance's automatic fallback only catches ±0.FindInfiniteRegionfinds no region and returns 1006.MakeFaceTopologyfails, and so doesMakeFace.MakeFacestill resets the sphere's owner to null (:19158), leaving the half-built face in the B-rep.BuildOffsetOfFaceuseignores the failure (:3753, no else branch).:1683) callsReplaceSurfaceon that face, andpOld->GetFace()is null.Recorded as
plan/upstream-issues/UB-291--…. fuzz00167 is a fixture and is parked under UB-291; #2737's child-process trap makes the crash a rejected case.The Rust side was wrong too: WR-749
On the same input the Rust side returned
Okwith the right sphere, radius 2.9, but in a B-rep of tolerance 1e-300. That body fails the kernel's owncheck_brep:Fix.
check_resolvable, the guard #2737 added, now also refuses a nonzero approximation tolerance at or belowEFF_ZERO(1e-12). The refusal isOffsetFailure::ToleranceUnresolved { tolerance }, a structured failure of kindInvalidInputthat names the value. An exact zero still takes upstream's automatic tolerance. The check runs before anything is built, for the static, solid and extended offsets. The C++ result is recorded as WR-749.Results that change
Ok, tolerance 1e-300ToleranceUnresolved, parked UB-291tiny_tolerance_sheet_exact_boundary,_above_boundarySetTolerance(1e-15), belowSM_EFF_ZERO, so the result fails check 0_below_boundary#2737's test. I changed the second half of #2737's fuzz00087 test. It asserted that an approximation tolerance of −1e-300 builds a body of tolerance 1e-300, which is the result this PR replaces. It now expects
ToleranceUnresolved, and is renamedfuzz00087_is_refused_by_its_distance_then_by_its_approximation_tolerance.The two differs from that night (fuzz00030, distance −0.0; fuzz00160, distance 1e-300) are covered by #2737's distance refusal: both are rejected on this base.
Evidence
issue_2393_extended_offset_tiny_approx_tol, 2 passed:Ok;offset_negative_approximation_tolerance: 4 passed.--unit offset.offset_executive_p2: PASS, 594 cases: 584 passed, 0 failed, 6 rejected, 4 parked (UB-241, UB-291, WR-749 ×2).--fuzz 300: FUZZ-PASS, 0 crashes. The 5 differs all have an approximation or source tolerance of ±1e-300, where the C++ builds and the Rust side refuses: WR-749 inputs.check_record_ids.pyare clean.Related: #2393, #2737, tangency-labs/smlib#135.
Status: ready for review.
Summary by CodeRabbit