8000 exp: hydrate extraction A/B (do not merge) by bryan-minimal · Pull Request #4010 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

exp: hydrate extraction A/B (do not merge) - #4010

Draft
bryan-minimal wants to merge 2 commits into
mainfrom
exp/hydrate-extract-ab
Draft

bryan-minimal wants to merge 2 commits into
mainfrom
exp/hydrate-extract-ab

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

Experiment branch. Do not merge. For the A/B runs proposed in #1192 (hydrate cost). Every toggle defaults to today's behaviour, so a build with none set extracts exactly as before.

Toggles (env, read once per process)

var values (first = default) effect
MINIMAL_EXP_EXTRACT_SYNC per_file | none | end | end_files sync_all after each file / never / one syncfs(2) after the extract / fsync every file after the extract. drop(f) (the ETXTBSY guard) always stays.
MINIMAL_EXP_XZ lzma_rs | lzma_rust2 lzma_rs decodes into a tempfile (capped) and extracts from that; lzma-rust2 0.26 XzReader streams into the tar reader like gzip/zstd. Both are wrapped in catch_unwind.
MINIMAL_EXP_EXTRACT_BLOCKING 0 | 1 SourceLoad extracts inline (today) or through tokio::task::spawn_blocking.

Bench and matrix

  • crates/common/examples/extract_bench.rs runs N concurrent extractions per rep in a K-worker multi-thread runtime, either inline in a task (as SourceLoad does today) or via spawn_blocking. A heartbeat task ticks every 10 ms, and its lateness (max/p99) shows worker starvation. Output is JSONL: wall, thread CPU, files, bytes. Each tree is deleted once it has been measured.
  • scripts/exp/hydrate-ab.sh has three subcommands: list, fetch CACHE (the pkgs URLs and sha256s), and run --cache --dest --out (sync x xz x mode x concurrency, interleaved rounds, a discarded warm-up, a free-space check per cell, and the fs, device and mount options recorded on every line). It needs no root.
cargo build --release --example extract_bench -p common
scripts/exp/hydrate-ab.sh fetch ~/hydrate-tarballs
scripts/exp/hydrate-ab.sh run --cache ~/hydrate-tarballs --dest /mnt/X/hydrate-ab --out ~/hydrate-ab-results --label X

A unit test checks that every toggle combination extracts the same tree as the default, and that lzma-rust2 returns an error, not a panic, on the malformed-xz fixture.

🤖 Generated with Claude Code

…do not merge)

Experiment branch for minimal#1192. Adds env toggles, read once per process,
whose defaults keep today's behaviour:

- MINIMAL_EXP_EXTRACT_SYNC=per_file|none|end|end_files: when extracted files
  are flushed (end = one syncfs(2) of the destination's filesystem).
- MINIMAL_EXP_XZ=lzma_rs|lzma_rust2: lzma-rust2's streaming XzReader feeds the
  tar reader directly, with no tempfile.
- MINIMAL_EXP_EXTRACT_BLOCKING=0|1: SourceLoad extracts on the blocking pool.

Also adds crates/common/examples/extract_bench.rs (concurrent extractions in a
tokio runtime with a 10 ms heartbeat to show worker starvation) and
scripts/exp/hydrate-ab.sh (fetch the pkgs tarballs, run the matrix per disk).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai
coderabbitai Bot commented Dec 4, 2026
Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

The tar reader stops at its end-of-archive blocks, so the streaming decoder
never reached the xz index and footer: the malformed-xz fixture extracted
without error. Read the stream to its end so those checks run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant

0