fix(agc): store uncompressed DCC keys at the first write of a fast-cleared image #903

Merged
Celegans12 merged 2 commits from upstream-pr/903 into main 2026-10-07 21:42:16 +00:00
Celegans12 commented 2026-10-06 14:55:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-06T14:55:48Z.


What

A storage image uploaded under fast-clear DCC keys kept the clear code in memory until its write-back, so a kernel reading the keys after a write to the image still read it.

  • Change: the first write of an image uploaded under a clear code (StorageTexture::MarkDirty) stores its keys uncompressed (MarkDccUncompressed, as at the write-back) and marks its uploaded keys uncompressed, unless the title filled them with a clear code since (#163).
  • While they are, StorageTexture::ProvedKeys (Refresh, fast revalidation) reads them as the pending work leaves them: fills and our key stores note their byte (Recorder::NotePendingFill), and it waits only while those bytes still allow a clear code.
  • PPSA26344 v1.008: libSceAgc's retile kernel copies the splash image's keys into the display metadata, which made the flips black.
  • The store covers fewer keys than the console's layout, so the display keys can read mixed and VideoOut throws; with #788's DccKeyCount they read 0xff.
  • #419's CB resolve destinations (MarkDirty) get it too.
  • #1202 edits the same two key reads in fastRevalidate; whichever lands second keeps both.
Details

The splash draw (queue 0 +6617) writes a 3840x2160 image at 0x5005160000; the retile kernel (+6693) copies its keys (0x5007140000), still 0x00. The store covers 0x1fe00 of its 0x28000 keys.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0, based on main ee391a56: configure -DBUILD_TESTING=ON, full build, --target libs, ctest:
  • 369/369 tests pass (ctest --output-on-failure)
  • Same build on lavapipe (Mesa 26.2.4 llvmpipe, 8-wide subgroups, VK_DRIVER_FILES): 368/368 pass; agc_driver_flat_store is left out there because it takes several minutes on Windows llvmpipe
  • New agc_driver_dcc_keys_first_write (plain and write-watched memory): a key copy after a first write reads 0xff; a pending 0x10 fill skips the wait, 0000 fills take it and the refresh clears the image; a write marked after a 0001 key fill, before a refresh, keeps 0x40. Fails without the store or the fill check; does not build on main.
  • agc_driver_recorder_tests (not in ctest) passes on NVIDIA; its key fills now write the keys.
  • PPSA26344 v1.008 with #788: 696/700 flips show the logos (black before) on an earlier revision; this one gives the same frames, with recorded-store syncs 3.0 to 1.4 per frame.
  • Not tested: Linux (CI), console behaviour.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4760548903 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/903). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-06T14:55:48Z. --- ### What A storage image uploaded under fast-clear DCC keys kept the clear code in memory until its write-back, so a kernel reading the keys after a write to the image still read it. - **Change:** the first write of an image uploaded under a clear code (`StorageTexture::MarkDirty`) stores its keys uncompressed (`MarkDccUncompressed`, as at the write-back) and marks its uploaded keys uncompressed, unless the title filled them with a clear code since (#163). - While they are, `StorageTexture::ProvedKeys` (`Refresh`, fast revalidation) reads them as the pending work leaves them: fills and our key stores note their byte (`Recorder::NotePendingFill`), and it waits only while those bytes still allow a clear code. - **PPSA26344 v1.008:** libSceAgc's retile kernel copies the splash image's keys into the display metadata, which made the flips black. - The store covers fewer keys than the console's layout, so the display keys can read mixed and VideoOut throws; with #788's `DccKeyCount` they read 0xff. - #419's CB resolve destinations (`MarkDirty`) get it too. - #1202 edits the same two key reads in `fastRevalidate`; whichever lands second keeps both. <details><summary>Details</summary> The splash draw (queue 0 +6617) writes a 3840x2160 image at 0x5005160000; the retile kernel (+6693) copies its keys (0x5007140000), still 0x00. The store covers 0x1fe00 of its 0x28000 keys. </details> ### Tested - Windows 11, MinGW-w64 GCC 15.2.0, based on `main` ee391a56: configure `-DBUILD_TESTING=ON`, full build, `--target libs`, `ctest`: - 369/369 tests pass (`ctest --output-on-failure`) - Same build on lavapipe (Mesa 26.2.4 llvmpipe, 8-wide subgroups, `VK_DRIVER_FILES`): 368/368 pass; `agc_driver_flat_store` is left out there because it takes several minutes on Windows llvmpipe - New `agc_driver_dcc_keys_first_write` (plain and write-watched memory): a key copy after a first write reads 0xff; a pending 0x10 fill skips the wait, 0000 fills take it and the refresh clears the image; a write marked after a 0001 key fill, before a refresh, keeps 0x40. Fails without the store or the fill check; does not build on main. - `agc_driver_recorder_tests` (not in ctest) passes on NVIDIA; its key fills now write the keys. - PPSA26344 v1.008 with #788: 696/700 flips show the logos (black before) on an earlier revision; this one gives the same frames, with recorded-store syncs 3.0 to 1.4 per frame. - Not tested: Linux (CI), console behaviour. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
