fix(agc): import selected texture layers within registered ranges #6820

Closed
Zenodeon wants to merge 4 commits from upstream-pr/6820 into main
Zenodeon commented 2026-10-16 13:18:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Zenodeon on 2026-10-16T13:18:39Z.


What

A partially used texture array can fall back to CPU staging even when its active physical layer is importable. The whole-descriptor HostImportFor lookup fails when unused slices cross separately owned allocations. Retry the lookup for one contiguous selection of complete physical layers, then use the existing recorded GPU upload/detile path. Unsupported selections retain the existing fallback.

Prerequisites are now on main through merged #6718, including the attributed #6202 integration. Depends on: none. This branch is based on main d6eafa54d0464258574fd2f71889754d05a5bc93 and contains only the three selected-import commits: regression, implementation and Linux write-watch policy variants. Current head: fa76baa139. Incremental review against the tested main revision.

For the observed two-layer descriptors, the active 8,847,360-byte layer fits a 10 MiB import run, while the full 17,694,720-byte descriptor does not. The existing upload implementation retains import/image lifetime, records selected pending-read ranges and preserves unrelated image contents. No public API or shader-semantic changes, skipped rendering, fabricated completion, title checks or input configuration changes.

Overlap rechecked before publication. #6718 implements selected CPU fallback uploads; this enables the GPU-import route. #6197 joins import windows for a whole surface and changes the whole-range lookup contract; this change leaves that contract alone and uses an already valid selected-layer run. #6202 supplies scoped refresh. No other open PR found implementing this selected-run retry. Prerequisite authorship is retained.

The allocation-history repair is already on main through merged #6718: collection memo hits now also require the allocation-registry generation to match. An ordering epoch and unwatch serial alone could reuse a proof from an earlier allocation at the same address. This fixes the inherited array regressions and the selected-import failure reproduced in the watched-import policy. The selected-run upload implementation remains unchanged; this PR adds Linux watch and unwatch regression variants using the existing override, without changing the default probe or production import policy.

Tested

Latest rebase validation — 2026-10-22. #6718 has merged. Replayed only this PR's three own commits onto main d6eafa54d0464258574fd2f71889754d05a5bc93; current head fa76baa139. git range-diff confirms all three patches remain equivalent. Dropped the old dependency and merge history while preserving original authorship. Prior merge resolutions were checked: main already retains scoped clearHandOver eligibility and ranged FlushPending, plus both test families, so none of those resolutions is lost.

Fresh Release builds on Windows 11 build 26200, Intel Core i7-13700, NVIDIA GeForce RTX 4070 / driver 610.88, GCC 15.2, SPIR-V Tools enabled. Main: 17/17 focused tests pass, zero skips, 41.55 s. Candidate: 18/18 pass, zero skips, 15.17 s, including selected GPU imports, both array-layer modes, collection/hint allocation-history cases, write-watch coverage, storage lifetime/failure/write-back, CPU snapshots and graphics. Every individual test finishes below 30 seconds.

Both runs use ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and the same GPU. Loader logs confirm Khronos 1.4.304 loads, with no missing-layer diagnostics. The logs contain identical existing validation-error messages (VUID-VkDeviceCreateInfo-pNext-pNext, structure 1000574000 unknown to this older layer); there are no new VUID errors, and zero total errors is not claimed.

Diff and conventions checks against the actual main target pass. The required origin/main conventions check was also run; that fork baseline reports inherited upstream findings (272 findings, 43 errors), while the three-commit diff against the tested canonical main passes. No new gameplay, performance, Linux or other-vendor result is claimed. Older measurements below retain their original source pins.

Earlier reviewer follow-up validation — 2026-10-20. Based on upstream main 5f7e30233e62ae5fdb7a6e3257698bc2e550bcc2; current head 8de7f9a7d443d0007e5454fc4e32fa6b01f8a4ec. The requested Windows hint-memo addition and regression are folded into the existing allocation-generation fix commit c19dcecfec8954233d0f22da969422c8eed7ac4f, preserving authorship and the existing commit count. UntrackedHint reads the allocation generation before its walk and stores/compares mapping in threadHintMemo. #6820 is restacked on updated #6718; its three incremental commits remain patch-equivalent.

Before the hint repair, agc_hint_mapping_history_cached fails with a cached hint walk hid a CPU store across allocation replacement, while _uncached passes. Main with the identical test-only fixture reproduces that result. After repair, both pass; the fixture also verifies unchanged hints, unchanged allocation replacement without invented CPU writes, and guest-byte preservation.

Fresh Release builds on Windows 11 build 26200, Intel Core i7-13700, NVIDIA GeForce RTX 4070 / driver 610.88, GCC 15.2, SPIR-V Tools enabled. This branch: 18/18 pass, zero skips, 19.46 s. #6718: 17/17 pass, zero skips, 14.58 s. Main's shared suite: 10/10 pass, zero skips, 11.43 s, plus its matching APS5_NO_HOST_IMPORT=1 array control 1/1 pass, 0.89 s. The separate main hint negative-control failure above is expected, not counted as a passing main test.

All matched GPU runs use ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and the same GPU. Loader logs confirm Khronos 1.4.304 actually loads, with no missing-layer diagnostics. Comparing main's shared tests plus its matching no-import control against the candidate finds identical validation-error messages: two instances of the existing VUID-VkDeviceCreateInfo-pNext-pNext for structure 1000574000 unknown to this older layer. No new VUID errors; zero total validation errors is not claimed.

Conventions against the frozen canonical main revision and diff checks pass. The required origin/main check was attempted and still fails with Windows WinError 206 because that fork baseline is stale. These are focused correctness results; no fresh gameplay, performance or Linux/vendor retest is claimed. Historical evidence and the previously documented full-suite Windows build limitation below remain applicable to their named revisions.

Earlier conflict-resolution validation — 2026-10-20. Rebased onto upstream main 43cd8f4c47f4c81185c4ca14b84240e0748e3459. Current head: 5126feba8ceabdd6b83aaf5277cd2f8a75dd53f2. Rebased directly onto updated #6718 head c778381786adc976f53e7761551751eb0fbae955, including its #6202 prerequisite and the conflict resolution with merged #6772. All three incremental selected-import commits remain patch-equivalent to the previous head. Original authorship is retained.

Fresh Release focused targets rebuilt on Windows 11 build 26200, Intel Core i7-13700, NVIDIA GeForce RTX 4070 / driver 610.88, GCC 15.2, SPIR-V Tools enabled. Main: 10/10 pass, zero skips, 15.41 s; its array fixture also passes 1/1 in 1.77 s with APS5_NO_HOST_IMPORT=1 to match the added CPU-only array configuration. PR: 16/16 pass, zero skips, 19.21 s. Both use ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and the same GPU. Logs confirm the Khronos 1.4.304 layer actually loads, with no missing-layer diagnostics. Comparing the shared tests and the matched no-import configuration finds no new VUID error signatures: main's ordinary suite plus its no-import control produce the same two unknown-extension-structure device-create errors as the candidate (VUID-VkDeviceCreateInfo-pNext-pNext, structure 1000574000 unknown to this older layer). Zero total validation errors is not claimed.

Upstream Windows test-build limitation: unmodified main's newly merged agc_driver_image_array_window_past_layer_limit_tests does not compile with the supported Windows GCC: ImageArrayWindowPastLayerLimit.cpp:33: requested alignment '65536' exceeds object file maximum 8192. The focused passing suites exclude that dedicated GPU test; the shared graphics binary does run RunTextureTilingTests, including main's array-window layout checks. No unrelated fixture change is included in this rebase. Full-suite Windows success is not claimed.

