VFS: respect PLS quotas in legacy disk-space queries #2798

Closed
CryingLaughing wants to merge 1 commit from upstream-pr/2808 into main
CryingLaughing commented 2026-11-26 14:06:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CryingLaughing on 2026-11-26T14:06:20Z.


The legacy GetDiskFreeSpaceW and GetDiskFreeSpaceA calls reported host-volume capacity on paths inside persistent local storage. Apply the existing byte-based PLS quota to the returned cluster counts and preserve native cluster geometry, results outside the quota mount, and missing-path failures.

What is in it

  • In crates/xcl/src/vfs_hooks.rs, share the PLS usage calculation between byte-based and legacy cluster queries. Clamp the reported free and total clusters to whole clusters within the quota.
  • Extend crates/xcl/tests/pls_quota.rs to check the wide and narrow calls, a full quota, and host, temporary-drive, and missing-path controls.

Tested

  • Revision a10a6ca355a80ba4a5ecb8df790a18e2e19560e0 on b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. Its tree 242afc49ec69759a3ec731bfd751eba96f398aa0 matches the tested overlay. Windows 11 25H2 build 26200.9974, Intel Core i5-13600K, RTX 4080 driver 621.01, Rust 1.100.0 x64 MSVC, and DXC 1.8.2502.11. Debug build and test profiles.
  • The focused disk_free_space_ex_reports_pls_quota test failed on the parent (0 passed, 1 failed). With 4,096-byte clusters, both APIs returned 271,951,544 free and 732,562,175 total clusters for a 1 MiB quota. On the fixed tree the same test passed 1/1. Both APIs returned 255 free and 256 total clusters before the quota filled, then 0 free and 256 total clusters at capacity. Host and T: controls retained native geometry and capacity. Missing paths retained their native failure behavior.
  • cargo build --workspace --locked -j 4 passed. cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output reported 1,435 passed, 0 failed, 47 ignored, with 29 explicit skip messages in the pass count across 37 harnesses.

Regression run

Independent retail smoke by Anon64 compared release builds of main and this exact head on an RTX 3060 12 GB (driver 581.80), Core i9-14900KF, and Windows 11 build 26200. The 60-second runs used the same title. The head retained 100.1% of the baseline frames and used 100.9% of its peak commit, with zero crashes or device removals. The run did not establish whether the title reached the changed code.

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1461 (PresentX 1462)
presents per 2 s (last 3): 10 1 1
device removals: 0
crashes: 0
peak commit: 23855 MB

PR:

xcl-smoke v1
commit: a10a6ca355a80ba4a5ecb8df790a18e2e19560e0
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1462 (PresentX 1462)
presents per 2 s (last 3): 6 1 9
device removals: 0
crashes: 0
peak commit: 24077 MB

Not tested

  • Retail PLS behavior and OEM path conversion.
