solidcore's main at c0d3cc0124, rewritten to one commit per same-author run per PR (2,800 commits, author credit kept; tree identical). Full original history: tangency-labs/solidcore archive/full-history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> git-subtree-dir: solidcore git-subtree-mainline:44525da669git-subtree-split:c440e5f892
3.6 KiB
Vendored
surface.surface_assert_valid: curve-bounded validity and contained identities (2026-10-29)
Unit: surface.surface_assert_valid; owned override: SmCurveBoundedSurface::AssertValid (surface.curve_bounded_surface). Claim: #1621, based on main d892c36a32.
The complete override calls the inherited surface check unless LEVEL_GIVEN, validates the owned basis, then each 3D boundary and each UV boundary in their native order, with the intervening context reports. Rust's single supplied kernel makes the context tests intrinsic. The existing virtual curve validator is shared through a crate-only wrapper; derived curve checks are not replaced by the Curve base check. Boundary validation uses exact evaluation copies, so their lazy NURB mutations are not retained by the const surface call.
Contained reports need distinct identities: assigning every nested object the surface key would deduplicate separate failures. The default Surface API assigns keys by traversal ordinal after the caller's root key (wrapping). Callers accumulating independent checks must reserve those ranges or use the new assert_valid_with_keys callback. The callback also makes repeated object identities explicit; duplicate keys within one walk are rejected. No address hashing is used. Tests cover three nested failing bases and accumulated independent roots, including a root key of u64::MAX. The explicit validity depth counter is bounded by the shared MAX_GEOMETRY_NESTING (32); constructors already bound owned geometry at that depth.
The pinned native implementation has two undefined paths, recorded in plan/upstream-issues/UB-273--curve-bounded-validity-unwritten-and-missing-labels.md: non-GIVEN base checks read unwritten continuity minima, and failed boundary reports index an omitted label table. LEVEL_GIVEN and null-list cases exercise the defined override. The intended six-entry table is not installed in Rust: defined failed test 0 keeps the pinned default label. No native success is claimed for an undefined path.
The new fixture family has 128 named cases plus a separate 400-case cbd generated stream. The existing gen and ext stream generation is unchanged. Native objects are real CurveBoundedSurface wrappers, plane bases and CompositeCurve boundaries containing degree-1 B-splines; report identities, all report fields/text, the return value and last_add use the existing output format. Context-mismatch objects cannot be represented in the single-kernel Rust model. Other curve kinds remain handled by the shared virtual dispatcher; its existing unported derived overrides still propagate Unported rather than fake a result.
Validation on merged main 55748ecf3b (implementation 217d598ca3): all 277 native units pass; targeted surface validity has 2598 cases, 2210 value passes, 388 guarded refusals, no mismatches or deferrals. Affected callers pass: topology.assert_valid 867 passes / 9 refusals; surface.curve_bounded_surface 537 passes. Workspace Clippy including cpp, Rust tests, wasm and formatting pass. The 11 targeted Rust tests also pass.
Two unrelated file-based runners initially lost coverage because canonicalizing this worktree's upstream symlink removed the literal upstream/TestFiles/pt_TestFiles path required by their guards. Rerunning with physical copies of the same allowed pinned fixtures restored baseline coverage: topology.api_files 334 passes / 1 refusal; topology.api_projection 47 passes / 1 refusal. No guard was changed. The earlier d892 baseline also predates the Boolean ND-491 parks merged in #1620 and waiver removal in #1660; final comparison uses the PR's actual updated base 55748ecf3b and its validated CI artifact.