GPU: answer live guard is_view from the title's placeholder records #242

Closed
github-bot wants to merge 1 commit from github-bot/gh-242 into main AGit
Owner

@⁠TheRifai on GitHub · 2026-12-02 15:42 UTC · original
TheRifai:placeholder-title-record → main · +9 −1 · 1 files · 1 commits · closed without merging

What

Follow-up to #208/#219: the RegionSize counter showed 88% of live-guard VirtualQuery calls land in multi-GiB regions (56.6% <8G, 31.3% >=8G) at ~87 µs each. Wine walks the whole placeholder region, which is what the maintainer's standalone test measured.

The runtime already reports these reservations through title_placeholder_reserved, but the records were only kept with VICTORY_HOLES_TOLD=1. This keeps them always and lets is_view answer from the record before asking Windows. A placeholder is "nothing mapped now", which is exactly what the hole walk would have answered. The Wine stacks from #139 are outside the reservations, so #141's refusal is untouched.

One file, one topic: the #219 counter was used for measurement but is not part of this diff.

Evidence

A/B/B/A on main b447925, RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Series X 3840x2160, house rt3, warm store, 100 s per run, scripted camera walk (W/I/K/J at 20/45/70/95 s), counter build in both arms:

Run Build Mean fps is_view ms/s sending waits ms/s LIVE_NOT_TITLE
A1 main + counter 26.91 129.2 58.8 16
B1 patched + counter 29.82 0.1 9.0 16
B2 patched + counter 28.37 0.2 11.6 16
A2 main + counter 28.57 110.9 48.3 16

So the query cost essentially disappears, sending waits drop ~5x, and fps improves in both pairs. The refusal count stays at 16 (the same 0x100000000 Wine stack blocks), so the crash fix is intact. No new loud kinds appeared; the two kinds seen only in patched arms (buffer view of an unknown buffer, slot written at a retry) also occur in other main runs.

tools/build.sh exit 0. Evidence: /home/shlong/Documents/VKtory-capture/placeholder-ab-{A1,B1,B2,A2}/, /home/shlong/Documents/VKtory-capture/isview-regions/.

Checklist (docs/AGENTS.md)

  • One topic; docs/TASKS.md not edited (rules 29/31)
  • No fallback, constant, switch, queue, unsafe or translator output added (rules 2/9b/33/35/36/27); an existing switch keeps its other behaviour
  • Comments say what is true now (rule 3)
  • No game content as evidence; only counters and fps
**@⁠TheRifai** on GitHub · 2026-12-02 15:42 UTC · [original](https://github.com/vktory6/VKtory/pull/242) `TheRifai:placeholder-title-record` → `main` · +9 −1 · 1 files · 1 commits · closed without merging ## What Follow-up to #208/#219: the `RegionSize` counter showed 88% of live-guard `VirtualQuery` calls land in multi-GiB regions (56.6% `<8G`, 31.3% `>=8G`) at ~87 µs each. Wine walks the whole placeholder region, which is what the maintainer's standalone test measured. The runtime already reports these reservations through `title_placeholder_reserved`, but the records were only kept with `VICTORY_HOLES_TOLD=1`. This keeps them always and lets `is_view` answer from the record before asking Windows. A placeholder is "nothing mapped now", which is exactly what the hole walk would have answered. The Wine stacks from #139 are outside the reservations, so #141's refusal is untouched. One file, one topic: the #219 counter was used for measurement but is not part of this diff. ## Evidence A/B/B/A on main `b447925`, RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Series X 3840x2160, house `rt3`, warm store, 100 s per run, scripted camera walk (W/I/K/J at 20/45/70/95 s), counter build in both arms: | Run | Build | Mean fps | `is_view` ms/s | sending waits ms/s | `LIVE_NOT_TITLE` | |---|---|---:|---:|---:|---:| | A1 | main + counter | 26.91 | 129.2 | 58.8 | 16 | | B1 | patched + counter | 29.82 | 0.1 | 9.0 | 16 | | B2 | patched + counter | 28.37 | 0.2 | 11.6 | 16 | | A2 | main + counter | 28.57 | 110.9 | 48.3 | 16 | So the query cost essentially disappears, sending waits drop ~5x, and fps improves in both pairs. The refusal count stays at 16 (the same `0x100000000` Wine stack blocks), so the crash fix is intact. No new loud kinds appeared; the two kinds seen only in patched arms (`buffer view of an unknown buffer`, `slot written at a retry`) also occur in other main runs. `tools/build.sh` exit 0. Evidence: `/home/shlong/Documents/VKtory-capture/placeholder-ab-{A1,B1,B2,A2}/`, `/home/shlong/Documents/VKtory-capture/isview-regions/`. ## Checklist (docs/AGENTS.md) - [x] One topic; `docs/TASKS.md` not edited (rules 29/31) - [x] No fallback, constant, switch, queue, `unsafe` or translator output added (rules 2/9b/33/35/36/27); an existing switch keeps its other behaviour - [x] Comments say what is true now (rule 3) - [x] No game content as evidence; only counters and fps
#208/#219: 88% of live guard VirtualQuery calls land in multi-GiB regions (56.6%
<8G, 31.3% >=8G) at ~87 us each, because Wine walks the whole placeholder.
The runtime already tells umem about these reservations, but only kept them with
VICTORY_HOLES_TOLD=1. Keep them always and let is_view answer from the record
before asking Windows. The Wine stacks from #139 are outside the reservations,
so #141's refusal still applies (LIVE_NOT_TITLE stayed 16 in every A/B arm).

