HLE: honor available disk space in storage prompts #3188
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T11:31:38Z.
Problem
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.
Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-26T12:07:33Z.
Review: COMMENTED
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.:Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T12:12:00Z.
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).Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-27T22:22:41Z.
NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head
4f06549(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.prompt_rejects_space_the_host_cannot_supply.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.