Skip to content

Typed errors (TE-O-01, part 3 of 3): the B-rep editor's p2 failures become named causes or reviewed defects (#19831) - #19914

Merged
bherbruck merged 17 commits into
tangency-labs:mainfrom
MarkusReichart:te-19831-p2-v2
Nov 24, 2026
Merged

bherbruck merged 17 commits into
tangency-labs:mainfrom
MarkusReichart:te-19831-p2-v2

Conversation

@MarkusReichart

@MarkusReichart MarkusReichart commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Change

Part of #19831 (TE-O-01 of #19799), part 3 of 3: this pull request converts topology/brep/p2.rs. It builds on part 1 (#19871, merged), which added EditingDisabled, CurveNotBSpline and the per-cause test this one extends, and follows part 2 (#19913, merged).

Each of the 16 counted sites keeps its status and ends as one outcome of section 6 of solidcore/docs/failure-codes-and-reproduction.md:

  • Named causes where the check reads the caller's argument, state or body: EditingDisabled, VertexNotInRegion { at_end }, NotLamina, LaminaNeighbourBound, HitNotOnBoundary (class invalid_input); CurveNotBSpline (class unsupported); NoRadialSector, NoMatingCurve (empty searches, rule 7), HitAtRayStart { distance, tolerance }, CoincidenceUndecided (class failed).
  • Defect { why } where the check reads the B-rep's own links: the lamina edge use's face, and a vertex use that belongs to neither an edge nor a loop (a shell vertex returns before that branch).

The line topology/brep/p2.rs is gone from the_topology_phrase_cause_sites_only_shrink.

Why one PR: it is one file of the three-part split, and its causes, their test and its pin line only make sense together.

Each site's outcome (lines on main at 11bf7c1)
Lines             Was                                          Outcome                                      Evidence
1825              radial sector without edge use               NoRadialSector, 1001                         an empty search (rule 7); the vertex branch skips the same None
1893              vertex use neither on an edge nor in a loop  Defect, 1001                                 a shell vertex returns earlier, so the use is an edge's or a loop's
1903              hit names no face, edge or vertex            HitNotOnBoundary, 1001                       the caller's argument (hit)
2176              nearest hit at the ray's start               HitAtRayStart { distance, tolerance }, 1001  the check's own numbers
2557, 2597, 2600  vertex has no shell in the region            VertexNotInRegion { at_end }, 1001           the caller's vertex and region
2843, 3126        editing not enabled                          EditingDisabled, 1001                        the caller's state (the cause #19871 adds)
2917              coincident interval unresolved               CoincidenceUndecided, 1001                   the classification's own answer Unsure
3034              curve not a B-spline                         CurveNotBSpline, 1006                        rule 8
3131              edge not lamina                              NotLamina, 1001                              the caller's argument
3139              lamina edge use's face                       Defect, 1006                                 a lamina edge bounds one face, whose loop holds its use
3156, 3167        neighbour neither lamina nor seam            LaminaNeighbourBound, 1001                   the caller's body
3328              no intersection curve meets both neighbours  NoMatingCurve, 1001                          an empty search (rule 7)

Changes a default: no

Test change: the edit-lock test in p2.rs asserted the old phrase; it now asserts EditingDisabled, status unchanged.

Validation

Full gate (sc_gate_v2.sh 1 te-19831-p2-v2 <worktree> <out-dir> --full) at 8a70217, stacked on part 2 at 4009e0c with main ad31644 merged in: RESULT pass. fmt, clippy -D warnings, wasm, panic sites, cargo nextest of the workspace (8237 run, 8237 passed, 0 failed, 59 skipped) and deny are green.

  • goldens: 283 unit(s), 283 passed, 0 failed; nothing re-blessed.
  • The status table matches the enum, and no cause or message is defined twice.

Not run: the test suites of crates this change does not touch, doctests, publish dry run and the kernel rig, left to CI.

Units: topology.brep_p2
In scope: every counted site of topology/brep/p2.rs and its pin line
Out of scope: the other files of #19831 (part 1 #19871, merged; part 2 #19913 for p1.rs, merged)

Screenshots of the behavior (when observable)

Nothing to show: no result changes, only the class and the message of a failure.

Integration status

