Repository navigation
Report APFS clone sharing and estimate reclaimable space - #9
Merged
Merged
Conversation
Port clone metadata, bounded per-scan reuse, accepted-set savings, and separate UI estimates from huntharo#3 at 87c02c7. Reuse the marking and review performance fixes already in PwrDisk main. Preserve PwrDisk branding, packaging, remote selection boundaries, and fresh removal guards.
Harold Hunt (huntharo)
force-pushed
the
port/apfs-clone-accounting
branch
from
October 30, 2026 01:25
a1670e8 to
4b85f58
Compare
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
APFS clones have distinct inodes but share allocated blocks. PwrDisk currently counts each clone in full and projects those listed bytes as savings, so selecting copies while retaining their original can overstate the space freed. A remaining hardlink can likewise retain data after a marked name is removed.
This ports the accounting from huntharo/disktree#3 at
87c02c7onto PwrDisk main8f63e4d. The marking and review performance fixes already merged in #5 are reused, without replaying their commit history. PwrDisk branding and release packaging are preserved.Fresh real-APFS fixture results, using an 8 MiB original and two
cp -ccopies:These compare the same port binary with metadata disabled/enabled, not separately built main and feature binaries. No deletion was performed in this fixture. Snapshots, open files and subsequent filesystem changes can retain space; the completed removal still reports the measured free-space change.
The node layout grows from 88 to 104 bytes; detailed allocation facts remain sparse. No new home-directory scan or elapsed-time benchmark was run. Historical source evidence is explicitly labelled in the accounting report.
Validation on macOS:
cargo xtask lintpassed.cargo xtask test: 315 passed (108 app, 200 core, 4 helper integration, 3 xtask); 8 opt-in/manual tests ignored. This includes real clones, modified clones, hardlinks, followed links, resource forks, accepted-set cache invalidation, remote boundaries and operation budgets.cargo build --release -p disktree-appandpwrdisk --helppassed.The port also carries the source branch's deterministic window-test palette and platform-correct remote fixture expectations so native theme callbacks and Unix-only live previews do not invalidate the cross-platform regression suite.