feat(snapshots): add lossless v5 compression#31
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughFormat v5 adds LZFSE-compressed archive sections, decoded-byte checksums, stored byte counts, and version-aware import/export. Shared streaming IO, manifest models, validation, localization, documentation, tests, and benchmarks are updated accordingly. ChangesSnapshot Format v5
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: Sequence Diagram(s)sequenceDiagram
participant ScanArchiveService
participant ScanArchiveSectionWriter
participant ScanArchiveDocument
participant ScanArchiveSectionReader
participant Snapshot
ScanArchiveService->>ScanArchiveSectionWriter: export encoded nodes and topology
ScanArchiveSectionWriter-->>ScanArchiveService: return decoded-byte checksums
ScanArchiveService->>ScanArchiveDocument: write v5 encodings, checksums, and byte counts
ScanArchiveService->>ScanArchiveSectionReader: read and decode archive sections
ScanArchiveSectionReader-->>ScanArchiveService: return decoded section bytes
ScanArchiveService->>Snapshot: import validated snapshot
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Radix/Services/ScanArchiveService.swift`:
- Around line 918-924: Update readSectionData’s catch chain to explicitly
rethrow CancellationError before the generic catch maps other failures through
mapError. Preserve the existing ScanArchiveError passthrough and domain-error
mapping for non-cancellation errors.
In `@SNAPSHOT_V5_PLAN.md`:
- Around line 496-502: Update the regression-suite commands in
SNAPSHOT_V5_PLAN.md to prefix both swift test and the multiline xcodebuild
invocation with rtk, matching the documented repository policy and the later
benchmark command.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: d0ab57da-4128-40e8-b191-5d5abe545664
📒 Files selected for processing (10)
Package.swiftREADME.mdRadix/Localizable.xcstringsRadix/Services/ScanArchiveModels.swiftRadix/Services/ScanArchiveNodeIO.swiftRadix/Services/ScanArchiveSectionStream.swiftRadix/Services/ScanArchiveService.swiftRadixCoreTests/ScanArchiveBenchmarkTests.swiftRadixCoreTests/ScanArchiveServiceTests.swiftSNAPSHOT_V5_PLAN.md
|
Ready to merge after QC, I think. Perf gains are demonstrated but need some larger scale testing + with Sonoma. Hopefully this weekend! |
Summary
Validation
Benchmark results
Same-process v4/v5 medians across three debug iterations:
The 7-node fixture grows by 223 bytes because the richer v5 manifest outweighs its compressed body savings. No tiny-archive shrinkage claim is made. The implementation adds no dependency and uses the macOS Compression framework.
Summary by CodeRabbit