fix(shader): preserve compiler options in captured requests #24721
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24721"
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 JJenkx on 2026-11-21T00:16:14Z.
What
Captured requests currently lose two sampling flags and nine target options, including buffer robustness, synchronization and host f16 NaN handling. Replay then restores false defaults and can emit different SPIR-V. Format 66 preserves those values alongside the split-state data introduced in upstream format 64. The reader retains upstream format 64 and earlier supported formats with their original missing-field defaults.
The tests cover 45 combinations of sampling/target options with absent, ordinary and emulated-barycentric graphics contexts, historical requests, truncation and trailing data. The shader-memory fixture normalizes current captures to format 63 before constructing older-format blobs; its semantic checks remain.
Overlap was manually checked against all 32 PRs reported by pr_overlap.py. Six writes already appear in #9508 and its dependent GPU-heap stack (#7642, #10193, #13928, #13929). This extracts the request-preservation piece for the options already on main and adds five flags not preserved there: deviceAtomicWorkgroupMemoryBarriers, float16HostNans, meshInlineFunctions, convertedSamples and layerRowSamples. It includes no heap-feature implementation. Proposed merge order: this correction first, followed by the heap stack rebasing its feature-specific fields onto the new format. No open PR is a code dependency.
Upstream #25576 assigned version 64 to split state after an earlier draft of this PR used that number for replay options. Some payloads fit either layout, so replay option-only draft captures with the original reader at
4f1338d80fdc. This PR now writes version 66. The next #20518 refresh is being tested with version 67 and a reader for its earlier mesh version 65. #23811 follows #20518.On three retained Ghost of Yotei requests from main
451f25bd26, the default replay emitted 324123 / 297994 / 270081 words. Restoring --robust2 --f16-host-nans emitted 321283 / 246862 / 269313 words, whose hashes exactly match the actual native pipeline captures. This is historical capture/replay fidelity evidence from those three requests.Additional option audit (2026-11-24): the standalone CPU witness confirms the eleven corrected options and finds that
spannedShuffleThroughMemorystill resets to false. That field is outside the nine target options covered here. That witness used the earlier draft format 64. Reproducer and scope.Tested
December 3 refresh at
84da834f4668merges mainc1593e4e1dd4. The shader patch has the same stable patch ID as the previous head. Both replay cleanup files match upstream #27860. All six focused Linux CTest entries passed on both trees. These cover request serialization, shader memory, replay cleanup, and the physical RX 6650 XT scalar-buffer and prepared-shader fixtures. Both Vulkan fixtures on each tree used Khronos validation 1.4.363, with zero VUIDs or synchronization hazards. The replay Python suite recorded 16 passes on each tree, including both mocked Darwin cleanup cases, plus six Windows-only skips.Refresh
01613958d287on Linux. Both CPU fixtures passed,request_serializerandagc_shader_memory_coherent_atomic_loads. Coverage includes split state with replay options, upstream format-64 split state with the original option defaults, truncation, and the existing older formats. The new branch also merged cleanly against upstream61426d5bf1dawith the same patch ID. The GPU results below remain pinned to the previously tested revision.Historical GPU qualification at
4f1338d80fdcLinux 7.3.5-arch1-1, AMD Radeon RX 6650 XT (RADV), Khronos validation 1.4.363, pinned Vulkan headers 335.
Independent Windows/NVIDIA validation: @throny’s report tests the earlier revision merged onto main
851212fb98, Windows 11 / RTX 4080, driver 610.88, Khronos validation 1.4.369. It reports 2,059/2,060 selected AGC tests passing, zero VUIDs on both main and change, and 1,892 confirmed layer insertions. The remainingagc_driver_store_over_untrackedfailure also occurs intermittently on main (#22670); the report finds no new failures. These are independently reported results.Upstream main:
786bc3afa1c874f98ec2990eb58179a99eeb425c. Identical-fixture control:f8547a7121e8b0a173f939a2c89b21457a320cf1. Change:4f1338d80fdc24f7da0c1d3ef9831ff3afb5f48b. The merge retains main's single-sample dither/version 63 coverage alongside the version 64 option checks; future-version refusal checks format 65. Both arms have identical serializer and shader-memory fixtures.Both complete patched/raw SDKs (
libs), relinker, replay tools and selected fixtures build. Each build restores its source/configuration/submodules; the GPU runs use unchanged, hash-verified frozen banks.The corrected GPU matrix has zero failures, skips or VUIDs on either arm. Every case shows the physical GPU and Khronos-layer insertion. Both arms use
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layerand the same tests. The frozen CTest replay now retains every registered test property, including per-test environment, failure regex, skip code, resource lock and explicit timeout. The original and applied registrations are compared using actual CTest--show-only=json-v1; only working directories are remapped to private writable directories. Verbose logs confirm each registered environment setting is present.Corrected qualification: source patches, valid CPU/build records, complete GPU logs/JUnit, registration round-trip proofs and unchanged-bank manifests, SHA-256
f795bbeba640a2b5b24202d86e1a8044aeb237de410b6a36ff391a17dd7e91d4. Downloaded again and verified all 43 payload hashes plus the payload manifest.Correction to the earlier report: the Nov20 and initial Nov21 custom GPU harness omitted per-test properties, notably
APS5_NO_MASKED_RESULT_MEMO=1for PreparedShaders. The previously reported 4/5 comparison was invalid and did not establish a baseline/source failure. The corrected 5/5 comparison above supersedes those GPU claims without a source or fixture change. The earlier receipts remain preserved, with their GPU portions invalidated.The original CPU and numeric title-replay evidence remains historical at upstream
3def8a39, controlceb30bf0and changed0886c72. Its GPU portion has the same invalidated harness limitation. No new title/FPS result is claimed. The archives contain no title assets, original modules, raw shader requests/SPIR-V, game binaries, memory or saves.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T00:47:02Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
d0886c721525e0ceab49588784109414d3511aa8against the supplied diff and prepared artifacts. No commands or tests were run in this session; the author-reported build and test results remain unverified.Results
Findings
Blocking
None found in the code reviewed.
Non-blocking
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:9127removes the 11 option bytes from the end of the request. This matches the current serializer layout, including the optional barycentric byte handled separately; a short comment describing that layout assumption could make future format edits safer.Not verified
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp,core/shader/recompiler/tests/RequestSerializerTests.cpp, anddocs/dev/debt/changes/request-replay-options.md. Read all changed ranges incore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppthrough the pinned-head reader; its full text was excluded from the prepared review folder because it is too large. No changed files were excluded from review.To get this to a good state
Nothing is required. The optional suggestion above may clarify the fixture helper's assumption.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T04:21:00Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the serializer preserves the added options and keeps older-format defaults in the code inspected.
What I ran
Reviewed head
4f1338d80fdc24f7da0c1d3ef9831ff3afb5f48bagainst the prepared diff and targeted source ranges usingrepo_read.py. No test commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas not fully read; its full text was excluded as too large. I inspected the changed ranges shown in the diff and the range around the updated version assertion. No tests or GPU runs were performed. The other changed files were read at their added-line ranges; serializer and test context were read where relevant.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T19:16:42Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed serializer preserves the added options and retains upstream format 64 compatibility.
What I ran
Reviewed head
01613958d287d7caafff1bf77ef561821a3eaa4cusing the prepared diff andrepo_read.pyfor targeted source reads. No commands or tests were run in this review. The description reports Linux CPU fixtures passed on this head; GPU results are reported for an earlier revision.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas read only around the updated format assertion; the full file was excluded from the review folder because it is too large. No tests were run. GPU behavior on this head was not verified. The other changed files listed as reviewed in the manifest were read:core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp,core/shader/recompiler/tests/RequestSerializerTests.cpp, anddocs/dev/debt/changes/request-replay-options.md.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:31:33Z.
Review: COMMENTED
request_serializerandagc_driver_gcn_scalar_buffer_basepassed on main and the patched tree. I ran both on the same Linux llvmpipe device with Vulkan required, shader cache disabled, and validation layer 1.4.369. Both logs show layer insertion and no missing-layer diagnostic orVUID-entry.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-03T15:01:09Z.
Review: COMMENTED
Actionable comments
988f4e99-1d56-488d-9d15-1a59ac6dfe13Reviewing files that changed from the base of the PR and between
01613958d2and84da834f46.core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T15:10:59Z.
Review: COMMENTED
I reran the review checks on the rewritten head.
request_serializerpassed on both main and the patched tree, including the patch's compiler-option round trips and legacy capture defaults.agc_driver_gcn_scalar_buffer_basepassed on both trees on the same Linux llvmpipe device with Vulkan required, shader cache disabled, and validation layer 1.4.369. Each log shows the layer loading and has no missing-layer diagnostic orVUID-entry.AI-assisted: yes.
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.