Skip to content

Notify each SoBase auditor once per notification - #823

Draft
Dikluwe wants to merge 32 commits into
coin3d:masterfrom
Dikluwe:codex/pr/sobase-notify-dedup
Draft

Dikluwe wants to merge 32 commits into
coin3d:masterfrom
Dikluwe:codex/pr/sobase-notify-dedup

Conversation

@Dikluwe

@Dikluwe Dikluwe commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Repeated registrations of the same auditor pointer can dispatch multiple notifications for a single SoBase notification. Deduplication state must be local to each notification so nested notifications and exception propagation do not poison subsequent calls.

Changes

  • Track already dispatched auditor pointers with Coin's SbPList for each notify() call.
  • Add regressions for empty lists, inline/allocated duplicates, mixed registration types, nested notifications, exceptions/reuse, and callbacks that remove or add auditors.
  • Retain the mutation-safe traversal prerequisite's per-callback notification list handling.

Deduplication is by pointer. A removed auditor is skipped; an auditor added during traversal is deferred to the next notification. SoNotList copying remains shallow. Auditor pointers remain borrowed. Identical pointer/data pairs removed and reinserted do not acquire a stable occurrence identity.

Dependencies — keep as draft

Requires traversal PR #826 at 43bf8ebee153284c45a4e7699bf3ed4135460c28. That prerequisite depends on #772 and the pointer-order change of #813. Its traversal contract was reviewed separately, including allocated snapshots, mutation, reentry and callback exceptions.

Traversal prerequisite PR.
Review the deduplication delta over its prerequisite.

The master diff remains cumulative. Keep this PR as draft until its prerequisite contributions are integrated and the diff can be narrowed to deduplication.

Validation

Linux candidate 94/94 CTests and individual integration lab 133/133. A diagnostic version with deduplication disabled failed the duplicate-notification regression. Focused nested, throwing and mutating notification cases passed with ASan/UBSan/vptr and LeakSanitizer in the combined review. The final publication integration gate is recorded below.

Final publication gate — 2026-10-08

The exact published heads, merged over the existing integration lab, passed 13/13 directed CTests and 139/139 total CTests, with no skips. GCC/Ninja Debug shared build, COIN_THREADSAFE=ON, external Expat, all build/compiler temporary files in RAM. The GLX test environment used Xvfb, LIBGL_ALWAYS_SOFTWARE=1 and COIN_GLX_PIXMAP_DIRECT_RENDERING=1. The initial full run omitted the latter setting and failed to create GLX contexts; the corrected environment passed without code changes. Integration commit: bc83f34.

Native Windows/macOS and ABI checks are left to this PR's CI.

Current publication gate — 2026-10-09

Current head 3d313b82595111cfec0942ee47a5383467993eaa incorporates the MSVC-only exception-fixture option from traversal PR #826. This changes only CcRbptreeTraverseTest compilation; the deduplication production delta is unchanged. The earlier Windows run failed that fixture with 0xc0000409; the corrected native run is pending.

The earlier deduplication candidate passed 102/102 CTests at 4c748ae4c1424a763924909c2d54a9d0fc1aafa6, and its dedicated lab passed 134/134. The fresh publication composition of all eight new PR heads and this exact head passed 35/35 directed and 153/153 full CTests, no skips, at e6687c088077082e6839b4fc39c632d5267b07d8. GCC/Ninja Debug shared build, thread safety enabled, external Expat, RAM build/TMPDIR, Xvfb/software GLX. Current native Windows/macOS and ABI checks rerun on this head.

Dikluwe added 30 commits October 2, 2026 14:58

This branch has not been deployed

No deployments
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.

1 participant