A/B/B/A on main b447925, RX 9070 XT / GE-Proton11-16, house rt3, 100 s:
is_view time 129.2/110.9 -> 0.1/0.2 ms/s, sending waits 58.8/48.3 -> 9.0/11.6
ms/s, fps 26.91/28.57 -> 29.82/28.37. No new loud kinds. Built with the #219
RegionSize counter for measurement; this PR contains only the fix.
Evidence: /home/shlong/Documents/VKtory-capture/placeholder-ab-*/.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 15:45:46 +00:00
Author
Owner

@⁠TheRifai on GitHub · 2026-12-02 15:43 UTC · original

Duplicate-work note: main moved to 3aea0e4 ("GPU: live guards know title memory from the runtime's own record, not VirtualQuery (#171)") while my A/B was running. That commit implements the same idea more completely (a title_owns/not_title record in umemranges.rs, including invalidation on title_memory_given/title_released), so this PR is superseded and should not be merged. I am not closing or reopening it myself — please close it when convenient.

The measurements that led here remain useful: is_view 129/111 -> 0.1/0.2 ms/s, sending waits 59/48 -> 9/12 ms/s, fps 26.91/28.57 -> 29.82/28.37 in paired 100 s house runs; refusal count unchanged at 16. They are on the #219 counter branch and in /home/shlong/Documents/VKtory-capture/placeholder-ab-*/.

**@⁠TheRifai** on GitHub · 2026-12-02 15:43 UTC · [original](https://github.com/vktory6/VKtory/pull/242#issuecomment-7350809811) Duplicate-work note: main moved to `3aea0e4` ("GPU: live guards know title memory from the runtime's own record, not VirtualQuery (#171)") while my A/B was running. That commit implements the same idea more completely (a `title_owns`/`not_title` record in `umemranges.rs`, including invalidation on `title_memory_given`/`title_released`), so this PR is superseded and should not be merged. I am not closing or reopening it myself — please close it when convenient. The measurements that led here remain useful: `is_view` 129/111 -> 0.1/0.2 ms/s, sending waits 59/48 -> 9/12 ms/s, fps 26.91/28.57 -> 29.82/28.37 in paired 100 s house runs; refusal count unchanged at 16. They are on the #219 counter branch and in `/home/shlong/Documents/VKtory-capture/placeholder-ab-*/`.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 16:08 UTC · original

Thanks. Main already has a fix for this since this afternoon: github.com/vktory6/VKtory@3aea0e4 (see #171). The guards keep the runtime's record of everything it gave the title, allocations and commits as well as placeholder reservations, so private title memory doesn't fall back to VirtualQuery either. Anything else is asked once and remembered. Closing as superseded; your placeholder-record idea is part of what that change uses.

**@⁠vktory6** on GitHub · 2026-12-02 16:08 UTC · [original](https://github.com/vktory6/VKtory/pull/242#issuecomment-7351496807) Thanks. Main already has a fix for this since this afternoon: https://github.com/vktory6/VKtory/commit/3aea0e4 (see #171). The guards keep the runtime's record of everything it gave the title, allocations and commits as well as placeholder reservations, so private title memory doesn't fall back to `VirtualQuery` either. Anything else is asked once and remembered. Closing as superseded; your placeholder-record idea is part of what that change uses.
github-bot closed this pull request 2026-12-02 16:19:05 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.