Skip to content

port: surface.trim_srf_cache - #1016

Merged
bherbruck merged 6 commits into
tangency-labs:mainfrom
fdalmaso:wire/trim-srf-cache-polyedges
Oct 25, 2026
Merged

bherbruck merged 6 commits into
tangency-labs:mainfrom
fdalmaso:wire/trim-srf-cache-polyedges

Conversation

@fdalmaso

@fdalmaso fdalmaso commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

When an edge-use implantation subdivided a boundary leaf containing polygon edges, Rust created the children and then returned Unported(SmFace::GetSurface). This completes that branch of SmTrimSrfCache::SubdivideNode: each polygon is reimplanted in child 1 and child 2 using its original surface, endpoints and tolerance.

The parent polygon list stays intact, iteration starts at its head, and each child's prepend order matches C++. Mixed edge-use lists retain native behavior. The cache keeps an owned evaluation snapshot of each implanted polygon's original surface, alongside its endpoints and tolerance, and carries that data through map_handles. Callers reimplant after editing an edge or its original surface, following the existing edge-use snapshot pattern.

Coverage adds 128 separate fixed-seed cases and 4 fixtures: repeated U/V subdivision, crossing and degenerate segments, mixed lists, different original/cache surfaces, handle remapping, tolerance cutoffs, and native zero/negative tolerance construction. All 630 existing cases remain passing with their value coverage preserved. The reference is still upstream c9c5979; no newer C++ version is required.

Validation after merging main 53872b3d0:

  • cargo fmt --all --check and cargo clippy --workspace --all-targets -- -D warnings: pass.
  • Native runner lint check, cargo clippy --profile difftest -p difftest --lib --features cpp -- -D warnings: pass.
  • cargo test -p solidcore: 2,229 passed, 0 failed, 1 existing ignored test.
  • cargo check -p solidcore --target wasm32-unknown-unknown: pass.
  • cargo test --profile difftest -p solidcore-ffi --features cpp surface_trim_srf_cache: 5 passed, including truncation, bad node indices, nonfinite data and zero/negative tolerance validation.
  • Full native --green --jobs 4: 261 units, 251 pass, 10 partial, 0 failures. CI applies the exact-base artifact ratchet.
PASS surface.trim_srf_cache cases=762 passed=762 failed=0 deferred=0 max_rel_err=0e0 with_values=762 no_values=0 vacuous=0
difftest: 261 unit(s), 251 passed, 10 partial, 0 failed

No tolerance or absolute floor changed; no known mismatch or coverage waiver added. Reports remain untracked.

fdalmaso and others added 6 commits October 25, 2026 22:08
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Retain polygon-edge endpoints, tolerance and original surface for child implantation. Preserve native parent lists and child ordering, including handle remapping. Add 130 differential cases and regression coverage for geometry updates.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
SmZoneTol3d accepts zero and normalizes negatives with fabs. Keep those inputs in native coverage and test rejection of nonfinite tolerances and invalid node indices.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
@fdalmaso
fdalmaso marked this pull request as ready for review October 25, 2026 21:58

@bherbruck bherbruck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by the automated first-pass review: CI green, mergeable, no CI/build/dependency file changes, no red-flag patterns in added code (process/network/env/unsafe outside FFI/blobs/hidden unicode), 0 known-mismatch entries added. Logic is gated by CI and the difftest merge queue.

@bherbruck
bherbruck added this pull request to the merge queue Oct 25, 2026
Merged via the queue into tangency-labs:main with commit a377a5c Oct 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants