Skip to content

solidcore: retire analytic_corner_failure_is_false (a failed analytic corner surface falls back to the Coons patch) - #16514

Merged
bherbruck merged 8 commits into
tangency-labs:mainfrom
brett19:retire-analytic-corner-14246
Nov 14, 2026
Merged

bherbruck merged 8 commits into
tangency-labs:mainfrom
brett19:retire-analytic-corner-14246

Conversation

@brett19

@brett19 brett19 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Retires the UpstreamFixes flag analytic_corner_failure_is_false (WR-254). Upstream SmFilletCorner::MakeAnalyticCornerSurface returns its failing SER / NER status as an SmBoolean, and CreateCornerPatch reads that as TRUE ("an analytic surface was made") although none was added. So the corner got no Coons patch either, and CreateCornerPatch reported success with no corner face. The fixed reading becomes the only path: a failed analytic surface reads FALSE, so the caller builds the Coons patch, or reports why it can't. SolidCraft's preset already has the flag on.

Part of #14246

Was stacked on #16433 (merged; its edits to the shared flag lists overlap). This PR's own change is the commits after #16433's head bf7f83eda: fbca20f08 (code, list entries, unit tests' flag-off halves, addendum), fd39ac11c (the one expectations commit: 15 golden rows), then two test-only commits from review: 7c131aded (the corner patch after a failing analytic exit; the inner SER status pinned) and 228b589cc (the p3 rows' curveless-edge premise, reproducible).

Units: blend.fillet_corner_p2, blend.fillet_corner_p3 (goldens)
In scope: UpstreamFixes::analytic_corner_failure_is_false (field, preset line in crates/smlib/src/core.rs, fixes.json, SolidCraft preset list in issue_2260 test, flag-off branch in FilletCorner::make_analytic_corner_surface_with, unit tests' flag-off halves), one WR-254 addendum. The goldens name map has no entry for this flag (it resolves through UpstreamFixes::flag_mut), so nothing changes there.
Expected edits: solidcore/crates/solidcore/src/kernel.rs, solidcore/crates/solidcore/src/blend/fillet_corner/p2.rs, crates/smlib/src/core.rs, solidcore/crates/solidcore/tests/kernel_cases/fixes.json, solidcore/crates/solidcore/tests/issue_2260_gn_pipe_refined_range_end.rs, goldens unit docs + expected/blend.fillet_corner_p{2,3}.jsonl, solidcore/plan/upstream-issues/
Evidence: 15 golden rows move (status only); each is proven in the table below
Related PRs / dependencies: #16433 (base), #14832 (ours, adjacent hunk in p2.rs), #15956 (retire-all experiment)
Available follow-ups: #16551, the remaining `Err(_) => Ok(true)` arm of make_analytic_corner_surface_with (errors with no upstream status that are not propagated still read as TRUE with no surface); this PR keeps the flag-on behaviour exactly and does not touch it
Status / blockers / next step: internal review passed; full gate PASS at 228b589cc (27/27); #16433 merged, origin/main merged in at b8dc15a84 (one conflict: main's retired boolean2d_plane_covers_far_faces preset line dropped), `sc-gate.sh --changed` PASS there (26/26, all goldens, rig, full craft tests); ready

Changes a default: no
SolidCraft's preset already has the flag on; the result SolidCraft ships does not change.

Test change: the unit tests' flag-off halves tested the retired upstream path and are removed (analytic_corner_surface_reads_a_failing_status_as_true becomes ..._as_false, the flag-on half of the old ..._failure_is_false_with_the_fix; ..._keeps_the_false_controls and ..._keeps_invalid_input lose their flag-off loop). analytic_corner_surface_failure_flag_does_not_change_a_made_surface compared flag off to flag on; it becomes analytic_corner_surface_makes_the_chamfer_plane, which checks the plane against the closed form (signed distance from the plane through the corner's three vertices, ≤ 1e-12 × scale, at three UV points). 15 golden rows move, each proven below.

Moved golden rows (15): before, after, proof

Measured on server2 at fbca20f08 with goldens --unit blend.fillet_corner_p2 --unit blend.fillet_corner_p3 --goldens: exactly these 15 rows change, each with 1 difference (the status int); every other value of each row (model export, corner members, surfaces) is identical. The error message behind each status (the reasons quoted below) came from a scratch diagnostic that was not committed. The p3 premise (a corner edge with no 3D curve in the input model) is pinned by the committed goldens test blend_fillet_corner_p3::tests::analytic_exit_cases_have_a_curveless_corner_edge, which regenerates the 8 cases from their seeds. Reproduce: cargo test --profile goldens -p goldens --lib analytic_exit_cases_have_a_curveless_corner_edge.