Part 2 (#19913) has landed; main at e5199bc, which contains it, is merged into this branch, so the diff shows part 3 only. After that merge cargo xtask fast --no-tests and the goldens of topology.brep_p2 were run again; the full gate above is from before it. error/topology.rs keeps the causes of #19960, #18887, #19905, #19971 and #20010 and gives each new cause its row in the status table. HitAtRayStart stays its own cause beside #19905's RayHitsAtStart: it carries the ray parameter and the tolerance the check compared.

Co-written and tested with Claude Code (AI).

Summary by CodeRabbit

  • Bug Fixes
    • Topology operations now provide more specific error details for invalid inputs, disconnected or non-manifold geometry, and missing geometry data.
    • Endpoint and curve-check failures include relevant endpoint, distance, and tolerance information.
    • Unresolved side classification now identifies the reason, helping distinguish points on a curve from other projection or endpoint cases.
    • Updated topology checks preserve more specific failure statuses for affected operations.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds structured topology failure causes and updates B-rep operations, status and kind mappings, display messages, and tests to use or verify those causes.

Changes: Typed topology failure reporting

Layer / File(s) Summary
Failure causes and mappings
solidcore/crates/solidcore/src/error/topology.rs
TopologyFailure gains typed causes and SideOpen reasons. Status, error-kind, and display mappings are added, along with mapping tests.
B-rep validation and classification
solidcore/crates/solidcore/src/topology/brep/p1.rs, solidcore/crates/solidcore/src/topology/brep/p10.rs, solidcore/crates/solidcore/src/primitive/primitive_creation/p2/planar_path.rs
B-rep p1 paths use typed failures for topology validation, trim distances, curve-side classification, and surface queries. Related tests check typed outcomes.
B-rep blend construction
solidcore/crates/solidcore/src/topology/brep/p1.rs
Corner and edge-edge blend paths use typed failures. Corner-blend edge-use ordering changes, and a test checks failures for edge uses without edges.
B-rep boundary queries and edge creation
solidcore/crates/solidcore/src/topology/brep/p2.rs
Boundary queries use typed failures for radial sectors, boundary hits, and ray-start hits. Edge creation identifies the missing endpoint.
Curve merging and lamina mating
solidcore/crates/solidcore/src/topology/brep/p2.rs
Curve merging and lamina-mating paths use typed failures for disabled editing, unresolved coincidence, invalid curves, lamina neighbors, and missing mating curves.

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

Merge Risk: Minimal · up to 8a702

This change converts topology failure sites to typed causes while keeping their status codes. No concrete regression was found, and the reported gate results are clean, so the merge risk is minimal.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the typed-error conversion of the B-rep editor's p2 failures, which matches the main change in topology/brep/p2.rs and the TopologyFailure variants added in error/topology.rs. It is sp…
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: it has a clear Change section explaining the conversion of topology/brep/p2.rs, a per-site outcome table, the required 'Changes a default: no' line, an…
Existing Defaults Unchanged Passed The check fails only if the PR changes a UX default: a default setting or preference, command or tool behavior in normal use, UI layout or behavior, or shortcuts. Kernel or geometry results under soli…
Full details: Title check

Explanation

The title names the typed-error conversion of the B-rep editor's p2 failures, which matches the main change in topology/brep/p2.rs and the TopologyFailure variants added in error/topology.rs. It is specific, but it uses internal identifiers (TE-O-01, part 3 of 3, #19831) that a teammate scanning history may not recognise, and it is long at 116 characters.

Full details: Description check

Explanation

The description follows the repository template: it has a clear Change section explaining the conversion of topology/brep/p2.rs, a per-site outcome table, the required 'Changes a default: no' line, and the required 'Test change:' reason for the edited edit-lock test. Validation lists the gate command, the commit, and the test and golden counts, and states what was not run. The screenshot section explains why no visual evidence applies, which the template allows for changes with no observable behaviour. The Integration status section records the upstream commit, the merge of main, and the post-merge checks. The change is a kernel change with no user-visible result change, so the screenshot omission is acceptable. The description is specific and not generic, and it leans on internal identifiers that a newcomer may not know, but it still explains the change in plain terms.

Full details: Existing Defaults Unchanged

Explanation

The check fails only if the PR changes a UX default: a default setting or preference, command or tool behavior in normal use, UI layout or behavior, or shortcuts. Kernel or geometry results under solidcore/ do not count as changed defaults and pass. Evidence: - The supplied raw summary lists only solidcore/ files: error/topology.rs, primitive/primitive_creation/p2/planar_path.rs, topology/brep/p1.rs, topology/brep/p10.rs, and topology/brep/p2.rs. - The changes add named TopologyFailure causes and the SideOpen enum. They also change failure status and class mappings and some failure messages. The PR description says: "Nothing to show: no result changes, only the class and the message of a failure." It also says "Changes a default: no", and the description is consistent with the summary. - No settings, preferences, CLI or tool defaults, UI layout, or shortcuts appear in the supplied change list. - A local git diff against main was not usable. The checkout HEAD is a merge commit with many unrelated changes, so it does not represent this PR's patch. I did not rely on it. The verdict rests on the supplied file list and the PR description. Failure-class and message changes inside solidcore/ are not UX defaults under this check's definition.

Resolution

None.

Finishing Touches

Generate unit tests (beta)

  • 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 72ad500 and 8a70217.

Files selected for processing: 5

  • solidcore/crates/solidcore/src/error/topology.rs
  • solidcore/crates/solidcore/src/primitive/primitive_creation/p2/planar_path.rs
  • solidcore/crates/solidcore/src/topology/brep/p1.rs
  • solidcore/crates/solidcore/src/topology/brep/p10.rs
  • solidcore/crates/solidcore/src/topology/brep/p2.rs

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

@github-actions

Copy link
Copy Markdown
Contributor

#19831 is already claimed by someone else. If this PR duplicates their work, please close it or offer to help there.

MarkusReichart and others added 2 commits November 22, 2026 23:28
…ome named causes or reviewed defects (tangency-labs#19831)

Stacked on part 1 (tangency-labs#19871). Every counted site of topology/brep/p1.rs keeps
its status and becomes a named cause, a Defect with its reason, or is deleted
where it cannot be reached; p1.rs leaves the topology phrase pin list.

Co-Authored-By: Claude Code <noreply@anthropic.com>
…ome named causes or reviewed defects (tangency-labs#19831)

Stacked on part 1 (tangency-labs#19871). Every counted site of topology/brep/p2.rs keeps
its status and becomes a named cause, a Defect with its reason, or is deleted
where it cannot be reached; p2.rs leaves the topology phrase pin list.

Co-Authored-By: Claude Code <noreply@anthropic.com>
MarkusReichart and others added 12 commits November 23, 2026 01:47
Conflict in error/topology.rs: both sides added causes to the same
kind() arms; kept both. NoTrimmedBSpline came in from tangency-labs#19962 word for
word (same status, class and text); this branch's copy is dropped and
p1 uses the one on main.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
create_edge_edge_blend filed an edge use without edge as a defect. The edge
uses are the caller's and B-rep links are not checked on the way in, as for
the same condition in the corner blend, so it is a named invalid-input cause,
TopologyFailure::EdgeuseWithoutEdge, keeping SM_ERR_INVALID_INPUT.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
@MarkusReichart MarkusReichart changed the title [WIP] Typed errors (TE-O-01, part 3 of 3): the B-rep editor's p2 failures become named causes or reviewed defects (#19831) Typed errors (TE-O-01, part 3 of 3): the B-rep editor's p2 failures become named causes or reviewed defects (#19831) Nov 24, 2026
@MarkusReichart
MarkusReichart marked this pull request as ready for review November 24, 2026 00:35
@MarkusReichart
MarkusReichart requested a review from a team as a code owner November 24, 2026 00:35
@MarkusReichart
MarkusReichart removed the request for review from a team November 24, 2026 00:35
MarkusReichart and others added 2 commits November 24, 2026 02:46
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
@bherbruck

Copy link
Copy Markdown
Collaborator

This part looks good on my side. It's stacked on part 2 (#19913), which I've just readied, so it lands right after that one: once #19913 merges, merge main here (the diff then shrinks to p2.rs and error/topology.rs) and push, and it goes in once green. I'll ping you when #19913 lands.

@bherbruck

bherbruck commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

#19913 has landed. Merge main here and push, and it goes in once green.

Update, to make the merge quicker: this is where it conflicts with current main:

git fetch https://github.com/tangency-labs/solidcraft.git main
git merge FETCH_HEAD
# resolve the files above, then
git add -A && git commit --no-edit && git push

Co-Authored-By: Claude Code <noreply@anthropic.com>
@bherbruck bherbruck added 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) labels Nov 24, 2026
@bherbruck
bherbruck enabled auto-merge November 24, 2026 05:49
@bherbruck
bherbruck added this pull request to the merge queue Nov 24, 2026
@bherbruck
bherbruck removed this pull request from the merge queue due to a manual request 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 4cf7c09 Nov 24, 2026
144 of 148 checks passed
@MarkusReichart
MarkusReichart deleted the te-19831-p2-v2 branch November 24, 2026 06:48
MarkusReichart added a commit to MarkusReichart/solidcraft that referenced this pull request Nov 24, 2026
main's tangency-labs#19914 converted brep/p2.rs, so the topology phrase-cause pin list is
empty; topology_failed and topology_missing lost their last callers and go,
as geom_failed did.

Co-Authored-By: Claude Code <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 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