vkback: make the in-place texcheck pass non-blocking #144

Manually merged
github merged 3 commits from github-bot/gh-144 into gh-pr/144/base 2026-12-02 15:18:21 +00:00 AGit
Owner

@⁠TheRifai on GitHub · 2026-12-01 21:25 UTC · original
TheRifai:texcheck-nonblock-v2 → main · +138 −2 · 4 files · 3 commits · merged 2026-12-02 15:12 UTC

What

The in-place texcheck pass requested on issue #121 now has the two fixes the maintainer asked for:

  • In-place images record (title address, row pitch, byte length, width, height) at creation (imgmake.rs), so the pass picks exactly those handles and needs no get_image_subresource_layout call (no VUID-07790 from arena images).
  • The copies are queued through the live setup path and compared at a later present once the timeline serial is reached — a non-blocking poll, not the old 5 s wait_fresh on the renderer thread. Buffers are dropped if 300 presents pass without completion.

The reference

No console counterpart: a rule-32 diagnostic tool for the contents question in TASKS "In-place linear textures: contents check".

Evidence

  • cargo check -p vkback --all-targets, 164 native tests, and the build all pass.
  • House, 100 s, GE-Proton11-16 with the <shot>.texcheck trigger: the run survives to timeout (EXIT 124, world reached), lines appear as texcheck in place: 1 images queued for readback, 0 not queued and then a comparison result.
  • Same trigger under the Khronos validation layer, 110 s: only the four known VUIDs (03428, 01688, 01687, 06409) — no 07790 — and the run again survives.
  • The first comparison found 0x8000000000000269 (16x28, pitch 256) differing in 68.21% of the bytes between the image readback and the CPU-mapped title rows. This is a finding, not a verdict: the old pass compared a GPU detile against the image and reported 35/35 matches, so the next step is to establish whether the CPU mapping is coherent/current for that address (or the title remapped it) before calling it a wrong bind. The pass is a usable tool for that check.
  • Runs: /tmp/opencode/capture/texcheck-nonblock7/, /tmp/opencode/capture/texcheck-final-val/. Neither is a performance measurement.

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 21:25 UTC · [original](https://github.com/vktory6/VKtory/pull/144) `TheRifai:texcheck-nonblock-v2` → `main` · +138 −2 · 4 files · 3 commits · merged 2026-12-02 15:12 UTC ## What The in-place texcheck pass requested on issue #121 now has the two fixes the maintainer asked for: - In-place images record `(title address, row pitch, byte length, width, height)` at creation (`imgmake.rs`), so the pass picks exactly those handles and needs **no** `get_image_subresource_layout` call (no VUID-07790 from arena images). - The copies are queued through the live setup path and compared at a later present once the timeline serial is reached — a non-blocking poll, not the old 5 s `wait_fresh` on the renderer thread. Buffers are dropped if 300 presents pass without completion. ## The reference No console counterpart: a rule-32 diagnostic tool for the contents question in TASKS "In-place linear textures: contents check". ## Evidence - `cargo check -p vkback --all-targets`, 164 native tests, and the build all pass. - House, 100 s, GE-Proton11-16 with the `<shot>.texcheck` trigger: the run survives to timeout (`EXIT 124`, world reached), lines appear as `texcheck in place: 1 images queued for readback, 0 not queued` and then a comparison result. - Same trigger under the Khronos validation layer, 110 s: only the four known VUIDs (`03428`, `01688`, `01687`, `06409`) — no `07790` — and the run again survives. - The first comparison found `0x8000000000000269` (16x28, pitch 256) differing in 68.21% of the bytes between the image readback and the CPU-mapped title rows. This is a **finding, not a verdict**: the old pass compared a GPU detile against the image and reported 35/35 matches, so the next step is to establish whether the CPU mapping is coherent/current for that address (or the title remapped it) before calling it a wrong bind. The pass is a usable tool for that check. - Runs: `/tmp/opencode/capture/texcheck-nonblock7/`, `/tmp/opencode/capture/texcheck-final-val/`. Neither is a performance measurement. ## 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)
Follow-up on issue #121. Record each in-place image's title address, row pitch and extent at creation (no get_image_subresource_layout call, so no VUID-07790 from arena images), queue the readback copies through the live setup path, and compare them at a later present once the timeline serial is reached. No renderer-thread wait: the earlier pass's 5 s wait at a menu could trip the title's timeout. Runs survive to timeout with the trigger on.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 21:30:13 +00:00
Author
Owner

@⁠TheRifai on GitHub · 2026-12-01 22:40 UTC · original

Correction on the evidence in this PR: the reported 68.21% (4889/7168) byte difference is not verified. My first comparison covered only width bytes per row instead of the full 256-byte pitch; after fixing that the run still shows a large difference, but I have not established that the CPU mapping at the title address is coherent/current at the time of the image readback, nor that the address still holds the same texture (the address changed between two runs). So the number must not be read as a wrong-bind finding.

The tool changes themselves (creation-time layout set, non-blocking poll, no new VUID, run survives) are verified by /tmp/opencode/capture/texcheck-final-val/ and the build/tests. The comparison result needs a control: run the pass on a known-good in-place texture (or detile the title bytes on the GPU as the existing pass does) and confirm it reports 0 differences before treating any nonzero result as evidence. Until then this PR should be judged as a tool, not as a contents verdict.

**@⁠TheRifai** on GitHub · 2026-12-01 22:40 UTC · [original](https://github.com/vktory6/VKtory/pull/144#issuecomment-7328171302) Correction on the evidence in this PR: the reported `68.21% (4889/7168)` byte difference is **not verified**. My first comparison covered only `width` bytes per row instead of the full 256-byte pitch; after fixing that the run still shows a large difference, but I have not established that the CPU mapping at the title address is coherent/current at the time of the image readback, nor that the address still holds the same texture (the address changed between two runs). So the number must not be read as a wrong-bind finding. The tool changes themselves (creation-time layout set, non-blocking poll, no new VUID, run survives) are verified by `/tmp/opencode/capture/texcheck-final-val/` and the build/tests. The comparison result needs a control: run the pass on a known-good in-place texture (or detile the title bytes on the GPU as the existing pass does) and confirm it reports 0 differences before treating any nonzero result as evidence. Until then this PR should be judged as a tool, not as a contents verdict.
github-bot changed target branch from main to gh-pr/144/base 2026-12-02 15:18:20 +00:00
github manually merged commit 00541a5f61 into gh-pr/144/base 2026-12-02 15:18:21 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 15:14 UTC · original

Merged as github.com/vktory6/VKtory@3523bafa1a, thanks. I pushed one change to your branch first: the in-place layout record now goes with its image's views (take_views in imgview.rs) instead of at each of the four removal sites, which also kept lib.rs inside its size limit. Tests and policy passed on private main.

If you're looking for a next topic: the streaming stutter is mostly renderer CPU, and "Texture fills on the GPU" and "Renderer CPU: index slots" in docs/TASKS.md are the biggest open items there.

**@⁠vktory6** on GitHub · 2026-12-02 15:14 UTC · [original](https://github.com/vktory6/VKtory/pull/144#issuecomment-7349989670) Merged as https://github.com/vktory6/VKtory/commit/3523bafa1a59883d9038872dc14c374cdcf956a0, thanks. I pushed one change to your branch first: the in-place layout record now goes with its image's views (`take_views` in imgview.rs) instead of at each of the four removal sites, which also kept `lib.rs` inside its size limit. Tests and policy passed on private main. If you're looking for a next topic: the streaming stutter is mostly renderer CPU, and "Texture fills on the GPU" and "Renderer CPU: index slots" in docs/TASKS.md are the biggest open items there.
This discussion has been locked. Commenting is limited to contributors.
No description provided.