HLE: honor available disk space in storage prompts #3190
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3190
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3190"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 11:31 UTC · original
andrewpozdnakov7-jpg:codex2/pls-available-space→main· +48 −2 · 1 files · 1 commits · openProblem
The persistent local storage prompt completes immediately. It currently compares the request with the remaining quota, even when the storage query says the host disk can supply fewer bytes. A title can receive
S_OKand then retry an operation with the same insufficient space.Use the
available_freevalue already calculated by the storage query. This accounts for both the remaining quota and the host disk's free space. GDK space informationVerification
On
63bcca43, the same synthetic fixture requests 301 bytes with 300 available and 900 remaining in the quota. The async status and result both returnS_OKon main. Both returnE_ABORTwith the change. Requests of zero bytes or exactly 300 bytes still succeed. The fixture also covers quota-limited and maximum-size requests.Full HLE library tests with default features and diagnostics, strict HLE Clippy in both configurations, and the repository asset policy passed. The disk capacity is synthetic so the test can run on any host volume.
Coordination claim
AI-assisted with Codex.
@AurumCarlos on GitHub · 2026-11-26 12:07 UTC · original · reviewed
Looks good to me. I read it together with
space()andxasync::finished:space()already buildsavailable_freeasfree.min(disk_free(..)), so the prompt now uses the same "writable now" figure thatspace_inforeports at 0x28. A title that checks the space and then prompts gets a consistent answer. When the disk isn't the limit,available_free == total_free, so nothing changes in that case. On non-Windows hostsdisk_freereturnsu64::MAX, so behaviour there is unchanged too.finish_space_prompt: passingSpaceInfoin is a nice way to test the disk-limited case without needing a full disk. The test drives the same path the vtable entry does (finished→XAsyncGetStatus→prompt_result).(disk_limited, 301)and(disk_limited, 900)are the ones that flip fromS_OKtoE_ABORTwith this change. Thequota_limitedrows pass onmainas well, since thereavailable_free == total_free. They're fine as guards for the quota limit, but a short comment saying so would make it clear they aren't part of the regression.One nit: the old doc comment on
prompt_for_spaceexplained why it completes immediately ("There is nobody to ask"), and the new one drops that. Maybe keep both parts, e.g.:@cloph-dsp on GitHub · 2026-11-26 12:12 UTC · original
Independent local verification of head
4f06549on Windows 11, Rust 1.100.0/MSVC:cargo test --locked -p victory-hle --lib -- --exact modules::storage::tests::prompt_rejects_space_the_host_cannot_supply— 1 passed, 0 failed.git diff --check origin/main HEAD— clean.Used a worktree-local
CARGO_TARGET_DIRto avoid stale shared-target binaries. SyntheticSpaceInfo/AsyncBlockinputs only; no game assets or DRM material used. AI-assisted (Hy4 flash).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.