Repository navigation
Enable experimental sparse VHD creation - #41726
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Sparse configuration conflicts with fixed-VHD creation and can cause fixed installations to fail.
Review effort: Balanced
Findings: 1
What changed in this PR
Enables experimental sparse VHD creation and removes the unsafe-flag requirement.
Changes:
- Honors
experimental.sparseVhdduring VHD creation. - Emits a localized experimental warning.
- Updates sparse-mode and legacy-flag tests.
| File | Description |
|---|---|
test/windows/SimpleTests.cpp |
Updates sparse VHD coverage. |
src/windows/service/exe/LxssUserSession.cpp |
Allows sparse mode without --allow-unsafe. |
src/windows/common/WslCoreFilesystem.cpp |
Enables sparse VHD creation and warning. |
localization/strings/en-US/Resources.resw |
Replaces the disabled warning with an experimental warning. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Blue (OneBlue)
approved these changes
Sep 29, 2026
4 of 6 tasks
seathatflowsinourveins (seathatflowsinourveins)
added a commit
to seathatflowsinourveins/native-agent-stack
that referenced
this pull request
Oct 6, 2026
…n tools; reclaim WSL VHDX with wsl --manage --compact (#753) ### Scope One anti-pattern log row in `docs/harness-defaults.md`, following the user's 2026-10-05 request to resolve the core reasons for NativeStack's disk growth. Lane: foundation. The row's facts: - NativeStack's root fell to 191 GB free, and its VHDX on Z: grew to 1,065 GB for 765 GB used. - The bulk was finished work: 403 worktrees, 124 GB of `/var/tmp` build scratch from a session that had ended, 56.5 GB of 1,802 byte-identical fixture-binary copies, 27.8 GB of per-session index databases, about 75 GB of superseded gateway builds, and 30 GB of unused images. - The cleanup reached 529 GB free, with every uncommitted change and the one local-only gateway patch preserved first. The rule closes each job with each tool's own command. It reclaims VHDX space with WSL 3.0.1's native `wsl --manage--compact`, and leaves sparse VHD off while WSL refuses it without `--allow-unsafe`. ### SOTA sources - [git-worktree](https://git-scm.com/docs/git-worktree): `remove` refuses unclean worktrees without `--force`. - [uv `cache prune`](https://docs.astral.sh/uv/reference/cli/#uv-cache-prune) and [docker `image prune`](https://docs.docker.com/reference/cli/docker/image/prune/). - microsoft/WSL: - [PR #40481](microsoft/WSL#40481): `--compact` force-terminates the target distro and runs an offline `e2fsck -E discard` before `CompactVirtualDisk`; - tag 3.0.1, `src/windows/service/exe/LxssUserSession.cpp:1761-1921`, where `--set-sparse true` is refused without `--allow-unsafe`; - [PR #41726](microsoft/WSL#41726): lifts that refusal in tag 3.0.2 and marks sparse experimental. ### Evidence-class table | Claim | Evidence class | Source | | --- | --- | --- | | Sizes and counts | host measurement on NativeStack (`du`, `df`, `git worktree list`) | the coordinator's private actions log | | WSL compact and sparse behaviour | upstream source review at tag 3.0.1, plus PRs | the links above | | git, uv and docker commands | upstream docs | the links above | ### Local commands run - `uv run --no-project --with pyyaml python -m unittest` over the 416 tests that reference `harness-defaults.md`: OK (2 skipped). - `python3 scripts/validate.py`: exit 0, after the registry-last commit. - `python3 scripts/validate_convergence.py --all-recorded`: exit 0. - The login-name scan is clean. ### Decision record None new; the anti-pattern log row is the record. ### Host evidence Sanitized counts only. No host paths or user names. ### Checklist - [x] No GitHub Actions or workflows changed. - [x] No secrets printed, logged or committed. - [x] No paid hosting or billing surface. - [x] Peer-owned untracked files and worktrees preserved. Each peer pruned its own data; the coordinator removed only data from ended sessions and its own lane, by literal target. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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
experimental.sparseVhdwhen creating new distribution VHDswsl --manage --set-sparse true without requiring--allow-unsafe, while continuing to accept the legacy flagValidation
cmake --build . -- -mbin\x64\Debug\test.bat /name:*CheckSparse*