Conventions against canonical upstream/main and diff checks pass; the stale fork origin/main checker still hits Windows command-line length limits. No fresh gameplay/performance measurement, raw evidence upload, or Linux/vendor retest is claimed.

Earlier rebase validation — 2026-10-20 (main 661f8b717, historical). Rebased onto upstream main 661f8b717 through updated #6718 head 6ef3a78d872bd2057bd61c564db2b79c79e3d270. Current head: b20fb6dec778a6d1e3f79711a1f8a82fe7173a18. All three incremental selected-import commits are patch-equivalent to the previous head; original authorship and the Linux policy variants are retained. The inherited #6202 integration preserves main's newer array-layout checks and lookup lifetime management.

Windows 11 build 26200, Intel Core i7-13700, NVIDIA GeForce RTX 4070 / driver 610.88, GCC 15.2 / Release / SPIR-V Tools. Fresh focused targets rebuilt for main and the PR. Main: 10/10 pass, zero skips, 11.98 s. PR: 16/16 pass, zero skips, 14.35 s, including selected imports, both array-layer modes and all four allocation-history cache/control cases. Both use ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and the same GPU. Loader logs confirm the Khronos 1.4.304 layer actually loads; neither log reports a missing requested layer. No new VUID errors compared with main. Both include the same VUID-VkDeviceCreateInfo-pNext-pNext for an extension structure unknown to that older layer; zero total VUIDs is not claimed.

The final runs load rebuilt unpatched libraries, with older DLL copies beside the test executables moved aside. Conventions against canonical upstream/main and diff checks pass. The required origin/main check was attempted but its stale fork baseline hits Windows command-line length limits; the canonical target baseline succeeds. No new gameplay/performance measurement, raw-trace upload or Linux/vendor retest is claimed. Earlier hardware reports and game measurements remain evidence only for their explicitly named revisions.

Previous rebase validation — 2026-10-19 (historical). Rebased onto upstream main 6b8228b2bfecb895010e379362c6d0bb288c2d47. Current head: 93180e82805e1d1dc51e3a9eecdcc49263fffdc0. Original authorship is retained.

This branch is based directly on rebased #6718 head 1505305e1, including its attributed #6202 prerequisite. #6367 is already merged and its duplicate commit is dropped. All three incremental selected-import commits are patch-equivalent to the previous head, including both Linux write-watch policy variants. The current incremental review is #6718 to this branch.

  • Windows RTX 4070: 26/26 focused tests pass, zero skips, 22.40 s summed test time; longest 9.56 s.
  • Ubuntu/WSL2 lavapipe: 27/27 focused tests pass, zero skips, 10.31 s summed test time; longest 4.72 s.
  • Release / GCC 15.2 / SPIR-V Tools; current bundled dependency gitlinks. Every individual test stays within 30 seconds. Conventions against canonical upstream and diff checks pass. WSL/lavapipe is software-Vulkan coverage, not a native Linux vendor-driver retest.
  • These are fresh source-correctness results, not new gameplay or performance measurements. Earlier game measurements and independent hardware reports below apply to their explicitly named pre-rebase revisions. No game/runtime snapshot, evidence bundle or PR status is changed by this rebase.

Earlier validation and investigation (historical revisions):

Review follow-up: final source 99926bd42, based on upstream 55b968a23, GCC 15.2, Release with SPIR-V Tools and bundled dependencies:

  • Linux/lavapipe: 27/27 pass, zero skips, 11.38 s total; longest test 4.67 s.
  • Windows RTX 4070: 26/26 pass, zero skips, 23.83 s total; longest test 8.25 s.
  • Conventions and diff checks pass. Each individual test has a 30-second timeout.

Linux: Ubuntu 26.04.1/WSL 2, kernel 6.18.54.1-microsoft-standard-WSL2, Mesa 26.0.8 lavapipe/llvmpipe, LLVM 21.1.8. Production write tracking is available. Windows: 10.0.26200, NVIDIA RTX 4070, driver 591.86.

The reviewer reported that compared imports passed on lavapipe while watched imports failed on native NVIDIA. Using the existing APS5_WRITE_WATCH_IMPORTS override reproduces the exact watched-path assertion here. The new registered tests are agc_storage_selected_import_watch and agc_storage_selected_import_unwatch; the original automatically probed test and all original assertions remain intact.

Isolated controls, changing only one implementation at a time:

Implementation Auto probe (compared here) Forced watch Forced unwatch
Mapping-generation cache repair removed; selected import enabled Pass Fails: a valid selected layer did not record its GPU import Pass
Selected-import lookup removed; cache repair present Same assertion fails Same assertion fails Same assertion fails
Complete repaired branch Pass Pass Pass

These are real Vulkan uploads/readbacks and CPU stores through the existing test, with first/last slices, registered/unregistered unused neighbors, preexisting/lazy imports, neighboring GPU-result preservation and retirement checks. The inherited array failures are covered by #6718's separately verified repair; no expectation was relaxed.

Limit: the forced-policy runs exercise the watched-import code path on software Vulkan. They do not establish that lavapipe should use forced watch generally, or qualify the reviewer's native Linux NVIDIA driver. That native retest remains pending. This update adds no new gameplay or frame-rate claim, residency/shader change, local input configuration, game assets or evidence-bundle upload.

Windows 10.0.26200, Intel Core i7-13700, 32 GiB RAM, NVIDIA GeForce RTX 4070 12 GiB / driver 591.86. GCC 15.2, Release -O3 -DNDEBUG, SPIR-V Tools enabled. Complete 126-library snapshots retain source/dependency revisions, flags and SHA256 hashes.

Historical publication-head validation: complete Release libraries and focused targets rebuilt at 5b4f9b93bb4d9c24a3fb3e83118bec524606e44a; 23/23 tests pass in 27.36 seconds, zero skips. Conventions and diff checks pass. No shader experiment, residency implementation or diagnostic instrumentation is included in this source head.

The new synthetic regression fails before the fix at a valid selected layer did not record its GPU import and passes afterward. Eight cases cover first/last layers, registered/unregistered unused neighbors, existing/lazy imports, exact queued read ranges, preserved neighboring GPU results and guest bytes, subsequent genuine CPU writes, and allocation retirement while a GPU read is pending. Existing focused tests cover CPU fallback, aliasing, clears, CPU snapshots, split write-back and retirement. Each test has a 30-second limit. git range-diff confirms both new commits are patch-equivalent before/after publication rebase.

The preserved playable integration passes 22/22 resource tests with residency off and on. Its separately attributed TheAggie shader experiment has a known flat-input interpolation semantic-test failure, retained without weakening the guard; the experiment is excluded from this PR source. The publishable source graphics/shader-semantic test passes.

The following gameplay measurements are of equivalent preserved integration runtimes, not bare current main or this newly rebased publication head. Reference 3f8d2989a and candidate c2d3d922b hold #6718, #1191 residency, the write-watch repair and TheAggie's shader revision 45944fbbe0dc constant. Their source difference is this regression/fix only. No dependency or shader gain is credited to this PR. The residency, write-watch repair, shader experiment and diagnostic hooks are excluded from the new implementation commits.

SuperTuxKart PPSA69421: Abyss, Tux, easy, four karts, 1920x1080, stationary starting-grid camera. Three alternating baseline/candidate pairs, 35-second cache warm-up per arm, separate restarts, 60-second lead-in and 120-second measurement window. Identical configuration/input hashes and 126-library hashes verified; no input, competing GPU run or harness redirection of acceptance game logs. Only residency selection and APS5_TRACE_SECONDS=60:120 are enabled beyond normal workload/cache/input setup.

Pair Reference FPS Candidate FPS Gain Presents reference/candidate Reference p50/p90/p99 ms Candidate p50/p90/p99 ms
1 10.238 11.901 16.24% 1229 / 1429 93.644 / 114.319 / 132.675 81.644 / 95.939 / 101.198
2 10.771 11.523 6.99% 1293 / 1383 86.762 / 116.759 / 121.461 82.062 / 107.777 / 112.422
3 10.927 11.807 8.05% 1312 / 1417 88.694 / 103.642 / 112.835 80.594 / 104.088 / 108.797

Median paired throughput gain is 8.05%, below the 20% target. The game remains around 12 FPS; no smooth-play, 30-FPS, black-rendering or repeatable-20%-gain claim.

All six frame windows completed and every counted present reached the display-buffer presentation path. Long detailed worker event timelines overflowed; their dropped-event fields are preserved below, and they are not used as complete profiling evidence. Separate complete short diagnostics show the two repeating CPU-staged uploads use GPU imports, steady-state CPU-staged upload counters reach zero, and synchronous fallback GPU roots disappear from the measured candidate window. In the timing capture the reference has 12.59 ms recorded GPU batches plus 1.79 ms synchronous batches per present; candidate recorded batches take 12.31 ms. GPU child timings are nested and are not added again. The recorded-only GPU figures in acceptance summary lines omit synchronous fallback work.

Captured candidate views preserve underwater scenery and the kart. Gameplay on the current review-repair head, extended stability, finite-race completion, cross-title validation and native Linux NVIDIA/AMD/Intel hardware remain pending. Earlier race/stability passes on other runtimes are not credited to this new change. Local W/Enter controls and --use-gamepad=1 remain outside the PR.

Full traces, digests, screenshots, manifests and test logs remain local at the author's request; no evidence bundle or game assets/binaries uploaded. Original acceptance summary lines are included below with local paths redacted. The PR remains ready for review at the author's request; dependencies and remaining validation are still outstanding.

