HLE: optionally back physical page pools with temporary sparse files #2517
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2519"
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 yyc160 on 2026-11-25T15:13:07Z.
When Windows commit is tight, let the user back XMem physical page pools with sparse, delete-on-close files instead of mapping them against the system pagefile. Views of a physical page still alias the same section. The default Windows path (
SEC_RESERVE) and Wine path (SEC_COMMIT) are unchanged. This trades commit for disk space and possible I/O; it is not a GPU residency or frame-rate change.Configuration and review changes
Set
[paths].physical_pages_dirinvictory.tomlto a directory on a local sparse-capable volume with room for the pages the title writes. Leave it unset to use the system pagefile. For existing launchers,VICTORY_FILE_BACKED_PAGES=1uses the configured path or<cache_dir>/physical-pages;=0disables it even when configured.victory configshows the resolved choice. The directory is checked against the asset policy before use.create_newandFILE_FLAG_DELETE_ON_CLOSE. An existing file is never opened or truncated.tempfileis dev-only.Title startup at the submitted head (
646c17c)Four launches of the same Windows diagnostics binary built directly from this PR head, not a previous integration build. Series S title, 32 GiB host with an RTX 5070 Ti, fresh cache and private save copy for each launch. The env switch was unset throughout; only the presence of the TOML setting selected the backing. Each run was stopped after present 64.
All four reported four successful allocations totaling 74,864 logical 64 KiB pages. The first file-backed allocation was 3,520 pages (220 MiB); both sparse launches left the backing directory empty after exit. The default launches did not create it. The source title executable and seed save were unchanged. Commit headroom is system-wide, not a per-process saving; these are short startup samples, not gameplay or steady-state benchmarks.
Validation
63bcca4was tested separately; its treedc189d36matches GitHub's test merge. 153 HLE, 15 core and 14 CLI unit tests passed, along with both workspace Clippy configurations and asset policy. The optional FidelityFX SDK integration check skipped (SDK not configured). GitHub CI.AI-assisted by GPT-6.2 Astra.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:31:54Z.
Automated triage for the maintainers.
Thanks for the rebase. Reviewed at
b081ccf, which merges cleanly. CI: passing.The mechanics in
crates/victory-hle/src/modules/xmem.rsread correctly.Section::newmakes a sparse temporary file withFSCTL_SET_SPARSEand maps it withoutSEC_RESERVE.commit_viewskipsVirtualAlloccommits only for those file-backed sections. The default path keepsSEC_RESERVE, orSEC_COMMITunder Wine.The points from the earlier note are still open:
crates/victory-hle/Cargo.tomlmovestempfilefrom dev-dependencies into the runtime dependencies. No other crate ships it at runtime, so this needs the maintainer's decision.VICTORY_FILE_BACKED_PAGESenv var read inapps/victory/src/run.rs. Avictory.tomlsetting would fit the other paths better.Verdict: needs work (needs the maintainer's decision). CI: passing.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-26T23:50:05Z.
Offscreen Wine/NVIDIA verification of
646c17cc666f7f92464768cb8de45ac814558820(production unchanged; local fail-closed/test-only probes). This verifies part of the file-backed mechanism, not a title-RAM/OOM fix.Tested — Linux 6.17, Wine 11.0, Intel i7-13620H / 16 GiB RAM, RTX 4060 Laptop 8 GiB, NVIDIA 590.48.01, Rust 1.98.1, Windows MSVC target. NVIDIA masking disabled (
DXVK_CONFIG='dxgi.hideNvidiaGpu = False'). GPU runs used our diagnostic relaxed-vtable vkd3d-proton2576c0b4adfae4a+, not stock certification. Fresh compilation from this exact checkout was recorded. External 9 GiB/512 MiB scope, 2 GiB global available-RAM floor, 6000 MiB GPU ceiling and 10 GiB disk floor retained.victory-hle::modules::xmem::tests::file_backed_pages_alias_across_a_placeholder_and_storage_view: 1/1 pass, replacing its unsupported-sparse-volume early return with a hard failure. Real sparse-file storage/placeholder aliases agree in both directions; the surviving view remains usable and the file disappears after the last view.victory-core, filterpage_file: 2/2 pass (opt-in/override policy and refusing the repo directory).CopyBufferRegionsubmissions/fence completion, not shader dispatch.Shared coherence failure, not a demonstrated #2519 regression
Reproducer sequence:
XMemAllocatePhysicalPages; map both at A and map page 1 again at B throughXMemMapPhysicalPages.i * 0x9e3779b9 ^ 1, refresh and GPU-copy the shadow to a separate readback buffer; verify every word.Exactly the same failure occurs with
PAGE_FILESunset and withuse_page_filespointing at an ext4-backed directory. Thus this does not isolate a sparse-file defect. Source inspection shows the old write-watch/guard bookkeeping here is virtual-address keyed; cross-alias invalidation is the likely missing contract, not a proven new regression. Suggested follow-through: add this dual-mapping GPU regression to the current XMem/shadow tracking stack and ensure writes through one physical-page alias invalidate copies addressed through another. A current-base integration should retain its newer tracking/lifetime fixes rather than assume this older head is sufficient.Commands (wrapper supplies
--locked --target x86_64-pc-windows-msvc):Local evidence directories under
.compat-runtime/logs/:verify-pr2519-owner-20261126T234642Z,verify-pr2519-gpu-pagefile-20261126T234724Z,verify-pr2519-gpu-file-20261126T234726Z(console, exact provenance, command/environment and guard samples retained). Local probe changes are retained inVIctory-pr2519for reproduction. The failed GPU assertion occurs before the probe's later token-free/cleanup checks, so those checks are not claimed to pass; the separate owner alias/lifetime fixture did pass.Not tested: native GPU imports of file-backed memory, a multi-GB allocation, actual RAM reclamation/peak RSS, disk-pressure behavior, a current-main integration, the full suite, title loading/gameplay or performance. No title launched.
AI-assisted verification/report: omp, OpenAI GPT-6 Astra. Results above are from executed local commands, not inferred test outcomes.
27 November: mixed-stack follow-through reaches the prologue card, not gameplay
This is not an exact-head retest or a retraction of the standalone alias failure above. I ported this PR's production mechanism at
646c17cc666f7f92464768cb8de45ac814558820onto localVIctory-pr2945-fixed, base3ed7d725f6895fe1a235eb6fa8ff2485261ca151, retaining its existing alias notifications/tracked-copy lifetime changes, #2112 GPU-write notification subset and #1893e39e34037915da6d0f10b58b2872799bd9f3ca8. The integration also contains #21210bc5edbd2e1c5836bab00dc0af9f186bdd56c608plus 0xkn0wh3r3/VIctory#13ba6e876944e14260fd5522f96b85b05aa0c1baaddescriptor paging/stride fixes. Local test/census probes are present. Dirty mixed integration, not a clean upstream result.Same Wine 11 / RTX4060 Laptop / 16 GiB host and diagnostic relaxed-vkd3d
2576c0b4adfae4a+described above; not stock certification. NVIDIA masking disabled. No resource cutoff was raised.Offscreen gates: 64 combined tests passed (including sparse-section lifetime, paging recovery, stride feedback, cache policy and 34 Wave64 cases), plus two config tests and one 64 MiB copy-only coherence fixture in each of scoped-file and default-tmpfs modes. Real GPU fixtures require the physical adapter. Wine's WARP-requested legs fall back to NVIDIA, not independent software coverage. Scoped backing retained correct CPU→GPU, GPU→guest, later CPU-write and second-mapping-alias data through production copy paths, checking every word after reclamation. At four active checkpoints, the selected disk file went from 64 MiB resident to zero; tmpfs retained 64 MiB. Normal final unmap/token release deleted the scoped file. These fixtures explicitly fsync/request cgroup reclaim; the title runs below did neither.
Runtime configuration: fresh diagnostics release (55.51 s compilation, intended worktree paths recorded), Series S,
VICTORY_FILE_BACKED_PAGES=1,VICTORY_IN_PLACE=0, private tmpfs Wine/tmp, requestedVICTORY_MODE=1920x1080, window limit1280x720,DXVK_CONFIG='dxgi.hideNvidiaGpu = False'. Native disk-backed GPU imports remain prohibited by the earlier integrity failure. The actual swapchain was still3840x2160: no1080p gameplay proof. Scope9 GiB/512 MiB; global available-RAM floor2048 MiB, GPU ceiling6000 MiB, free-disk floor10 GiB.All exit137 were deliberate guard time stops, not crashes or RAM stops. Initial available RAM and caches differed; these are sequential integration smoke tests, not matched A/B savings or loading-time benchmarks. No recognizable 3D world, controllable gameplay or FPS claim.
Snapshots identify four regular files under
<cache>/physical-pagesas the live XMem backing, while other Wine temporary storage stays on tmpfs. At175 s, those files had4121.02 MiB allocated blocks; the scope had8448.6 MiB total /5448.0 MiB anonymous /2846.7 MiB file, including only3.5 MiB shmem. Allocated blocks, residency and logical spans are different measures; do not sum file+shmem. This run passed the old loading RAM gate far enough to expose later rendering failures, but does not establish a universal OOM fix or attribute the entire improvement to this PR alone.New cleanup finding: after killing the complete Wine scope, named backing files survived despite delete-on-close. Normal fixture cleanup therefore does not cover this Wine termination mode. Startup left779.67 MiB allocated; the90 s run left4039.27 MiB. I removed only exact device/inode-matched files from ended trials, after confirming inactive scopes and no open handles. The180 s run's files were handled the same way. Suggested owner follow-through: document/test Wine whole-scope/server termination and safe stale-file recovery; never unlink an active or unidentified backing object. Repeated killed runs otherwise consume disk and collide with reused names.
The later black frame has separate actionable findings:43 compute translation refusals (14 divergent64-lane ballots,23 split-wave LDS-without-uniform-fence,3 divergent reductions,3 divergent cross-lane reads), plus unsupported host texture formats67/115/86. Descriptor paging was active with zero
title slot past the host heapwarnings. These are next verification targets, not a demonstrated file-backing regression or proof of the black frame's sole cause. No unchanged black-screen retry planned.Local evidence (no title assets or imagery published):
xmem-reclaim-scoped-copy-20261127T003149Z/,xmem-reclaim-tmpfs-copy-20261127T003358Z/verify-scoped-integration-config-20261127T002321Z/,verify-scoped-paged-gates-20261127T003521Z/,verify-scoped-paged-release-20261127T003809Z/20261127T003957Z-{console.log,resources.csv},20261127T004204Z-{console.log,resources.csv},20261127T004545Z-{console.log,resources.csv}scoped-paged-trial-<stamp>/: exact command/settings, captures, ownership snapshots and guard identityscoped-backing-cleanup-20261127T004541Z.tsv,scoped-backing-cleanup-20261127T005248Z.tsv: identified orphan files, with separate empty open-handle checks.Subsequent rendering gate, still no gameplay (27 November)
Same dirty scoped-backing/paging/copy-only integration, now with #2101
4d8c89a8castable-format filter and #1701fb27a56dreported-mode override. Five targeted checks pass; fresh release42.46s. Same machine/diagnostic-relaxed-vkd3d/guards above. 180s run20261127T022056Z, A20s: prologue card120s, black150/175s, wall stop137. Minimum availableRAM4998.5MiB; GPUpeak4488MiB; scopepeak6248.9MiB; diskmin12.071GiB. No matched memory-saving claim: shader/cache/progress differ. Texture creation refusals now zero; translation/native pipeline failures remain. The native graphics log returns Vulkan-13alongside NVVM compiler failures before the wrapper reportsE_OUTOFMEMORY; this is not an OS OOM diagnosis.Resolution correction: the earlier prologue stack ignored
VICTORY_MODEand hardcoded its DXGI mode to4K. #1701 now passes an actual-output-interface1920×1080 probe, but title swapchain still4K. FSR context render1280×720/output1920×1080 was logged both before and after; neither setting nor window size proves gameplay resolution.After the new scope became inactive, four backing files were removed only after exact snapshot device/inode checks and an empty
lsofcheck:4115.14MiB allocated; user-available disk restored16.089GiB. Manifestscoped-backing-cleanup-20261127T022056Z.json; snapshots/capturesscoped-paged-trial-20261127T022056Z/. No resource limits raised, no native file-backed GPU imports, no unchanged title retry planned. Detailed rendering follow-through: https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7207265429 .Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-28T16:00:26Z.
Wine/RTX 4060 Laptop follow-through: the user observed correctly-looking rendered imagery, with severe lag, on a VIctory-NVIDIA integration using this PR's scoped-file policy. The credited code adaptation and full verification report are now public: https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1226 (head
72657763d96cd04fae7b0cc3e05e65fae5e43c3b, based on forke7d8150defa7713b6f839561c45da9a26aa88620). This is not an exact #2519-head test, a matched savings comparison, or proof of controllable gameplay/30 FPS.Wine 11, Linux 6.17, NVIDIA 590.48.1, physical RTX 4060 Laptop 8 GiB / 16 GiB system RAM, stock assertion-enabled vkd3d-proton
2576c0b4adfae4a. File-backed XMem is opt-in and excluded from native GPU import; CPU/GPU copies remain enabled. Retained fork rendering approximations/exclusions and compiler prerequisites are disclosed in the linked PR. Three stock-GPU scatter/import-generation/file-copy checks pass; the 128 KiB alias fixture verifies every word across three refresh/writeback/later-CPU-write rounds. No forced runtime fsync/reclaim.The 2026-11-28 15:48:40 UTC run reached its 9,216 MiB scope cap (
memory.events max=114,oom=0,oom_kill=0). Around 200 s, scope I/O pressure wasfull avg10=39.27; title and DirectStorage threads repeatedly blocked infolio_wait_bit_commonandbalance_dirty_pages. GPU peak was 5,903 MiB, minimum available RAM 2,349.6 MiB. These are real paging/writeback symptoms, not attribution to one backing inode or proof of the sole frame-time cause. The supervisor ended the run after its journal query timed out; kernel interval had no GPU fault/reset/OOM signature. A denied proc-syscall diagnostic produced audit messages and has been removed. Scheduled screenshots missed the scene the user saw.Suggested next owner experiment, relevant to #3012: bound in-flight streaming/decompression demand (bytes as well as workers) and compare the same reached scene with
memory.current, dirty/writeback, refault/reclaim counters, I/O PSI and frame times. Keep the external cap and RAM/GPU floors. File backing provides reclaimability, but this result does not make reclaim/refault traffic free or establish adequate throughput under pressure. Do not free GPU-pending data or raise limits to conceal the problem.Raw mapping paths, game imagery/assets and saves remain local. The PR publishes the measured results and reproducible hardware fixtures.
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.