perf(agc): trap label reads of small images inside pending large ones on macOS #13678

Merged
Gonic0 merged 8 commits from upstream-pr/13678 into main 2026-11-01 11:26:42 +00:00
Gonic0 commented 2026-10-30 23:35:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Gonic0 on 2026-10-30T23:35:49Z.


What

Builds on #13499. Its label trap skips an image that shares a page with another pending image, so the label stores it as before. In PPSA21564 (ASTRO BOT 01.007.000) on MoltenVK, every image the trap skipped during the intro was skipped for that reason, and each of them lies inside a large pending tiled render target: a 960x540 linear image and 120x67, 60x33 and 30x16 tiled images of 64 KiB inside 2432x1368, 1920x1080 and 3840x2160 targets. The memory is reused across passes. A label never stores those large targets (they are tiled and over SmallStoreBytes), but the small images inside them were stored at every label. Each of those stores waited for the GPU (FlushPending → Recorder::Sync), on average 7.6 ms per frame on queue 0x40.

Three changes, all macOS-only like the trap:

  • Page rule: a pending image counts as sharing a page only if a label would store it: linear, or at most SmallStoreBytes. Images being stored (pending.flushing) still count, so a storing thread never faults on a new trap.
  • Store over a trap: when FlushPending stores an image that covers a trapped one, it stores the trapped one in the same flush. Without this, the large image's store lands first and the trapped image's store lands later, at the guest's first read, over it.
  • Eviction and explicit write-back: StorageTexture::Flush() and WriteBack() store a dirty image without FlushPending, so they first store the trapped images it covers through FlushPending. Flush() is called from the storage cache's evictions and FlushCachedTextures, under the cache's mutex; cachedStorageTexture already calls FlushPending under that mutex next to its evictions, FlushPending takes GpuMutex recursively and does not wait for the GPU inside a completion, and the memory-pressure eviction only evicts clean images, for which the new step does nothing.