<!-- greyfinch-sync:ivall/xcl:issue:5511484740 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2808). Originally posted by [CryingLaughing](https://github.com/CryingLaughing) on 2026-11-26T14:06:20Z. --- The legacy `GetDiskFreeSpaceW` and `GetDiskFreeSpaceA` calls reported host-volume capacity on paths inside persistent local storage. Apply the existing byte-based PLS quota to the returned cluster counts and preserve native cluster geometry, results outside the quota mount, and missing-path failures. **What is in it** - In `crates/xcl/src/vfs_hooks.rs`, share the PLS usage calculation between byte-based and legacy cluster queries. Clamp the reported free and total clusters to whole clusters within the quota. - Extend `crates/xcl/tests/pls_quota.rs` to check the wide and narrow calls, a full quota, and host, temporary-drive, and missing-path controls. **Tested** - Revision `a10a6ca355a80ba4a5ecb8df790a18e2e19560e0` on `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. Its tree `242afc49ec69759a3ec731bfd751eba96f398aa0` matches the tested overlay. Windows 11 25H2 build 26200.9974, Intel Core i5-13600K, RTX 4080 driver 621.01, Rust 1.100.0 x64 MSVC, and DXC 1.8.2502.11. Debug build and test profiles. - The focused `disk_free_space_ex_reports_pls_quota` test failed on the parent (0 passed, 1 failed). With 4,096-byte clusters, both APIs returned **271,951,544 free and 732,562,175 total clusters** for a 1 MiB quota. On the fixed tree the same test passed 1/1. Both APIs returned **255 free and 256 total clusters** before the quota filled, then **0 free and 256 total clusters** at capacity. Host and `T:` controls retained native geometry and capacity. Missing paths retained their native failure behavior. - `cargo build --workspace --locked -j 4` passed. `cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output` reported **1,435 passed, 0 failed, 47 ignored**, with 29 explicit skip messages in the pass count across 37 harnesses. **Regression run** [Independent retail smoke by Anon64](https://github.com/xcl-dev/xcl/pull/2808#issuecomment-7195248029) compared release builds of main and this exact head on an RTX 3060 12 GB (driver 581.80), Core i9-14900KF, and Windows 11 build 26200. The 60-second runs used the same title. The head retained 100.1% of the baseline frames and used 100.9% of its peak commit, with zero crashes or device removals. The run did not establish whether the title reached the changed code. main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1461 (PresentX 1462) presents per 2 s (last 3): 10 1 1 device removals: 0 crashes: 0 peak commit: 23855 MB ``` PR: ``` xcl-smoke v1 commit: a10a6ca355a80ba4a5ecb8df790a18e2e19560e0 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1462 (PresentX 1462) presents per 2 s (last 3): 6 1 9 device removals: 0 crashes: 0 peak commit: 24077 MB ``` **Not tested** - Retail PLS behavior and OEM path conversion.
Anon64 commented 2026-11-26 15:03:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-26T14:44:11Z.


Regression run of a10a6ca on a newer retail title: no device removal, no crash, frames and commit within the limits.

Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main b49be18 (this PR's base) and of this PR's exact head, scripts/smoke.ps1 -Game <title> for 60 s with XCL_NETWORK=0 and A pressed every 4 s from 20 s. Main ran before and after a batch of 11 PRs and peaked at 23,855 and 23,844 MB, so the baseline held steady over the batch.

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1461 (PresentX 1462)
presents per 2 s (last 3): 10 1 1
device removals: 0
crashes: 0
peak commit: 23855 MB

this PR:

xcl-smoke v1
commit: a10a6ca355a80ba4a5ecb8df790a18e2e19560e0
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1462 (PresentX 1462)
presents per 2 s (last 3): 6 1 9
device removals: 0
crashes: 0
peak commit: 24077 MB

100 % of main's frames, 100 % of its peak commit. One run each.

Not tested: the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD.

AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7195248029 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2808#issuecomment-7195248029). Originally posted by [Anon64](https://github.com/Anon64) on 2026-11-26T14:44:11Z. --- **Regression run of `a10a6ca` on a newer retail title: no device removal, no crash, frames and commit within the limits.** **Setup:** RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main `b49be18` (this PR's base) and of this PR's exact head, `scripts/smoke.ps1 -Game <title>` for 60 s with `XCL_NETWORK=0` and A pressed every 4 s from 20 s. Main ran before and after a batch of 11 PRs and peaked at 23,855 and 23,844 MB, so the baseline held steady over the batch. main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1461 (PresentX 1462) presents per 2 s (last 3): 10 1 1 device removals: 0 crashes: 0 peak commit: 23855 MB ``` this PR: ``` xcl-smoke v1 commit: a10a6ca355a80ba4a5ecb8df790a18e2e19560e0 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1462 (PresentX 1462) presents per 2 s (last 3): 6 1 9 device removals: 0 crashes: 0 peak commit: 24077 MB ``` 100 % of main's frames, 100 % of its peak commit. One run each. **Not tested:** the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD. AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2798
No description provided.