Skip to content

Typed errors (TE-B-16, part 1 of 2): the feature executive's, fillet identification's and hidden curve removal's phrase causes become named causes, reviewed defects and a refusal (#19826) (carried from #20742) - #21311

Merged
bherbruck merged 7 commits into
tangency-labs:mainfrom
brett19:te/b16-p1-carry
Nov 24, 2026

Conversation

@brett19

@brett19 brett19 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

This carries @MannXo's #20742 (#20742) so it can land. All of part 1's work is his: his commit 2ea51d6 is kept unchanged with his authorship. We only merged current main and resolved the registration conflicts the way the heads-up on #20742 describes (main's name-sorted arms per variant, with his nine causes re-added in sorted position; the phrase pins of the three converted files removed instead of the old PINNED lines). Supersedes #20742 if he prefers; he is welcome to take it back.

Part of #19826.

Change

Part 1 of 2 of the typed-errors ticket TE-B-16 (#19826, part of #13790). solidcore is the B-rep kernel under SolidCraft, and this work moves its failures from sentences onto typed causes, so a caller can tell a defect of the kernel from a refusal of its input. This part converts every phrase-cause site in blend/feature_executive.rs (32), blend/identify_fillet.rs (4) and blend/hcr.rs (2). Their three phrase pins (error/pins/phrase/.../blend/{feature_executive,hcr,identify_fillet}.rs.pin) are removed. blend/fillet_removal.rs and fillet_removal/ring.rs (23 + 5) follow in part 2, since their ner helper alone has about 100 calls to split per site.

No numeric status changes. Every site keeps the status it reported, through with_status where the cause's default differs.

Changes a default: no

Test change: three tests asserted the old phrases (no_feature_built_is_a_typed_consistency_failure, identify_fillet's a_missing_object_is_a_typed_failure, and the open-base case in or_at_fills_empty_slots_and_never_changes_an_outcome). They now assert the typed cause, its class and the same status. The identify_fillet test exercises the new iso_boundaries helper, since the ner helper it called is gone.

New causes (error/blend.rs)

Cause Class Status Sites
NoFeatureMade InvalidInput SM_ERR_ASSERT_FAILURE feature_executive "Feature not built" (2)
LoopDoesNotSplitBody { edge } InvalidInput SM_ERR_ASSERT_FAILURE collect_faces (2)
LoopEdgesBranch { vertex } InvalidInput SM_ERR fix_edge_chain_list's figure 8 (3 calls of the old sm_err)
BodyEdgeWithoutCurve { edge } InvalidInput SM_ERR_NULL_POINTER collect_feature_loop_edges, edge_curves
EdgeWithoutVertices { edge } InvalidInput SM_ERR_NULL_POINTER fix_edge_chain_list, edge_vertices
FaceWithoutSurface { face } InvalidInput SM_ERR_NULL_POINTER ext_surface_rebuild, hcr brep_surfaces
IsoDirectionNotUOrV InvalidInput SM_ERR_NULL_POINTER identify_fillet's three iso-boundary reads
SurfaceWithoutBSplineForm { face, kind } Unsupported SM_ERR_NULL_POINTER hcr compute_silhouettes
KeptFeatureLeavesBaseOpen Unsupported SM_ERR the open-base refusal

The open-base refusal keeps all three things the ticket names. Status SM_ERR, the operation and the edge entity are unchanged, so is_open_base_refusal and its branch in offset/offset_faces.rs read it as before. Its class is Unsupported, the class of the DefeatureFailure limits the same check returns when the patch's construction named one. When the base patch's construction failed with an error that names no limit (for example FaceWithoutSurface from ext_surface_rebuild), the loop keeps that error (FeatureLoop::cause) and the refusal chains it as its cause, so the typed cause is no longer dropped by keep_unported in build_patches. The outer status and the rollback are unchanged.

Per-site outcomes

feature_executive.rs

Site Outcome Evidence
sm_err (one counted site, ~40 calls), split per call rule 5
chain starts in add_feature_with_edges (3) Defect, SM_ERR each start is an index the chaining wrote into the same list
loop index get(ii)/get(li) (8) Defect, SM_ERR every index runs over feature.loops, which nothing shortens while patches are built
first loop in build_patches/join_patches (2) Defect, SM_ERR patches are joined only for more than one loop
feature B-rep (sm_err 3, blend_missing 4) Defect, SM_ERR / SM_ERR_NULL_POINTER partitioning makes it before every reader, and only putting the feature back takes it
patch slots (apply_patches 2, put_patch, take_patch) Defect, statuses kept a patch is added before its id is recorded
cached patch in build_patch (2) deleted (rule 11) use_b_patch/use_f_patch already require the patch to be there; cached is now Some exactly then
"known to fail" in build_patch control flow (rule 10) both callers turn every non-unported error into "not rebuilt"; build_patch now returns Ok(false)
restore_feature not restorable control flow (rule 10) both callers turn the error into another path; it now returns Ok(false)
copy_faces_carrying left faces out Defect, SM_ERR the faces are the base's own, copied through the merge
piecewise_merge result elsewhere Defect, SM_ERR a merge without its own result B-rep keeps the result in the first
figure 8 (3) LoopEdgesBranch, at the vertex where they branch the caller's loop edges
first unused edge deleted (rule 11) the list was checked non-empty just above; the check now binds the first edge
"Feature not built" (2) NoFeatureMade add_feature* returns None only for the caller's faces/edges
collect_faces (2) LoopDoesNotSplitBody { edge } one condition (rule 12): the caller's loop does not split the body at that edge
"CollectFeatureLoopEdges" Defect, SM_ERR_ASSERT_FAILURE the feature B-rep is a copy of the faces along each base loop edge, curves included
"Cannot partition Feature from Base" control flow (rule 10) a caller can clear the public defeature_ready through features_mut() (issue_3093 does), so the check stays; the feature is left unpartitioned and the caller, which passes on only unported or cancelled errors and reads is_partitioned, keeps it, as before
"wasn't partitioned" in build_patches control flow (rule 10) reached after a failed partition; the caller passes on only unported or cancelled errors and reads is_partitioned, so it returns Ok(())
"Cannot rebuild the brep before partitioning" in build_patch deleted (rule 11) repeats build_patches' check, its only caller
validate_patch (2) cause dropped each was only the cause of a DefeatureFailure limit (NotEnclosed, or the open piece's limit) and restated it; the limit's status is unchanged
planar cap PassedOn removed, error passed on (rule 6) its only caller wraps it as DefeatureFailure::LoopNotPlanar with the error as the cause; that refusal's SM_ERR is unchanged
base/feature edge's curve BodyEdgeWithoutCurve on the edge that lacks it the caller's body (rule 9)
edge_curves BodyEdgeWithoutCurve loop edges of the caller's body or their copies
on_loop_curve Defect, SM_ERR_NULL_POINTER a patch edge, cut along surfaces or copied from edges that have curves
recorded edge index Defect, SM_ERR_NULL_POINTER the index was read from the same list
"an edge the face shares with the loop" deleted (rule 11) each face is collected from a loop edge, which is now kept beside it (the same edge common.first() found)
the face's loop Defect, SM_ERR_NULL_POINTER that edge is one of the face's edges
the face's surface in ext_surface_rebuild FaceWithoutSurface the caller's body
other vertex, end vertex (2) EdgeWithoutVertices the caller's loop edges
cc_curve (2) Defect, SM_ERR_NULL_POINTER the classification was made of that geometry's curves
manifold_xor primary (2) Defect, SM_ERR_NULL_POINTER the boolean hands the primary back when it builds no new result
open base KeptFeatureLeavesBaseOpen above

identify_fillet.rs: the three iso-boundary reads go through one helper, iso_boundaries, giving IsoDirectionNotUOrV. create_iso_boundaries returns None only for a direction that is neither u nor v. At two of the three the direction is other_dir(..), always u or v, so only test_for_fillet_surface_u_or_v's caller-given which_dir can reach it. The face's surface in identify_fillet is deleted (rule 11). A face without a surface is a fillet in neither direction, so that branch never sees one, and the code falls back to upstream's unset size rather than erroring.

hcr.rs: a scene face without a surface is FaceWithoutSurface, the caller's body. The file's other surface-less reads are already InvalidInput, so the class is the same everywhere in the file (rule 12). A surface kind with no B-spline form is SurfaceWithoutBSplineForm with the kind's type string (rule 8).

Alternatives for the reviewer

  • KeptFeatureLeavesBaseOpen could instead be a DefeatureFailure variant beside the named limits. I kept it in BlendFailure so this PR edits no other area's error file.
  • The two validate_patch causes could stay as defects under the limit, but they were refusals' restatements, not kernel faults, so they are dropped rather than given a why that would not hold.

Validation

Run on aarch64 macOS, solidcore toolchain 1.99.1, nice -n 10, --jobs 4, on main at 44121e9 (then rebased onto bd7e258, which only renumbers the variant inventory; error:: and blend::feature_executive re-run there: 155 passed, test-profile clippy and fmt clean; full checks left to CI):

  • cargo test -p solidcore --lib -- error:: blend::: 941 passed, 0 failed, 1 ignored (the ticket's gate, including the phrase pins and the variant inventory, and the new a_kept_feature_refusal_keeps_its_patch_failure)
  • cargo test -p solidcore --test booleans -- defeature: 14 passed, 1 ignored (the defeature integration tests, open base and Modeling: unexpected result #3218 limits among them)
  • cargo fmt --all -- --check: clean
  • cargo clippy -p solidcore --lib -- -D warnings and the same with --profile test: clean
  • goldens (--profile goldens, with upstream/ at the pinned commit): blend.feature_executive, blend.identify_fillet and blend.hcr compared against main 44121e9 blessed on the same machine (aarch64 macOS moves 3 feature_executive cases on clean main already): 0 changed in all three (149, 510 and 481 cases). On aeb5d4c, before this rebase, blend.fillet_removal and offset.offset_executive_p1 also passed, and sweep.topology_sweep and offset.offset_executive_p2/offset_geometry_creation changed identically on clean main.

Not run locally, left to CI: the full cargo test -p solidcore, workspace clippy, check_panic_sites.py, the wasm check and the kernel rig.

Screenshots of the behavior (when observable)

None: no observable behaviour changes. Only the error's cause and message change, and every status stays.

Integration status

Rebased on main at bd7e258, over #20703 (TE-B-13), #20708 (TE-B-10), #20750 (TE-B-14), #20761 (TE-B-15), #16913 (WeldNotBuilt) and #20707 (Solver). #20703 added a unit BlendFailure::EdgeWithoutCurve for the fillet executive's smooth sequences, so this PR's edge-carrying cause is BodyEdgeWithoutCurve { edge }. Main has since dropped the numbered inventory; the nine causes sit in name order in every match. #20475 (TE-B-01) and #20443 (TE-B-05) also add BlendFailure variants, so whichever merges later will need a small rebase of error/blend.rs and the inventory test.

Carry merge

Merge of origin/main at 026e4aa on top of 2ea51d6. On the merge: cargo fmt --all --check, cargo clippy -p solidcore --all-targets -- -D warnings, and cargo test -p solidcore --lib -- error:: blend::feature_executive blend::identify_fillet blend::hcr : fmt and clippy clean, 180 tests passed, 0 failed (server2, toolchain 1.99.1). An independent review of the conflict resolution found the nine causes byte-identical to 2ea51d6 and nothing of main's side lost. Full checks are left to CI.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Blend and fillet failures now provide clearer, more specific error details, including the affected geometry where available.
    • Missing surfaces, invalid curve directions, branching edge chains, and other malformed geometry are reported more consistently.
    • Failed feature restoration and patch construction are handled more safely, helping preserve the original failure context.

MannXo and others added 2 commits November 23, 2026 03:46
…identification's and hidden curve removal's phrase causes become named causes, reviewed defects and a refusal (tangency-labs#19826)

feature_executive.rs (32), identify_fillet.rs (4) and hcr.rs (2) build no phrase
cause any more, so their lines leave the PINNED list in error/phrase_sites.rs.
The local sm_err and assert_failure wrappers are split per site. Statuses are
kept at every site. fillet_removal.rs and ring.rs are left for part 2.

Part of tangency-labs#19826
Resolve the registration conflicts in error/blend.rs and error/phrase_sites.rs
by taking main's side and re-adding part 1's nine causes as name-sorted
arms (enum, comparison_status, class, replaces_upstream_status, Display).
Remove the phrase pins of feature_executive.rs, hcr.rs and identify_fillet.rs,
which part 1 converts fully.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The blend code adds typed failure causes and applies them across feature patch construction, restoration, topology checks, surface rebuilding, and fillet classification. Patch operations now distinguish successful results from nonfatal inability to build or restore. Callers also preserve relevant construction errors in kept-feature refusals.

Changes: Blend feature error handling

Layer / File(s) Summary
Typed blend failure contract
solidcore/crates/solidcore/src/error/blend.rs
BlendFailure adds causes for missing geometry, invalid loops and iso directions, open bases, and surfaces without B-spline forms. Status, classification, upstream-status, and display mappings are updated.
Patch construction and restoration
solidcore/crates/solidcore/src/blend/feature_executive.rs
Patch construction and restoration distinguish success from nonfatal inability to proceed. FeatureLoop stores a construction error, and kept-feature refusals can retain it.
Topology checks and surface rebuilding
solidcore/crates/solidcore/src/blend/feature_executive.rs
Feature processing reports typed errors for invalid topology and missing geometry. Surface rebuilding associates source faces with loop edges, and branching errors identify the vertex.
Surface and iso-direction error handling
solidcore/crates/solidcore/src/blend/hcr.rs, solidcore/crates/solidcore/src/blend/identify_fillet.rs
HCR and fillet identification return typed errors for missing surface data and invalid iso directions. Fillet identification continues its size heuristic when a face surface is absent.

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

Merge Risk: Minimal · previous review 6b7c7

This change converts phrase-based blend errors into typed causes while preserving the reported numeric statuses. No concrete merge-blocking issue was found; full CI remains to be run.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the main change: converting phrase-based error causes in the feature executive, fillet identification, and hidden curve removal into named typed causes. It carries the ticket reference…
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.
Description check Passed The description follows the repository template closely. It has a clear Change section explaining the kernel, the typed-error conversion, and the scope split into part 1 and part 2. It has a required …
Existing Defaults Unchanged Passed The check passes this pull request. It asks whether the change alters a UX default that users already rely on. The check also states that kernel or geometry results under solidcore/ are not changed de…
Full details: Title check

Explanation

The title names the main change: converting phrase-based error causes in the feature executive, fillet identification, and hidden curve removal into named typed causes. It carries the ticket reference and part marker. The title is long and includes process detail (carried from #20742, reviewed defects and a refusal), but it still describes the primary change. Note that the PR objectives and description say the change covers feature_executive, identify_fillet and hcr; the title's 'hidden curve removal' does not match the diff, since fillet_removal is deferred to part 2 and not converted here.

Full details: Description check

Explanation

The description follows the repository template closely. It has a clear Change section explaining the kernel, the typed-error conversion, and the scope split into part 1 and part 2. It has a required 'Changes a default: no' line. It records the test change reason for the three modified tests. It includes a detailed Validation section with commands, toolchain, and results. The screenshot section explains that there is no observable behaviour change. The Integration status section records the upstream base commit, rebase, conflicts, and carry merge. The description also clearly credits the original author and links the issue and the superseded PR. The template's title guidance is not part of this check, and the description is not vague.

Full details: Existing Defaults Unchanged

Explanation

The check passes this pull request. It asks whether the change alters a UX default that users already rely on. The check also states that kernel or geometry results under solidcore/ are not changed defaults. Evidence from the raw summary and PR description: - Every changed file is under solidcore/crates/solidcore/src/, including the blend, error, and pin files. The summary lists no UI, CLI, settings, preference, shortcut, or layout files. - The changes convert phrase-based errors into typed BlendFailure causes. They also add FeatureLoop::cause and return Ok(false) from some restore and patch paths. The description states that no numeric status changes and that the open-base refusal keeps its SM_ERR status, operation, and edge entity. - The description says the change has no observable behaviour change, and it gives Changes a default: no. Nothing in the evidence shows a UX default changed, so the fail-on-mismatch clause does not apply. - Changed refusal or error text is an error-message change inside the kernel. It is not a UX default under this check's definition. Limitation: I did not run a tool call against the PR diff itself. The verdict rests on the enumerated changed files in the summary and the description. The solidcore exemption in the check covers the observed changes either way.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 026e4aa and 6b7c726.

Files selected for processing: 7

  • solidcore/crates/solidcore/src/blend/feature_executive.rs
  • solidcore/crates/solidcore/src/blend/hcr.rs
  • solidcore/crates/solidcore/src/blend/identify_fillet.rs
  • solidcore/crates/solidcore/src/error/blend.rs
  • solidcore/crates/solidcore/src/error/pins/phrase/solidcore/src/blend/feature_executive.rs.pin
  • solidcore/crates/solidcore/src/error/pins/phrase/solidcore/src/blend/hcr.rs.pin
  • solidcore/crates/solidcore/src/error/pins/phrase/solidcore/src/blend/identify_fillet.rs.pin
Files with no reviewable changes: 3

  • solidcore/crates/solidcore/src/error/pins/phrase/solidcore/src/blend/feature_executive.rs.pin
  • solidcore/crates/solidcore/src/error/pins/phrase/solidcore/src/blend/hcr.rs.pin
  • solidcore/crates/solidcore/src/error/pins/phrase/solidcore/src/blend/identify_fillet.rs.pin

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

@github-actions

Copy link
Copy Markdown
Contributor

#19826 is already claimed by @MannXo. If this PR duplicates their work, please close it or offer to help there.

@github-actions github-actions Bot added the area:kernel B-rep kernel, booleans, blends, STEP/IGES label Nov 23, 2026
@brett19 brett19 added the approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) label Nov 23, 2026
@brett19
brett19 marked this pull request as ready for review November 23, 2026 19:26
@brett19
brett19 requested a review from a team as a code owner November 23, 2026 19:26
@brett19
brett19 requested review from jyviko and removed request for a team November 23, 2026 19:26
Conflict in error/blend.rs: main added BlendingRailEndOffFace and
BlendingRailOffFace where this branch added BodyEdgeWithoutCurve; all
three are kept, in the lists' alphabetical order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…trol flow

TE-B-16 part 1 deleted "Cannot partition Feature from Base" as unreachable,
but `defeature_ready` is a public field a caller can clear through
`features_mut()` (issue_3093's a_feature_that_cannot_be_partitioned test
does). Without the check the feature was partitioned anyway and the call
succeeded. The check now returns Ok(()) and leaves the feature
unpartitioned: the only caller passes on only unported or cancelled errors
and reads `is_partitioned`, so the feature is kept and the call is refused
as on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brett19

brett19 commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed f4f76d5 for the red SolidCore tests (2/6): issue_3093_extrusion_defeature::a_feature_that_cannot_be_partitioned_refuses_the_call_and_leaves_the_base returned Ok([KeptFeature { feature: 2, .. }]). The part-1 change deleted partition_feature's defeature_ready check as unreachable, but a caller can clear that public field through features_mut() (the test does), so the feature was partitioned anyway. The check is back as control flow (Ok(()), feature left unpartitioned, kept and refused as on main), and the PR body's table row is updated. The issue_3093 tests and the feature_executive unit tests pass locally, and fmt and clippy are clean.

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

# Conflicts:
#	solidcore/crates/solidcore/src/error/blend.rs
@bherbruck bherbruck added the status:decision Waiting on a maintainer group decision; don't merge or close label Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bherbruck bherbruck added owner-approved Owner reviewed a sensitive-path change (kernel, CI, build scripts, deps); only the owner adds this ready to merge reviewed, every ask addressed; merge once CI is green approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) and removed status:decision Waiting on a maintainer group decision; don't merge or close approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) labels Nov 24, 2026
@bherbruck
bherbruck enabled auto-merge November 24, 2026 02:29
@bherbruck bherbruck added approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) and removed approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) labels Nov 24, 2026
@bherbruck
bherbruck added this pull request to the merge queue Nov 24, 2026
Merged via the queue into tangency-labs:main with commit 6a13ac6 Nov 24, 2026
191 of 206 checks passed
brett19 added a commit to brett19/solidcraft that referenced this pull request Nov 24, 2026
Part 1 landed as a squash, so this PR's diff is now part 2 only. The one
conflict, the kept feature's limit refusal in feature_executive.rs, keeps
part 2's version: it builds on part 1's plain refusal and adds the cause the
limit's construction failed with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brett19 added a commit to brett19/solidcraft that referenced this pull request Nov 24, 2026
… rational exact fillet causes

The one conflict, in error/blend.rs's test module, was two adjacent
insertions: this PR's rational cause tests next to main's. Both are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 owner-approved Owner reviewed a sensitive-path change (kernel, CI, build scripts, deps); only the owner adds this 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.

3 participants