NahuelGenchi commented 2026-10-06 23:58:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by NahuelGenchi on 2026-10-06T23:58:46Z.


Tested c99a7bed on an R9 380 (Tonga, GFX8, RADV, Mesa 26.0.8, subgroup 64), Ubuntu 26.04, GCC 15.2, Release build.

The new agc_driver_dcc_keys_first_write test fails here every time (5 out of 5 runs, also with ANYPS5_NO_SHADER_CACHE=1). The kernel rejects the command stream ("radv/amdgpu: The CS has been rejected, see dmesg for more information (-14)"), vkQueueSubmit then returns -4 (device lost) and the test ends with "the refresh after the one that cleared the image uploaded it again". Right before that it logs "has mixed DCC keys ... its texels are read as stored" for the 128x128 format 56 storage image.

The same binary passes on llvmpipe on this machine, so it looks specific to RADV on GCN. The rest of the suite passes (367 of 368, lod_clamp skipped since the card has no shaderResourceMinLod). I also ran all agc_driver_* binaries under the Khronos validation layer with sync validation on and got no errors or hazards, the same as main. I couldn't read dmesg on this box, so I don't have the kernel side of the rejection. Happy to run anything else on this card if it helps.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6027749974 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/903#issuecomment-6027749974). Originally posted by [NahuelGenchi](https://github.com/NahuelGenchi) on 2026-10-06T23:58:46Z. --- Tested c99a7bed on an R9 380 (Tonga, GFX8, RADV, Mesa 26.0.8, subgroup 64), Ubuntu 26.04, GCC 15.2, Release build. The new agc_driver_dcc_keys_first_write test fails here every time (5 out of 5 runs, also with ANYPS5_NO_SHADER_CACHE=1). The kernel rejects the command stream ("radv/amdgpu: The CS has been rejected, see dmesg for more information (-14)"), vkQueueSubmit then returns -4 (device lost) and the test ends with "the refresh after the one that cleared the image uploaded it again". Right before that it logs "has mixed DCC keys ... its texels are read as stored" for the 128x128 format 56 storage image. The same binary passes on llvmpipe on this machine, so it looks specific to RADV on GCN. The rest of the suite passes (367 of 368, lod_clamp skipped since the card has no shaderResourceMinLod). I also ran all agc_driver_* binaries under the Khronos validation layer with sync validation on and got no errors or hazards, the same as main. I couldn't read dmesg on this box, so I don't have the kernel side of the rejection. Happy to run anything else on this card if it helps.
Celegans12 commented 2026-10-07 00:33:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-07T00:33:56Z.


Thanks for running this on the 380. Your log was enough to find it, and I'm fairly confident it's a bug in my test, not in GCN or DCC. When the device starts on Linux, the driver checks whether the kernel driver writes to imported pages, and amdgpu does: it re-faults userptr pages for write on every submission. So on any amdgpu card, host imports are taken off the write watch. My test decided its second block was write-watched before that block got imported, so its last check expected a second refresh to skip the upload, which only holds while the watch is on. I get your exact message on NVIDIA when I run that check on unwatched memory.

I'm less sure about the CS rejection, but it looks like a side effect. The failed check skipped the final wait, and the test had already freed its memory when the device was torn down. The teardown then submitted the leftover work with userptr BOs whose pages were gone, which amdgpu rejects with -EFAULT.

a8ba1c53 fixes the test. It checks the watch again once its block is imported, as the storage refresh test in Recorder.cpp does, and it frees its memory after the device. On amdgpu, the second pass now runs as unwatched. Could you run it once on that head?

ctest --test-dir build -R 'agc_driver_dcc_keys_first_write$' -V 2>&1 | grep -E 'write-watch\]|host imports are compared|teardown|tests passed'

I'd expect three lines:

  • "host imports resolve write protection: yes" from the probe;
  • "host imports are compared, not watched: the write-watched block runs as unwatched";
  • "DCC keys first write tests passed".

There shouldn't be a teardown line.