blend.fillet_corner_p2 (MakeAnalyticCornerSurface's SmBoolean)

row before after why the new value is right label
corner_analytic_13 1 0 surfaces: [0] in the same row: no surface was made. The function returns whether it made an analytic surface, so FALSE. Exit: SM_ERR_NULL_POINTER, interpolating edge without its original face PROVEN (row's own surface count)
corner_analytic_43 1 0 same; exit SM_ERR, a corner edge's curve is not a B-spline PROVEN
corner_analytic_70 1 0 same; exit SM_ERR_NULL_POINTER, no original face PROVEN
corner_analytic_84 1 0 same; SM_ERR_NULL_POINTER, no original face PROVEN
corner_analytic_85 1 0 same; SM_ERR_NULL_POINTER, no original face PROVEN
corner_analytic_87 1 0 same; SM_ERR_NULL_POINTER, no original face PROVEN
corner_analytic_90 1 0 same; SM_ERR_NULL_POINTER, no original face PROVEN

Why the old figure was wrong: it was upstream's SmStatus cast to SmBoolean (WR-254). Cross-check over the whole unit: after the change, every analytic row has status == (surfaces > 0) (50 rows 1/1, 28 rows 0/0). Before, these 7 were the only rows with status 1 and no surface.

blend.fillet_corner_p3 (CreateCornerPatch, directly or through CalcCornerGeom)

row op before after why the new value is right label
gen0060 Patch 0 1006 The input model's fillet edges 4 and 5 (corner edges) have no 3D curve (no curve in the case JSON). A Coons patch is bounded by its sides' curves, so it can't be built. CreateCornerBlend returns SM_ERR_NULL_POINTER for a null boundary curve; the port reports Missing("a boundary curve"), 1006 PROVEN (input structure; committed test)
gen0089 CalcGeom 0 1006 edges 4, 5 have no curve; same refusal, "a boundary curve" PROVEN
gen0104 CalcGeom 0 1006 edges 4, 5 have no curve or fillet geometry. With the extended-surface patch on, the patch first reads the edge's fillet geometry for its base surface: Missing("the corner edge use's fillet geometry"), 1006 PROVEN
gen0145 CalcGeom 0 1006 edges 4, 5 have no curve; "a boundary curve" PROVEN
gen0170 CalcGeom 0 1006 corner edge 0 (all three corner edges) has no 3D curve; "a boundary curve" PROVEN
gen0189 Patch 0 1006 edges 4, 5 have no curve or fillet geometry, extended surface on; "fillet geometry" PROVEN
gen0282 Patch 0 1006 edges 4, 5 have no curve; "a boundary curve" PROVEN
gen0326 Patch 0 1006 edges 4, 5 have no curve or fillet geometry, extended surface on; "fillet geometry" PROVEN

Why the old figure was wrong: with the analytic exit read as TRUE, CreateCornerPatch skipped the patch. MakeFaceBrep then returned at once on an empty surface list, and the corner reported success (0) with surfaces: [0] and no corner face: a hole reported as a built corner. The new status is a refusal whose cause is visible in the input: a missing curve or a missing fillet geometry.

After a failing analytic exit: what the Coons path does

corner_patch_after_a_failing_analytic_exit_refuses_without_a_boundary_curve (p2 tests) runs CreateCornerPatch after the exit on two corners. One is curveless. The other is a chamfer whose interpolating arc has no original face: its NER exit comes after the arc's curve was deleted for recomputation, which the test asserts. Both refuse with Missing("a boundary curve") (1006), with no surface and no face. Without this PR they returned Ok(()), so the test fails on main's flag-off path. analytic_corner_surface_reads_a_failing_status_as_false also pins the inner exit's status (SM_ERR), so it exercises the SER→FALSE arm.

A Coons face built after such an exit (surfaces = 1) was not reached. ARGUED from the code (not asserted): every upstream-status exit of MakeAnalyticCornerSurface that I found leaves a side without a 3D B-spline curve. In the first loop that is a missing curve or a curve of none of the B-spline kinds. In the chamfer recompute it is the edge whose curve was set to None before its original face, fillet geometry or intersection was read. The one exception I found is a failure in set_edgeuse_uv_curve after a new curve was set, and no fixture reaches it. The fix's observable effect is therefore a refusal in place of a reported success with a hole, which is what all 15 rows show.

Certificate checklist (§7)

  1. Sampled or bounded: no accept/refuse decision is added. The change maps an existing upstream-status exit to FALSE. The p3 refusals are the existing null checks of the Coons path.
  2. Rounding: n/a (no numeric decision).
  3. NaN: n/a.
  4. No tolerance widened, no expectation loosened: the moved rows go from success-with-no-surface to a refusal. The chamfer-plane test checks a closed form at 1e-12 × scale.
  5. Refusal names the size that fits: n/a. The refusal is a missing input (curve or fillet geometry), not a size.
  6. Bounded work: unchanged.
  7. Every moved golden explained: the tables above.
  8. Real-defect test: analytic_corner_surface_keeps_invalid_input (the port's own InvalidInput still propagates), analytic_corner_surface_makes_the_chamfer_plane (a made surface is still TRUE), and the corner-patch refusal test above (fails on main's flag-off path).

Overlap check (all open PRs, any author, drafts included)

Method: every open PR's file list (GraphQL, files over 100 checked by diff) intersected with the flag's read-site and list files (fillet_corner/p2.rs, crates/smlib/src/core.rs, fixes.json, issue_2260_gn_pipe_refined_range_end.rs, goldens solidcraft.rs; kernel.rs left out, since every flag PR touches it). The diff of each overlapping PR, and of each PR over 100 files, was grepped for the flag name and make_analytic_corner_surface_with. gh pr list --search was run for the flag name and WR-254.

PR files shared class
#16433 (ours) all list files base of this PR
#14832 (ours) fillet_corner/p2.rs (adjacent hunk in make_analytic_corner_surface_with), core.rs same function, different lines: whichever lands second rebases
#15956 (bherbruck, experiment) p2.rs, core.rs, solidcraft.rs removes every flag; if it lands first this PR is moot
#15475, #16482 (ours, drafts) core.rs / fixes.json flag name in context lines only: rebase expected
#11776, #11875, #13581, #13591, #14102, #14907, #15004, #15530, #15602, #15713, #15901, #15963, #16283, #16442, #16445 list files only no flag lines: rebase expected

🤖 Generated with Claude Code

https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU

Summary by CodeRabbit

  • Behavior Changes
    • Analytic corner-surface creation now treats specified upstream failure statuses as unsuccessful and attempts to build a Coons patch instead.
    • Some corner cases that previously reported success now return status 1006 when the required boundary curve is unavailable.
  • Bug Fixes
    • Updated expected results and tests to reflect the revised outcomes for affected corner cases.

brett19 and others added 3 commits November 14, 2026 02:31
Each flag's fixed path becomes the only path: the field, SolidCraft's
preset line, the fixes.json entry, the goldens name map entry, the
flag-off branches and the tests' flag-off halves are removed, with an
addendum per record in plan/upstream-issues.

Retired: fillet_3x2_tangent_side_edge_roles,
fillet_corner_ball_center_from_axes, fillet_corner_ball_patch,
fillet_corner_variable_radius_rail_on_opposite_fillet,
fillet_nx1_end_rib_global_merge, fillet_nx1_tangent_corner_edge,
fillet_refuse_mixed_corner_crossing_rails,
fillet_round_ends_at_tangent_continuation, fillet_run_on_past_far_end_only,
fillet_section_end_trim_at_creases, fillet_split_edge_keeps_near_half,
glue_vertices_joins_every_region, temporary_radius_setup_errors,
offset_missing_surface_fails, offset_updates_result_tolerances,
offset_walls_touch_refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Upstream-status errors from analytic corner-surface creation now return Ok(false) without an opt-in flag. The caller can then build a Coons patch. Tests, generated-case documentation, and expected statuses were updated.

Changes: Analytic corner status handling

Layer / File(s) Summary
Unconditional status handling and corner tests
solidcore/crates/solidcore/src/kernel.rs, crates/smlib/src/core.rs, solidcore/crates/solidcore/src/blend/fillet_corner/p2.rs, solidcore/crates/solidcore/tests/*, solidcore/plan/upstream-issues/*
The opt-in flag and its configuration references were removed. Upstream-status errors now map to Ok(false). Tests cover corner state, patch creation, preserved error cases, and chamfer-plane creation.
Generated corner cases and expected results
solidcore/crates/goldens/src/units/blend_fillet_corner_p*.rs, solidcore/crates/goldens/expected/blend.fillet_corner_p*.jsonl
Generated-case tests check for corner edges without model curves. The case documentation and expected statuses were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: Minimal · up to b8dc1

This change makes a failed analytic corner surface read as a failure, so the corner patch is attempted instead of being skipped. The shipped SolidCraft behavior is unchanged because the flag was already on. No remaining merge-blocking risk was identified.

Security architecture risk: Minimal · up to b8dc1

The inspected change replaces a misleading success result with the existing fallback path. Cancellation and explicit input or invariant errors still propagate, and no introduced security or failure-containment risk was established. The application preset already selected this behavior.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The inspected entrypoint already requires caller-provided mutable access to the corner and its patch environment. The edit changes error classification within those existing capabilities rather than granting additional access to geometry state.

Trust Boundaries and Controls

  • observed — Unported, Cancelled, InvalidInput, and PortInvariant errors still propagate before upstream-status classification. The change does not convert those explicit failures into permission to attempt fallback.

Resilience and Maintainability Implications

  • observed — Analytic chamfer reconstruction can delete an edge curve before failing; the PR does not add transactional restoration. The fallback checks for missing boundary curves before surface publication. Added tests assert that the curveless and deleted-curve cases return a missing-boundary error without adding corner surfaces or surface faces, rather than the former empty success.
Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the main change: retiring the analytic_corner_failure_is_false flag. The changeset removes the flag from UpstreamFixes, the preset in crates/smlib/src/core.rs, fixes.json, and the issu…
Description check Passed The description follows the repository template. It opens with a plain-words Change section that explains the upstream bug (WR-254), the resulting behavior, and the fix. It states 'Changes a default: …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Existing Defaults Unchanged Passed The check covers UX defaults only: default settings or preferences, command behaviour in normal use, UI layout or behaviour, and shortcuts. Kernel or geometry results under solidcore/ are explicitly n…
Full details: Title check

Explanation

The title names the main change: retiring the analytic_corner_failure_is_false flag. The changeset removes the flag from UpstreamFixes, the preset in crates/smlib/src/core.rs, fixes.json, and the issue_2260 test. It also changes the fillet corner logic so a failed analytic surface reads as false and falls back to the Coons patch. The title uses specific identifiers and states the behavior change. It is a single sentence and is clear for a teammate scanning history.

Full details: Description check

Explanation

The description follows the repository template. It opens with a plain-words Change section that explains the upstream bug (WR-254), the resulting behavior, and the fix. It states 'Changes a default: no' with the required rationale. It includes the required 'Test change:' line explaining why the old flag-off test halves were wrong. The Validation section gives the gate result, the reproduction command, and the 15 golden row changes with before/after values and proofs. The template asks for screenshots when behavior is observable. This PR changes kernel results in goldens and corner-patch status, which are not directly visible in the app, so the omission is reasonable. The Integration status section is covered by the Status/blockers line and the rebase note, though it is not labeled with the template heading. The description is dense, but it covers the required information.

Full details: Existing Defaults Unchanged

Explanation

The check covers UX defaults only: default settings or preferences, command behaviour in normal use, UI layout or behaviour, and shortcuts. Kernel or geometry results under solidcore/ are explicitly not changed defaults. The changed-file inventory (git diff --name-status) has 10 entries. Each one is kernel, golden, test, or plan material: - crates/smlib/src/core.rs: removes one preset line, f.analytic_corner_failure_is_false = true;, from fixes(). This is a kernel upstream-fix toggle, not a user-facing setting. The PR description says SolidCraft already had this flag on, so the shipped kernel behaviour does not change. - solidcore/crates/solidcore/src/kernel.rs: removes the UpstreamFixes field. This is an internal kernel flag struct. - solidcore/crates/solidcore/src/blend/fillet_corner/p2.rs: changes the analytic corner-surface error mapping. This is a geometry result change. - Goldens and the golden expectation JSONL: 15 status values change. These are kernel result changes, such as a case that is now refused, which the check exempts. - Test files, fixes.json, and the WR-254 addendum: no user-facing effect. No UI, shortcut, command-line, or preference files change. The description's Changes a default: no is consistent with the code: no UX default changes, so the description does not contradict the code.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 29bb749 and b8dc15a.

Files selected for processing: 10

  • crates/smlib/src/core.rs
  • solidcore/crates/goldens/expected/blend.fillet_corner_p2.jsonl
  • solidcore/crates/goldens/expected/blend.fillet_corner_p3.jsonl
  • solidcore/crates/goldens/src/units/blend_fillet_corner_p2.rs
  • solidcore/crates/goldens/src/units/blend_fillet_corner_p3.rs
  • solidcore/crates/solidcore/src/blend/fillet_corner/p2.rs
  • solidcore/crates/solidcore/src/kernel.rs
  • solidcore/crates/solidcore/tests/issue_2260_gn_pipe_refined_range_end.rs
  • solidcore/crates/solidcore/tests/kernel_cases/fixes.json
  • solidcore/plan/upstream-issues/WR-254--addendum-2026-11-14-flag-removed-analytic-corner-failure-is-false.md
Files with no reviewable changes: 4

  • crates/smlib/src/core.rs
  • solidcore/crates/solidcore/src/kernel.rs
  • solidcore/crates/solidcore/tests/issue_2260_gn_pipe_refined_range_end.rs
  • solidcore/crates/solidcore/tests/kernel_cases/fixes.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@github-actions github-actions Bot added the area:kernel B-rep kernel, booleans, blends, STEP/IGES label Nov 14, 2026
brett19 and others added 3 commits November 14, 2026 06:24
MakeAnalyticCornerSurface's SER / NER exits add no surface; upstream
returns their status as an SmBoolean that CreateCornerPatch reads as TRUE,
so the corner got neither an analytic surface nor the Coons patch. The
fixed reading (FALSE, so the caller builds the Coons patch) is now the
only path. Removed: the UpstreamFixes field, SolidCraft's preset line, the
fixes.json and SolidCraft-preset list entries, the flag-off branch and the
unit tests' flag-off halves. The made-surface test, which compared off to
on, now checks the chamfer plane against the plane through the corner's
three vertices.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU
15 rows move, status only, each proven in the PR's table:

- blend.fillet_corner_p2 corner_analytic_13/43/70/84/85/87/90:
  MakeAnalyticCornerSurface 1 -> 0. Each row has surfaces [0]: no
  surface was made, so FALSE is the answer by the function's contract.
- blend.fillet_corner_p3 gen0060/0089/0104/0145/0170/0189/0282/0326:
  CreateCornerPatch 0 -> 1006. Each corner has a fillet edge with no 3D
  curve in its input model, so no Coons patch can be bounded; before, the
  corner reported success with no surface and no face.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU
The failing-status test now also pins the inner exit's upstream status
(the SER arm), and a new test runs CreateCornerPatch after the exit on a
curveless corner and on a chamfer whose interpolating arc has no original
face: the Coons patch refuses with SM_ERR_NULL_POINTER (a missing boundary
curve) and leaves no surface or face, where upstream reported success.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU
…corner_p3 rows

A unit test regenerates gen0060/0089/0104/0145/0170/0189/0282/0326 from
their seeds and asserts each corner has an edge with no 3D curve in its
input model: the premise of their 0 -> 1006 move, now reproducible.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU
@brett19

brett19 commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

Gate at 228b589 (sc-gate.sh --changed, case 3 with craft tests, all goldens and the kernel rig): PASS, 27/27 steps. Includes craft-tests (1367 s), core-tests, core-goldens (all units), core-rig, craft and core clippy, wasm, panic sites, and the solidcraft-smlib core and core::blend tests.

Written by Claude Code (Anthropic) on behalf of @brett19.

Conflict in crates/smlib/src/core.rs: main retired
boolean2d_plane_covers_far_faces, so its preset line goes; this branch's
removal of the analytic_corner_failure_is_false line is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
@brett19
brett19 marked this pull request as ready for review November 14, 2026 19:56
@brett19
brett19 requested a review from a team as a code owner November 14, 2026 19:56
@brett19
brett19 requested review from jyviko and removed request for a team November 14, 2026 19:56
@bherbruck bherbruck added approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) ready to merge reviewed, every ask addressed; merge once CI is green labels Nov 14, 2026
@bherbruck
bherbruck enabled auto-merge November 14, 2026 20:26
@bherbruck
bherbruck added this pull request to the merge queue Nov 14, 2026
Merged via the queue into tangency-labs:main with commit d179b61 Nov 14, 2026
143 of 147 checks passed
@brett19
brett19 deleted the retire-analytic-corner-14246 branch November 24, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) area:kernel B-rep kernel, booleans, blends, STEP/IGES ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants