chore(agc): log the storage writeback submit and done lines only with APS5_DEBUG_LOG #12244

Merged
Tehshortbus merged 1 commit from upstream-pr/12244 into main 2026-10-28 11:28:09 +00:00
Tehshortbus commented 2026-10-28 04:39:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tehshortbus on 2026-10-28T04:39:07Z.


What

writeBackLayers in Texture.cpp printed StorageTexture writeback submit and StorageTexture writeback done unconditionally, around the blocking submit of every storage image writeback. Both now use APS5_LOG_CHARS_OUT_DEBUG, the macro the AGC driver's other per-operation lines use, so they are compiled out unless APS5_DEBUG_LOG is defined. Same approach as 81c67e1be and #11423. +2/−2, no behaviour change.

Tested

CachyOS Linux (kernel 7.3.0-4-cachyos), GCC 16.2.1, Release, NVIDIA GeForce RTX 4070 SUPER (615.78.08).

  • Focused tests, main 86fb985abb and this change on it (c80bbd9eea, since rebased onto 82d5f01f28 with no other change):
    ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-tests -V -R '^(agc_storage_idle_writeback_race|agc_storage_split_writeback|agc_storage_write_back|agc_storage_writeback_blocks|agc_driver_storage_write_back_no_window|agc_driver_storage_write_back_overhang|agc_driver_storage_write_back_overhang_draw_pipeline)$'

    main this change
    tests 7/7 pass 7/7 pass
    VUID- lines 0 0
    was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
    StorageTexture writeback lines 18 0

    The 18 lines on main come from agc_storage_idle_writeback_race (6), agc_storage_split_writeback (8) and agc_storage_writeback_blocks (4), so those three reach the changed lines; the other four pass on both without printing them.

  • GTA V (PPSA04264 01.011.001). main stops 40–50 s after launch on #11425, so these runs used main 86fb985abb with #11580 (fedf3e91a7) merged locally, the base for both columns:

    runs StorageTexture writeback lines per run share of the log
    base 5 (one cold, 674 s; four warm, 2–3 min into Story mode) 54–978 5–55 %
    base + this change 1 (warm, 312 s, into gameplay) 0 0 % (0 of 1,065 lines)

    All six runs reached gameplay, with no [gpu] driver failure. The four warm base runs also had APS5_FRAME_CAPTURE set (it never started); the run with this change had only APS5_TRACE_SUMMARY_EVERY.

  • python3 tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py lists 44 open pull requests sharing Texture.cpp that it could not compare; I checked their diffs and none adds, removes or edits either line.

Not checked: a build with APS5_DEBUG_LOG defined (the macro's debug branch is unchanged and already used elsewhere), and Windows or other GPUs.

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
  • GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 615.78.08, CachyOS Linux (kernel 7.3.0-4-cachyos)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5045296953 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12244). Originally posted by [Tehshortbus](https://github.com/Tehshortbus) on 2026-10-28T04:39:07Z. --- ### What `writeBackLayers` in `Texture.cpp` printed `StorageTexture writeback submit` and `StorageTexture writeback done` unconditionally, around the blocking submit of every storage image writeback. Both now use `APS5_LOG_CHARS_OUT_DEBUG`, the macro the AGC driver's other per-operation lines use, so they are compiled out unless `APS5_DEBUG_LOG` is defined. Same approach as 81c67e1be and #11423. +2/−2, no behaviour change. ### 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. --> CachyOS Linux (kernel 7.3.0-4-cachyos), GCC 16.2.1, Release, NVIDIA GeForce RTX 4070 SUPER (615.78.08). - **Focused tests**, `main` `86fb985abb` and this change on it (`c80bbd9eea`, since rebased onto `82d5f01f28` with no other change): `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-tests -V -R '^(agc_storage_idle_writeback_race|agc_storage_split_writeback|agc_storage_write_back|agc_storage_writeback_blocks|agc_driver_storage_write_back_no_window|agc_driver_storage_write_back_overhang|agc_driver_storage_write_back_overhang_draw_pipeline)$'` | | `main` | this change | |---|---|---| | tests | 7/7 pass | 7/7 pass | | `VUID-` lines | 0 | 0 | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | 0 | 0 | | `StorageTexture writeback` lines | 18 | 0 | The 18 lines on `main` come from `agc_storage_idle_writeback_race` (6), `agc_storage_split_writeback` (8) and `agc_storage_writeback_blocks` (4), so those three reach the changed lines; the other four pass on both without printing them. - **GTA V** (PPSA04264 01.011.001). `main` stops 40–50 s after launch on #11425, so these runs used `main` `86fb985abb` with #11580 (`fedf3e91a7`) merged locally, the base for both columns: | | runs | `StorageTexture writeback` lines per run | share of the log | |---|---|---|---| | base | 5 (one cold, 674 s; four warm, 2–3 min into Story mode) | 54–978 | 5–55 % | | base + this change | 1 (warm, 312 s, into gameplay) | 0 | 0 % (0 of 1,065 lines) | All six runs reached gameplay, with no `[gpu] driver failure`. The four warm base runs also had `APS5_FRAME_CAPTURE` set (it never started); the run with this change had only `APS5_TRACE_SUMMARY_EVERY`. - `python3 tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py` lists 44 open pull requests sharing `Texture.cpp` that it could not compare; I checked their diffs and none adds, removes or edits either line. Not checked: a build with `APS5_DEBUG_LOG` defined (the macro's debug branch is unchanged and already used elsewhere), and Windows or other GPUs. ### 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 615.78.08, CachyOS Linux (kernel 7.3.0-4-cachyos) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-28 04:44:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T04:44:12Z.

Review: APPROVED


The change is limited to routing the two per-writeback messages through the existing debug-only logging macro. It leaves the submit/wait and writeback code unchanged. The reported Linux validation-layer run confirms the relevant storage tests pass with zero VUID- lines and suppresses the target log lines; the hosted Windows job also completed successfully. The APS5_DEBUG_LOG-defined build was not tested, as stated.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5677883677 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12244#pullrequestreview-5677883677). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T04:44:12Z. **Review:** APPROVED --- The change is limited to routing the two per-writeback messages through the existing debug-only logging macro. It leaves the submit/wait and writeback code unchanged. The reported Linux validation-layer run confirms the relevant storage tests pass with zero `VUID-` lines and suppresses the target log lines; the hosted Windows job also completed successfully. The `APS5_DEBUG_LOG`-defined build was not tested, as stated.
MarcZX10 commented 2026-10-28 09:01:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T09:01:29Z.

Review: APPROVED


Both per-writeback log lines now use the same debug-only macro as other AGC per-operation diagnostics. The focused before/after run reports the same seven tests passing and zero validation errors, with the three tests that reach these call sites dropping from 18 log lines to none. This removes unconditional output without changing the writeback sequence. Current Windows and conventions checks pass. No blocking issue found.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5680105218 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12244#pullrequestreview-5680105218). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T09:01:29Z. **Review:** APPROVED --- Both per-writeback log lines now use the same debug-only macro as other AGC per-operation diagnostics. The focused before/after run reports the same seven tests passing and zero validation errors, with the three tests that reach these call sites dropping from 18 log lines to none. This removes unconditional output without changing the writeback sequence. Current Windows and conventions checks pass. No blocking issue found.
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!12244
No description provided.