test(agc): count depth view allocations on Windows #20324

Merged
lgqdaxia merged 1 commit from upstream-pr/20324 into main 2026-11-26 18:02:01 +00:00
lgqdaxia commented 2026-11-15 02:03:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by lgqdaxia on 2026-11-15T02:03:34Z.


What

Windows currently compiles out the resident-depth allocation assertion because its counter is glibc-only. Enable that same assertion for Windows/MinGW test builds by counting scalar operator new calls inside the AGC DLL.

A known allocation inside the DLL must count as one before the existing 16-draw zero-allocation check runs. Allocation requests still use the existing allocator; the glibc path stays unchanged. The counter covers the calling thread's scalar allocations inside AGC.

This extends #17007 and provides Windows regression coverage for #15058. The two PRs can merge independently.

Tested

Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0, Release/Ninja, BUILD_TESTING=ON, SPIRV-Tools disabled.

  • Main 2f6d40f29b and test head 3a0e8ed7a5: agc_driver_graphics and agc_graphics_profile_draw pass 2/2 on each. The candidate executes the DLL positive control (1) and the warmed 16-draw assertion (0).
  • Combined with depth fix 6b7ff32a11: both cases pass. Restoring only the unfixed depth implementation makes both fail at 16 allocations over 16 draws, so the Windows assertion detects that regression.
  • Actual loaded AGC DLL hashes match their builds on both combined arms. Test registration and export inspection pass; the allocator and linker wrapper remain unexported.
Focused negative-control composition

Private combined head 95d5d5a05605028595faaeb518b08a986727eec4. The negative control restores only Graphics/src/DepthSurface.cpp from 5561bfa9336ed717d05f2183564a0e2e93eb19b7, retaining the checked-reader and counter support. These graphics fixtures use mock Vulkan.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: n/a (mock Vulkan fixtures)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5318522411 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20324). Originally posted by [lgqdaxia](https://github.com/lgqdaxia) on 2026-11-15T02:03:34Z. --- ### What Windows currently compiles out the resident-depth allocation assertion because its counter is glibc-only. Enable that same assertion for Windows/MinGW test builds by counting scalar `operator new` calls inside the AGC DLL. A known allocation inside the DLL must count as one before the existing 16-draw zero-allocation check runs. Allocation requests still use the existing allocator; the glibc path stays unchanged. The counter covers the calling thread's scalar allocations inside AGC. This extends #17007 and provides Windows regression coverage for #15058. The two PRs can merge independently. ### 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. --> Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0, Release/Ninja, `BUILD_TESTING=ON`, SPIRV-Tools disabled. - Main `2f6d40f29b` and test head `3a0e8ed7a5`: `agc_driver_graphics` and `agc_graphics_profile_draw` pass **2/2** on each. The candidate executes the DLL positive control (**1**) and the warmed 16-draw assertion (**0**). - Combined with depth fix `6b7ff32a11`: both cases pass. Restoring only the unfixed depth implementation makes both fail at **16 allocations over 16 draws**, so the Windows assertion detects that regression. - Actual loaded AGC DLL hashes match their builds on both combined arms. Test registration and export inspection pass; the allocator and linker wrapper remain unexported. <details> <summary>Focused negative-control composition</summary> Private combined head `95d5d5a05605028595faaeb518b08a986727eec4`. The negative control restores only `Graphics/src/DepthSurface.cpp` from `5561bfa9336ed717d05f2183564a0e2e93eb19b7`, retaining the checked-reader and counter support. These graphics fixtures use mock Vulkan. </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) and the licence notice of code adapted from upstream (see AGENTS.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 <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a (mock Vulkan fixtures) <!-- 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 <!-- yes / no -->
MarcZX10 commented 2026-11-15 11:09:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T11:09:36Z.

Review: APPROVED


Reviewed — looks good

The reviewed change adds a Windows/MinGW allocation counter for the AGC DLL and a positive control to the repeated depth view allocation test; review was limited to the supplied diff and changed files.

What I ran

Reviewed head 3a0e8ed7a5e6ef36c75fc210530877980136f1a9. No build or tests were run. The author reports Windows test results in the PR description; those were not run by me.

Results

Check Result Note
Changed-file review passed All four changed files read
Build and tests not run Author reports Windows 11 results

Findings

Blocking

None.

Non-blocking

None.

Not verified

The supplied files.json was not available through the reader, so I could not independently confirm its exclusions or reviewed-file list. I read the description, commits, manifest, diff, and full text of all four changed files. No other repository files were read. Build behavior, test results, and Windows linker/export behavior were not independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5910379572 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20324#pullrequestreview-5910379572). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T11:09:36Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed change adds a Windows/MinGW allocation counter for the AGC DLL and a positive control to the repeated depth view allocation test; review was limited to the supplied diff and changed files. ## What I ran Reviewed head `3a0e8ed7a5e6ef36c75fc210530877980136f1a9`. No build or tests were run. The author reports Windows test results in the PR description; those were not run by me. ## Results | Check | Result | Note | |---|---|---| | Changed-file review | passed | All four changed files read | | Build and tests | not run | Author reports Windows 11 results | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The supplied `files.json` was not available through the reader, so I could not independently confirm its exclusions or reviewed-file list. I read the description, commits, manifest, diff, and full text of all four changed files. No other repository files were read. Build behavior, test results, and Windows linker/export behavior were not independently verified. ## To get this to a good state Nothing is required.
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!20324
No description provided.