graphics: fall back to the stored chain for mip views past MAX_MIP #2357
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!2357
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2357"
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?
@wuboo on GitHub · 2026-11-17 18:40 UTC · original
wuboo:pr/logo-mip-view→main· +146 −57 · 4 files · 1 commits · openProblem
ASTRO BOT (PPSA21564) exits during the PS logo, a few seconds after start, on current
main:The guest thread is the title-screen resource loader (
ProductNextLoad_ATQT/OdxAsyncLoader). The crash is deterministic: 3/3 runs on41e2147c0and 1/1 onfaec1f45e.Cause
bd41e2f6c("rebase texture views that lie entirely past MAX_MIP") handles a view whose levels all sit pastMAX_MIPas a separate one-level image of that mip's extent. That fits the No Man's Sky case: a 256x256kStandard4KBT# with base=1, last=1, max=0 is really a 128x128 image.The texture here is mip 6 of a 6-level 1920x1080
kRenderTargetimage (MAX_MIP 5). That mip still sits in the parent's allocation and is not laid out like a standalone 30x16 image. The rebase does not match, soResolveTextureMipViewreturns false. The caller then takes thebase >= physical_levelsbranch added in39ecbab73, which exits. Beforebd41e2f6c, the same view was resolved against the stored chain and the game kept running.Fix
The view is still rebased first, so the No Man's Sky case works as before. When the standalone-mip reading does not match,
ImageInfois restored and the view is matched against the chain the T# actually stores, which is the pre-bd41e2f6csearch. For the logo texture the result is the 1920x1080 chain, with the data size of its six stored levels. A tail mip that is not its own chain is still rejected, and thebase < physical_levelsclamp path is unchanged.ResolveTextureMipViewmoves fromdescriptors.cpptoimageInfo.cpp/.hso it can be unit-tested. Its body is otherwise the upstream code, split into a helper so it can run twice.Testing
TestMipViewPastMaxMipinshader_cfg_tests, covering:kRenderTargetmip 6 fork8_8_8_8UNorm,k10_10_10_2UNormandk16_16_16_16Float, with and without DCC metadata. The view must stay on the 1920x1080 image with the size of the 6-level chain.format=56 meta=0 ok=0 ... base=6 size=0 chain=12648448.ctestgives the same result set with and without the change (45/82 pass; the 37 failures are all GPU tests that cannot load a Vulkan loader on this machine, plus the existingshader_cfgabort inTestGpuProducedWritableDescriptor, which runs after the new test).--shader-cache:41e2147c0and 1/1 onfaec1f45e. With the change it passes in 9/9 runs.title_controller_ship), the world map andtransition_next.mainplus this change, most runs (6/7) then stop with a guest trap in a level-loader thread. That is a separate issue, which goes away with the file-read fix in #2356 (0/2 runs). With both changes, the first planet (underwater_aerial_garden) loads and plays: a 19,500-frame run with no errors, and the image is correct.AI use & testing
I used AI coding assistants to help investigate the issue, draft the code and write the unit test. I reviewed every line of the diff myself and I am responsible for it.
Testing:
41e2147c0, 1 onfaec1f45e) -> 0/9 after.TestMipViewPastMaxMip, including a mutation check that fails when the fallback is reverted.@coderabbitai[bot] on GitHub · 2026-11-17 18:48 UTC · original · edited 2026-11-25 01:37 UTC
No actionable comments were generated in the recent review.
Walkthrough
The change adds
ResolveTextureMipViewto the image information module. It matches stored mip layouts against a calculated physical chain and can try a rebased extent when the base mip exceeds the physical level count. The prior static helper is removed from the descriptor implementation. New tests cover rebasing, tail-mip rejection, and render-target allocation size.Suggested reviewers:
nmzikChange: Bug fix
Merge Risk:
Minimal · previous review
b3d15This change stops texture mip-view resolution from failing when a requested mip lies past MAX_MIP, which lets ASTRO BOT and similar titles get past the crash. Tests cover the new resolution cases, and testers report titles now reaching gameplay. No concrete merge-blocking risk remains.
Pre-merge checks:
4
bd41e2f6c, the fallback to the stored chain, the relocation of ResolveTextureMipView to ima…Full details: Title check
Explanation
The title names the main change: when a requested mip view lies past MAX_MIP and the standalone rebase does not match, the code falls back to the stored mip chain. The changeset adds ResolveTextureMipView in imageInfo.cpp/.h, adds the stored-chain fallback (MatchStoredMipChain), removes the helper from descriptors.cpp, and adds TestMipViewPastMaxMip. The title is specific and concise, and it is a single sentence.
Full details: Description check
Explanation
The description is closely related to the changeset. It explains the crash, its cause in the rebase added by
bd41e2f6c, the fallback to the stored chain, the relocation of ResolveTextureMipView to imageInfo.cpp/.h for unit testing, the new TestMipViewPastMaxMip test, and the mutation check. It also covers test results and objectives.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
32665d7a-8077-42a3-8e70-a8037b6a149eReviewing files that changed from the base of the PR and between 37d0cb60f1fcf935ab987b3b16b3124f9981c5c2 and b3d15fe9b4789b7a146c26ee9924e8d9124d7bb6.
src/graphics/host_gpu/renderer/image/imageInfo.cppsrc/graphics/host_gpu/renderer/image/imageInfo.htests/shaderCfgTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@Nawid3333 on GitHub · 2026-11-18 22:28 UTC · original
A second game for this check: Resonance: A Plague Tale Legacy (PPSA30601, #2374) stops at the logo on main with
unsupported texture mip view changes physical layout: base=8 last=8 max=7 extent=512x512x1 tile=5(descriptors.cpp:606). @Crispy81 ran this PR's Windows build (run 44176181642, head deef97a01) and it goes in game, with screenshots in #2374.@rigeri1 on GitHub · 2026-11-19 21:11 UTC · original
Tested the CI Windows build from run 44176181642 (
pr/logo-mip-view) with ASTRO BOT (PPSA21567) — @Nawid3333 asked in #2368 for reports on how far the game gets.Result: the fix works. On the release build
KytyPS5-2026-11-19-5ad27cdthis game stopped in theps_logolevel withunsupported texture mip view changes physical layout: base=6 last=6 max=5 extent=1920x1080x1 tile=27(descriptors.cpp:606). With this PR the game goes far past that point:ps_logo→ title screen → world map →hub_crashsite_tutorial→ intro cinematics → world map →hub_crashsite→underwater_aerial_garden→StartLevel aerial_garden— actual gameplay loads and runs. Clean exit, no crash (I closed the emulator myself).Notes from this run (low-end hardware: Ryzen 7 5800H, RTX 3060 Laptop 6 GB, 16 GB RAM, Windows 10 19045):
primitive restart is not implemented for mesh shaders; continuing draw (primitive=5 indexed=1).Full console log and an in-game overlay screenshot are available on request.
Note: I am not a programmer and my English is poor, so an AI assistant analyzed the log(s) and prepared this comment for publication from my Russian notes. The testing itself and the hardware are mine.
@wuboo on GitHub · 2026-11-19 23:38 UTC · original
Thanks for testing on different hardware. Good to see it gets through the PS logo and into aerial_garden.
On the memory numbers: the fallback in this PR does not allocate anything new. When the rebase does not fit, it resolves the view against the image that already exists. So the VRAM and RAM use you saw comes from the rest of the game, not from this change. The audio sync, the 30 FPS cap in the intro and the mesh-shader primitive restart warning are also outside this PR.
@rigeri1 on GitHub · 2026-11-20 00:46 UTC · original
Correct, my AI didn’t quite understand the task. The PR works, the game and levels launch. The rest is already testing of the game itself, which should be placed elsewhere. Don’t judge me too harshly, I’m just learning to test 🙃
@santisfied on GitHub · 2026-11-20 03:47 UTC · original · edited 2026-11-20 09:58 UTC
Same issue. Windows build [run 44176181642] works, Will this fix be merged into the main branch?
@mrfelek on GitHub · 2026-11-24 01:20 UTC · original
Tried the Linux artifact of the CI run you linked (run 45269682636; the binary reports
git = d89233a, the CI merge of37d0cb6). Setup: ASTRO BOT (PPSA21564), Linux, Radeon 780M, Mesa 26.0.8 RADV, headless with no controller input,--game <dir> --no-splash --skip-notice-screen.KytyPS5-2026-11-23-4e90654build stops about 36 s after start, right aftertitle_controller_shipstarts, withunsupported texture mip view changes physical layout: base=6 last=6 max=5 extent=1920x1080x1 tile=27(as reported in #2368).d89233aartifact runs the same setup for the full 300 s: nodescriptors.cppstop, no device loss, no GPU ring timeout, GPU busy 92% on average.Without controller input it stays in
title_controller_ship, so this only shows that it gets past the stop. I couldn't check how far the game gets after the title screen, and my screen captures of the headless display were black, so I didn't check the picture either.@wuboo on GitHub · 2026-11-24 02:38 UTC · original
Thanks for checking on Linux/RADV with the 780M. That matches what I see on Windows: the
descriptors.cppstop aftertitle_controller_ship(the one in #2368) goes away and the game keeps running. On my side, with pad input, it continues past the title screen into aerial_garden, and the picture there matches my earlier test runs of this PR.@mrfelek on GitHub · 2026-11-25 16:49 UTC · original
Retested the current head
deb82cdfawith the Linux artifact of run 45527078424, same setup as before (ASTRO BOT PPSA21564, Linux, Radeon 780M, Mesa 26.0.8 RADV, headless, no input). It reachesLevel has started: title_controller_shipand is still running at 300 s, when the script stops it. The log has nounsupported texture mip viewline, there are no amdgpu ring timeouts, and the GPU is about 92% busy. My screen captures of the headless session come out black on both builds, so this confirms only that the run continues past the old stop, not that the picture is right.AI-assisted.
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.