Files
ViewDesignEngine/docs
hm 68f8a679d7 fix(brep): deterministic parallel boolean assembly (KCP-1.0 W8)
The legacy union/intersection/difference cores pushed kept fragments into a
shared keep vector from their #pragma omp parallel for schedule(dynamic)
face passes, so the assembled order depended on the OpenMP schedule.  That
order feeds the serial sew_faces()/pply_conic_arcs() stages, making the
resulting face/edge ids (and B5 bit digest) vary with thread count and run.

Collect fragments into a per-face DeterministicSink (single writer per slot,
lock-free) and merge the slots in ascending face order after each parallel
region.  The merge order reproduces the single-thread emission order exactly,
so serial output is unchanged while multi-thread output is now bit-identical
to it.

Also make difference's _has_out std::atomic (it was a data race) and drop
the now-unneeded keep_mutex.

Verified: B5 digests identical across 1/2/4/8 threads and rounds, all three
workloads; [CBRA] gated 18-line output byte-identical; same-session A/B shows
no slowdown; new tests/brep/test_boolean_determinism.cpp (7 cases) passes;
Boolean|Brep|Determinism ctest 180/181 (0 failures; 1 disabled, 1 env-gated
skip as before).
2026-11-19 22:49:08 +08:00
..