Repository navigation
tar follow-ups: snapshots on the tar engine, reads that end with their data - #1908
Merged
Merged
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues were found.
|
zechengz
force-pushed
the
claude/tar-followups
branch
from
October 27, 2026 20:50
8a22234 to
4abc999
Compare
zechengz
added a commit
that referenced
this pull request
Oct 27, 2026
log --graph draws a fork the way 2.56 does, -h exits 0 with its usage on stdout, an ambiguous abbreviation prints the usage on stderr, and the long option tables follow 2.56's --help-all. Split out of #1908 so main goes green without the tar work.
…end with their data, mirage's git as CI's git 2.56 Snapshots (both hosts) read and write their tar through mirage-rs's tar instead of tarfile and modern-tar: the manifest first, each blob after it, a disk mount's file staged as it arrives, old pax and compressed snapshots read as before. modern-tar leaves the npm tree. A gathered Read that reaches the end of its input sends its last bytes with end, so tar -c and zip ask once less per member. CI's runner moved to git 2.56.0: -h and --help exit 0, log --graph draws a root apart from the commit below it, an ambiguous option's usage goes to stderr, and git branch has --forked, --delete-merged and --dry-run. Mirage follows on both hosts, with integ cases. The native lists keep only forms git 2.54 to 2.56 answer alike (the read-only fixture's shared skew commit now has a parent); the 2.56-only graph forms are pinned next to them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…opy; keep a header an unset key shares read_tar and readTar read past a member the manifest names no blob for instead of holding it, so a small compressed upload cannot expand into memory. A staged file's writer is aborted when its copy into the file fails, so a restore reports the failure rather than waiting on it; writeTar shares that writer. Taking an upstream's keys out of a branch section keeps a header that one of them shared a line with, as git 2.56 does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…perands alone A blob path such as ./b//f is written as given, but tar's -x names the member b/f: both hosts now key held and staged blobs by that member name and look a reference up the same way, so such a snapshot reads back. rev-list, rev-parse and diff-tree take -h as help only when it is the verb's one operand and no option of the verb's came with it, instead of when the line ends in the verb's name and -h; the integ case pins a branch named after the verb and an option beside -h, as git 2.56 refuses both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…blob named elsewhere too Two blob paths that tar's -x gives one member name (b/f and ./b//f) are refused when the snapshot is written, and a member stored twice is refused when it is read, so distinct blobs never come back as the same bytes. A disk file staged on restore that the manifest also names elsewhere is held in memory as well, so that other reference still resolves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zechengz
force-pushed
the
claude/tar-followups
branch
from
October 27, 2026 23:34
ca8022a to
12eeca9
Compare
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.
Summary
This PR does two things on both hosts:
tar_ioonto mirage-rs's tar engine;Readcarry end-of-input with its last bytes.The git 2.56 work that started here landed separately as #1909; this branch now takes main's version of every git file, so none of that is in this diff.
1. Snapshots on the tar engine
write_tar/read_tar(Python) andwriteSnapshotTar/readSnapshotTar/writeTar/readTar(TypeScript) now drive thetarstream with a small host:stagingas it arrives, and every other blob is held in memory.tarfileis gone from the snapshot path and the server's load route.modern-taris gone from core's dependencies, the lockfile and the tests:.tgzwith mirage's owntar -cz.tarfile(pax, plain,.gz,.xz) still load.././@LongLinkfor long names, and read back fine intarfile.staging;2. A gathered
Readends with its dataStreamHost (both hosts) now sends
endtogether with the last bytes of aleastread that reaches end-of-input. Patch's host already did.tar's and zip's readers use those bytes and then stop. Before, each member cost one more round trip to learn the input had ended.
The Rust test host does the same, so tar's and zip's unit tests exercise it.
Measured on a disk mount, eight runs each:
tar -cof 1,000 × 100 KiB filestar -cof one 200 MiB filetar -cof the whole 298 MiB treeThe gain is small (1–2%) and about the size of the noise at a load average around 6. The extra round trip was cheaper than tar: one Rust engine for both hosts #1893 estimated.
Size
+608 / −316 lines over 21 files: snapshots are most of it, the read change +66 / −30. Driving the engine needs a small host per side, which costs more lines than calling
tarfileandmodern-tardid; in exchangemodern-tarleaves the npm tree.Verification
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings(withPYO3_PYTHONset to the venv), and-p mirage-rs-wasm --target wasm32-unknown-unknown: clean.cargo test --workspace: all pass, 592 inmirage-rs.uv run pytest -n 8before the latest merge: 33,972 passed, 1 failed. The failure,test_cancelling_a_call_kills_what_the_child_started, is a timing-sensitive sandbox test; it passed 3 out of 3 alone.jsand runtime tests, which exit 127 becauseqjs-wasiisn't installed locally; it's the same set as on main.tsc: clean.check_symbol_parity --strict: baseline lowered from main's 2,913 to 2,910.check_layout_parity --strict,check_barrel_surface,check_case_targets --strict(27),check_spec_parity(101 commands, 12 CLI trees),check_cli_cold_start,check_release_artifactsandcheck_dependency_licenses --python --npm(917 packages): pass.🤖 Generated with Claude Code