Details
  • The check that failed is the last one in the write-watched pass (DccKeysFirstWrite.cpp, the if (watched) block after the 0000 fills). The plain pass had already finished.
  • The "mixed DCC keys ... read as stored" warning is expected. The test stores 0000 over half the keys on purpose, and NVIDIA prints the warning for both passes too. On your run it was just the last driver line before the failure.
  • The import probe (decideImportWatch in GuestBufferMemory.cpp) runs at device creation. After a "yes", every import calls GuestMemory::Unwatch first. An unwatched block can't prove it is unchanged, so StorageTexture::Refresh uploads again.
  • On NVIDIA the probe reads 0 of 4 pages, so imports stay watched there. My understanding is that llvmpipe just uses the host pages as they are, so its imports stay watched too, which is why the test passed there.
  • The -4 comes from [gpu] unit shadow teardown: AGC graphics: vkQueueSubmit recorder: Vulkan result -4. ~VulkanDevice runs PublishAllShadows and recorder->Sync(), and imports are only retired lazily, so both BOs were still in that submission. dmesg probably won't show anything: as far as I know, amdgpu logs this failure only at debug level.
  • To check without rebuilding, on c99a7bed:
    • with APS5_WRITE_WATCH_IMPORTS=unwatch VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json, llvmpipe should fail the same way, without the CS rejection;
    • with APS5_NO_WRITE_WATCH=1, the test should pass on RADV.
  • The same teardown pattern could hit a game on RADV that unmaps imported guest memory while work is still queued. That would be a separate issue on main, not part of this PR.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6028177482 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/903#issuecomment-6028177482). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-07T00:33:56Z. --- Thanks for running this on the 380. Your log was enough to find it, and I'm fairly confident it's a bug in my test, not in GCN or DCC. When the device starts on Linux, the driver checks whether the kernel driver writes to imported pages, and amdgpu does: it re-faults userptr pages for write on every submission. So on any amdgpu card, host imports are taken off the write watch. My test decided its second block was write-watched before that block got imported, so its last check expected a second refresh to skip the upload, which only holds while the watch is on. I get your exact message on NVIDIA when I run that check on unwatched memory. I'm less sure about the CS rejection, but it looks like a side effect. The failed check skipped the final wait, and the test had already freed its memory when the device was torn down. The teardown then submitted the leftover work with userptr BOs whose pages were gone, which amdgpu rejects with -EFAULT. a8ba1c53 fixes the test. It checks the watch again once its block is imported, as the storage refresh test in `Recorder.cpp` does, and it frees its memory after the device. On amdgpu, the second pass now runs as unwatched. Could you run it once on that head? ``` ctest --test-dir build -R 'agc_driver_dcc_keys_first_write$' -V 2>&1 | grep -E 'write-watch\]|host imports are compared|teardown|tests passed' ``` I'd expect three lines: - "host imports resolve write protection: yes" from the probe; - "host imports are compared, not watched: the write-watched block runs as unwatched"; - "DCC keys first write tests passed". There shouldn't be a teardown line. <details><summary>Details</summary> - The check that failed is the last one in the write-watched pass (`DccKeysFirstWrite.cpp`, the `if (watched)` block after the 0000 fills). The plain pass had already finished. - The "mixed DCC keys ... read as stored" warning is expected. The test stores 0000 over half the keys on purpose, and NVIDIA prints the warning for both passes too. On your run it was just the last driver line before the failure. - The import probe (`decideImportWatch` in `GuestBufferMemory.cpp`) runs at device creation. After a "yes", every import calls `GuestMemory::Unwatch` first. An unwatched block can't prove it is unchanged, so `StorageTexture::Refresh` uploads again. - On NVIDIA the probe reads 0 of 4 pages, so imports stay watched there. My understanding is that llvmpipe just uses the host pages as they are, so its imports stay watched too, which is why the test passed there. - The -4 comes from `[gpu] unit shadow teardown: AGC graphics: vkQueueSubmit recorder: Vulkan result -4`. `~VulkanDevice` runs `PublishAllShadows` and `recorder->Sync()`, and imports are only retired lazily, so both BOs were still in that submission. dmesg probably won't show anything: as far as I know, amdgpu logs this failure only at debug level. - To check without rebuilding, on c99a7bed: - with `APS5_WRITE_WATCH_IMPORTS=unwatch VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json`, llvmpipe should fail the same way, without the CS rejection; - with `APS5_NO_WRITE_WATCH=1`, the test should pass on RADV. - The same teardown pattern could hit a game on RADV that unmaps imported guest memory while work is still queued. That would be a separate issue on `main`, not part of this PR. </details>
