vkback: count shared-memory targets in the stats line #130

Manually merged
github merged 2 commits from github-bot/gh-130 into gh-pr/130/base 2026-12-01 20:03:54 +00:00 AGit
Owner

@⁠TheRifai on GitHub · 2026-12-01 19:31 UTC · original
TheRifai:shared-target-count → main · +66 −8 · 3 files · 2 commits · merged 2026-12-01 20:03 UTC

What

The GPU-written-target census (only under UMEM_MEMREPORT) found two cases invisible in the regular stats line: textures of one description sharing physical title pages at different title addresses, and textures displaced at an address a later texture took. Both are now counted on the stats line as shared targets: same description N (M MB), displaced K (docs/TASKS.md, "Targets of one description over the same memory are separate images"). No Vulkan behaviour changes.

The reference

No console counterpart: rule-32 counters, so a normal run records the cases without a special memory-report build.

Evidence

  • cargo check -p vkback --all-targets, 160 native tests, and the build all pass.
  • Boat start, 105 s, GE-Proton11-16, UMEM_MEMREPORT=1: stats line same description 6 (61 MB), displaced 208; the census in the same run reports same description at different title addresses 6 (61 MB) — the new counter agrees with the existing census exactly.
  • House, 85 s, no UMEM_MEMREPORT: the same line is still present (6 (61 MB), displaced 208), so the counts work without the special switch.
  • Runs: /tmp/opencode/capture/shared-targets-boat/, /tmp/opencode/capture/shared-targets-house/.

Checklist (docs/AGENTS.md)

  • One topic; docs/TASKS.md not edited (rule 29/31)
  • No fallback, constant, switch, queue, unsafe or translator output changed (rules 2/9b/33/35/36/27)
  • Comments say what is true now (rule 3)
  • Nothing from the title, no non-free data pointers (hard constraints)
**@⁠TheRifai** on GitHub · 2026-12-01 19:31 UTC · [original](https://github.com/vktory6/VKtory/pull/130) `TheRifai:shared-target-count` → `main` · +66 −8 · 3 files · 2 commits · merged 2026-12-01 20:03 UTC ## What The GPU-written-target census (only under `UMEM_MEMREPORT`) found two cases invisible in the regular stats line: textures of one description sharing physical title pages at different title addresses, and textures displaced at an address a later texture took. Both are now counted on the stats line as `shared targets: same description N (M MB), displaced K` (docs/TASKS.md, "Targets of one description over the same memory are separate images"). No Vulkan behaviour changes. ## The reference No console counterpart: rule-32 counters, so a normal run records the cases without a special memory-report build. ## Evidence - `cargo check -p vkback --all-targets`, 160 native tests, and the build all pass. - Boat start, 105 s, GE-Proton11-16, `UMEM_MEMREPORT=1`: stats line `same description 6 (61 MB), displaced 208`; the census in the same run reports `same description at different title addresses 6 (61 MB)` — the new counter agrees with the existing census exactly. - House, 85 s, no `UMEM_MEMREPORT`: the same line is still present (`6 (61 MB), displaced 208`), so the counts work without the special switch. - Runs: `/tmp/opencode/capture/shared-targets-boat/`, `/tmp/opencode/capture/shared-targets-house/`. ## Checklist (docs/AGENTS.md) - [x] One topic; `docs/TASKS.md` not edited (rule 29/31) - [x] No fallback, constant, switch, queue, `unsafe` or translator output changed (rules 2/9b/33/35/36/27) - [x] Comments say what is true now (rule 3) - [x] Nothing from the title, no non-free data pointers (hard constraints)
The rtsize census (only under UMEM_MEMREPORT) found two cases the stats line did not show: six pairs of GPU-written textures with one description over the same physical pages at different title addresses, and 208 textures displaced at an address another texture already had. Show both on the stats line so a run without the memory report carries the counts too. No Vulkan behaviour changes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 19:32:24 +00:00
github-bot changed target branch from main to gh-pr/130/base 2026-12-01 20:03:52 +00:00
github manually merged commit 89adc8d98e into gh-pr/130/base 2026-12-01 20:03:54 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 20:03 UTC · original

Merged, thanks. The counts match the census exactly, and both deviations are now visible in every run (rule 32).

One fix of mine on your branch: the "displaced" counter also counted it when the same texture was named at its own address again, which displaces nothing. It now counts only when another texture takes the address, with a unit test.

Next on this task: a write-here/read-there probe on the same-description pairs, to see whether the title actually reads across them. The full fix is "Render targets bound in place over their title memory", where we're on it internally now.

**@⁠vktory6** on GitHub · 2026-12-01 20:03 UTC · [original](https://github.com/vktory6/VKtory/pull/130#issuecomment-7323966807) Merged, thanks. The counts match the census exactly, and both deviations are now visible in every run (rule 32). One fix of mine on your branch: the "displaced" counter also counted it when the same texture was named at its own address again, which displaces nothing. It now counts only when another texture takes the address, with a unit test. Next on this task: a write-here/read-there probe on the same-description pairs, to see whether the title actually reads across them. The full fix is "Render targets bound in place over their title memory", where we're on it internally now.
This discussion has been locked. Commenting is limited to contributors.
No description provided.