Original acceptance summary lines, pairs 1–3 (reference then candidate)
{"commit":"3f8d2989a83f","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":444,"ms":120041.624},"presents":1229,"frame_ms":{"p50":93.644,"p90":114.319,"p99":132.675,"max":159.077},"gpu_busy_ms_per_present":11.955,"worker_busy_pct":{"queue worker 0x0":17.526},"top_phases_ms_per_frame":{"Driver.Packet":10.895,"Driver.Packet.draw":8.858,"Driver.Draw":8.797,"Driver.EndSubmission":6.217,"Driver.Draw.draw_enqueued":5.902,"Driver.Draw.shader_compile_and_link":2.3,"Shader.DrawStage":1.381,"Driver.Present":0.935},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":51.144,"events_lost":303419,"totals_full":false}},"trace":"aps5-trace-3f8d2989a83f-80920.json.gz"}
{"commit":"c2d3d922b72d","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":494,"ms":120072.944},"presents":1429,"frame_ms":{"p50":81.644,"p90":95.939,"p99":101.198,"max":128.781},"gpu_busy_ms_per_present":13.078,"worker_busy_pct":{"queue worker 0x0":12.88},"top_phases_ms_per_frame":{"Driver.Packet":9.585,"Driver.Packet.draw":7.761,"Driver.Draw":7.714,"Driver.Draw.draw_enqueued":5.364,"Driver.Draw.shader_compile_and_link":1.88,"Driver.EndSubmission":1.232,"Driver.Present":1.22,"Shader.DrawStage":1.124},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":48.008,"events_lost":334419,"totals_full":false}},"trace":"aps5-trace-c2d3d922b72d-83656.json.gz"}
{"commit":"3f8d2989a83f","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":444,"ms":120049.832},"presents":1293,"frame_ms":{"p50":86.762,"p90":116.759,"p99":121.461,"max":124.987},"gpu_busy_ms_per_present":10.521,"worker_busy_pct":{"queue worker 0x0":16.168},"top_phases_ms_per_frame":{"Driver.Packet":10.286,"Driver.Packet.draw":7.946,"Driver.Draw":7.896,"Driver.Draw.draw_enqueued":5.32,"Driver.EndSubmission":4.718,"Driver.Draw.shader_compile_and_link":2.079,"Shader.DrawStage":1.283,"Driver.Present":0.754},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":48.666,"events_lost":319975,"totals_full":false}},"trace":"aps5-trace-3f8d2989a83f-76796.json.gz"}
{"commit":"c2d3d922b72d","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":468,"ms":120019.331},"presents":1383,"frame_ms":{"p50":82.062,"p90":107.777,"p99":112.422,"max":114.56},"gpu_busy_ms_per_present":13.652,"worker_busy_pct":{"queue worker 0x0":12.424},"top_phases_ms_per_frame":{"Driver.Packet":9.495,"Driver.Packet.draw":7.668,"Driver.Draw":7.618,"Driver.Draw.draw_enqueued":5.262,"Driver.Draw.shader_compile_and_link":1.883,"Driver.EndSubmission":1.28,"Driver.Present":1.212,"Shader.DrawStage":1.13},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":51.056,"events_lost":312950,"totals_full":false}},"trace":"aps5-trace-c2d3d922b72d-74976.json.gz"}
{"commit":"3f8d2989a83f","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":501,"ms":120065.27},"presents":1312,"frame_ms":{"p50":88.694,"p90":103.642,"p99":112.835,"max":141.796},"gpu_busy_ms_per_present":11.787,"worker_busy_pct":{"queue worker 0x0":18.779},"top_phases_ms_per_frame":{"Driver.Packet":11.545,"Driver.Packet.draw":8.685,"Driver.Draw":8.631,"Driver.Draw.draw_enqueued":6.015,"Driver.EndSubmission":5.634,"Driver.Draw.shader_compile_and_link":2.094,"Shader.DrawStage":1.274,"Driver.Present":1.042},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":49.799,"events_lost":310075,"totals_full":false}},"trace":"aps5-trace-3f8d2989a83f-66804.json.gz"}
{"commit":"c2d3d922b72d","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":478,"ms":120017.874},"presents":1417,"frame_ms":{"p50":80.594,"p90":104.088,"p99":108.797,"max":111.69},"gpu_busy_ms_per_present":13.667,"worker_busy_pct":{"queue worker 0x0":12.296},"top_phases_ms_per_frame":{"Driver.Packet":9.726,"Driver.Packet.draw":7.976,"Driver.Draw":7.929,"Driver.Draw.draw_enqueued":5.537,"Driver.Draw.shader_compile_and_link":1.935,"Driver.Present":1.22,"Shader.DrawStage":1.189,"Driver.Present.render_fence_wait":0.943},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":47.952,"events_lost":358723,"totals_full":false}},"trace":"aps5-trace-c2d3d922b72d-55996.json.gz"}

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 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: none
  • Fixes: none
  • Unblocks: none claimed; SuperTuxKart PPSA69421 is the regression workload
  • GPUs tested: NVIDIA GeForce RTX 4070, driver 610.88, Windows 11 build 26200 (latest rebase); earlier validation: NVIDIA RTX 4070, driver 591.86, Windows 11 10.0.26200; Mesa 26.0.8 lavapipe/llvmpipe (LLVM 21.1.8), Ubuntu 26.04.1/WSL 2; native Linux NVIDIA/AMD/Intel retest pending
  • AI-assisted: yes, OpenAI Codex
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4888951582 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6820). Originally posted by [Zenodeon](https://github.com/Zenodeon) on 2026-10-16T13:18:39Z. --- ### What A partially used texture array can fall back to CPU staging even when its active physical layer is importable. The whole-descriptor `HostImportFor` lookup fails when unused slices cross separately owned allocations. Retry the lookup for one contiguous selection of complete physical layers, then use the existing recorded GPU upload/detile path. Unsupported selections retain the existing fallback. **Prerequisites are now on main through merged #6718, including the attributed #6202 integration. Depends on: none.** This branch is based on main `d6eafa54d0464258574fd2f71889754d05a5bc93` and contains only the three selected-import commits: regression, implementation and Linux write-watch policy variants. Current head: `fa76baa139`. [Incremental review against the tested main revision](https://github.com/Zenodeon/AnyPS5/compare/d6eafa54d0464258574fd2f71889754d05a5bc93...stk-selected-layer-gpu-import). For the observed two-layer descriptors, the active 8,847,360-byte layer fits a 10 MiB import run, while the full 17,694,720-byte descriptor does not. The existing upload implementation retains import/image lifetime, records selected pending-read ranges and preserves unrelated image contents. No public API or shader-semantic changes, skipped rendering, fabricated completion, title checks or input configuration changes. Overlap rechecked before publication. #6718 implements selected CPU fallback uploads; this enables the GPU-import route. #6197 joins import windows for a whole surface and changes the whole-range lookup contract; this change leaves that contract alone and uses an already valid selected-layer run. #6202 supplies scoped refresh. No other open PR found implementing this selected-run retry. Prerequisite authorship is retained. The allocation-history repair is already on main through merged #6718: collection memo hits now also require the allocation-registry generation to match. An ordering epoch and unwatch serial alone could reuse a proof from an earlier allocation at the same address. This fixes the inherited array regressions and the selected-import failure reproduced in the watched-import policy. The selected-run upload implementation remains unchanged; this PR adds Linux `watch` and `unwatch` regression variants using the existing override, without changing the default probe or production import policy. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> **Latest rebase validation — 2026-10-22.** #6718 has merged. Replayed only this PR's three own commits onto main `d6eafa54d0464258574fd2f71889754d05a5bc93`; current head `fa76baa139`. `git range-diff` confirms all three patches remain equivalent. Dropped the old dependency and merge history while preserving original authorship. Prior merge resolutions were checked: main already retains scoped `clearHandOver` eligibility and ranged `FlushPending`, plus both test families, so none of those resolutions is lost. Fresh Release builds on Windows 11 build 26200, Intel Core i7-13700, NVIDIA GeForce RTX 4070 / driver 610.88, GCC 15.2, SPIR-V Tools enabled. Main: **17/17 focused tests pass, zero skips, 41.55 s**. Candidate: **18/18 pass, zero skips, 15.17 s**, including selected GPU imports, both array-layer modes, collection/hint allocation-history cases, write-watch coverage, storage lifetime/failure/write-back, CPU snapshots and graphics. Every individual test finishes below 30 seconds. Both runs use `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and the same GPU. Loader logs confirm Khronos 1.4.304 loads, with no missing-layer diagnostics. The logs contain identical existing validation-error messages (`VUID-VkDeviceCreateInfo-pNext-pNext`, structure 1000574000 unknown to this older layer); there are no new VUID errors, and zero total errors is not claimed. Diff and conventions checks against the actual main target pass. The required `origin/main` conventions check was also run; that fork baseline reports inherited upstream findings (272 findings, 43 errors), while the three-commit diff against the tested canonical main passes. No new gameplay, performance, Linux or other-vendor result is claimed. Older measurements below retain their original source pins. **Earlier reviewer follow-up validation — 2026-10-20.** Based on upstream `main` `5f7e30233e62ae5fdb7a6e3257698bc2e550bcc2`; current head `8de7f9a7d443d0007e5454fc4e32fa6b01f8a4ec`. The requested Windows hint-memo addition and regression are folded into the existing allocation-generation fix commit `c19dcecfec8954233d0f22da969422c8eed7ac4f`, preserving authorship and the existing commit count. `UntrackedHint` reads the allocation generation before its walk and stores/compares `mapping` in `threadHintMemo`. #6820 is restacked on updated #6718; its three incremental commits remain patch-equivalent. Before the hint repair, `agc_hint_mapping_history_cached` fails with `a cached hint walk hid a CPU store across allocation replacement`, while `_uncached` passes. Main with the identical test-only fixture reproduces that result. After repair, both pass; the fixture also verifies unchanged hints, unchanged allocation replacement without invented CPU writes, and guest-byte preservation. Fresh Release builds on Windows 11 build 26200, Intel Core i7-13700, NVIDIA GeForce RTX 4070 / driver 610.88, GCC 15.2, SPIR-V Tools enabled. This branch: **18/18 pass, zero skips, 19.46 s**. #6718: **17/17 pass, zero skips, 14.58 s**. Main's shared suite: **10/10 pass, zero skips, 11.43 s**, plus its matching `APS5_NO_HOST_IMPORT=1` array control **1/1 pass, 0.89 s**. The separate main hint negative-control failure above is expected, not counted as a passing main test. All matched GPU runs use `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and the same GPU. Loader logs confirm Khronos 1.4.304 actually loads, with no missing-layer diagnostics. Comparing main's shared tests plus its matching no-import control against the candidate finds identical validation-error messages: two instances of the existing `VUID-VkDeviceCreateInfo-pNext-pNext` for structure 1000574000 unknown to this older layer. No new VUID errors; zero total validation errors is not claimed. Conventions against the frozen canonical main revision and diff checks pass. The required `origin/main` check was attempted and still fails with Windows `WinError 206` because that fork baseline is stale. These are focused correctness results; no fresh gameplay, performance or Linux/vendor retest is claimed. Historical evidence and the previously documented full-suite Windows build limitation below remain applicable to their named revisions. **Earlier conflict-resolution validation — 2026-10-20.** Rebased onto upstream `main` `43cd8f4c47f4c81185c4ca14b84240e0748e3459`. Current head: `5126feba8ceabdd6b83aaf5277cd2f8a75dd53f2`. Rebased directly onto updated #6718 head `c778381786adc976f53e7761551751eb0fbae955`, including its #6202 prerequisite and the conflict resolution with merged #6772. All three incremental selected-import commits remain patch-equivalent to the previous head. Original authorship is retained. Fresh Release focused targets rebuilt on Windows 11 build 26200, Intel Core i7-13700, NVIDIA GeForce RTX 4070 / driver 610.88, GCC 15.2, SPIR-V Tools enabled. Main: **10/10 pass, zero skips, 15.41 s**; its array fixture also passes **1/1 in 1.77 s** with `APS5_NO_HOST_IMPORT=1` to match the added CPU-only array configuration. PR: **16/16 pass, zero skips, 19.21 s**. Both use `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and the same GPU. Logs confirm the Khronos 1.4.304 layer actually loads, with no missing-layer diagnostics. Comparing the shared tests and the matched no-import configuration finds **no new VUID error signatures**: main's ordinary suite plus its no-import control produce the same two unknown-extension-structure device-create errors as the candidate (`VUID-VkDeviceCreateInfo-pNext-pNext`, structure 1000574000 unknown to this older layer). Zero total validation errors is not claimed. **Upstream Windows test-build limitation:** unmodified main's newly merged `agc_driver_image_array_window_past_layer_limit_tests` does not compile with the supported Windows GCC: `ImageArrayWindowPastLayerLimit.cpp:33: requested alignment '65536' exceeds object file maximum 8192`. The focused passing suites exclude that dedicated GPU test; the shared graphics binary does run `RunTextureTilingTests`, including main's array-window layout checks. No unrelated fixture change is included in this rebase. Full-suite Windows success is not claimed. Conventions against canonical `upstream/main` and diff checks pass; the stale fork `origin/main` checker still hits Windows command-line length limits. No fresh gameplay/performance measurement, raw evidence upload, or Linux/vendor retest is claimed. **Earlier rebase validation — 2026-10-20 (main `661f8b717`, historical).** Rebased onto upstream `main` `661f8b717` through updated #6718 head `6ef3a78d872bd2057bd61c564db2b79c79e3d270`. Current head: `b20fb6dec778a6d1e3f79711a1f8a82fe7173a18`. All three incremental selected-import commits are patch-equivalent to the previous head; original authorship and the Linux policy variants are retained. The inherited #6202 integration preserves main's newer array-layout checks and lookup lifetime management. Windows 11 build 26200, Intel Core i7-13700, NVIDIA GeForce RTX 4070 / driver 610.88, GCC 15.2 / Release / SPIR-V Tools. Fresh focused targets rebuilt for main and the PR. Main: **10/10 pass, zero skips, 11.98 s**. PR: **16/16 pass, zero skips, 14.35 s**, including selected imports, both array-layer modes and all four allocation-history cache/control cases. Both use `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and the same GPU. Loader logs confirm the Khronos 1.4.304 layer actually loads; neither log reports a missing requested layer. **No new VUID errors compared with main**. Both include the same `VUID-VkDeviceCreateInfo-pNext-pNext` for an extension structure unknown to that older layer; zero total VUIDs is not claimed. The final runs load rebuilt unpatched libraries, with older DLL copies beside the test executables moved aside. Conventions against canonical `upstream/main` and diff checks pass. The required `origin/main` check was attempted but its stale fork baseline hits Windows command-line length limits; the canonical target baseline succeeds. No new gameplay/performance measurement, raw-trace upload or Linux/vendor retest is claimed. Earlier hardware reports and game measurements remain evidence only for their explicitly named revisions. **Previous rebase validation — 2026-10-19 (historical).** Rebased onto upstream `main` `6b8228b2bfecb895010e379362c6d0bb288c2d47`. Current head: `93180e82805e1d1dc51e3a9eecdcc49263fffdc0`. Original authorship is retained. This branch is based directly on rebased #6718 head `1505305e1`, including its attributed #6202 prerequisite. #6367 is already merged and its duplicate commit is dropped. All three incremental selected-import commits are patch-equivalent to the previous head, including both Linux write-watch policy variants. The current incremental review is [#6718 to this branch](https://github.com/Zenodeon/AnyPS5/compare/1505305e1722698d90ae9340d223852baf05773b...stk-selected-layer-gpu-import). - **Windows RTX 4070: 26/26 focused tests pass, zero skips**, 22.40 s summed test time; longest 9.56 s. - **Ubuntu/WSL2 lavapipe: 27/27 focused tests pass, zero skips**, 10.31 s summed test time; longest 4.72 s. - Release / GCC 15.2 / SPIR-V Tools; current bundled dependency gitlinks. Every individual test stays within 30 seconds. Conventions against canonical upstream and diff checks pass. WSL/lavapipe is software-Vulkan coverage, not a native Linux vendor-driver retest. - These are fresh source-correctness results, not new gameplay or performance measurements. Earlier game measurements and independent hardware reports below apply to their explicitly named pre-rebase revisions. No game/runtime snapshot, evidence bundle or PR status is changed by this rebase. **Earlier validation and investigation (historical revisions):** **Review follow-up:** final source `99926bd42`, based on upstream `55b968a23`, GCC 15.2, Release with SPIR-V Tools and bundled dependencies: - **Linux/lavapipe: 27/27 pass, zero skips, 11.38 s total; longest test 4.67 s.** - **Windows RTX 4070: 26/26 pass, zero skips, 23.83 s total; longest test 8.25 s.** - Conventions and diff checks pass. Each individual test has a 30-second timeout. Linux: Ubuntu 26.04.1/WSL 2, kernel `6.18.54.1-microsoft-standard-WSL2`, Mesa 26.0.8 lavapipe/llvmpipe, LLVM 21.1.8. Production write tracking is available. Windows: 10.0.26200, NVIDIA RTX 4070, driver 591.86. The reviewer reported that compared imports passed on lavapipe while watched imports failed on native NVIDIA. Using the existing `APS5_WRITE_WATCH_IMPORTS` override reproduces the exact watched-path assertion here. The new registered tests are `agc_storage_selected_import_watch` and `agc_storage_selected_import_unwatch`; the original automatically probed test and all original assertions remain intact. Isolated controls, changing only one implementation at a time: | Implementation | Auto probe (compared here) | Forced watch | Forced unwatch | | --- | --- | --- | --- | | Mapping-generation cache repair removed; selected import enabled | Pass | Fails: `a valid selected layer did not record its GPU import` | Pass | | Selected-import lookup removed; cache repair present | Same assertion fails | Same assertion fails | Same assertion fails | | Complete repaired branch | Pass | Pass | Pass | These are real Vulkan uploads/readbacks and CPU stores through the existing test, with first/last slices, registered/unregistered unused neighbors, preexisting/lazy imports, neighboring GPU-result preservation and retirement checks. The inherited array failures are covered by #6718's separately verified repair; no expectation was relaxed. **Limit:** the forced-policy runs exercise the watched-import code path on software Vulkan. They do not establish that lavapipe should use forced watch generally, or qualify the reviewer's native Linux NVIDIA driver. That native retest remains pending. This update adds no new gameplay or frame-rate claim, residency/shader change, local input configuration, game assets or evidence-bundle upload. Windows 10.0.26200, Intel Core i7-13700, 32 GiB RAM, NVIDIA GeForce RTX 4070 12 GiB / driver 591.86. GCC 15.2, Release `-O3 -DNDEBUG`, SPIR-V Tools enabled. Complete 126-library snapshots retain source/dependency revisions, flags and SHA256 hashes. **Historical publication-head validation:** complete Release libraries and focused targets rebuilt at `5b4f9b93bb4d9c24a3fb3e83118bec524606e44a`; **23/23 tests pass in 27.36 seconds, zero skips**. Conventions and diff checks pass. No shader experiment, residency implementation or diagnostic instrumentation is included in this source head. The new synthetic regression fails before the fix at `a valid selected layer did not record its GPU import` and passes afterward. Eight cases cover first/last layers, registered/unregistered unused neighbors, existing/lazy imports, exact queued read ranges, preserved neighboring GPU results and guest bytes, subsequent genuine CPU writes, and allocation retirement while a GPU read is pending. Existing focused tests cover CPU fallback, aliasing, clears, CPU snapshots, split write-back and retirement. Each test has a 30-second limit. `git range-diff` confirms both new commits are patch-equivalent before/after publication rebase. The preserved playable integration passes 22/22 resource tests with residency off and on. Its separately attributed TheAggie shader experiment has a known flat-input interpolation semantic-test failure, retained without weakening the guard; the experiment is excluded from this PR source. The publishable source graphics/shader-semantic test passes. **The following gameplay measurements are of equivalent preserved integration runtimes, not bare current `main` or this newly rebased publication head.** Reference `3f8d2989a` and candidate `c2d3d922b` hold #6718, #1191 residency, the write-watch repair and TheAggie's shader revision `45944fbbe0dc` constant. Their source difference is this regression/fix only. No dependency or shader gain is credited to this PR. The residency, write-watch repair, shader experiment and diagnostic hooks are excluded from the new implementation commits. SuperTuxKart **PPSA69421**: Abyss, Tux, easy, four karts, 1920x1080, stationary starting-grid camera. Three alternating baseline/candidate pairs, 35-second cache warm-up per arm, separate restarts, 60-second lead-in and 120-second measurement window. Identical configuration/input hashes and 126-library hashes verified; no input, competing GPU run or harness redirection of acceptance game logs. Only residency selection and `APS5_TRACE_SECONDS=60:120` are enabled beyond normal workload/cache/input setup. | Pair | Reference FPS | Candidate FPS | Gain | Presents reference/candidate | Reference p50/p90/p99 ms | Candidate p50/p90/p99 ms | |---|---:|---:|---:|---:|---|---| | 1 | 10.238 | 11.901 | 16.24% | 1229 / 1429 | 93.644 / 114.319 / 132.675 | 81.644 / 95.939 / 101.198 | | 2 | 10.771 | 11.523 | 6.99% | 1293 / 1383 | 86.762 / 116.759 / 121.461 | 82.062 / 107.777 / 112.422 | | 3 | 10.927 | 11.807 | 8.05% | 1312 / 1417 | 88.694 / 103.642 / 112.835 | 80.594 / 104.088 / 108.797 | Median paired throughput gain is **8.05%**, below the 20% target. The game remains around 12 FPS; no smooth-play, 30-FPS, black-rendering or repeatable-20%-gain claim. All six frame windows completed and every counted present reached the display-buffer presentation path. Long detailed worker event timelines overflowed; their dropped-event fields are preserved below, and they are not used as complete profiling evidence. Separate complete short diagnostics show the two repeating CPU-staged uploads use GPU imports, steady-state CPU-staged upload counters reach zero, and synchronous fallback GPU roots disappear from the measured candidate window. In the timing capture the reference has 12.59 ms recorded GPU batches plus 1.79 ms synchronous batches per present; candidate recorded batches take 12.31 ms. GPU child timings are nested and are not added again. The recorded-only GPU figures in acceptance summary lines omit synchronous fallback work. Captured candidate views preserve underwater scenery and the kart. Gameplay on the current review-repair head, extended stability, finite-race completion, cross-title validation and native Linux NVIDIA/AMD/Intel hardware remain pending. Earlier race/stability passes on other runtimes are not credited to this new change. Local W/Enter controls and --use-gamepad=1 remain outside the PR. Full traces, digests, screenshots, manifests and test logs remain local at the author's request; no evidence bundle or game assets/binaries uploaded. Original acceptance summary lines are included below with local paths redacted. The PR remains ready for review at the author's request; dependencies and remaining validation are still outstanding. <details> <summary>Original acceptance summary lines, pairs 1–3 (reference then candidate)</summary> ```json {"commit":"3f8d2989a83f","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":444,"ms":120041.624},"presents":1229,"frame_ms":{"p50":93.644,"p90":114.319,"p99":132.675,"max":159.077},"gpu_busy_ms_per_present":11.955,"worker_busy_pct":{"queue worker 0x0":17.526},"top_phases_ms_per_frame":{"Driver.Packet":10.895,"Driver.Packet.draw":8.858,"Driver.Draw":8.797,"Driver.EndSubmission":6.217,"Driver.Draw.draw_enqueued":5.902,"Driver.Draw.shader_compile_and_link":2.3,"Shader.DrawStage":1.381,"Driver.Present":0.935},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":51.144,"events_lost":303419,"totals_full":false}},"trace":"aps5-trace-3f8d2989a83f-80920.json.gz"} {"commit":"c2d3d922b72d","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":494,"ms":120072.944},"presents":1429,"frame_ms":{"p50":81.644,"p90":95.939,"p99":101.198,"max":128.781},"gpu_busy_ms_per_present":13.078,"worker_busy_pct":{"queue worker 0x0":12.88},"top_phases_ms_per_frame":{"Driver.Packet":9.585,"Driver.Packet.draw":7.761,"Driver.Draw":7.714,"Driver.Draw.draw_enqueued":5.364,"Driver.Draw.shader_compile_and_link":1.88,"Driver.EndSubmission":1.232,"Driver.Present":1.22,"Shader.DrawStage":1.124},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":48.008,"events_lost":334419,"totals_full":false}},"trace":"aps5-trace-c2d3d922b72d-83656.json.gz"} {"commit":"3f8d2989a83f","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":444,"ms":120049.832},"presents":1293,"frame_ms":{"p50":86.762,"p90":116.759,"p99":121.461,"max":124.987},"gpu_busy_ms_per_present":10.521,"worker_busy_pct":{"queue worker 0x0":16.168},"top_phases_ms_per_frame":{"Driver.Packet":10.286,"Driver.Packet.draw":7.946,"Driver.Draw":7.896,"Driver.Draw.draw_enqueued":5.32,"Driver.EndSubmission":4.718,"Driver.Draw.shader_compile_and_link":2.079,"Shader.DrawStage":1.283,"Driver.Present":0.754},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":48.666,"events_lost":319975,"totals_full":false}},"trace":"aps5-trace-3f8d2989a83f-76796.json.gz"} {"commit":"c2d3d922b72d","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":468,"ms":120019.331},"presents":1383,"frame_ms":{"p50":82.062,"p90":107.777,"p99":112.422,"max":114.56},"gpu_busy_ms_per_present":13.652,"worker_busy_pct":{"queue worker 0x0":12.424},"top_phases_ms_per_frame":{"Driver.Packet":9.495,"Driver.Packet.draw":7.668,"Driver.Draw":7.618,"Driver.Draw.draw_enqueued":5.262,"Driver.Draw.shader_compile_and_link":1.883,"Driver.EndSubmission":1.28,"Driver.Present":1.212,"Shader.DrawStage":1.13},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":51.056,"events_lost":312950,"totals_full":false}},"trace":"aps5-trace-c2d3d922b72d-74976.json.gz"} {"commit":"3f8d2989a83f","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":501,"ms":120065.27},"presents":1312,"frame_ms":{"p50":88.694,"p90":103.642,"p99":112.835,"max":141.796},"gpu_busy_ms_per_present":11.787,"worker_busy_pct":{"queue worker 0x0":18.779},"top_phases_ms_per_frame":{"Driver.Packet":11.545,"Driver.Packet.draw":8.685,"Driver.Draw":8.631,"Driver.Draw.draw_enqueued":6.015,"Driver.EndSubmission":5.634,"Driver.Draw.shader_compile_and_link":2.094,"Shader.DrawStage":1.274,"Driver.Present":1.042},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":49.799,"events_lost":310075,"totals_full":false}},"trace":"aps5-trace-3f8d2989a83f-66804.json.gz"} {"commit":"c2d3d922b72d","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR_TARGETS":"1","APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 591.86","os":"Windows 10.0.26200","resolution":"1920x1080","window":{"spec":"seconds 60:120","first_present":478,"ms":120017.874},"presents":1417,"frame_ms":{"p50":80.594,"p90":104.088,"p99":108.797,"max":111.69},"gpu_busy_ms_per_present":13.667,"worker_busy_pct":{"queue worker 0x0":12.296},"top_phases_ms_per_frame":{"Driver.Packet":9.726,"Driver.Packet.draw":7.976,"Driver.Draw":7.929,"Driver.Draw.draw_enqueued":5.537,"Driver.Draw.shader_compile_and_link":1.935,"Driver.Present":1.22,"Shader.DrawStage":1.189,"Driver.Present.render_fence_wait":0.943},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":47.952,"events_lost":358723,"totals_full":false}},"trace":"aps5-trace-c2d3d922b72d-55996.json.gz"} ``` </details> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 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: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none claimed; SuperTuxKart PPSA69421 is the regression workload <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: NVIDIA GeForce RTX 4070, driver 610.88, Windows 11 build 26200 (latest rebase); earlier validation: NVIDIA RTX 4070, driver 591.86, Windows 11 10.0.26200; Mesa 26.0.8 lavapipe/llvmpipe (LLVM 21.1.8), Ubuntu 26.04.1/WSL 2; native Linux NVIDIA/AMD/Intel retest pending <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes, OpenAI Codex <!-- yes / no -->
jotitadev commented 2026-10-16 15:29:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-16T15:29:58Z.

Review: COMMENTED


First Linux run, since the description lists Linux as pending. The new test fails on NVIDIA under Linux, and two array-layer tests from the carried #6718 commits fail on both devices.

Machine: NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, plus lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same machine. Ubuntu 26.04 (kernel 7.0.0-38), i7-8700, GCC 15.2, Release, BUILD_TESTING=ON. Head 5b4f9b93b merged onto main bc400bede, clean merge. -j1 --timeout 60, 3 runs per device.

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04

test RTX 3070, head lavapipe, head both, at 4dc4def0e (test only)
agc_storage_selected_import fails 3/3 passes 3/3 fails (expected)
agc_driver_array_layer_target fails 3/3 fails 3/3 fails
agc_driver_array_layer_target_cpu fails 3/3 fails 3/3 fails
  • agc_storage_selected_import on the 3070 stops with a valid selected layer did not record its GPU import (Recorder.cpp, the PendingReadOverlaps check after RefreshLayers(selected, 1)). The two devices differ in the write-watch probe. The 3070 reports host imports resolve write protection: no ... imported ranges stay watched, while lavapipe reports host imports resolve write protection: yes ... imported ranges are compared. In 2 of the 3 failing runs the 3070 also logs storage image ...: guest memory changed while GPU results were pending; keeping the CPU's blocks just before the failure. Lavapipe never logs that.
  • Both array-layer tests stop with the unused array slices unexpectedly have complete write history. That Require is in UncommittedUnusedLayers (ArrayLayerTarget.cpp), added by 4a506dad6 from the #6718 stack. It runs only when GuestMemory::WriteWatched() is true. It already fails at 4dc4def0e, before this PR's fix. On unchanged main bc400bede, agc_driver_array_layer_target passes here.
  • RTX 3070, ctest -R "^agc|shader|recompiler" -E "agc_display_buffer_dcc|agc_driver_flip|agc_driver_lds_atomics64|display|flip" -j1 --timeout 60: 617 tests, 4 failures. Those are the three above, plus agc_driver_store_over_untracked, which also fails on main here (#6347). On main alone the same suite has only that one failure.

I could not run #6718 alone on this main, because it does not merge cleanly onto bc400bede. So the array-layer failures are from the stack as carried here.

Not checked: Windows, AMD/Intel, SuperTuxKart.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5549984318 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6820#pullrequestreview-5549984318). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-16T15:29:58Z. **Review:** COMMENTED --- First Linux run, since the description lists Linux as pending. The new test fails on NVIDIA under Linux, and two array-layer tests from the carried #6718 commits fail on both devices. **Machine:** NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, plus lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same machine. Ubuntu 26.04 (kernel 7.0.0-38), i7-8700, GCC 15.2, Release, `BUILD_TESTING=ON`. Head `5b4f9b93b` merged onto `main` `bc400bede`, clean merge. `-j1 --timeout 60`, 3 runs per device. GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04 | test | RTX 3070, head | lavapipe, head | both, at `4dc4def0e` (test only) | |---|---|---|---| | `agc_storage_selected_import` | **fails 3/3** | passes 3/3 | fails (expected) | | `agc_driver_array_layer_target` | **fails 3/3** | **fails 3/3** | fails | | `agc_driver_array_layer_target_cpu` | **fails 3/3** | **fails 3/3** | fails | - `agc_storage_selected_import` on the 3070 stops with `a valid selected layer did not record its GPU import` (Recorder.cpp, the `PendingReadOverlaps` check after `RefreshLayers(selected, 1)`). The two devices differ in the write-watch probe. The 3070 reports `host imports resolve write protection: no ... imported ranges stay watched`, while lavapipe reports `host imports resolve write protection: yes ... imported ranges are compared`. In 2 of the 3 failing runs the 3070 also logs `storage image ...: guest memory changed while GPU results were pending; keeping the CPU's blocks` just before the failure. Lavapipe never logs that. - Both array-layer tests stop with `the unused array slices unexpectedly have complete write history`. That `Require` is in `UncommittedUnusedLayers` (`ArrayLayerTarget.cpp`), added by `4a506dad6` from the #6718 stack. It runs only when `GuestMemory::WriteWatched()` is true. It already fails at `4dc4def0e`, before this PR's fix. On unchanged `main` `bc400bede`, `agc_driver_array_layer_target` passes here. - RTX 3070, `ctest -R "^agc|shader|recompiler" -E "agc_display_buffer_dcc|agc_driver_flip|agc_driver_lds_atomics64|display|flip" -j1 --timeout 60`: 617 tests, 4 failures. Those are the three above, plus `agc_driver_store_over_untracked`, which also fails on `main` here (#6347). On `main` alone the same suite has only that one failure. I could not run #6718 alone on this `main`, because it does not merge cleanly onto `bc400bede`. So the array-layer failures are from the stack as carried here. Not checked: Windows, AMD/Intel, SuperTuxKart. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
blawesom commented 2026-10-16 19:08:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-16T19:08:27Z.


Pre-review verification found a test failure — the full local suite on this head (Linux, CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV) fails agc_driver_array_layer_target and agc_driver_array_layer_target_cpu with:

AGC graphics: the unused array slices unexpectedly have complete write history

This is the same assertion that fails on #6718 (same test family, overlapping code — the pr-overlap bot flagged the pair), so it looks like the expectation contradicting current main's storage-image write-history behavior rather than either PR's own changes: on this machine the unused slices do have complete write history against main's newer tracking. Everything else passes on this head (only the known main regression agc_driver_tessellation, #4727, besides these two), and conventions are green — so the PR's own changes verify clean; it's the carried test's expectation that needs reconciling with main (or main's tracking is over-reporting for this case). Whichever of the two PRs lands the test family will need that resolved.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6222779893 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6820#issuecomment-6222779893). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-16T19:08:27Z. --- **Pre-review verification found a test failure** — the full local suite on this head (Linux, CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV) fails `agc_driver_array_layer_target` and `agc_driver_array_layer_target_cpu` with: `AGC graphics: the unused array slices unexpectedly have complete write history` This is the same assertion that fails on #6718 (same test family, overlapping code — the pr-overlap bot flagged the pair), so it looks like the *expectation* contradicting current `main`'s storage-image write-history behavior rather than either PR's own changes: on this machine the unused slices do have complete write history against `main`'s newer tracking. Everything else passes on this head (only the known `main` regression `agc_driver_tessellation`, #4727, besides these two), and conventions are green — so the PR's own changes verify clean; it's the carried test's expectation that needs reconciling with `main` (or `main`'s tracking is over-reporting for this case). Whichever of the two PRs lands the test family will need that resolved.
Zenodeon commented 2026-10-17 21:49:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Zenodeon on 2026-10-17T21:49:06Z.


Thanks for the Linux verification. Updated head 99926bd42 is rebased onto 55b968a23 and carries the repaired #6718 dependency, retaining prerequisite attribution.

I reproduced a valid selected layer did not record its GPU import on Linux/lavapipe using the existing APS5_WRITE_WATCH_IMPORTS=watch override. Removing only #6718's allocation-generation memo repair makes that watched case fail while auto-probed/compared imports pass. Restoring the repair passes both policies. This matches the reported policy distinction, although it is not a native NVIDIA retest.

Two Linux variants now cover that distinction: agc_storage_selected_import_watch and agc_storage_selected_import_unwatch. All original pending-read, neighboring GPU-result, CPU-write and retirement assertions remain intact. As a separate control, removing the selected-import lookup makes all three policy variants fail, so the original GPU-import fix remains necessary.

Final focused validation, GCC 15.2 / Release / SPIR-V Tools:

  • Linux: 27/27 pass, zero skips, 11.38 s. Ubuntu 26.04.1/WSL 2, kernel 6.18.54.1, Mesa 26.0.8 lavapipe/llvmpipe, LLVM 21.1.8; production write tracking active.
  • Windows: 26/26 pass, zero skips, 23.83 s. RTX 4070, driver 591.86, Windows 11 10.0.26200.
  • Every test finishes within 30 s; conventions and diff checks pass.

The forced-policy runs exercise the code path; they do not establish general watched-import support on lavapipe or qualify the native Linux NVIDIA driver. Confirmation on the reported RTX 3070 setup remains pending. No new gameplay-performance claim or evidence-bundle upload. AI-assisted implementation and validation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241747213 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6820#issuecomment-6241747213). Originally posted by [Zenodeon](https://github.com/Zenodeon) on 2026-10-17T21:49:06Z. --- Thanks for the Linux verification. Updated head `99926bd42` is rebased onto `55b968a23` and carries the repaired #6718 dependency, retaining prerequisite attribution. I reproduced `a valid selected layer did not record its GPU import` on Linux/lavapipe using the existing `APS5_WRITE_WATCH_IMPORTS=watch` override. Removing only #6718's allocation-generation memo repair makes that watched case fail while auto-probed/compared imports pass. Restoring the repair passes both policies. This matches the reported policy distinction, although it is not a native NVIDIA retest. Two Linux variants now cover that distinction: `agc_storage_selected_import_watch` and `agc_storage_selected_import_unwatch`. All original pending-read, neighboring GPU-result, CPU-write and retirement assertions remain intact. As a separate control, removing the selected-import lookup makes all three policy variants fail, so the original GPU-import fix remains necessary. Final focused validation, GCC 15.2 / Release / SPIR-V Tools: - **Linux: 27/27 pass, zero skips, 11.38 s.** Ubuntu 26.04.1/WSL 2, kernel 6.18.54.1, Mesa 26.0.8 lavapipe/llvmpipe, LLVM 21.1.8; production write tracking active. - **Windows: 26/26 pass, zero skips, 23.83 s.** RTX 4070, driver 591.86, Windows 11 10.0.26200. - Every test finishes within 30 s; conventions and diff checks pass. The forced-policy runs exercise the code path; they do not establish general watched-import support on lavapipe or qualify the native Linux NVIDIA driver. Confirmation on the reported RTX 3070 setup remains pending. No new gameplay-performance claim or evidence-bundle upload. AI-assisted implementation and validation.
jotitadev commented 2026-10-18 00:05:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-18T00:05:14Z.

Review: COMMENTED


The native retest on the RTX 3070 you asked for: head 99926bd42 passes, and the default (auto-probed) test now passes on this driver too.

Machine: Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON. NVIDIA GeForce RTX 3070 (driver 595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same host. PR merged onto main 5de7a46e0 (clean). ANYPS5_NO_SHADER_CACHE=1, -j1 --timeout 30.

Tests: agc_storage_selected_import (+ _watch, _unwatch), agc_collect_mapping_history_* (4), agc_driver_array_layer_target and _cpu, 9 in total.

RTX 3070 lavapipe
head 99926bd42 9/9, 3 runs, no skips 9/9, no skips
same, a2f69d7f6 (allocation-generation memo repair) reverted 7 fail (2 runs) 6 fail

Full ^agc suite with this PR (677 tests, without display/flip/lds_atomics64): 677/677 on both devices. That is main's 669 plus the 8 new ones, with the same skips as main (1 on the 3070, 44 on lavapipe).

On the 3070 the probe picks the watched path on its own: host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched. That is the path where agc_storage_selected_import failed on 5b4f9b93b; it now prints Selected physical-layer GPU imports passed.

With a2f69d7f6 reverted:

  • RTX 3070: agc_storage_selected_import and _watch fail with a valid selected layer did not record its GPU import, the three cached agc_collect_mapping_history_* modes with a cached collect hid a CPU store across allocation replacement, and both array-layer tests with the unused array slices unexpectedly have complete write history. _unwatch and _uncached pass.
  • lavapipe: the same, except that the default agc_storage_selected_import passes, because the probe picks compared imports there. Only _watch catches it. So the forced variant is what gives lavapipe CI the NVIDIA failure, as you describe.

Not run: Windows, AMD, any title.

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3), Ubuntu 26.04

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5560728304 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6820#pullrequestreview-5560728304). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-18T00:05:14Z. **Review:** COMMENTED --- The native retest on the RTX 3070 you asked for: head `99926bd42` passes, and the default (auto-probed) test now passes on this driver too. **Machine:** Ubuntu 26.04, i7-8700, GCC 15.2, Release, `BUILD_TESTING=ON`. NVIDIA GeForce RTX 3070 (driver 595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same host. PR merged onto `main` `5de7a46e0` (clean). `ANYPS5_NO_SHADER_CACHE=1`, `-j1 --timeout 30`. Tests: `agc_storage_selected_import` (+ `_watch`, `_unwatch`), `agc_collect_mapping_history_*` (4), `agc_driver_array_layer_target` and `_cpu`, 9 in total. | | RTX 3070 | lavapipe | |---|---|---| | head `99926bd42` | 9/9, 3 runs, no skips | 9/9, no skips | | same, `a2f69d7f6` (allocation-generation memo repair) reverted | 7 fail (2 runs) | 6 fail | Full `^agc` suite with this PR (677 tests, without display/flip/`lds_atomics64`): 677/677 on both devices. That is `main`'s 669 plus the 8 new ones, with the same skips as `main` (1 on the 3070, 44 on lavapipe). On the 3070 the probe picks the watched path on its own: `host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched`. That is the path where `agc_storage_selected_import` failed on `5b4f9b93b`; it now prints `Selected physical-layer GPU imports passed`. With `a2f69d7f6` reverted: - RTX 3070: `agc_storage_selected_import` and `_watch` fail with `a valid selected layer did not record its GPU import`, the three cached `agc_collect_mapping_history_*` modes with `a cached collect hid a CPU store across allocation replacement`, and both array-layer tests with `the unused array slices unexpectedly have complete write history`. `_unwatch` and `_uncached` pass. - lavapipe: the same, except that the default `agc_storage_selected_import` passes, because the probe picks compared imports there. Only `_watch` catches it. So the forced variant is what gives lavapipe CI the NVIDIA failure, as you describe. Not run: Windows, AMD, any title. GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3), Ubuntu 26.04 Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

Pull request closed

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!6820
No description provided.