github-actions[bot] commented 2026-10-07 19:38:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T19:38:08Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#1202 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L1465, L1507
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6045418075 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/903#issuecomment-6045418075). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T19:38:08Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #1202 | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L1465](https://github.com/boykopovar/AnyPS5/blob/4764e59c37b1fc6c89284fdecaef5a5718b6119e/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L1465), [L1507](https://github.com/boykopovar/AnyPS5/blob/4764e59c37b1fc6c89284fdecaef5a5718b6119e/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L1507) | | |
adriadam10 commented 2026-10-07 20:09:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T20:09:11Z.

Review: CHANGES_REQUESTED


Ran it merged onto current main on RADV (RDNA2, amdgpu): build + ctest 401/401. agc_driver_dcc_keys_first_write also passes on CI's lavapipe. On amdgpu it takes the "host imports are compared, not watched" path and passes, so the R9 380 failure looks fixed by a8ba1c53 (@NahuelGenchi, a rerun on GCN would confirm it).

Negative checks: the new execution test fails without the MarkDirty store, without the wait in ProvedKeys, without the fill value in FillBuffer, and without the value on the key store. Two gaps:

  • tests/Recorder.cpp:2702-2735: agc_driver_graphics still passes with every non-test change of the PR reverted to main, and also with only the MarkDirty store disabled. Its draw doesn't reach StorageTexture::MarkDirty, so these new checks don't test this change. Please make them reach the storage-image first write, or drop them.
  • Texture.cpp:2105: nothing covers the !IsDccClear(filledKeys) guard. With it removed, both tests still pass. Recorder.cpp:2733-2735 looks meant to cover it, but see the point above. A case in DccKeysFirstWrite.cpp would pin it: a 0x40 key fill after the clear, then a storage write, and the keys must still read 0x40.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5447742860 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/903#pullrequestreview-5447742860). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T20:09:11Z. **Review:** CHANGES_REQUESTED --- Ran it merged onto current `main` on RADV (RDNA2, amdgpu): build + ctest 401/401. `agc_driver_dcc_keys_first_write` also passes on CI's lavapipe. On amdgpu it takes the "host imports are compared, not watched" path and passes, so the R9 380 failure looks fixed by a8ba1c53 (@NahuelGenchi, a rerun on GCN would confirm it). Negative checks: the new execution test fails without the `MarkDirty` store, without the wait in `ProvedKeys`, without the fill value in `FillBuffer`, and without the value on the key store. Two gaps: - `tests/Recorder.cpp:2702-2735`: `agc_driver_graphics` still passes with every non-test change of the PR reverted to `main`, and also with only the `MarkDirty` store disabled. Its `draw` doesn't reach `StorageTexture::MarkDirty`, so these new checks don't test this change. Please make them reach the storage-image first write, or drop them. - `Texture.cpp:2105`: nothing covers the `!IsDccClear(filledKeys)` guard. With it removed, both tests still pass. Recorder.cpp:2733-2735 looks meant to cover it, but see the point above. A case in `DccKeysFirstWrite.cpp` would pin it: a 0x40 key fill after the clear, then a storage write, and the keys must still read 0x40.
Celegans12 commented 2026-10-07 21:14:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-07T21:14:43Z.


Thanks for the negative checks; they're what found both gaps. I've pushed 124375cc.

  • Recorder.cpp checks: they did call MarkDirty, but they sit in agc_driver_recorder_tests, which ctest never builds or runs, so they tested nothing in CI. I dropped them and left that coverage to agc_driver_dcc_keys_first_write, which fails without the store.
  • The guard: your 0x40 case is now at the end of DccKeysFirstWrite.cpp, and with !IsDccClear(filledKeys) removed it fails on NVIDIA and lavapipe. One difference from what you suggested: a dispatch right after the fill refreshes the image first, which clears it again under 0001 and then correctly stores 0xff. So the case marks the write before any refresh has seen the fill, which is the only path that reaches the guard.

While testing this I found one sequence the guard still gets wrong: a 0x40 fill, then a kernel storing 0000 over the keys, then a storage write. On write-watched memory the refresh sees 0000, which matches the keys the image was uploaded under, so FilledKeys keeps the stale 0001 and the first write skips its store; the reader then sees the clear colour. It isn't a regression against main, which never stores at the first write, but it's the same kind of bug this PR is for, so I'll push a fix (drop filledKeys when a refresh sees keys that differ from the fill) with a test for that sequence here.

Details

Without the store: a kernel reading the keys after the first write of a 0000-cleared surface: 0 of 256 key bytes are 0xff (key 0 is 0x00)

