graphics: keep views past MAX_MIP in the declared chain when its layout holds them (ASTRO BOT) #2172
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2172
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2172"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Nawid3333 on GitHub · 2026-11-08 00:00 UTC · original
Nawid3333:fix/mipview-tail-chain→main· +40 −14 · 2 files · 4 commits · openASTRO BOT (PPSA21564) exits on main early after boot with
A compute shader (
IMAGE_LOAD_MIP) binds mip 6 of a 1920x1080 RGBA16F image with tile mode 27 as a storage image, through a T# with MAX_MIP 5 (dwords055ea000,c4700000,010dc1df,91b66fac,0,00700050,0,0). Seven levels have the same layout as the declared six, and mip 6 lies in their mip tail. Beforebd41e2f6cthis view matched the declared chain; sincebd41e2f6cevery view past MAX_MIP is rebased onto a standalone chain of its own, which has no mip tail, so the match fails and the emulator exits. Main from 11-01 (893b03552) runs past this point with the same input.Change.
ResolveTextureMipViewmatches the view against the declared chain first, as beforebd41e2f6c, and rebases only when that fails. The matching itself moves unchanged intoMatchTextureMipView. The No Man's Sky case ofbd41e2f6cstill rebases (its declared one-level chain cannot hold mip 1), andTailMipViewPastMaxMipstill exits.When a view starts inside the declared chain and its LAST_LEVEL is past MAX_MIP,
39ecbab73on main ends it at MAX_MIP, unless the shader selects mips dynamically. That does not reach this view: its fallback still exits when the base level is past the declared levels (base 6 of 6 here). With this change the first match is the same as on main, so 39ecbab73's fallback is unchanged for views that start inside the chain.Test. A case in
CheckRenderExecutorStencilBindingDiscovery(--storage-mip-host-only) resolves ASTRO BOT's T# and requires the seven-level 1920x1080 image with view base 6 and a created view, inside the test's mapping (now 32 MiB, since the chain alone is larger than the 8 MiB the old fixture left after its address).shader_cfg_tests.81d29d43c, rebased onto main83df9c252): Windows, Linux and macOS build and pass the tests (run).Written with Claude Code and OpenAI Codex (AI): the fix, the test and the measurements, run on my PC; reviewed by me.
@coderabbitai[bot] on GitHub · 2026-11-08 00:05 UTC · original · edited 2026-11-12 18:21 UTC
No actionable comments were generated in the recent review.
Walkthrough
MatchTextureMipViewnow receives the physical image and its level count.ResolveTextureMipViewfirst tries to match against the declared image. If that fails and the view base level is at or beyondphysical_levels, it builds a physical image from the selected mip extent and retries. Tests increase an allocation size and check a mip-6 texture descriptor's resource-level count, allocation bounds, base level, and texture-cache lookup.Suggested reviewers:
nmzik,defektuChange: Bug fix
Merge Risk:
Minimal · up to
81d29This change keeps mip views past MAX_MIP within the declared chain when the layout holds them. That should stop the startup exit reported for ASTRO BOT. No actionable merge-blocking risk remains.
Pre-merge checks:
4
bd41e2f6crebasing views past MAX_MIP onto a standalone chain), the fix in ResolveTextureMipView and MatchTextureMipView, the added test in Ch…Full details: Title check
Explanation
The title names the main change: views past MAX_MIP are kept in the declared mip chain when its layout can hold them, and the ASTRO BOT target is named. It matches the changeset summary and PR objectives, which describe matching against the declared chain first and rebasing only on failure.
Full details: Description check
Explanation
The description states the crash symptom, the root cause (
bd41e2f6crebasing views past MAX_MIP onto a standalone chain), the fix in ResolveTextureMipView and MatchTextureMipView, the added test in CheckRenderExecutorStencilBindingDiscovery, and the test results. It relates directly to the changeset.Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
e4b48666-f8f5-4409-b813-1240112e28a8Reviewing files that changed from the base of the PR and between 84e7546eb0ca98829275f3ae7248982becde2fc2 and
81d29d43cb.tests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@coderabbitai[bot] on GitHub · 2026-11-08 00:06 UTC · original · reviewed
3340d4b6-dedd-4c9a-b94f-1bbda7da7517Reviewing files that changed from the base of the PR and between
751fbd0965and 5aa6b3eb2922ffbaf7accd7c2079b95a18f04fb4.src/graphics/host_gpu/renderer/pipeline/descriptors.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@coderabbitai[bot] on GitHub · 2026-11-09 15:19 UTC · original · reviewed
d249d160-59ee-4638-bbf8-5634f5a3a4f0Reviewing files that changed from the base of the PR and between
f399d48183and 34ef4bded63207e6d268971cc0ba064fdb9d5a77.src/graphics/host_gpu/renderer/pipeline/descriptors.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
@coderabbitai[bot] on GitHub · 2026-11-09 16:33 UTC · original · reviewed
709dd811-c70e-417e-9e6c-b33c0e90e6e4Reviewing files that changed from the base of the PR and between
f399d48183and 79dbcf16a638b286fb3b04f00973f713249357c1.src/graphics/host_gpu/renderer/pipeline/descriptors.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
@ZrDaniel07 on GitHub · 2026-11-14 22:16 UTC · original
Independent confirmation on NVIDIA. Setup: Windows 11 Pro 26300, RTX 5090 (driver 621.24), Ryzen 9 5900X, clang-cl Release builds, ASTRO BOT PPSA21564.
Unit tests. Built this PR's head
81d29d43and ranshader_recompiler_compute_testswith no selector: "all cases passed",RenderExecutorStencilBindingDiscoveryandRebasedLastMipQueryStoreincluded.TailMipViewPastMaxMipis a death test compiled out on Windows, so it was not exercised here.Bisect. Before finding this PR I bisected the boot exit with
git bisect runbetweeneecd9821(good) and782a85c6(bad). Each step builtkyty_emulatorand ran the game for 150 s from the same save; a step was bad if the log containedunsupported texture mip view changes physical layout.c1d1003d9678c59b6d8d4c8b259186918ac946ce7816ac79bd41e2f6Bad steps always stop at the same point (
base=6 last=6 max=5 extent=1920x1080x1 tile=27), which matches your analysis.Ordering note. My first local fix also tried the declared chain first, but it built the rebased chain from
infoafter the first attempt had already runinfo.UpdateSize()on it. That version failedmip view past MAX_MIPinRenderExecutorStencilBindingDiscovery. Your version passes: it copiesdeclaredbefore either attempt. So does my second version, which rebases first from an untouched copy. I think the copy is what matters, not the order, but I have not isolated that.In game, with this PR's code. Build:
main3e226bff+ this PR'sdescriptors.cppchange (the two test-only commits were left out because they conflict withmain's test file) + a port of #838. Starting with an empty shader cache, ASTRO BOT went from boot toworldmapat 0:29 and toaerial_gardenat 0:46 (from the game'sStartLevellog lines). I played the Garden level by hand for about 9.5 minutes with no exit and no dispatch skips. Per-second overlay figures (a local lab log line): FPS median 17.7, 10th percentile 10.2, worst frame per second 67 ms median; the CPU waits on the GPU about 920 ms of every second. An earlier build with an equivalent fallback but without #838 stopped at the level select (see #838).AI use: Claude Code ran the bisect, the builds and the tests and drafted this with me; I played the game.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.