With these, the bytes in guest memory are the same as when the label stores the small image: the new test checks four sequences against the bytes APS5_NO_LABEL_READ_TRAP=1 leaves. Which of two overlapping images wins is still decided by the existing write-back rules (blocks stamped since an image's generation keep their bytes); this PR does not change that.

The debt entry for label read traps describes the new rule and the two stores.

Performance

Apple M5 Pro, macOS 27.2, MoltenVK 1.4.2, 3840x2160. PPSA21564 01.007.000 from boot, warm shader cache, 60 s per run, the same tree with #13499 below this change (and the open macOS port PRs), alternated. Traces cover presents 700 to 880 (APS5_TRACE_FRAMES=700:180), in the intro.

round #13499 this change frame p50 (ms) GPU busy per present (ms)
1 42.8 FPS 52.8 FPS 24.3 → 18.5 14.8 → 12.1
2 45.4 FPS 51.6 FPS 21.3 → 18.7 13.4 → 13.7
3 49.3 FPS 53.5 FPS 19.9 → 18.5 12.9 → 12.1
4 46.7 FPS 44.2 FPS 22.0 → 21.1 14.6 → 15.4
5 41.2 FPS 48.0 FPS 24.6 → 20.7 15.4 → 15.3

Averaged over the five rounds: 45.1 → 50.0 FPS for the whole run, and 22.4 → 19.5 ms frame p50 in the traced window. Round 4 was slower with the change over the whole run, although its traced window was faster; across the five rounds the base alone ranged from 41.2 to 49.3 FPS.

Queue 0x40 drops from 6.8–8.5 ms of work per frame to 1.5–2.1 ms. In earlier runs with a temporary counter and the same page rule, StoreReadbackBeforeLabel stored 230 to 3,400 images per 10 s before the change and none with it, and no trap was resolved: no guest read touched those images.

Queue 0x0 is now the busy one (14–16 ms of work per frame). One run with the change (round 2) had a 438 ms frame at present 878: queues 0x40 and 0x48 waited on memory while queue 0x0 compiled shaders at first use and ran a long dispatch (Driver.Dispatch.materialize). Every run compiles those five shaders at use, at different points; this one fell inside the traced window, and rounds 3 to 5 with the change had no frame over 27 ms.

Paired summary lines (rounds 1 and 3)

Round 1, #13499:

{"commit":"a9a7ce776ec8","dirty":null,"env":{"APS5_ASYNC_PIPELINES":"1","APS5_DUMP_FRAMES":"200","APS5_DUMP_FRAMES_EVERY":"60","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"700:180"},"gpu":"Apple M5 Pro","driver":"MoltenVK 1.4.2","os":"Darwin 27.2.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"frames 700:180","first_present":700,"ms":4250.879},"presents":180,"frame_ms":{"p50":24.257,"p90":26.021,"p99":31.414,"max":31.570},"gpu_busy_ms_per_present":14.818,"worker_busy_pct":{"queue worker 0x0":97.290,"queue worker 0x40":99.400,"queue worker 0x48":82.419,"queue worker 0x3a":0.289},"top_phases_ms_per_frame":{"Driver.Packet":65.630,"Driver.Packet.memory_wait":39.927,"Driver.Packet.dispatch":7.468,"Recorder.Sync":7.383,"VideoOut.Flip":7.136,"Driver.Dispatch":6.097,"Driver.Present":5.885,"VideoOut.Flip.present":5.855},"trace_dropped":false,"trace":"aps5-trace-a9a7ce776ec8-68653.json.gz"}

Round 1, this change:

{"commit":"6d4e29cccb37","dirty":null,"env":{"APS5_ASYNC_PIPELINES":"1","APS5_DUMP_FRAMES":"200","APS5_DUMP_FRAMES_EVERY":"60","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"700:180"},"gpu":"Apple M5 Pro","driver":"MoltenVK 1.4.2","os":"Darwin 27.2.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"frames 700:180","first_present":700,"ms":3322.796},"presents":180,"frame_ms":{"p50":18.546,"p90":19.303,"p99":21.956,"max":22.176},"gpu_busy_ms_per_present":12.088,"worker_busy_pct":{"queue worker 0x0":96.972,"queue worker 0x40":97.674,"queue worker 0x48":80.660,"queue worker 0x3a":0.237},"top_phases_ms_per_frame":{"Driver.Packet":50.566,"Driver.Packet.memory_wait":31.276,"VideoOut.Flip":7.672,"Graphics.Draw":7.015,"Driver.Present":6.504,"VideoOut.Flip.present":6.473,"Driver.Present.render_fence_wait":6.337,"Vulkan.Retire":6.337},"trace_dropped":false,"trace":"aps5-trace-6d4e29cccb37-71654.json.gz"}

Round 3, #13499:

{"commit":"a9a7ce776ec8","dirty":null,"env":{"APS5_ASYNC_PIPELINES":"1","APS5_DUMP_FRAMES":"200","APS5_DUMP_FRAMES_EVERY":"60","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"700:180"},"gpu":"Apple M5 Pro","driver":"MoltenVK 1.4.2","os":"Darwin 27.2.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"frames 700:180","first_present":700,"ms":3583.436},"presents":180,"frame_ms":{"p50":19.916,"p90":21.262,"p99":22.743,"max":25.234},"gpu_busy_ms_per_present":12.929,"worker_busy_pct":{"queue worker 0x0":97.020,"queue worker 0x40":97.840,"queue worker 0x48":83.304,"queue worker 0x3a":0.254},"top_phases_ms_per_frame":{"Driver.Packet":55.106,"Driver.Packet.memory_wait":34.107,"Recorder.Sync":9.085,"VideoOut.Flip":7.682,"Driver.Packet.flush_between_packets":7.487,"Driver.Present":6.529,"VideoOut.Flip.present":6.494,"Driver.Present.render_fence_wait":6.373},"trace_dropped":false,"trace":"aps5-trace-a9a7ce776ec8-86790.json.gz"}

Round 3, this change:

{"commit":"6d4e29cccb37","dirty":null,"env":{"APS5_ASYNC_PIPELINES":"1","APS5_DUMP_FRAMES":"200","APS5_DUMP_FRAMES_EVERY":"60","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"700:180"},"gpu":"Apple M5 Pro","driver":"MoltenVK 1.4.2","os":"Darwin 27.2.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"frames 700:180","first_present":700,"ms":3324.290},"presents":180,"frame_ms":{"p50":18.477,"p90":19.384,"p99":20.596,"max":21.599},"gpu_busy_ms_per_present":12.075,"worker_busy_pct":{"queue worker 0x0":96.459,"queue worker 0x40":97.214,"queue worker 0x48":80.299,"queue worker 0x3a":0.272},"top_phases_ms_per_frame":{"Driver.Packet":50.307,"Driver.Packet.memory_wait":31.015,"VideoOut.Flip":7.807,"Graphics.Draw":7.623,"Driver.Present":6.378,"VideoOut.Flip.present":6.348,"Vulkan.Retire":6.161,"Driver.Present.render_fence_wait":6.160},"trace_dropped":false,"trace":"aps5-trace-6d4e29cccb37-86875.json.gz"}

Traces:

Tested

On the tree above (Apple M5 Pro, macOS 27.2, x86-64 under Rosetta 2):

  • The 82 CTest entries of agc_driver_recorder_tests pass with VK_LAYER_KHRONOS_validation (one skips, as on #13499). agc_small_tiled_shadow_label passes 5 of 5.
  • All agc_*, guest_* and write_watch* CTest entries: 46 fail, the same 46 without this change.

The new part of agc_small_tiled_shadow_label puts an 8x8 linear image inside a 256x256 kR64KBX image that is pending, and checks:

  1. a label traps the small image;
  2. a store of the large image's 64 KiB block that holds it (an access next to it) stores the small image too, gives its page back and leaves the bytes a label store leaves;
  3. the same after the large image is written again after the small one;
  4. evicting the large image (Flush()) stores the trapped image inside it first;
  5. after the eviction, a label traps the small image again and a read from another thread sees its results.

Before writing the expected bytes into the test, I ran the same sequences with APS5_NO_LABEL_READ_TRAP=1 and with this change, and printed the bytes: they were the same at each step. Without the second and third changes the trap left the large image's bytes in each step, and at step 5 a read of the trapped image returned the large image's older bytes.

Negative controls, each of which fails the test:

  • the old page rule: "a label stored a small image inside a pending large tiled one instead of trapping its reads";
  • FlushPending not storing the trapped images a store covers: "a store of a large image's block left a trapped image inside it trapped";
  • no store of the covered traps before an eviction: "evicting a large image did not store the trapped image inside it first".

I also tried ordering the images of one flush (trapped ones first, or by last write) and widening the GPU wait to the added images' ranges. Neither changed any byte in these sequences, on the GPU path or the CPU path (FlushPending with idle), so neither is in this PR.

Not tested on Linux or Windows, where nothing changes.

Checklist

  • Based on #13499; 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 under Silent stubs in their library's technical debt file
  • 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: #13499
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Apple M5 Pro (MoltenVK)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5092436186 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13678). Originally posted by [Gonic0](https://github.com/Gonic0) on 2026-10-30T23:35:49Z. --- ### What Builds on #13499. Its label trap skips an image that shares a page with another pending image, so the label stores it as before. In PPSA21564 (ASTRO BOT 01.007.000) on MoltenVK, every image the trap skipped during the intro was skipped for that reason, and each of them lies inside a large pending tiled render target: a 960x540 linear image and 120x67, 60x33 and 30x16 tiled images of 64 KiB inside 2432x1368, 1920x1080 and 3840x2160 targets. The memory is reused across passes. A label never stores those large targets (they are tiled and over `SmallStoreBytes`), but the small images inside them were stored at every label. Each of those stores waited for the GPU (`FlushPending` → `Recorder::Sync`), on average 7.6 ms per frame on queue 0x40. Three changes, all macOS-only like the trap: - **Page rule:** a pending image counts as sharing a page only if a label would store it: linear, or at most `SmallStoreBytes`. Images being stored (`pending.flushing`) still count, so a storing thread never faults on a new trap. - **Store over a trap:** when `FlushPending` stores an image that covers a trapped one, it stores the trapped one in the same flush. Without this, the large image's store lands first and the trapped image's store lands later, at the guest's first read, over it. - **Eviction and explicit write-back:** `StorageTexture::Flush()` and `WriteBack()` store a dirty image without `FlushPending`, so they first store the trapped images it covers through `FlushPending`. `Flush()` is called from the storage cache's evictions and `FlushCachedTextures`, under the cache's mutex; `cachedStorageTexture` already calls `FlushPending` under that mutex next to its evictions, `FlushPending` takes `GpuMutex` recursively and does not wait for the GPU inside a completion, and the memory-pressure eviction only evicts clean images, for which the new step does nothing. With these, the bytes in guest memory are the same as when the label stores the small image: the new test checks four sequences against the bytes `APS5_NO_LABEL_READ_TRAP=1` leaves. Which of two overlapping images wins is still decided by the existing write-back rules (blocks stamped since an image's generation keep their bytes); this PR does not change that. The debt entry for label read traps describes the new rule and the two stores. ### Performance Apple M5 Pro, macOS 27.2, MoltenVK 1.4.2, 3840x2160. PPSA21564 01.007.000 from boot, warm shader cache, 60 s per run, the same tree with #13499 below this change (and the open macOS port PRs), alternated. Traces cover presents 700 to 880 (`APS5_TRACE_FRAMES=700:180`), in the intro. | round | #13499 | this change | frame p50 (ms) | GPU busy per present (ms) | |---|---|---|---|---| | 1 | 42.8 FPS | 52.8 FPS | 24.3 → 18.5 | 14.8 → 12.1 | | 2 | 45.4 FPS | 51.6 FPS | 21.3 → 18.7 | 13.4 → 13.7 | | 3 | 49.3 FPS | 53.5 FPS | 19.9 → 18.5 | 12.9 → 12.1 | | 4 | 46.7 FPS | 44.2 FPS | 22.0 → 21.1 | 14.6 → 15.4 | | 5 | 41.2 FPS | 48.0 FPS | 24.6 → 20.7 | 15.4 → 15.3 | Averaged over the five rounds: 45.1 → 50.0 FPS for the whole run, and 22.4 → 19.5 ms frame p50 in the traced window. Round 4 was slower with the change over the whole run, although its traced window was faster; across the five rounds the base alone ranged from 41.2 to 49.3 FPS. Queue 0x40 drops from 6.8–8.5 ms of work per frame to 1.5–2.1 ms. In earlier runs with a temporary counter and the same page rule, `StoreReadbackBeforeLabel` stored 230 to 3,400 images per 10 s before the change and none with it, and no trap was resolved: no guest read touched those images. Queue 0x0 is now the busy one (14–16 ms of work per frame). One run with the change (round 2) had a 438 ms frame at present 878: queues 0x40 and 0x48 waited on memory while queue 0x0 compiled shaders at first use and ran a long dispatch (`Driver.Dispatch.materialize`). Every run compiles those five shaders at use, at different points; this one fell inside the traced window, and rounds 3 to 5 with the change had no frame over 27 ms. <details><summary>Paired summary lines (rounds 1 and 3)</summary> Round 1, #13499: ```json {"commit":"a9a7ce776ec8","dirty":null,"env":{"APS5_ASYNC_PIPELINES":"1","APS5_DUMP_FRAMES":"200","APS5_DUMP_FRAMES_EVERY":"60","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"700:180"},"gpu":"Apple M5 Pro","driver":"MoltenVK 1.4.2","os":"Darwin 27.2.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"frames 700:180","first_present":700,"ms":4250.879},"presents":180,"frame_ms":{"p50":24.257,"p90":26.021,"p99":31.414,"max":31.570},"gpu_busy_ms_per_present":14.818,"worker_busy_pct":{"queue worker 0x0":97.290,"queue worker 0x40":99.400,"queue worker 0x48":82.419,"queue worker 0x3a":0.289},"top_phases_ms_per_frame":{"Driver.Packet":65.630,"Driver.Packet.memory_wait":39.927,"Driver.Packet.dispatch":7.468,"Recorder.Sync":7.383,"VideoOut.Flip":7.136,"Driver.Dispatch":6.097,"Driver.Present":5.885,"VideoOut.Flip.present":5.855},"trace_dropped":false,"trace":"aps5-trace-a9a7ce776ec8-68653.json.gz"} ``` Round 1, this change: ```json {"commit":"6d4e29cccb37","dirty":null,"env":{"APS5_ASYNC_PIPELINES":"1","APS5_DUMP_FRAMES":"200","APS5_DUMP_FRAMES_EVERY":"60","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"700:180"},"gpu":"Apple M5 Pro","driver":"MoltenVK 1.4.2","os":"Darwin 27.2.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"frames 700:180","first_present":700,"ms":3322.796},"presents":180,"frame_ms":{"p50":18.546,"p90":19.303,"p99":21.956,"max":22.176},"gpu_busy_ms_per_present":12.088,"worker_busy_pct":{"queue worker 0x0":96.972,"queue worker 0x40":97.674,"queue worker 0x48":80.660,"queue worker 0x3a":0.237},"top_phases_ms_per_frame":{"Driver.Packet":50.566,"Driver.Packet.memory_wait":31.276,"VideoOut.Flip":7.672,"Graphics.Draw":7.015,"Driver.Present":6.504,"VideoOut.Flip.present":6.473,"Driver.Present.render_fence_wait":6.337,"Vulkan.Retire":6.337},"trace_dropped":false,"trace":"aps5-trace-6d4e29cccb37-71654.json.gz"} ``` Round 3, #13499: ```json {"commit":"a9a7ce776ec8","dirty":null,"env":{"APS5_ASYNC_PIPELINES":"1","APS5_DUMP_FRAMES":"200","APS5_DUMP_FRAMES_EVERY":"60","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"700:180"},"gpu":"Apple M5 Pro","driver":"MoltenVK 1.4.2","os":"Darwin 27.2.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"frames 700:180","first_present":700,"ms":3583.436},"presents":180,"frame_ms":{"p50":19.916,"p90":21.262,"p99":22.743,"max":25.234},"gpu_busy_ms_per_present":12.929,"worker_busy_pct":{"queue worker 0x0":97.020,"queue worker 0x40":97.840,"queue worker 0x48":83.304,"queue worker 0x3a":0.254},"top_phases_ms_per_frame":{"Driver.Packet":55.106,"Driver.Packet.memory_wait":34.107,"Recorder.Sync":9.085,"VideoOut.Flip":7.682,"Driver.Packet.flush_between_packets":7.487,"Driver.Present":6.529,"VideoOut.Flip.present":6.494,"Driver.Present.render_fence_wait":6.373},"trace_dropped":false,"trace":"aps5-trace-a9a7ce776ec8-86790.json.gz"} ``` Round 3, this change: ```json {"commit":"6d4e29cccb37","dirty":null,"env":{"APS5_ASYNC_PIPELINES":"1","APS5_DUMP_FRAMES":"200","APS5_DUMP_FRAMES_EVERY":"60","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"700:180"},"gpu":"Apple M5 Pro","driver":"MoltenVK 1.4.2","os":"Darwin 27.2.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"frames 700:180","first_present":700,"ms":3324.290},"presents":180,"frame_ms":{"p50":18.477,"p90":19.384,"p99":20.596,"max":21.599},"gpu_busy_ms_per_present":12.075,"worker_busy_pct":{"queue worker 0x0":96.459,"queue worker 0x40":97.214,"queue worker 0x48":80.299,"queue worker 0x3a":0.272},"top_phases_ms_per_frame":{"Driver.Packet":50.307,"Driver.Packet.memory_wait":31.015,"VideoOut.Flip":7.807,"Graphics.Draw":7.623,"Driver.Present":6.378,"VideoOut.Flip.present":6.348,"Vulkan.Retire":6.161,"Driver.Present.render_fence_wait":6.160},"trace_dropped":false,"trace":"aps5-trace-6d4e29cccb37-86875.json.gz"} ``` </details> Traces: - round 1, #13499: [round1-13499.json.gz](https://github.com/user-attachments/files/34205557/round1-13499.json.gz) - round 1, this change: [round1-this-change.json.gz](https://github.com/user-attachments/files/34205556/round1-this-change.json.gz) - round 3, #13499: [round3-13499.json.gz](https://github.com/user-attachments/files/34205555/round3-13499.json.gz) - round 3, this change: [round3-this-change.json.gz](https://github.com/user-attachments/files/34205552/round3-this-change.json.gz) ### Tested On the tree above (Apple M5 Pro, macOS 27.2, x86-64 under Rosetta 2): - The 82 CTest entries of `agc_driver_recorder_tests` pass with `VK_LAYER_KHRONOS_validation` (one skips, as on #13499). `agc_small_tiled_shadow_label` passes 5 of 5. - All `agc_*`, `guest_*` and `write_watch*` CTest entries: 46 fail, the same 46 without this change. The new part of `agc_small_tiled_shadow_label` puts an 8x8 linear image inside a 256x256 `kR64KBX` image that is pending, and checks: 1. a label traps the small image; 2. a store of the large image's 64 KiB block that holds it (an access next to it) stores the small image too, gives its page back and leaves the bytes a label store leaves; 3. the same after the large image is written again after the small one; 4. evicting the large image (`Flush()`) stores the trapped image inside it first; 5. after the eviction, a label traps the small image again and a read from another thread sees its results. Before writing the expected bytes into the test, I ran the same sequences with `APS5_NO_LABEL_READ_TRAP=1` and with this change, and printed the bytes: they were the same at each step. Without the second and third changes the trap left the large image's bytes in each step, and at step 5 a read of the trapped image returned the large image's older bytes. Negative controls, each of which fails the test: - the old page rule: "a label stored a small image inside a pending large tiled one instead of trapping its reads"; - `FlushPending` not storing the trapped images a store covers: "a store of a large image's block left a trapped image inside it trapped"; - no store of the covered traps before an eviction: "evicting a large image did not store the trapped image inside it first". I also tried ordering the images of one flush (trapped ones first, or by last write) and widening the GPU wait to the added images' ranges. Neither changed any byte in these sequences, on the GPU path or the CPU path (`FlushPending` with `idle`), so neither is in this PR. Not tested on Linux or Windows, where nothing changes. ### Checklist - [x] Based on #13499; 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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: #13499 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: Apple M5 Pro (MoltenVK) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!13678
No description provided.