This file records optimization hypotheses derived from the papers in the README, including rejected ideas and the evidence required to retain a change. All three papers in the README reference list are mapped to the relevant production paths below.
The guiding safety boundary comes from EMBER’s exact plane representation and adaptive spatial subdivision, together with Mesh Arrangements’ separation of arrangement construction from winding-number extraction: approximate data may organize work, but it must never decide topology, classification, or output.
Status: kept
The certified construction-aware output path associated every split edge with
all projective vertices incident to its two defining planes. It previously
implemented that exact identity join by scanning every retained vertex once
per split edge, making candidate construction O(split edges * vertices) and
retaining an additional complete (vertex, identity) list.
Candidate construction now indexes split groups by their unordered pair of canonical construction-plane identities. Each plane-triple vertex visits its three unordered plane pairs once, producing the same order-independent, incidence-consistent candidate sets in O(split edges + vertices). Final sorting and deduplication are unchanged. This is retained exact construction identity; no approximate value selects a candidate or commits topology, and coincidence classes still reach output resolution atomically.
A two-second perf profile of the 4,512-triangle YeahRight union attributed
2.25% self time to the old full-scan Vec<usize>::extend specialization. After
indexing, that symbol was below the profile’s 0.05% reporting threshold.
Five deterministic single-execution counter runs measured:
| Version | Instructions | Branches |
|---|---|---|
| Full scan | 404,855,354 | 71,506,553 |
| Plane-pair index | 403,118,176 | 70,848,636 |
| Change | -0.43% | -0.92% |
The corresponding 10-sample Criterion interval moved from
14.920–15.315 ms to 15.021–17.104 ms with p = 0.38; wall-clock performance
was therefore neutral at that sample size rather than a claimed improvement.
The former full-scan hotspot, lower deterministic work, and lower asymptotic
memory/time cost justify retaining the change.
The competitive fixture support now also constructs closed 18,048- and 72,192-triangle YeahRight variants by refining shared indexed edges. An ignored release stress test retains both raw fixture families and all Hypermesh, boolmesh, and manifold-rust carriers concurrently, then runs and closure-checks both exact Hypermesh unions. The measured run completed in 0.47 seconds with 248,532 KiB peak RSS. Its first execution exposed that generic independently quantized barycentric refinement manufactured boundary edges at these scales; the stress generator now grows the pinned closed 4,512-triangle topology by shared-edge midpoint refinement instead.
Status: kept
The public GPU boundary formerly produced separate position and normal vectors.
Consumers with interleaved vertex layouts then allocated a third vector and
moved both streams into it, increasing peak memory and repeating traversal.
approximate_interleaved_gpu_mesh_f32 and its binary64 counterpart now validate
the exact input once and write each (position, normal) row directly into one
pre-sized output vector. Exact source rows and topology remain unchanged; only
the explicitly lossy renderer boundary is affected.
On the 48,384-vertex end_to_end corpus, 100-sample Criterion intervals were
4.749–4.761 ms interleaved versus 5.315–5.358 ms separate for f32 (10.9%
faster at the midpoint), and 0.713–0.721 ms versus 1.997–2.002 ms for f64
(64.1% faster). The interleaved path also removes two temporary attribute-vector
allocations from consumers that otherwise merge the streams. Unit tests prove
row-for-row equality with the separate APIs and preserve invalid-index errors.
Coverage is audited by executable public family. Constructors, enums, report accessors, and borrowed views are validated through the public operation that produces or consumes them; they do not receive misleading standalone timing rows. Every exact-computation family below has semantic assertions, a release timing, and a recording window that fails on an empty dispatch trace.
| Public executable family | Semantic tests | Release benchmark | Exact path trace |
|---|---|---|---|
| Input meshes and polygon soups | core, regression |
end_to_end/build_polygon_soup |
mesh_build_polygon_soup plus the dispatch-trace integration test |
| Primitives, clipping, intersections, BVHs, and local BSP | core, regression |
exercised inside end_to_end Boolean and hull workloads |
polygon_clip_intersection_bvh_bsp |
| Immediate Boolean polygon and triangle output, including certified-convex dispatch and all operations | core, regression |
end_to_end/boolean_operation and end_to_end/boolean_immediate_output |
every operation over overlapping, nested, variadic, and subdivided inputs plus immediate certified-convex output views |
| Subdivision, leaf processing, segment tracing, and winding propagation | core, regression |
exercised inside end_to_end Boolean workloads |
Boolean recordings plus segment_and_winding |
| Certified output extraction, triangulation, and closure reports | core, regression |
end_to_end/output |
Boolean recordings include output-closure certification |
| Convex hull, coplanar groups, and retained construction facts | core, regression |
all end_to_end/convex_hull cases, including both retained variants |
convex_hull/grid_4913 and convex_hull_public_variants |
cargo bench --features dispatch-trace --bench dispatch_trace records the
exact-computation paths for every Boolean operation across overlapping,
contained, variadic, and subdivided inputs, plus convex hull construction. It
also contains direct public-module workloads for mesh preparation; polygon
construction, clipping, and intersection; exact BVH queries; local BSP
splitting; axis/general segment tracing; and winding propagation and output
classification. Every recording window fails if it emits neither dispatch nor
rational-reducer evidence.
These trace workloads complement the Criterion timings in end_to_end and the
unit/integration tests: the Criterion suite measures retained end-to-end costs,
the dispatch benchmark identifies the selected exact paths, and the tests lock
their semantic results and failure behavior.
Status: kept
References considered:
Hypothesis: BoundsBvh repeatedly converted exact coordinates to f64 inside
median-partition comparators. The conversions only choose BVH partitions; exact
AABB comparisons and exact point/plane predicates certify every rejection and
reported candidate. Precomputing the three approximate keys per item should
therefore remove repeated work without weakening the exact computation model.
Implementation:
Benchmark evidence was collected with Criterion on an AMD Ryzen 7 5800X3D,
Rust 1.97.0, using the bench profile:
| Workload | Before | Cached BVH keys | Shared hull/BVH keys |
|---|---|---|---|
convex_hull/grid_4913 |
13.383 ms | 7.747 ms | 7.399 ms |
The final result is 44.7% faster than the same-turn baseline. Criterion also
reported improvements against its stored baseline for
convex_hull/moment_curve_64 (53.8%) and convex_hull/curved_shell_684
(26.9%). boolean_operation/cubes/Union, the Boolean workload with a current
comparable baseline, was statistically unchanged.
Trace evidence from cargo bench --bench dispatch_trace --features
dispatch-trace for convex_hull/grid_4913:
compare-real dispatches.Validation:
cargo test --all-targets: 950 unit, 52 core, and 48 regression tests passed;
one benchmark-style regression test remained intentionally ignored.cargo clippy --all-targets -- -D warnings passed.RUSTDOCFLAGS="-D warnings" cargo doc --no-deps passed.cargo check --examples --benches passed.Status: kept
Reference considered:
Hypothesis: the leaf classification caches preserve useful results across failed subdivision attempts and certified child reuse, but tracing showed no reuse among classifications appended during the same leaf-processing pass. Every new polygon therefore scanned an increasingly long suffix that could not produce a valid hit. Snapshotting the cache lengths at the beginning of a pass should preserve cross-pass reuse while avoiding the quadratic same-pass scan.
Implementation:
Benchmark evidence was collected with Criterion on the same machine and profile as the BVH experiment:
| Workload | Before | Bounded lookup | Result |
|---|---|---|---|
boolean_operation/nested_tools_5/Difference |
20.818 ms | 20.493 ms | 1.56% faster |
boolean_operation/cubes/Union |
about 8.04 ms | 8.050 ms | statistically unchanged |
boolean_operation/octahedra/Union |
10.146 ms stored baseline | 10.060 ms | within noise threshold |
The new variadic benchmark subtracts five disjoint nested cubes from one host cube, producing 72 classified polygons. Its trace recorded 72 misses and 71 skipped same-pass scans in each of the polygon and interior-point caches, with zero hits. The existing cube, nested-cube, and octahedron traces showed the same all-miss pattern. The optimization does not remove the cache: entries from earlier passes are still searched and the focused tests cover that reuse.
Status: no production changes retained
The following hypotheses were implemented and measured, then removed:
boolean_operation/nested_cubes/Difference from
5.626 ms to 5.759 ms (2.37% slower). The more expensive reachability check is
correctly left after the cheaper preparation and contraction path.Instrumentation retained from this audit records subdivision tasks, bound contractions, winding-reachability discards, completed leaves, and split searches. Every current Boolean trace performs two task entries, one bound contraction, and one completed leaf, with no split search or reachability discard. Consequently, EMBER’s split heuristics and parallel work scheduling were additionally probed with exact-rational closed tetrahedra using certified face-, edge-, and vertex-reference normalization. Each again completed after a bound contraction and one leaf, with zero split searches. Closed-cube boundary references that lacked the required adjacent-cell winding certificate failed explicitly during reference propagation before subdivision, as required by the public correctness contract.
This differs from EMBER’s cost model: the paper subdivides until a local polygon threshold is reached, whereas this implementation first attempts its complete local BSP and exact segment-trace classifier even for the 384-polygon stress leaf. Recursive splitting is therefore a certification fallback, not a size-driven production hot path. Split ranking, branch work stealing, and parallel cache sharing have no correctness-certified workload under the current API on which they can be meaningfully timed. They are classified as architecture-inapplicable until the leaf policy or supported input contract changes, rather than left as an unbounded optimization task.
Validation after the first two retained optimizations:
cargo test --all-targets: 952 unit and 52 core tests passed; 48 regression
tests passed and one benchmark-style regression remained intentionally
ignored; all benchmark smoke executions passed.cargo clippy --all-targets -- -D warnings passed.RUSTDOCFLAGS="-D warnings" cargo doc --no-deps passed.cargo check --examples --benches passed.cargo fmt --all -- --check and git diff --check passed.Status: kept
Reference considered:
The existing implementation already follows two central rules from the paper: it constructs each unordered candidate pair once and reverses that certified result for the other polygon, and it retains exact pairwise results in the subdivision runtime cache. The audit therefore focused inside the remaining exact construction.
Hypothesis: each edge of a triangular polygon classified both endpoints against the opposing support plane, so each vertex was classified twice. A specialized triangle path can classify all three vertices once and reuse those results for the three edge tests without changing any predicate, construction, or topology decision. The generic convex-polygon path remains unchanged.
Same-turn Criterion evidence:
| Workload | Before | Triangle classification reuse | Result |
|---|---|---|---|
boolean_operation/cubes/Union |
8.1043 ms | 7.9284 ms | 2.17% faster |
boolean_operation/octahedra/Union |
10.101 ms | 9.8733 ms | 2.25% faster |
boolean_operation/nested_tools_5/Difference |
20.780 ms | 20.776 ms | unchanged |
Dispatch traces explain the improvement while preserving certified behavior:
Two broader variants were rejected before retaining the narrow triangle path:
Status: no production optimization applicable to the current contract
Reference considered:
The paper evaluates a real-valued solid-angle field as an inside/outside confidence measure for open, self-intersecting, non-manifold, or otherwise imperfect oriented meshes. It accelerates repeated field evaluations with an AABB hierarchy whose nodes close local open patches; outside a node’s convex hull, the winding contribution of the patch is the negative contribution of its usually smaller closure. Construction stops at about 100 facets or when a closure is no smaller than its source. The paper then uses graph-cut segmentation because a simple threshold is not reliable for imperfect input.
hypermesh has a stricter and materially different contract:
Replacing that path with generalized solid-angle evaluation or graph-cut labels would weaken exact Boolean topology guarantees, so it was not attempted. The paper’s exact closure hierarchy also does not fit the measured workload: representative traces contain only 24–72 leaf polygons, below its approximate 100-facet stopping threshold. Its applicability was tested separately on a much larger certified leaf below; any compatible design must accelerate the same exact transition semantics rather than introduce confidence thresholds.
Final validation after the intersection change repeated the full matrix: 952 unit tests and 52 core tests passed; 48 regression tests passed with the one benchmark-style regression intentionally ignored; benchmark smoke execution, Clippy with warnings denied, rustdoc with warnings denied, and example/bench compilation all passed.
Status: benchmark retained; production experiment removed
The earlier hierarchy audit lacked a representative leaf above the generalized winding-number paper’s roughly 100-facet stopping scale. A new certified fixture recursively tessellates each face of two overlapping closed cubes, producing 192 triangles per mesh without changing their geometry. Its union completes as one exact leaf with 384 classification misses and 276 output polygons. The trace records 4,032 pairwise BVH candidates, 168 nonempty cuts, and 2,783,428 exact comparisons, so it is a genuine large-leaf stress case.
An experiment built one shared ExactBvh in the leaf probe cache and queried
each axis segment’s exact AABB before running the unchanged exact tracer on the
reported candidates. The hierarchy remained scheduling-only: exact node bounds
certified every rejection and every candidate still entered the existing exact
plane/edge predicates. Nevertheless, BVH construction, exact node traversal,
candidate collection, and temporary polygon cloning outweighed the avoided
linear checks:
| workload | linear scan | exact trace BVH | result |
|---|---|---|---|
boolean_operation/subdivided_cubes_192/Union |
312.36 ms | 445.86 ms | 42.7% slower |
All production hierarchy plumbing was removed. The benchmark and dispatch fixture remain so a future zero-copy query integration can prove a different cost model rather than extrapolating from the smaller cube cases.
Status: kept
The public build-once/extract-many Boolean surface was removed. Each call now names exactly one operation, performs only that operation’s reachability and transition work, closure-certifies the result, and returns owned output without exposing or caching intermediate arrangement state.
boolean_operation returns certified polygons. boolean_triangle_soup
continues directly through certified triangulation and output resolution, and
the certified-convex variants use the projective two-input fast path without a
public carrier. The selected classified fragments are moved into the result
instead of cloned. boolean_symmetric_difference completes the two-input
convenience API.
The former multi-result crossover measurements are intentionally retired: retaining classified arrangements is no longer an API or an optimization target. The immediate benchmark group measures polygon output, triangle-soup output, and certified-convex triangle-soup output separately so future work is judged on cold operation latency and allocation rather than cache reuse.
A --quick Criterion smoke run on two overlapping cubes measured:
| operation | polygon output | triangle-soup output | certified-convex triangle soup |
|---|---|---|---|
| union | 3.30–3.36 ms | 3.31–3.47 ms | 166.7–167.4 us |
| intersection | 3.18–3.36 ms | 3.08–3.10 ms | 108.6–110.6 us |
| difference | 3.15–3.29 ms | 3.17–3.28 ms | 131.5–133.9 us |
| symmetric difference | 3.38–3.39 ms | 3.36–3.40 ms | 190.1–190.3 us |
These short runs are smoke evidence, not a replacement for the longer reference-guided sampling protocol.
Status: kept
Sampled call stacks for the 192-triangle-per-mesh subdivided-cube union showed
that exact point/plane classification was the largest named function and that
rational magnitude detection plus conversion to conservative f64 intervals
accounted for another substantial share. Dispatch tracing recorded 211,430
prepared affine points feeding 265,416 exact-rational classifications: the
same point was commonly tested against a support plane and several edge
planes, but its three coordinates and homogeneous weight were converted again
for every filter attempt.
hyperreal now exposes a hidden prepared rational linear-form query carrying
four approximate values and their certified error radii. PreparedPoint3
constructs the affine form once, uses an exact 1.0 homogeneous weight with
zero error, and reuses it across every plane classification. Inconclusive
filters still execute the same exact rational signed-product-sum ordering.
Matched release A/B runs used identical code and settings except for retaining the prepared query:
| workload | repeated conversion | retained query | result |
|---|---|---|---|
boolean_operation/subdivided_cubes_192/Union |
168.49 ms | 163.39 ms | 3.03% faster |
boolean_operation/cubes/Union |
3.8631 ms | 3.7679 ms | 2.46% faster |
convex_hull/grid_4913 |
7.6063 ms | 7.4052 ms | 2.64% faster |
The subdivided case used 30 samples and a ten-second measurement window for
each side of the A/B. Criterion reported a significant 3.12% regression when
the retained query was disabled (p < 0.01), corroborating the direct
point-estimate comparison. Cube union and the grid hull likewise regressed
significantly when disabled (p < 0.01). The complete dispatch workload
retained the same output polygon/triangle counts with zero unknown-fact and
fallback/abort events.
The full default and all-feature test matrices passed, as did the
no-default-feature build, warning-denied Clippy, rustdoc, benchmark and fuzz
target builds, the release WASM UI build, and a 15-second sanitizer campaign
over polygon_predicates (35,735 executions with no failure).
Status: kept for difference and intersection
The certified two-convex path already prunes fragments for one requested operation and carries their exact front/back winding evidence. Difference and intersection nevertheless cloned both winding vectors onto every generated triangle, then immediately classified those copies, allocated a second triangle/source list, and cloned the merged exact vertex pool. Their operation orientation is now classified once per output polygon and consumed directly while triangulating. Closure is still certified on the oriented soup, and failure still enters the existing precomputed-f64 exact fallback.
Union and symmetric difference retain the prior construction-plus-winding selection path after the direct path did not improve both workloads. A 31-fresh-process CSGRS/CGAL/OpenCascade sphere/box matrix compared the selective version with the clean implementation on the same host:
| operation | clean cold | selective cold | cold result | clean warm | selective warm |
|---|---|---|---|---|---|
| difference | 2.651918 ms | 2.582393 ms | 2.62% faster | 111.867 us | 88.964 us |
| intersection | 2.005512 ms | 1.981404 ms | 1.20% faster | 33.222 us | 33.023 us |
| union (control) | 4.010995 ms | 3.912562 ms | run-order variation | 129.991 us | 102.673 us |
| symmetric difference (control) | 3.431765 ms | 3.439824 ms | 0.23% noise | 135.436 us | 132.836 us |
Every operation retained the same output size and checksum. Difference and intersection remained much faster than OpenCascade; intersection also beat CGAL in the selective run, while the remaining cold competitor gaps stay open.
Status: kept
The two-convex classifier already caches the certified sign of each exact source point against each opposing support plane. It still rebuilt the same four-value floating filter query separately for every previously unseen point/plane pair. The cache now retains one prepared query per unique source point alongside its plane-indexed signs. Only conservative approximate values and their certified error radii are retained; uncertain filters continue to use the unchanged exact rational signed-product-sum ordering.
A 500-operation alternating-input profile forced a fresh Boolean computation
on every call. Rational-to-f64 conversion fell from 10.97% to 8.20% of sampled cycles,
a 25.3% reduction in the targeted hotspot’s share. Total sampled cycles also
fell from 4.775 billion to 4.713 billion.
Because sequential release builds showed thermal drift, the end-to-end check preserved both binaries and alternated their execution for 101 fresh processes per side. Each process ran the same four CSGRS sphere/box operations; output sizes and checksums matched throughout.
| operation | repeated query | retained query | cold result |
|---|---|---|---|
| difference | 2.617380 ms | 2.558905 ms | 2.23% faster |
| intersection | 1.978735 ms | 1.919859 ms | 2.98% faster |
| union | 4.474474 ms | 4.355922 ms | 2.65% faster |
| symmetric difference | 3.500130 ms | 3.393198 ms | 3.06% faster |
Warm measurements used 31 similarly interleaved processes. Union and symmetric difference were unchanged; difference and intersection moved by about 1–2.5%, identifying that residual as binary-layout and measurement variation.
Validation passed the default and all-feature matrices (954 unit tests, 59/60
core integration tests, and 48 regressions with one benchmark smoke test
ignored), the no-default-feature check, warning-denied Clippy and rustdoc,
benchmark and fuzz-target builds, and the release WASM demo. A 20-second ASAN
campaign completed 371 boolean_pipeline executions without failure.
Status: kept
The two-convex path first uses an inexact clip only to propose a smaller set of
active opposing planes, then certifies the resulting homogeneous cycle against
every exact candidate plane. That certification previously converted the same
four exact projective coordinates into conservative floating intervals once
per point/plane pair. PreparedProjectivePoint3 now retains those intervals
once per cycle point while visiting the candidate planes. The traversal remains
fully certified: inconclusive filters evaluate the unchanged exact rational
four-term signed product sum, and non-rational coordinates retain the general
Real predicate fallback.
Both release binaries were preserved and alternated for 101 fresh processes per side. Output sizes and checksums matched for every sample.
| operation | repeated projective query | prepared projective query | cold result |
|---|---|---|---|
| difference | 2.540766 ms | 2.415564 ms | 4.93% faster |
| intersection | 1.914299 ms | 1.786318 ms | 6.69% faster |
| union | 4.300215 ms | 4.199283 ms | 2.35% faster |
| symmetric difference | 3.384948 ms | 3.257197 ms | 3.77% faster |
Thirty-one interleaved warm processes also improved every operation by 1.2–1.8%. The focused predicate test checks repeated negative, on-plane, and positive results, including the non-rational coefficient fallback.
Validation passed the default and all-feature matrices (955 unit tests, 59/60
core integration tests, and 48 regressions with one benchmark smoke test
ignored), the no-default-feature check, warning-denied Clippy and rustdoc,
benchmark and fuzz-target builds, and the release WASM demo. A 20-second ASAN
campaign completed 371 boolean_pipeline executions without failure.
Status: kept for union
Union needs vertices from unselected arrangement fragments to split selected boundaries at exact T-junctions, but it does not need to triangulate those fragments, clone their winding vectors onto every triangle, and then copy the selected triangle list. The single-union path now classifies each fragment once. Zero-classification fragments remain in the merged vertex pool and construction-candidate index but skip boundary triangulation; selected fragments emit triangles in their final exact orientation. Closure is still certified, and any failure retains the existing classified-triangle fallback. XOR remains on its prior path because the broader experiment did not improve it.
A 301-pair fresh-process release A/B isolated the CSGRS sphere/box union and alternated the preserved binaries. Every output size and checksum matched:
| operation | classified triangle selection | recovery-only fragments | result |
|---|---|---|---|
| union | 4.272108 ms | 4.248489 ms | 0.55% faster |
Validation passed the default and all-feature matrices (955 unit tests, 59/60
core integration tests, and 48 regressions with one benchmark smoke test
ignored), the no-default-feature check, warning-denied Clippy and rustdoc,
benchmark and fuzz-target builds, and the release WASM demo. A 20-second ASAN
campaign completed 358 boolean_pipeline executions without failure.
Status: kept
Certified two-convex input preparation rebuilds exact edge planes only for
selected output fragments. Its initial triangle carriers nevertheless cloned
the four-coefficient support plane into all three edge slots before knowing
whether a source triangle would reach projective clipping. The carrier now
retains one placeholder support plane. ProjectiveCycle expands that value to
the source vertex count only when the triangle actually needs clipping; direct
inside/outside transitions avoid the two unused clones entirely. Exact support
classification, crossing construction, final edge-plane rebuilding, and output
closure certification are unchanged.
Five interleaved release runs per side forced a fresh Boolean computation for each of 500 alternating CSGRS sphere/box operations:
| operation | eager placeholders | deferred placeholders | result |
|---|---|---|---|
| union | 1,238.474 ms | 1,219.832 ms | 1.51% faster |
| difference | 1,009.196 ms | 999.312 ms | 0.98% faster |
An exact algebraic alternative expanded each (p1 - p0) x (p2 - p0) normal
component into one six-term product sum. It was rejected: the additional
products outweighed delayed rational normalization, regressing union by 6.05%
and difference by 8.83% against the retained deferred-placeholder version.
Validation passed the default and all-feature matrices (956 unit tests, 59/60
core integration tests, and 48 regressions with one benchmark smoke test
ignored), the no-default-feature check, warning-denied Clippy and rustdoc,
benchmark and fuzz-target builds, and the release WASM demo. A 20-second ASAN
campaign completed 362 boolean_pipeline executions without failure, and the
downstream CSGRS library suite passed all 304 tests.
Status: kept
The operation computation already owns every classified polygon through final triangle output. The construction-candidate triangulator nevertheless cloned the whole polygon set into a temporary vector, including exact support coefficients and winding vectors, before immediately borrowing those clones. Its internal polygon consumers now accept either owned or borrowed carriers and immediate triangle output passes references. Polygon output instead moves the selected fragments into the result. Vertex materialization, exact duplicate merging, construction-edge T-junction recovery, orientation, and closure certification are unchanged.
Five interleaved release runs per side forced a fresh Boolean computation for each of 500 alternating CSGRS sphere/box operations:
| operation | cloned polygons | borrowed polygons | result |
|---|---|---|---|
| union | 1,235.264 ms | 1,224.814 ms | 0.85% faster |
| difference | 995.178 ms | 987.234 ms | 0.80% faster |
A follow-up that also borrowed each polygon’s retained vertex cycle was
rejected. Avoiding its temporary Vec<Point3> changed union by -0.10% and
difference by +0.06%, which is noise, while adding a second materialization
branch.
Validation passed the default and all-feature matrices (956 unit tests, 59/60
core integration tests, and 48 regressions with one benchmark smoke test
ignored), the no-default-feature check, warning-denied Clippy and rustdoc,
benchmark and fuzz-target builds, and the release WASM demo. A 20-second ASAN
campaign completed 359 boolean_pipeline executions without failure, and the
downstream CSGRS library suite passed all 304 tests.
Status: kept
Certified two-convex classification used a second owned support-plane table even though the input polygon soup remains alive for the whole preparation. For the sphere/box workload this cloned every exact normal and offset before performing read-only equality, classification, and clipping queries. The table now borrows each source polygon’s support plane. Emitted fragments still own their source or derived polygon geometry, so immediate result ownership is unchanged.
Five interleaved release runs per side forced a fresh Boolean computation for each of 500 alternating CSGRS sphere/box operations:
| operation | cloned support planes | borrowed support planes | result |
|---|---|---|---|
| union | 1,234.734 ms | 1,216.364 ms | 1.49% faster |
| difference | 1,004.544 ms | 995.970 ms | 0.85% faster |
Validation passed the default and all-feature matrices (956 unit tests, 59/60
core integration tests, and 48 regressions with one benchmark smoke test
ignored), the no-default-feature check, warning-denied Clippy and rustdoc,
benchmark and fuzz-target builds, and the release WASM demo. A 20-second ASAN
campaign completed 359 boolean_pipeline executions without failure, and the
downstream CSGRS library suite passed all 304 tests.
Status: kept
Once one source-triangle vertex is exactly positive and another is exactly
negative against an opposing support plane, the triangle’s Crossing relation
cannot change. The classifier previously continued through the remaining
vertex. It now returns immediately, avoiding an unnecessary prepared predicate
query and allowing a decided crossing even when a later irrelevant query would
be undecidable.
Wall-clock movement was below scheduler noise, so five interleaved release runs per side measured retired instructions for 500 alternating immediate operations:
| operation | visit every vertex | stop at crossing | result |
|---|---|---|---|
| union | 11,289,466,082 | 11,277,251,607 | 0.108% fewer instructions |
| difference | 9,012,280,707 | 8,999,990,649 | 0.136% fewer instructions |
Every paired run retired fewer instructions. The focused test also verifies that only the two decisive source points enter the exact point/plane cache.
Validation passed the default and all-feature matrices (957 unit tests, 59/60
core tests, and 48 regressions plus one intentional ignore), the no-default-
feature check, warning-denied Clippy and rustdoc, benchmark and fuzz-target
builds, and the release WASM demo. A 20-second ASAN campaign completed 358
boolean_pipeline executions without failure, and the downstream CSGRS library
suite passed all 304 tests.
Status: kept
Expanded polygon boundaries require a centroid fan to preserve the certified
closed output. Each coordinate previously accumulated canonical Real sums
and then performed another exact division. Exact-rational coordinates now use
Hyperreal’s borrowed mean reducer, which chooses one common-denominator
schedule and canonicalizes only the final mean. Non-rational coordinates keep
the original exact Real sum and division path, and triangulation topology is
unchanged.
Preserved release binaries each prepared 500 fresh sphere/box arrangements. Seven counter runs measured:
| operation | repeated reduction | one final reduction | result |
|---|---|---|---|
| union | 11,171,163,355 | 10,665,871,420 | 4.52% fewer instructions |
| difference | 8,915,422,180 | 8,599,082,893 | 3.55% fewer instructions |
Cycles fell 4.89% for union and 3.60% for difference. In the matched five-sample cross-kernel run, cold exact difference reached 1.966 ms versus CGAL EPECK’s 1.882 ms, while cold union measured 3.097 ms versus 2.496 ms. Retained CSGRS remained 22.33x faster than CGAL for difference and 17.75x for union, and exceeded the tight OpenCascade rows at both temperatures.
Validation passed the default and all-feature matrices (957 unit tests, all 60
core tests, and 48 regressions plus one intentional ignore), the no-default-
feature check, warning-denied Clippy and rustdoc, benchmark and fuzz-target
builds, and the release WASM demo. A 20-second ASAN campaign completed 376
boolean_pipeline executions without failure, and the downstream CSGRS library
suite passed all 304 tests.
Status: kept
An exact T-junction expands a convex polygon’s emitted boundary but does not
change the polygon interior. The closure-preserving triangle fan therefore now
chooses its center from the original polygon vertex cycle instead of averaging
every inserted boundary point. The center remains a strict convex combination
inside the same support plane, while the exact fan boundary, triangle count,
source provenance, and represented surface remain unchanged. A focused
regression inserts a midpoint into a source triangle edge and verifies that the
fan retains the source triangle’s exact (2/3, 2/3, 0) centroid.
Preserved release binaries each prepared 500 fresh sphere/box arrangements. Seven counter runs measured:
| operation | expanded-boundary mean | source-cycle mean | result |
|---|---|---|---|
| union | 10,664,618,650 | 9,926,385,863 | 6.92% fewer instructions |
| difference | 8,599,114,266 | 8,294,119,288 | 3.55% fewer instructions |
Cycles fell 4.91% for union and 2.79% for difference. A two-midpoint dyadic interior point was rejected after increasing union instructions by 0.81%.
Certified convex arrangements now also expose the already-constructed exact
source support normal by global source triangle and output orientation. The
lookup validates retained source identity and returns no value for general
arrangements that consumed their source polygon carrier. This lets downstream
adapters reuse exact support work without adding normals to TriangleSoup or
changing its public storage contract.
Validation passed the default and all-feature matrices (958 unit tests, 60/61
core integration tests, and 48 regressions plus one intentional benchmark
ignore), the no-default-feature check, warning-denied Clippy and rustdoc,
benchmark and fuzz-target builds, and the release WASM demo. A 20-second ASAN
campaign completed 352 boolean_pipeline executions without failure. The
downstream CSGRS default and all-feature suites passed all 305/369 library tests
and their integration tests.
Status: kept
Closed-arrangement triangulation formerly allocated one boundary vector and one triangle vector for every emitted polygon, then copied each temporary fan into the final triangle soup. It now reserves each boundary from the known polygon size, preallocates the final triangle/source rows, and appends construction-identity fans directly. A single pass skips consecutive segments with the same construction-edge identity while retaining the prior weakly convex fallback when fewer than three strict corners remain. Exact vertices, triangle order, source provenance, winding rows, and closure certification are unchanged.
Preserved release binaries each performed 500 fresh sphere/box operations. Seven counter runs measured:
| operation | temporary fans | direct fans | instruction result | cycle result |
|---|---|---|---|---|
| union | 18,792,107,702 | 18,761,534,911 | 0.16% fewer | 0.98% fewer |
| difference | 13,681,648,051 | 13,653,035,759 | 0.21% fewer | 0.73% fewer |
Heap profiles of 25 unions fell from 1,045,599 to 1,038,724 allocations: 275 allocations removed per operation, or 0.66% of the complete construction, Boolean, and materialization workload. Direct regressions cover an ordinary fan, a repeated collinear construction identity, and an uncertified fan that must leave output untouched for the exact fallback.
Validation passed the default and all-feature matrices (961 unit tests, all 61
core integration tests, and 48 regressions plus one intentional benchmark
ignore), the no-default-feature check, warning-denied Clippy and rustdoc,
benchmark and fuzz-target builds, and the release WASM demo. A 20-second ASAN
campaign completed 370 boolean_pipeline executions without failure. The
downstream CSGRS all-feature suite passed all 369 library tests and every
integration test.
Status: kept
Certified-convex polygon edges retain the source mesh and their original endpoint indices. The vertex shared by the incoming and outgoing source edges therefore identifies the original source point without hashing its three arbitrary-precision coordinates. Source-plane classification now stores prepared point queries and per-plane results directly by that certified source index. Split, derived, or otherwise unlabeled points continue to use the exact coordinate-identity map, so the optimization changes neither the certified floating filter nor its exact fallback.
Thirty deterministic counter runs over 500 alternating fresh sphere/box operations measured:
| operation | coordinate-map instructions | source-index instructions | result | cycle result |
|---|---|---|---|---|
| union | 9,936,194,568 | 9,861,417,347 | 0.75% fewer | 1.14% fewer |
| difference | 7,860,766,245 | 7,787,262,464 | 0.94% fewer | 0.88% fewer |
In the union profile, prepare_two_convex_inputs_projectively fell from 5.20%
to 3.29% self time. Heap profiles of 50 unions fell only from 1,060,050 to
1,059,904 allocations (2.92 allocations per operation), confirming that the
measured CPU reduction comes primarily from avoiding arbitrary-precision
coordinate hashing. A focused regression verifies that certified source
vertices populate the indexed cache without touching the coordinate map, while
the existing early-crossing regression continues to exercise the fallback map.
Validation passed the default, all-feature, and all-target matrices (962 unit
tests, all 61 core integration tests, and 48 regressions plus one intentional
benchmark ignore), the no-default-feature check, warning-denied Clippy and
rustdoc, benchmark and fuzz-target builds, and the release WASM demo. A
20-second ASAN campaign completed 368 boolean_pipeline executions without
failure. The downstream CSGRS all-feature suite passed all 370 library tests and
every integration test.
Status: kept
Output extraction and triangulation previously called ConvexPolygon::vertices
even when the polygon already retained its exact affine vertex cycle. That call
cloned the complete cycle into a temporary vector before the output path moved
or cloned the same coordinates again. Public polygon extraction, fallback fan
triangulation, and duplicate-vertex merging now borrow retained cycles directly;
polygons without retained vertices preserve the computed affine fallback. The
merge path also reserves its exact total input vertex count before collection.
Eight alternating counter runs each performed 500 fresh, globally shifted sphere/box operations:
| operation | temporary-cycle instructions | borrowed-cycle instructions | result | cycle result |
|---|---|---|---|---|
| union | 9,988,951,430 | 9,955,446,701 | 0.34% fewer | 0.84% fewer |
| difference | 8,520,274,492 | 8,489,569,986 | 0.36% fewer | 0.82% fewer |
Heap profiles of 50 unions fell from 1,191,406 to 1,183,880 allocations: 7,526
allocations removed in total, or 150.52 per operation and 0.63% of the complete
construction, Boolean, and materialization workload. Exact Real coordinates,
polygon order, source provenance, and the non-retained intersection fallback are
unchanged.
Validation passed the default, all-feature, and all-target matrices (962 unit
tests, all 61 core integration tests, and 48 regressions plus one intentional
benchmark ignore), the no-default-feature check, warning-denied Clippy and
rustdoc, benchmark and fuzz-target builds, and the release WASM demo. A
20-second ASAN campaign completed 371 boolean_pipeline executions without
failure. The downstream CSGRS all-feature suite passed all 370 library tests and
every integration test.
Status: kept
Construction-aware T-junction filtering projected the same exact output vertex into many certified 2D line predicates, converting its arbitrary-precision coordinates and rebuilding conservative error radii each time. The output merge now prepares every rational 3D vertex once when recovery filtering is enabled. Line endpoints and candidate queries select their two axes from those retained intervals; failed conversions, invalid projections, and uncertain filters still fall through to the unchanged exact point-on-segment predicate.
Eight alternating counter runs each performed 500 fresh, globally shifted sphere/box operations:
| operation | repeated-conversion instructions | prepared-point instructions | result | cycle result |
|---|---|---|---|---|
| union | 9,955,432,140 | 9,516,772,993 | 4.41% fewer | 4.04% fewer |
| difference | 8,488,857,196 | 8,487,528,295 | 0.02% fewer | neutral |
Rational::to_f64_lossy fell from 4.91% to 2.09% self time in the union
profile. Heap profiles rose from 1,183,904 to 1,183,949 allocations over 50
unions—only 0.9 allocation per operation for the prepared-query vector. The
Hyperreal regression suite locks positive, negative, uncertain, and invalid-axis
filter behavior while Hypermesh’s exact split-edge and output suites retain the
same topology.
Validation passed 962 unit tests, 60 default integration tests, 48 regression
tests with the benchmark smoke test ignored, the complete all-target/all-feature
suite, the no-default-feature build, Clippy with warnings denied, warning-clean
documentation, benchmark compilation, every fuzz-target build, and the locked
release WASM application build. A 20-second ASAN campaign completed 365
boolean_pipeline executions without failure. The downstream CSGRS all-feature
suite passed all 370 library tests and every integration test.
Status: kept
Certified source vertices previously stored one independently allocated plane- classification vector per vertex. The indexed source path now retains prepared queries in one vector and classifications in one contiguous vertex-by-plane matrix. Coordinate-keyed fallback points keep their existing independent cache, and a changed plane count fails closed instead of indexing an incompatible row.
Eight alternating counter runs each performed 500 fresh, globally shifted 8x4 sphere/box operations:
| operation | per-vertex rows instructions | packed rows instructions | result | cycle result |
|---|---|---|---|---|
| union | 8,048,764,677 | 8,037,695,540 | 0.14% fewer | 0.29% fewer |
| difference | 6,796,668,533 | 6,787,164,684 | 0.14% fewer | 0.17% fewer |
Heap profiles over 100 unions fell from 1,912,386 to 1,909,782 allocations, removing 2,604 allocations, or 26.04 per operation. The source-relation regression now verifies both packed query and classification occupancy.
Validation passed the complete 962-test all-target/all-feature suite, the no-
default-feature build, Clippy with warnings denied, warning-clean documentation,
benchmark compilation, every fuzz-target build, and the locked release WASM
application build. A 20-second ASAN campaign completed 373 boolean_pipeline
executions without failure. The downstream CSGRS all-feature suite passed all
370 library tests and every integration test.
Status: kept
Input triangles retained their three exact affine vertices and three source-edge
identities as Arc<Vec<_>>. Each fixed-size cache therefore allocated both an
Arc owner and a separate Vec buffer. These internal caches now use
Arc<[_]>; triangle construction places each three-element array directly in
one shared allocation, while variable-size derived cycles convert their owned
vectors at the same boundary. Exact coordinates, edge identities, clone
sharing, polygon order, and every public type remain unchanged.
An isolated cold CSGRS sphere/box union under Callgrind fell from 55,517,396 to 55,466,235 retired instructions, 51,161 fewer instructions (0.092%). A complete 47-workload CSGRS/CGAL/OpenCascade sweep kept all warm CSGRS rows ahead of both comparison kernels. The cold sphere/box union measured 2.083 ms versus CGAL’s 2.024 ms (0.972x), while the related difference, intersection, and symmetric difference rows remained CSGRS wins.
Two nearby ideas were rejected by deterministic measurement. Carrying selected fragment orientation through operation-scoped triangulation changed 55,517,396 instructions to 55,518,574, and a per-arrangement prepared-plane filter cache increased the count to 55,531,805. The existing winding and global predicate filter paths are already cheaper for this workload.
Validation passed all 962 unit tests, 60 core integration tests, and 48
regressions plus one intentional benchmark ignore; all-target benchmark
harnesses, warning-denied Clippy, rustdoc, and every fuzz-target build were
clean. A 20-second ASAN boolean_pipeline campaign completed 369 executions
without failure (LeakSanitizer was disabled because the runner uses ptrace).
The downstream CSGRS all-feature suite passed all 373 library tests and the
nine focused exact adapter/differential tests.
Status: kept
Certified two-convex preparation previously cloned the three exact source
positions into every triangle even though MeshRef already supplied an indexed
position pool. Deferred input polygons now retain one shared exact position
slice per source mesh plus their three source indices. Owned vertex cycles
remain available for ordinary input, clipping, inversion, and derived output,
so this changes neither the public API nor exact fallback behavior. A regression
verifies that adjacent triangles share the pool while preserving each indexed
cycle and its affine materialization.
The same projective candidate also built an approximate AABB for every deferred triangle. That candidate classifies directly against indexed support planes and does not query polygon bounds. Deferred polygons now omit those unused bounds; if candidate construction fails, preparation rebuilds ordinary bounded input before entering BVH or subdivision code.
On the isolated cold CSGRS sphere/box union, shared indexed positions reduced Callgrind’s count from 55,466,235 to 55,344,048 instructions. Omitting unused deferred AABBs reduced it again to 54,906,147: 560,088 fewer instructions (1.01%) than the preceding checkpoint and 611,249 fewer (1.10%) than the original 55,517,396 baseline. In the final 47-workload cross-kernel sweep, cold sphere/box union measured 1.973 ms versus CGAL’s 2.095 ms, a 1.062x CSGRS win; the related difference, intersection, and symmetric-difference rows also won, and every warm CSGRS row remained ahead of both CGAL and OpenCascade.
Validation passed all 963 unit tests, 60 core integration tests, and 48
regressions plus one intentional benchmark ignore, including every benchmark
harness. Warning-denied Clippy, rustdoc, and every fuzz-target build were clean.
A 20-second ASAN boolean_pipeline campaign completed 373 executions without
failure (LeakSanitizer remained disabled because the runner uses ptrace). The
downstream CSGRS all-feature suite passed all 373 library tests.
Status: kept
Large certified root leaves populated the host-BSP and BSP-leaf-certification caches even though a completed root attempt returns immediately and can never query those entries. Each entry retained a clone of the complete polygon family. On the 1,140-facet YeahRight convex-hull/box arrangement, the dispatch trace reported one subdivision task and Heaptrack attributed 480 full-family clones (323.94 MiB) to BSP certification plus 160 clones (107.98 MiB) to host BSP leaves. The root path now computes those values once without retaining them; recursive tasks keep the existing caches because split retries can reuse their results. Probe-query caches are likewise scoped to one classification so unrelated exact probes do not retain one another’s search state.
Five fresh-process runs produced a 944.8 ms median with 81.6–82.5 MiB peak RSS, versus the 1.341 s and 569,956 KiB baseline: 29.5% lower latency and 85.5% lower peak RSS. Heaptrack fell from 6,589,299 to 5,020,891 allocations and from 534.04 MiB to 67.74 MiB peak heap. Output remained 5,152 polygons with checksum 675,298,388. The refreshed native comparison measured 930.7 ms cold and 941.9 ms warm for CSGRS, 1.66x faster than OpenCascade; CGAL EPECK remains the target to close at 9.0 ms cold.
Validation passed the complete 970-test all-target/all-feature unit suite and
all integration, regression, and benchmark targets, the no-default-feature
build, warning-denied Clippy, rustdoc, and every fuzz-target build. A 20-second
ASAN boolean_pipeline campaign completed 380 executions without failure. All
nine downstream CSGRS exact Hypermesh adapter and differential tests passed.
The concurrent CSGRS sketch conversion edit left the broader downstream run at
389/390; its sole curved-region failure is outside this subdivision change.
All reference-derived ideas are mapped as follows: