Windows shader and pipeline caches cannot persist under long host paths (PPSA99902) #7452
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T08:08:48Z.
Merged fixes verified — 26 October2026
Closing after the previously outstanding current-main path verification. Literal main
5b5d24cb223ede690fe5eab1fe2f7a1736b801a5contains the tracked production corrections from #7933/#7462,#8554,#8580 and#7945. 16focused checks pass:10CPU and6physicalGPU,zero validation diagnostics/skips/timeouts;maximum2.184s.Coverage:shared mapped-file reads;ordinary shader disk cache;Windows cache persistence/mapped SPIR-V and pack loading beyondMAX_PATH;all7prebuilt-discovery path modes(plain,relative,plain-long,extended,extended-forward,device,extended-long);pipeline cache file/header/reuse once on each RTX5080 and Radeon iGPU. The long-path header case checks idle-save reuse and that an unreadable cache logs the error while retaining the existing file. Full native/relinker/real-fixture build and stable pre/post binary hashes verified.
Windows11Enterprise26200/localNTFS,WinLibsGCC15.2r7 Release,RTX5080/621.01 and Radeon/32.0.21045.16010;actual GPU/layer identity and required Vulkan verified for GPU cases. Namespace-root eviction remains intentionally skipped and the long device-alias stamp limitation remains documented debt. This does not claim every Windows namespace operation is implemented.
The separate SMB retained-reader replacement problem remains open in #10833. No fresh title/end-to-end SMB persistence,cache-performance benefit or full-suite claim. Exact fixture/source pins and full logs. AI-assisted:yes(Codex).
Previous evidence and source-pinned history
Current coverage, 2026-10-21 UTC
#7933 merged as
d14a186f46, carrying #7462's shared helper with its original authorship and our credited mapped-reader corrections. #7462 was closed as covered. Journal and mapped entry/pack fixes are upstream.#8580 has also merged, as
01fbf1060d0c66883a800d75678e61ac7675083c, present in checked mainc8301bbca5. It handles native Windows paths while discovering prebuilt packs/loose cache directories. This updates the source/status coverage; we have not performed a fresh runtime test of that merge.#8554 and #7945 have now both merged, as
042504ea2820a97e6add8c89829ea65e4244e7a1and854a514bbe070bfa4322aec040e796d46813895e, respectively. #8554 coversPipelineCache::readHeaderand the failed-read existence check; #7945 avoids unsafe namespace-root directory traversal. Thus the previous reason to hold this issue for an unmerged #7945 is obsolete.All tracked production corrections are now upstream in checked main
27c88a8d75caa49e1f143594cd657d6368ab5563. Remaining: focused current-main verification of these paths together before closing this report, not another duplicate implementation. #7945 intentionally skips namespace-root eviction; its long device-alias stamp limitation remains documented debt. Our header-regression offer and historical evidence below retain their original pins; we have not freshly runtime-tested these merges. No new title, SMB end-to-end or performance result, and no claim that cache persistence causes level-loading behavior.AI-assisted report maintenance: yes (Codex).
Original reproductions, proposed corrections and validation at their recorded pins
Failure
Sonic Unleashed Recompiled (PPSA99902, #3036) logs shader-cache write failures and cannot persist its Vulkan pipeline cache when the default cache is beside the converted executable under a long Windows host path:
The first path is abbreviated above; its actual length is 269 characters, and its parent directory exists. The title uses integration 8d4b244dac on main1c523, the standard a515 converted executable, unchanged original configuration, and the default cache settings. This is not an unchanged-main whole-title result. Menu/cinematic rendering continues; this report establishes failed cache persistence, not the cause of level loading or an FPS change.
Isolated current-main reproduction
ShaderCacheDirectory.hppon main ed01d79d3c is byte-identical to the tested integration header (Git blob84fbd1ae361a7243165fe3c638eeb5e87b967d5c). A standalone Windows program calls the real inlineWriteFileAtomicallyandReadWholeFilehelpers with four-byte synthetic data. It makes an existing 150-character absolute parent directory, then uses filenames giving these total path lengths. Each row reproduced in 3 fresh processes:All direct extended-path writes/readbacks match the original four bytes. The 235-character destination is below MAX_PATH, but the helper appends a unique
.tmp.*suffix before opening it. Merely passing an extended path into the existing atomic writer also fails, including the short control, so adding a prefix at the caller is not a validated correction.Minimal shape of the probe, compiled with
g++ -std=c++23 -O0 -I core/shader/recompiler probe.cpp:Pass a fresh short absolute directory as argv1. Windows11 Enterprise26200, WinLibs GCC15.2.0 r7/UCRT.
LongPathsEnabled=1; the standalone probe has no long-path-aware manifest. Microsoft's long-path documentation describes the separate application opt-in and extended path form. #4618 opted inrelinker.exe, not converted executables; the runtime library should not assume that host opt-in.Scope and follow-up
This concerns host shader/pipeline cache I/O, separate from merged guest
fopen#7187 and gueststat#7196. #6771 moves the pipeline-cache file into a source-version directory and does not correct these file opens. At issue creation, searches for cache long paths/MAX_PATH/WriteFileAtomically found no matching open or merged fix.AlexanderCalli's #7462 now proposes the shared writer/reader correction. Its existing tests and our additional host-path checks pass on Windows. Independent validation and an additional mapped-entry/pack gap record the exact source pins, successful-write checks, repeated failures and correction.
The focused fork proposal
0a3621bbbf, based on that exact PR and current maincb1, reuses its helper for the two remaining mapped opens. The regression verifies correct published bytes, mapped SPIR-V and prebuilt-pack round trips. Full Windows/Linux builds of0a3621bbbfpass (SPIRV-Tools ON), with 51 selected test passes across RTX5080, AMD integrated graphics, Windows CPU and Linux/lavapipe, plus one explicit Linux pipeline-cache skip. The linked validation comment gives the exact matrix and analysis limits. The parent PR also needs its independently reproduced cross-drive test correction, proposed on the fork. The integration has now been refreshed to main9caecfdwith these changes at e4c6c8f970; its runtime libraries and12 repeated cache checks pass. Ordinary180s/90s RTX5080 replays now confirm 60 shader writes followed by56 shader hits with zero misses/load failures, plus successful reload of5461.2KiB from the original269-character pipeline-cache file. Each replay hash-restores145 prior files, including3 cache files, and verifies all127 runtime-library hashes and unchanged original inputs/configs. The short replays reach Continue/opening cinematic and establish persistence/readback; they do not revalidate sustained gameplay or establish an FPS/speed change. Full current evidence. This deeper-directory case is additional coverage; it is not established as the cause of Sonic's original startup time. No duplicate shared-helper PR or performance claim.Remaining header reader: confirmed and proposed to #7462
The lightweight
PipelineCache::readHeaderstill uses a plain path after #7462's shared read/write correction. An AMD diagnostic counted1→4 Vulkan cache creations across three unchanged idle saves. The focused regression fails3/3 per physical GPU; reverting only the reader on the final fixture also fails on each GPU. Focused correction8d4b4914f0, on main0d078f75d3 plus exact #7462/3df970aeb7, passes full Windows/Linux builds,18 selected Windows GPU runs and6 lavapipe runs (one explicit neighboring file-merge skip). It uses AlexanderCalli's helper and provides an idle-save regression; the fixture keeps directory listings belowMAX_PATH. Maintainer-directed proposal and exact validation. This confirms redundant cache reloads, not a measured title speedup. Other single-file and directory-housekeeping review points remain tracked in #7462.AI-assisted: yes, Codex; author responsible for the report and validation.
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-18T11:00:09Z.
I am looking into this Windows path length limitation in
ShaderDiskCacheand pipeline cache persistence, and will open a PR shortly with extended-path (\\?\) handling and regression tests.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T12:53:20Z.
For coordination, @pushkarreddyy: #7462 already provides the shared extended-path helper. Its latest reviews list the remaining file-I/O and directory-housekeeping cases. We have supplied tested mapped-cache and relative-path fixture corrections there, and now a verified header-reader follow-up. That thread has the current implementation and evidence for coordinating the remaining work.
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-18T16:41:30Z.
Thanks @Amoenus for the heads-up and coordination note! Understood—I will stand down on this path so as not to duplicate effort, and leave the extended-path handling and cache persistence follow-ups to #7462.