Bound common simple evaluation before nested dispatch

Cover curve-bounded wrappers with the same owned-geometry depth preflight as other common evaluators.

Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
Karl Von Richter
2026-10-16 20:00:38 +10:00
parent 42fbed58a8
commit f804bc5f38
3 changed files with 25 additions and 0 deletions
@@ -1131,6 +1131,7 @@ impl Surface {
highest_v_deriv: usize,
flags: EvaluateFlags,
) -> Result<Vec<Vec<Vec3>>> {
self.check_evaluation_copy_depth(0)?;
match self.kind() {
SurfaceKind::BSpline(s) => s.evaluate_simple(
uv,
@@ -4979,6 +4979,25 @@ mod kernel_dispatch_tests {
EvaluateFlags::default()
)
.is_err());
let mut bounded = surface.clone();
for _ in 0..70 {
bounded = Surface::from(CurveBoundedSurface::new(
bounded,
Vec::new(),
Vec::new(),
true,
));
}
assert!(matches!(
bounded.evaluate_simple(
&kernel,
Point2::new(0.5, 0.5),
0,
0,
EvaluateFlags::default(),
),
Err(SolidError::InvalidInput { .. })
));
for _ in 0..70 {
surface = Surface::from(StepSurface::new(surface, true));
}
+5
View File
@@ -5446,3 +5446,8 @@ Apple build after their removal. The final GNU rerun is recorded below when
complete. No #71/#100 numerical implementation is imported. Common intersection
adapter errors now identify the remaining Surface integration rather than the
already-partial cone numerical unit.
The review also found `Surface::evaluate_simple` recursively delegates through
curve-bounded bases without the preflight used by the other common evaluators.
It now checks the same 64-level owned-geometry limit before dispatch; a 70-level
curve-bounded regression verifies normal `InvalidInput` rather than recursion.