Skip to content

Drop stale DevelopableMerge heap entries instead of re-queueing them (0.4.1) - #9

Merged
cdcseacave merged 2 commits into
developfrom
fix/developable-merge-stale-entries
Oct 2, 2026
Merged

cdcseacave merged 2 commits into
developfrom
fix/developable-merge-stale-entries

Conversation

@cdcseacave

Copy link
Copy Markdown
Owner

Summary

Chart segmentation went quadratic on a mesh with one dominant chart. DevelopableMerge re-queued every stale heap entry at its new cost, but the merge that made it stale (doMerge, then tryPush(r, n) over every neighbour) had already pushed the same pair fresh. So every merge of either root added one more copy of each pair around it, and the work grew with the square of the merges a large chart absorbs.

Stale entries are now dropped. Every stale entry has a fresh duplicate at its true cost, or would be rejected anyway (budget, blocked pair, or wouldEnclose, which is monotone), so the change leaves the result bit-identical.

Also bumps to 0.4.1 (CMakeLists, vcpkg.json, CHANGELOG, install URLs in README and docs/PYTHON.md). Tag v0.4.1 after merge to build the wheels.

Measurements (L4 dev box, 2026-09-30)

Production block meshes from a 1,494-image DroneDeploy plan (radiance block pipeline), standalone halfmesh.unwrap at 3840:

Mesh 0.4.0 this PR
block 3 (103k faces) 116 s 39 s
block 4 (147k faces) 2,346 s 68 s
block 4, heap pops in the first merge call 59.7M 0.47M

Pushes, merges and chart counts are unchanged in every merge call, and the output PLY is byte-identical to the 0.4.0 build's on both meshes.

Tests

  • ctest: 615/615, including the bit-exact golden corpus
  • python/tests: 103/103

🤖 Generated with Claude Code

cdcseacave and others added 2 commits September 30, 2026 21:28
The merge that changes a root's moments pushes every pair around it again at
its true cost, so a re-queued stale entry is a duplicate. Duplicates grew by
one per merge of either root, quadratic in the merges a dominant chart absorbs:
a 147k-face block mesh spent 2,346 s in segmentation, now 68 s. Output is
bit-identical; ctest 615/615, python 103/103.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 12:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The algorithm change is sound and release metadata is aligned; only a minor missing changelog link definition remains.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Optimizes chart segmentation by discarding redundant stale heap entries and prepares the 0.4.1 release.

Changes:

  • Prevents quadratic heap growth in DevelopableMerge.
  • Bumps package and documentation versions to 0.4.1.
  • Adds performance results to the changelog.
File Description
src/​AtlasCharting.cpp Drops stale merge-heap entries.
CMakeLists.txt Bumps project version.
vcpkg.json Bumps manifest version.
README.md Updates wheel installation URL.
docs/​PYTHON.md Updates wheel URL and documented version.
CHANGELOG.md Documents the optimization and release.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CHANGELOG.md
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.1]
@cdcseacave
cdcseacave merged commit 8bb5f6e into develop Oct 2, 2026
17 checks passed
@cdcseacave
cdcseacave deleted the fix/developable-merge-stale-entries branch October 2, 2026 13:29
cdcseacave added a commit that referenced this pull request Oct 11, 2026
…reshold tests

- DevelopableMerge counts heap pops (AtlasSegmentStats, now also for the
  initial merge). The mesh.ply stats test asserts pops <= pushes in every
  merge; the pre-0.4.1 re-queue fails it (49,955 pops for 15,034 pushes
  in the initial merge).
- CloseHoles: the outline classifier flood-fills only the components
  that hold a fill candidate, instead of labelling the whole mesh, and no
  thread pool starts when there is nothing to fill. 800k-face closed
  sphere plus one isolated triangle: 32 ms -> 2.3 ms (1.4 ms without the
  triangle); new perf-harness guard.
- Tests on both sides of the 3/4 outline share: a 16-sided washer filled
  at inner radius 0.65 and kept open at 0.66, a tetrahedron missing its
  base filled at height 1 and kept open at 0.2, at unit scale and scaled
  1000x far from the origin. The hole regressions now check
  ValidateHalfMesh(). The shallow-shell case is documented with the washer.
- CHANGELOG: link definitions for 0.4.1, 0.4.2 and 0.5.0.
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.

2 participants