Compress the file data of images with lz4 #16
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 321 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16"
general
weight: 0.35
fzakaria
Give
-zlz4tomkfs.erofs, so every input image holds its file data compressed. That covers store closures,--roottrees and root tars. The guest kernel already hasCONFIG_EROFS_FS_ZIP, and it decompresses a block only when the guest reads it.The images directory is now
3, so Rewind does not reuse an uncompressed image from before.Size
An image is about 56 percent of its closure. With #15, peak disk while building falls from about 3.2x the closure to about 1.6x.
Why lz4 and not lz4hc
lz4hc at its default level costs ten times the CPU for an image about 10 percent smaller. On the 433 MB input closure of hello:
| Mode | CPU to build | Image |
|---|---|---|
| none | 0.03 s | 433 MB |
| lz4 | 0.9 s | 246 MB |
| lz4hc,3 | 5.0 s | 224 MB |
| lz4hc (level 9) | 8.7 s | 221 MB |
Single-threaded, lz4hc runs at about 46 MB/s. mkfs pays that on every new closure. mkfs memory also grows with the worker count, which follows the CPU count: about 1 GB at 16 workers on a 3.5 GB closure, and more on a many-core builder.
Determinism
The image must be a function of its files alone. mkfs.erofs compresses in fixed 16 MiB segments and merges them in order, whatever the number of workers. With lz4, a 171 MB tree gave the same image with 1 worker, 16 workers and the default. With lz4hc, a 3.5 GB closure gave the same image with 1 worker, 16 workers and
taskset -c 0, and the release's static mkfs.erofs gave the same image as the dynamic one. A mkfs.erofs built without threads (--workers=0) lays the data out differently. The release ships its own threaded mkfs.erofs.Guest cost
Measured with lz4hc; lz4 decompresses faster.
The guest mounts erofs without DAX, so file data already went through the guest page cache. Compression gives up no fast path. For
rewind nixof hello:| | Uncompressed | Compressed |
|---|---|---|
| Steps (3 runs) | 123389–123410 | 123384–123648 |
| Virtual time | 11.579 s | 11.579 s |
| Guest MemFree at step 120000 | 880.7 MB | 871.4 MB |
| Host rewind RSS | 430 MB | 326 MB |
The page store grew 6.5 percent. Reading every file of a 436 MB image used 26 MB more guest memory and took 2 more steps.
The image hash is part of the run id, so this changes every run id.
Tests
an_image_holds_its_file_data_compressedpacks a 1 MiB file of one repeated line and checks that the image is under half its size. It fails if-zis dropped.docs/design.mddescribes the compression and namesimages/3.Tested: the Fediversity checks build in Rewind with lz4hc.
Assisted-by: Claude:claude-fable-5-2