Stale BC7 textures: four images hold fewer non-zero bytes than their title memory #59

Open
opened 2026-12-01 09:05:16 +00:00 by github-bot · 4 comments
Owner

@⁠TheRifai on GitHub · 2026-12-01 09:03 UTC · original

Finding (AGENTS.md rule 29)

A shot.texcheck at the bathroom view on the house save reported four textures whose vkback image differs from title memory:

  • a 1024x1024 BC7 mip chain (1,398,096 B): title memory 18.7% non-zero, vkback image 1.2%
  • two 512x512 BC7 chains (349,504 / 349,520 B): title 22.9% non-zero, image 5.7/5.8%
  • one 49,128 B float-like table: 28.3% of bytes differ (both non-zero)

The images hold fewer non-zero bytes than title memory, so either a fill is partial or the title memory holds a different texture's bytes. Character-texture-sized; a pixel probe named the arm pass but VKB_VALDUMP cannot patch it ("no Int64 type").

This is secondary to the visible black-limb symptom, which was resolved by supplying the BCPack tables (VICTORY_BCPACK_TABLES; see capture/black-limbs.md). It is still a correctness finding: title-memory bytes are not reaching the GPU image as they should. Recheck on current main before working on it.

Next

Fix the valdump description so it can carry Int64 (or add a texture-id probe), then name the four textures by id and compare them directly. A picture gate is needed if the fix changes what is sampled.

Seen on: feb6d04 (black-limb probe, 2026-12-01).

