fix(agc): read the pipeline cache header through the long-path form on Windows #8554
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8554"
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 aarushkha on 2026-10-20T16:25:49Z.
What
PipelineCache::readHeaderopened the cache file with a plainstd::ifstream(path).readFile(throughShaderRecompiler::ReadWholeFile) and the atomic writer already resolve the path withNativeCachePath_nid_no_patch. On Windows, past MAX_PATH, the header read fails while the full read and write succeed.savethen compares a missing on-disk header withsettledFile, treats the file as changed, and re-reads and merges it on every save. This is the remaining header reader confirmed in #7452.On Windows the header is now read through the extended path, as
PipelineJournaldoes for its directory. If the path cannot be resolved, it returnsstd::nullopt, matching a failed open.readFilehad the same gap in its fallback: when the full read fails it callsstd::filesystem::existsto tell a missing file from an unreadable one, and used the plain path. Past MAX_PATH an existing file was reported missing instead of unreadable, sosavecould write over it. It now checks the extended path too. This was listed in the review of #7462 and is not part of #7933 or open #7945. Linux and macOS are unchanged.Tested
Windows 10 Pro (10.0.19045), WinLibs GCC 15.2.0 posix UCRT r7, Release, full build with
-DBUILD_TESTING=ON, NVIDIA GeForce RTX 3060 (driver 617.42). Both commits applied tomain83751168dd(they cherry-pick cleanly; this branch's own base is older).PipelineCache.cppcompiles with no warnings.ctest --test-dir build -R "^agc_pipeline_cache(_file)?$"withANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1:agc_pipeline_cacheagc_pipeline_cache_filemain83751168ddmain+ this PRThese tests write the cache under a short temporary path, so they check that the change does not break the ordinary path. They do not exercise a path past MAX_PATH. I tried that by pointing
TEMPat a 196-character directory, so the cache file lands past MAX_PATH. Onmain,agc_pipeline_cache_filethen hangs rather than failing. That matches the housekeeping hang on long extended roots that #7945 addresses, so this PR's long-path behaviour could not be measured that way, and no long-path regression is added here.Not run: the Khronos validation layer (
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation), because no Vulkan SDK is installed on this machine; Linux; a title.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)PipelineCache::readHeadergap from #7452)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-20T21:17:11Z.
Current-main integration follow-up, 2026-10-21 UTC
#8554 is merged as
042504ea2820a97e6add8c89829ea65e4244e7a1. We have now adapted the previously offered header regression to the version-directory layout: fixture adjustment2e844131db. It enumerates the current 16-digit source-version directory, keeps that listing below MAX_PATH, requires the actual cache filename beyond MAX_PATH, and retains persisted-byte equality plus the real cache-creation counter across three idle saves.The old fixture first failed because it expected a cache file directly under the configured root; that failure is retained. After the fixture correction,
agc_pipeline_cache_headerpasses 3/3 fresh serial processes on each physical GPU: RTX 5080 and AMD Radeon(TM) Graphics on Windows 11 Enterprise 26200. Required Vulkan and the loaded Khronos 1.4.363 layer; no skips, timeouts, VUIDs or validation warnings/errors. The two neighboring ordinary cache groups also pass 3/3 per GPU: 18 passing GPU processes total.Scope: experimental integration
2e844131dbon main7d7b097407a0d5d1ddd243d98f0ddc5d9cbc5420, with other title-bring-up changes. ItsPipelineCache.cppis byte-identical to that main; this is not an isolated run of #8554's former head or a literal-main whole-build result. The integration's full Windows build and explicit libraries build pass. No new negative-control run, failed-read/existence fault injection, title-speed or console claim. No production change or competing PR here. The earlier control and authorship/proposal history remain below.AI-assisted: yes (Codex); author responsible.
Original regression offer and historical controls
@aarushkha there is an existing focused regression for the header half that you can reuse:
8d4b4914f0, offered in #7462. Itsagc_pipeline_cache_headermode keeps the directory at 220–249 characters and makes only the filename cross MAX_PATH, so it does not need an oversizedTEMP. It checks exact persisted bytes and counts real cache creations: three idle saves must neither reload the unchanged cache nor alter the bytes.The recorded test-only control failed 3/3 on RTX 5080 and 3/3 on Radeon Graphics; the corrected old composition passed on both with Khronos validation. Those results are pinned to main
0d078f75d3+ #74623df970aeb7+ the offered commit, not this PR's current head. Full details and limitations are in that earlier report. The fixture needs adaptation to current main and cannot substitute for a regression of your separate failed-read/existence check.I will not open a competing header-reader PR. Please preserve original authorship if you take the fixture; your existence-check correction remains your separate contribution. AI-assisted: yes (Codex); author responsible.
Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-21T23:36:34Z.
Follow-up regression coverage is in #9013,
8b01446efc, maina6dcea9279; original fixture authorship preserved. It checks long cache filenames while keeping the directory below MAX_PATH, idle saves without reload, and locked-file diagnostics/byte retention.Current baseline passes both existing cache cases; candidate passes all 3 (Windows 11, RTX 3050 Laptop/617.42, GCC 15.2.0-r7), no skips, missing validation layer or VUIDs. Independent header/existence controls on
27c88a8d75each fail their expected assertion; restoring passes 3/3. No Linux/title/full-suite claim. AI-assisted: yes.