Files
solvecraft/crates/solidcore/examples
Brett Lawson 566a5b389e perf(topology): check and seed each object's notify record once, not on every edit
Every p3 edit (`with_caller_identities_for`) ran `check_keys` and
`seed_records` over the whole B-rep: a `key_of` call and a reserved-key test
for every object, plus every prospective index up to the allocation window,
and a BTreeMap entry for every object. A boolean that grows a body pays that
for every face it deletes, so the per-cut cost rises with body size. Upstream
keeps these records as object fields (`SmTopology.h:83-105`): no per-edit
walk.

`NotifyEnv::records` (and `NotificationStores::records`) is now a
`topology::topology::NotifyRecords`. It reads like the map (`Deref`), its
writes go through methods, and it keeps one flag per arena index and kind for
each B-rep it has served: index checked, object seeded. Each edit still
walks the same objects and prospective indices, but only an index not yet
flagged is checked or seeded. That is exact:
- an index's key is a fixed function of the index under the same caller
  identity (keyed by the B-rep key, its serial and `key_of` at index 0 of
  every kind), so a passed check stays passed;
- records are only removed through `remove`/`retain`/`clear`, which drop the
  flags, so a seeded object still has its record;
- all checks still run before any seeding, so a refused key seeds nothing,
  as before.
A source B-rep (copies and merges) keeps the full walk.

End-to-end recipe cases against main 2973b29ff (min of 3, interleaved):
menger_2 -35.3%, gear_60 -14.7%, plate_holes_12 -6.9%, enclosure_6 0%; all 17
cases give identical face counts, solid flags and volume/area bits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:33:38 +01:00
..