Skip to content

Record deletions as delta patches with in-place compaction - #357

Draft
nabeya11 wants to merge 4 commits into
perf/patch-appendfrom
perf/patch-undo
Draft

Record deletions as delta patches with in-place compaction#357
nabeya11 wants to merge 4 commits into
perf/patch-appendfrom
perf/patch-undo

Conversation

@nabeya11

@nabeya11 nabeya11 commented Aug 6, 2026

Copy link
Copy Markdown
Member

Changes

Deletion (editor's passThrough / passThroughByMask) now compacts the cloud in place and records only the original positions and contents of the removed points.

  • compactInPlace moves consecutive runs of surviving points forward in bulk and keeps the spare capacity of Data.
  • Undo restores with a backward walk filling from the tail: the write position always stays at or after the read position, so not-yet-read points are never overwritten, and no allocation is needed while the capacity is available. Ascending indices and the kept capacity are the preconditions of this walk.
  • The package-level passThrough functions used non-destructively (VoxelFilter extraction, ExportSelectedPCD) are unchanged.
  • Added tests covering five deletion patterns times two capacity paths.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.61538% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.28%. Comparing base (44b4edf) to head (56e59b7).

Files with missing lines Patch % Lines
patch.go 82.22% 4 Missing and 4 partials ⚠️
editor.go 87.87% 4 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           perf/patch-append     #357      +/-   ##
=====================================================
+ Coverage              46.49%   48.28%   +1.79%     
=====================================================
  Files                      9        9              
  Lines                   1624     1690      +66     
=====================================================
+ Hits                     755      816      +61     
- Misses                   815      816       +1     
- Partials                  54       58       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This comment was marked as outdated.

Deletion now compacts the cloud in place, keeping the spare capacity of
Data, and records only the removed points. Undo re-expands with a
backward walk, without allocation when the capacity is still available.
This replaces the last snapshot-fallback edit; the whole-cloud
replacePatch remains only for re-import and full voxel_grid.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nabeya11
nabeya11 changed the base branch from master to perf/patch-append August 22, 2026 10:52
@nabeya11 nabeya11 changed the title Replace full-snapshot undo history with in-place edits and patches Record deletions as delta patches with in-place compaction Aug 22, 2026
@nabeya11
nabeya11 requested a lite review from Copilot August 22, 2026 10:54

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread patch_test.go Outdated
The subtest exercises revert without spare capacity; the reallocation
branch is only reached when points were actually removed, so name it
after the setup rather than the branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

nabeya11 and others added 2 commits August 22, 2026 22:11
Adapt deletePatch to the encodeHead/payload interface; its points are
now copied straight to the JS heap when pushed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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