Repository navigation
Typed errors (TE-B-11, part 3 of 3): the standard fillet solver's p2 phrase failures become named causes or reviewed defects (#19820) - #21265
Conversation
…ency-labs#19820) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Converts the 28 counted phrase-cause sites in fillet_standard_solver/p2.rs to named causes or reviewed defects, and deletes the file's phrase pin. Unreachable repeats of a just-passed check are folded into slice patterns. New variants: FilletSetUp::ReferenceCurve and SolverOriginalCurve (InvalidInput, SM_ERR_NULL_POINTER), SolverFailure::IntersectionPointBeforeCurve and TraceFailure::JointWeightNotPositive. Every site keeps its status and fails on the same condition as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BaseDerivativeZero's doc and text now cover the standard solvers' offset surfaces as well as the custom solver's base surfaces, since p1.rs and p2.rs raise it for both. IntersectionPointBeforeCurve's doc says why it is a refusal. Two tests reach converted sites directly: scale_to_joint with a zero joint weight names JointWeightNotPositive, and a reversed rational law reverses its control points and weights, which locks in the rewritten law_in_parameter loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
333b3fe
Change
Part of #19820 (TE-B-11 of the typed-errors index #19799, programme #13790), part 3 of 3. Parts 1 (#20746) and 2 (#20807) are merged.
This part converts the 28 counted phrase-cause sites in
solidcore/crates/solidcore/src/blend/fillet_standard_solver/p2.rs. Each was read and handled under section 6 ofsolidcore/docs/failure-codes-and-reproduction.md, and the file's pinsrc/error/pins/phrase/solidcore/src/blend/fillet_standard_solver/p2.rs.pin(28) is deleted. A site becomes one of:BlendFailure::Solver(SolverFailure):JacobianNotLoaded,NoSingleCurveFoot,OffsetNormalVanishes,OffsetNormalsParallel,FilletGeomWithoutRailandRailEdgeUseCount. One new variant is added:IntersectionPointBeforeCurve { parameter }.BlendFailure::Trace(TraceFailure):BaseDerivativeZeroandNoSingleSurfaceFoot, as in part 2. One new variant is added:JointWeightNotPositive { joined, piece }.BlendFailure::FilletSetUpInvalid(FilletSetUp): the existingSolverExecutive, plus two new variants,ReferenceCurveandSolverOriginalCurve. All three are InvalidInput, statusSM_ERR_NULL_POINTER.BlendFailure::Defectwith awhy, orEvery site keeps its status. No result changes: every converted site returns an error on exactly the same condition as before.
Before any variant was added, it was checked against main and the open blend TE PRs (#20759, #20443, #21264, #20475, #20500, #21263, #21266, #20742); none adds one with the same meaning. New variants are in sorted position in every enum and match.
The ticket's three
error::ignoredcontrol-flow sites (p2.rs1538, 1588, 1672) are left alone, as the ticket asks.Per-site outcomes
Lines are main's (a5b69d1).
as_sm_err)SolverFailure::JacobianNotLoaded,.caused_by(e)load_jacobian's error. It now passes the cause through, asfillet_solver/p1.rs'sas_sm_errdoes. The pass-through arms are unchanged.NoSingleCurveFoot { count }let [sol] = ..; the second check was unreachable (rule 11).FIRST_PARTIALS, part 2's constant, nowpub(super))Surface::evaluate(uv, 1, 1)returns the first partials (same reading as part 2's 1640/1645)NoSingleSurfaceFoot { count }let [s] = ..if sols.len() == 1if let [s] = ..OffsetNormalVanishes { side: rail, u, v }blend_missing: the reference curveFilletSetUpInvalid(FilletSetUp::ReferenceCurve)(new)re_calc_fillet_geomis pub, andref_curve: Option<&Curve>is the caller's argument (rule 2/9)blend_missing: the fillet geometry's railSolverFailure::FilletGeomWithoutRail { fillet_geom, side }pseudo: &mut FilletBrepis the caller'sSolverFailure::RailEdgeUseCount { fillet_geom, side, count }RailEdgeUseCount's other sitesNoSingleCurveFoot { count }let [solution] = ..; the second check was unreachableblend_missing: the solver's original curveFilletSetUpInvalid(FilletSetUp::SolverOriginalCurve)(new)CurveBasedFs::originalis a pub field, with the pub setterset_original_curve(Option<Curve>)SolverFailure::IntersectionPointBeforeCurve { parameter }(new)TraceFailure::BaseDerivativeZeroif sols.len() == 2; nowif let [sol0, sol1] = .., with the same reads in the same orderNoSingleCurveFoot { count }let [sol] = ..if sols.len() == 1if let [s] = ..TraceFailure::JointWeightNotPositive { joined, piece }(new)ZoneWeightNotPositiveand the corner'sFaceWeightNotPositive(both Unsupported); it carries both weightsPIECE_IS_PROCEDURAL_BLEND)PIECES_JOINED)KNOT_MULTIPLICITIES)kkwasiorlc - 1 - ifori < lc = control_points.len(), so the lookup always succeeded. The loop now walks the enumerated control points, reversed wheredbis not positive: the same order and the same weights.blend_missing: the executive's pseudo-B-repFilletSetUpInvalid(FilletSetUp::SolverExecutive)calc_fillet_geomis the pub entry point for a solver outside an executive (its doc says so); the existing variant names exactly thisSolverFailure::OffsetNormalsParallelfillet_solver/p4.rs). Its doc and text are widened from "at the tangent intersection point" to "where the curve is to start", which covers both sites.Count: 28 counted sites. 20 are converted and 8 are deleted as unreachable: 631, 718, 1807 and 2165 are folded into their
let [..]patterns, and 753, 2128, 2248 and 3045 are removed. None is left.Defect table
Every
Defectadded in p2.rs. For each one, the pub entry points were traced to check whether a caller can build the state that reaches it.FIRST_PARTIALS)Surface::evaluate(uv, 1, 1)returns the first partials; a shorter matrix would be an evaluator fault. This is part 2's reading for the same lines in p1.rs.ConstantRadiusFs'sload_initial_values(throughconstant_radius_load_initial_values)PIECE_IS_PROCEDURAL_BLEND)definedcomes only from the privatepiece_definitions. That function pushes only theSomeresults ofdefinition_surface, which returnsGnSectionFsg::build_given_ball'sSome, alwaysSurface::from(ProceduralBlend::create(..))(fillet_section/section.rs1957).CircularCrossSectionFsg::piecewise_surface,definition_surfacePIECES_JOINED)endsis[rail1 start, corners.., rail1 end], so it has at least two entries and at least one window. Each window either returns an error or setsjoined.piecewise_surface(caller's curves and corners)KNOT_MULTIPLICITIES)law_curve.canonical()takes its knots and multiplicities from oneBSplineCurve::knots(None)call, which returns them as pairs.law_in_parameter(caller'sLawBall)Testing
Run on the main box:
cargo fmt --check;-D warnings) and SolidCraft clippy;check_panic_sites.py;error::andblend::fillet_standard_solverlib tests;goldens --test fuzz_corpus.Results on head feb38dd: fmt, core clippy, SolidCraft clippy, panic sites and both wasm checks all pass.
error::, including the pins, andblend::fillet_standard_solver): 184 passed.fuzz_corpus: 1 passed.No fuzz-corpus or goldens file quotes a removed phrase, the old
OffsetNormalsParalleltext or the oldBaseDerivativeZerotext, so no rows were re-recorded.Review: one independent adversarial review. It found no blocking issues and three it asked to fix, all fixed in feb38dd:
BaseDerivativeZero's doc and text are widened so they cover the standard solvers' offset surfaces as well (p1.rs 915/1257 and p2.rs 1993 raise it);IntersectionPointBeforeCurve's doc now says why it is a refusal;scale_to_jointwith a zero joint weight, and a reversed rational law throughlaw_in_parameter, which locks in the rewritten loop.Test change: three assertions in
p2::testsnamed the old phrase errors and now name the typed causes for the same conditions:SolverFailure::OffsetNormalsParallel, stillSM_ERR;FilletSetUp::SolverExecutive, stillSM_ERR_NULL_POINTER;FilletSetUp::ReferenceCurve, stillSM_ERR_NULL_POINTER.Each keeps its inputs and still asserts an error. Four tests are added:
a_failed_jacobian_load_keeps_its_cause: the wrapper's chained cause;p2_causes_keep_their_status_and_class: every cause used here, with its class and status, and the defectwhys;a_joint_weight_that_is_not_positive_is_named;a_reversed_rational_law_reverses_its_points_and_weights.Changes a default: no
🤖 Generated with Claude Code
Summary by CodeRabbit