Repository navigation
perf(topology): share the edge arenas between a B-rep and its classification snapshot - #1037
Conversation
…ication snapshot curve_on_classify clones the whole B-rep (clone_sharing_surface_caches) for every curve it classifies and drops it afterwards; on a 269-face boolean this was about half of the cut, and the edge and edgeuse arenas were 72% of each copy. The snapshot now shares those two arenas through an Arc and copies one only when something writes to it (Arc::make_mut in DerefMut), so every writer sees exactly what the deep copy gave it. Plain Brep::clone stays deep.
bherbruck
left a comment
There was a problem hiding this comment.
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.
|
The merge queue removed this twice (failed checks, run with jobs |
…t-share-edges-on-main stack: tangency-labs#1037 (share edge arenas with the classification snapshot) merged with main, Send-safe
curve_on_classifyclones the whole B-rep (clone_sharing_surface_caches) for every curve it classifies and drops the copy afterwards. On a 269-face boolean from a battery model this clone was about half of the cut's samples, and the edge and edgeuse arenas were 72% of each copy.The classification snapshot now shares those two arenas with the source B-rep through an
Arcand copies one only when something writes to it (Arc::make_mutinDerefMut). Every writer therefore sees exactly what the deep copy gave it. PlainBrep::clonestays deep. The diff is one file,crates/solidcore/src/topology.rs.Measured on that model: eight sequential
boolean_differencecuts of a 269-face body by 14-face tools (macOS arm64, release, main 329e22c, 3 interleaved runs each):Validation, on Linux arm64 (
ci.ymlsteps reproduced locally): fmt, both clippy runs (including--features difftest/cpp), workspace tests, runner tests with C++, wasm and publish dry-run. On the previous base, the--greensweep showed only failures that occur identically on clean main on arm64, and 42 units that go throughcurve_on_classifyand the Booleans gave output identical to main.x86_64 parity is left to this PR's CI. No tolerances or cases changed.