Without the guard: a write marked after a 0001 key fill over a cleared image, before a refresh saw the fill: 0 of 256 key bytes are 0x40 (key 0 is 0xff)

Both fail the same way on an RTX 3080 and on llvmpipe. The merge with current main builds, and the DCC, image and graphics tests pass on both.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6046988953 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/903#issuecomment-6046988953). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-07T21:14:43Z. --- Thanks for the negative checks; they're what found both gaps. I've pushed 124375cc. - **Recorder.cpp checks:** they did call `MarkDirty`, but they sit in `agc_driver_recorder_tests`, which ctest never builds or runs, so they tested nothing in CI. I dropped them and left that coverage to `agc_driver_dcc_keys_first_write`, which fails without the store. - **The guard:** your 0x40 case is now at the end of `DccKeysFirstWrite.cpp`, and with `!IsDccClear(filledKeys)` removed it fails on NVIDIA and lavapipe. One difference from what you suggested: a dispatch right after the fill refreshes the image first, which clears it again under 0001 and then correctly stores 0xff. So the case marks the write before any refresh has seen the fill, which is the only path that reaches the guard. While testing this I found one sequence the guard still gets wrong: a 0x40 fill, then a kernel storing 0000 over the keys, then a storage write. On write-watched memory the refresh sees 0000, which matches the keys the image was uploaded under, so `FilledKeys` keeps the stale 0001 and the first write skips its store; the reader then sees the clear colour. It isn't a regression against `main`, which never stores at the first write, but it's the same kind of bug this PR is for, so I'll push a fix (drop `filledKeys` when a refresh sees keys that differ from the fill) with a test for that sequence here. <details><summary>Details</summary> Without the store: `a kernel reading the keys after the first write of a 0000-cleared surface: 0 of 256 key bytes are 0xff (key 0 is 0x00)` Without the guard: `a write marked after a 0001 key fill over a cleared image, before a refresh saw the fill: 0 of 256 key bytes are 0x40 (key 0 is 0xff)` Both fail the same way on an RTX 3080 and on llvmpipe. The merge with current `main` builds, and the DCC, image and graphics tests pass on both. </details>
adriadam10 commented 2026-10-07 21:26:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T21:26:15Z.

Review: APPROVED


Re-checked 124375cc merged onto current main on RADV (RDNA2): build + ctest 407/407. Both earlier points are addressed.

Mutation checks on the new test: it fails without the !IsDccClear(filledKeys) guard, without the first-write store, without the fill value in FillBuffer or on the key store, and when WaitForKeyWriters always or never waits. Two mutants survived, so I added a commit with two rows in DccKeysFirstWrite.cpp:

  • a pending 0x10 fill overwritten by a pending 0000 fill reads 0000 after waiting (kills sorting PendingFillsLeaveUncompressed oldest-first);
  • a pending 0000 fill over the first key half, with 0x10 already in memory in the other half, reads uncompressed without waiting (kills ignoring the keys in memory that no pending fill covers).

Rebased onto main, build + ctest green. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5448557589 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/903#pullrequestreview-5448557589). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T21:26:15Z. **Review:** APPROVED --- Re-checked 124375cc merged onto current `main` on RADV (RDNA2): build + ctest 407/407. Both earlier points are addressed. Mutation checks on the new test: it fails without the `!IsDccClear(filledKeys)` guard, without the first-write store, without the fill value in `FillBuffer` or on the key store, and when `WaitForKeyWriters` always or never waits. Two mutants survived, so I added a commit with two rows in `DccKeysFirstWrite.cpp`: - a pending 0x10 fill overwritten by a pending 0000 fill reads 0000 after waiting (kills sorting `PendingFillsLeaveUncompressed` oldest-first); - a pending 0000 fill over the first key half, with 0x10 already in memory in the other half, reads uncompressed without waiting (kills ignoring the keys in memory that no pending fill covers). Rebased onto `main`, build + ctest green. Merging once CI is green.
Celegans12 commented 2026-10-07 21:30:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-07T21:30:32Z.


Thanks for the two extra rows, both are good catches. I'll leave this branch as it is so it can go in, and send the stale FilledKeys fix I mentioned as a separate follow-up PR once this is merged, with the test for that sequence.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6047239019 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/903#issuecomment-6047239019). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-07T21:30:32Z. --- Thanks for the two extra rows, both are good catches. I'll leave this branch as it is so it can go in, and send the stale `FilledKeys` fix I mentioned as a separate follow-up PR once this is merged, with the test for that sequence.
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
boykopovar/AnyPS5!903
No description provided.