**@⁠TheRifai** on GitHub · 2026-12-01 09:03 UTC · [original](https://github.com/vktory6/VKtory/issues/59) ## Finding (AGENTS.md rule 29) A `shot.texcheck` at the bathroom view on the house save reported four textures whose vkback image differs from title memory: - a 1024x1024 BC7 mip chain (1,398,096 B): title memory 18.7% non-zero, vkback image 1.2% - two 512x512 BC7 chains (349,504 / 349,520 B): title 22.9% non-zero, image 5.7/5.8% - one 49,128 B float-like table: 28.3% of bytes differ (both non-zero) The images hold fewer non-zero bytes than title memory, so either a fill is partial or the title memory holds a different texture's bytes. Character-texture-sized; a pixel probe named the arm pass but `VKB_VALDUMP` cannot patch it ("no Int64 type"). This is secondary to the visible black-limb symptom, which was **resolved** by supplying the BCPack tables (`VICTORY_BCPACK_TABLES`; see `capture/black-limbs.md`). It is still a correctness finding: title-memory bytes are not reaching the GPU image as they should. Recheck on current main before working on it. ## Next Fix the valdump description so it can carry Int64 (or add a texture-id probe), then name the four textures by id and compare them directly. A picture gate is needed if the fix changes what is sampled. Seen on: `feb6d04` (black-limb probe, 2026-12-01).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 09:05:16 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 09:08 UTC · original

Thanks! I created a task based on your report: "Texture images that differ from their title memory" in github.com/vktory6/VKtory@a2d52e2. It carries your Seen on (a build that isn't main), and its first step is a recheck with texcheck on current main, since several texture and fill fixes went in today.

**@⁠vktory6** on GitHub · 2026-12-01 09:08 UTC · [original](https://github.com/vktory6/VKtory/issues/59#issuecomment-7306267452) Thanks! I created a task based on your report: "Texture images that differ from their title memory" in https://github.com/vktory6/VKtory/commit/a2d52e2. It carries your `Seen on` (a build that isn't main), and its first step is a recheck with `texcheck` on current main, since several texture and fill fixes went in today.
Author
Owner

@⁠TheRifai on GitHub · 2026-12-01 09:14 UTC · original

Rechecked on current main (a2d52e2) with VICTORY_BCPACK_TABLES set, house save, world entry, <shot>.texcheck. Report lines were again not flushed to vk.log before the run ended, but the bins were written; comparing them directly:

texcheck-869f50: 2,088,960 B  title non-zero 99.8%  image 99.7%  differing bytes 97.5%
texcheck-869fe0:   522,240 B  title non-zero 100%   image 100%   differing bytes 86.1%
texcheck-86a070:   522,240 B  title non-zero 100%   image 100%   differing bytes 92.8%

Bins are in /tmp/opencode/capture/texcheck-main-recheck/ (not committed). So the discrepancy is still present: unlike the earlier report (title 18.7%/22.9% non-zero vs image 1.2%/5.7%), both sides are essentially fully non-zero now, but the bytes mostly differ. Three textures were sampled this time (the 49 KB float table did not appear), and the sizes differ from the earlier chains, so the sampled set may not be the same.

Two possibilities remain, as in the issue: a partial/wrong fill, or title memory holding a different texture's bytes. The next step is still to name these ids (869f50/869fe0/86a070) by texture and check their fill source. Note for whoever picks it up: a byte-for-byte mismatch could also be expected if one side is a detiled representation, so confirm the expected layout before calling it a bug.

**@⁠TheRifai** on GitHub · 2026-12-01 09:14 UTC · [original](https://github.com/vktory6/VKtory/issues/59#issuecomment-7306412556) Rechecked on current main (`a2d52e2`) with `VICTORY_BCPACK_TABLES` set, house save, world entry, `<shot>.texcheck`. Report lines were again not flushed to vk.log before the run ended, but the bins were written; comparing them directly: ``` texcheck-869f50: 2,088,960 B title non-zero 99.8% image 99.7% differing bytes 97.5% texcheck-869fe0: 522,240 B title non-zero 100% image 100% differing bytes 86.1% texcheck-86a070: 522,240 B title non-zero 100% image 100% differing bytes 92.8% ``` Bins are in `/tmp/opencode/capture/texcheck-main-recheck/` (not committed). So the discrepancy is still present: unlike the earlier report (title 18.7%/22.9% non-zero vs image 1.2%/5.7%), both sides are essentially fully non-zero now, but the bytes mostly differ. Three textures were sampled this time (the 49 KB float table did not appear), and the sizes differ from the earlier chains, so the sampled set may not be the same. Two possibilities remain, as in the issue: a partial/wrong fill, or title memory holding a different texture's bytes. The next step is still to name these ids (869f50/869fe0/86a070) by texture and check their fill source. Note for whoever picks it up: a byte-for-byte mismatch could also be expected if one side is a detiled representation, so confirm the expected layout before calling it a bug.
Author
Owner

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

Thanks for the recheck. It's in the task with Rechecked on: a2d52e2 (github.com/vktory6/VKtory@89f9fb6). Agreed on your caveat: with both sides fully non-zero, a tiled-against-linear comparison would look exactly like this, so the first step is now to confirm what layout texcheck compares. The unflushed report lines are noted too.

**@⁠vktory6** on GitHub · 2026-12-01 09:20 UTC · [original](https://github.com/vktory6/VKtory/issues/59#issuecomment-7306560135) Thanks for the recheck. It's in the task with `Rechecked on: a2d52e2` (https://github.com/vktory6/VKtory/commit/89f9fb6). Agreed on your caveat: with both sides fully non-zero, a tiled-against-linear comparison would look exactly like this, so the first step is now to confirm what layout `texcheck` compares. The unflushed report lines are noted too.
Author
Owner

@⁠TheRifai on GitHub · 2026-12-01 21:26 UTC · original

On the "confirm what layout texcheck compares" step (seen on a2d52e2), I read the pass in current main: it is not comparing tiled title bytes with a linear image.

greenfield/vkback/src/texcheck.rs:44-62 calls gpu_fill_prepare(..., refill=true), which runs record_detile over the title bytes into w.lin (the same GPU detile the real fill uses), copies w.lin into buffer A, and copies the image into buffer B with w.regions rebased to the same buffer offsets. Both sides are therefore in the same detiled, tightly-packed subresource layout; the per-subresource byte counts in the report are like-for-like. Caveat: that is the GPU-filled pass; my new in-place pass (PR #144) compares CPU-mapped title rows directly against an in-place image readback, which is a different comparison and only valid for linear/256-byte-padded textures.

So for the three texture ids in /tmp/opencode/capture/texcheck-main-recheck/ (869f50/869fe0/86a070), the ~86-98% differing bytes are not explained by a tiled-vs-linear mismatch in the existing pass. The remaining leads are a partial/wrong detile fill or title memory holding different bytes than the fill read; naming the ids and their fill source is still the next step.

**@⁠TheRifai** on GitHub · 2026-12-01 21:26 UTC · [original](https://github.com/vktory6/VKtory/issues/59#issuecomment-7326255285) On the "confirm what layout texcheck compares" step (seen on `a2d52e2`), I read the pass in current main: it is **not** comparing tiled title bytes with a linear image. `greenfield/vkback/src/texcheck.rs:44-62` calls `gpu_fill_prepare(..., refill=true)`, which runs `record_detile` over the title bytes into `w.lin` (the same GPU detile the real fill uses), copies `w.lin` into buffer A, and copies the image into buffer B with `w.regions` rebased to the same buffer offsets. Both sides are therefore in the same detiled, tightly-packed subresource layout; the per-subresource byte counts in the report are like-for-like. Caveat: that is the GPU-filled pass; my new in-place pass (PR #144) compares CPU-mapped title rows directly against an in-place image readback, which is a different comparison and only valid for linear/256-byte-padded textures. So for the three texture ids in `/tmp/opencode/capture/texcheck-main-recheck/` (869f50/869fe0/86a070), the ~86-98% differing bytes are not explained by a tiled-vs-linear mismatch in the existing pass. The remaining leads are a partial/wrong detile fill or title memory holding different bytes than the fill read; naming the ids and their fill source is still the next step.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/vktory6--VKtory#59
No description provided.