fix(diagnostics): unwind sampled process thread callers #13131

Merged
Rengundom merged 2 commits from upstream-pr/13131 into main 2026-11-02 17:26:38 +00:00
Rengundom commented 2026-10-30 03:46:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Rengundom on 2026-10-30T03:46:50Z.


What

The Windows process-wide sampler creates per-thread walkers without stack bounds, so DWARF unwinding stops at the sampled frame. When existing bounds do not cover the sampled stack pointer, find the committed, accessible region that contains it. Keep reads within that region, and reject guarded, inaccessible and uncommitted regions.

Tested

Windows 11, MinGW GCC 15.2, Release. A new CTest samples an optimized busy function and checks for its exact caller address in the report. With main's code it fails with zero caller samples; with this change it passes, including 10 consecutive runs. It also checks that the fixture has no native Windows unwind entry, so it exercises DWARF unwinding. The test finishes in under one second and has a 20-second timeout. All four existing worker-sampler modes and agc_stack_walk pass on main and the change. A separate diagnostic of the actual walker checks boundary words, guard-page preservation, and no-access, reserved and null regions.

Matched main/change GPU tests agc_driver_bindless_images, agc_driver_image_sample_reduction and agc_driver_image_table pass with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. The layer loads in each GPU test, and neither log has VUIDs, validation errors or missing-layer warnings. No game run or performance claim.

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 3080, NVIDIA 616.92, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5079150901 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13131). Originally posted by [Rengundom](https://github.com/Rengundom) on 2026-10-30T03:46:50Z. --- ### What The Windows process-wide sampler creates per-thread walkers without stack bounds, so DWARF unwinding stops at the sampled frame. When existing bounds do not cover the sampled stack pointer, find the committed, accessible region that contains it. Keep reads within that region, and reject guarded, inaccessible and uncommitted regions. ### Tested Windows 11, MinGW GCC 15.2, Release. A new CTest samples an optimized busy function and checks for its exact caller address in the report. With main's code it fails with zero caller samples; with this change it passes, including 10 consecutive runs. It also checks that the fixture has no native Windows unwind entry, so it exercises DWARF unwinding. The test finishes in under one second and has a 20-second timeout. All four existing worker-sampler modes and agc_stack_walk pass on main and the change. A separate diagnostic of the actual walker checks boundary words, guard-page preservation, and no-access, reserved and null regions. Matched main/change GPU tests agc_driver_bindless_images, agc_driver_image_sample_reduction and agc_driver_image_table pass with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. The layer loads in each GPU test, and neither log has VUIDs, validation errors or missing-layer warnings. No game run or performance claim. <!-- 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. --> ### 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 3080, NVIDIA 616.92, Windows 11 - [x] AI-assisted: yes
copilot-pull-request-reviewer[bot] commented 2026-10-30 03:47:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-30T03:47:00Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5707847406 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13131#pullrequestreview-5707847406). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-10-30T03:47:00Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
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!13131
No description provided.