Skip to content

Revert sparse snapshot blob writes (#1788) - #1895

Closed
danbugs wants to merge 1 commit into
hyperlight-dev:mainfrom
danbugs:revert-sparse-snapshot-blob
Closed

danbugs wants to merge 1 commit into
hyperlight-dev:mainfrom
danbugs:revert-sparse-snapshot-blob

Conversation

@danbugs

@danbugs danbugs commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

This reverts #1788 because sparse snapshot blobs slow down the first guest function call after a restore on Windows (WHP). Any blob written with FSCTL_SET_SPARSE costs about 35 ms extra on that first guest function call, even when the blob has no holes. Clearing the flag later doesn't fix it; only a dense rewrite does.

…ght-dev#1788)"

This reverts commit 3ef1a36.

On Windows, a snapshot blob marked with FSCTL_SET_SPARSE is slow to map
under WHP. The first guest function call after restoring from it takes
about 35 ms longer than from a dense blob. Having the flag set is enough:
a blob with no holes and a single extent is just as slow, and clearing
the flag afterwards does not help. Only a fresh dense write does.

Signed-off-by: danbugs <danilochiarlone@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 17:47
@danbugs danbugs added the C-bug For PRs that fix bugs label Oct 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

It regresses Unix snapshot performance and leaves existing Windows sparse blobs unchanged.

1 open finding
What changed in this PR

Reverts sparse snapshot blob writes to avoid WHP restore latency.

Changes:

  • Restores dense atomic blob writes.
  • Removes sparse-write code, tests, and Windows API features.
  • Removes the sparse-write changelog entry.
File Description
fsutil.rs Restores dense snapshot writes.
Cargo.toml Removes sparse-file API features.
CHANGELOG.md Removes sparse-write documentation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@danbugs

danbugs commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1898 (reopened from a branch in the main repo so CI gets the longer job timeouts).

@danbugs danbugs closed this Oct 7, 2026
auto-merge was automatically disabled October 7, 2026 18:54

Pull request was closed

danbugs added a commit that referenced this pull request Oct 8, 2026
This reverts #1788 because sparse snapshot blobs slow down the first
guest function call after a restore on Windows (WHP). Any blob written
with `FSCTL_SET_SPARSE` costs about 35 ms extra on that first guest
function call, even when the blob has no holes. Clearing the flag later
doesn't fix it; only a dense rewrite does.

Replaces #1895, which was opened from a fork and hit the shorter CI
timeouts.

Signed-off-by: danbugs <danilochiarlone@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants