Windows: integrate Astro Bot runtime fixes and Debug build support #1162
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!1162
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1162/head"
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?
@SergiioDev on GitHub · 2026-10-07 20:01 UTC · original
SergiioDev:codex/astro-shader-resource-fix→main· +284 −30 · 9 files · 4 commits · closed without mergingASTRO BOT PPSA21567, version 01.019.000, previously crashed at a host
memcpyreading null + 0x18 during shader resource materialization. On Windows, protected guest destinations could also makeReadFilefail silently and leave level loading in an infinite tunnel. This branch combines the existing emulator fixes and adds Windows regression coverage. It allows the tested launcher run to reach the galaxy map with the game's native rendering paths enabled.Relationship to existing PRs
This is a draft integration/validation PR, not a claim of a new independent shader fix. Both contributing PRs are still open:
eda7620666c4d1dfb9f5cb84cc1621f0e478db9d, with original authorship retained. It removes raw guest dereferences from SRT reads and capture, uses checked readers, and handles reads in speculative blocks.The new Windows-only test exercises ordinary and write-protected destinations, user-mode fault handling, a nonzero starting offset, reads spanning multiple 1 MiB chunks, byte integrity, EOF, and final file position. It failed against the original file-read implementation and passed with the retry. A small diagnostic improvement also reports the Vulkan timeline-wait result and tick instead of only a generic fatal condition.
The user-provided
Instassertion now budgets its fixed storage separately fromsizeof(std::vector<Use>):sizeof(Inst) <= 88 + sizeof(std::vector<Use>). This allows Debug standard-library bookkeeping while retaining the fixed instruction-storage limit. Debug emulator and focused test targets build with this assertion.Maintainers can take the two existing fixes through their original PRs and retain the additional guards/tests separately. This PR deliberately overlaps them to present the exact combined source changes used for this Windows validation.
Validation
resource_materialization,resource_tracking,scalar_provenance,windows_file_read,archive_file, andguest_red_zone_patcher.shader_cfg(Debug vector bounds assertion),kernel_file_system(unknown socket-option expectation),shader_recompiler_computeandcompute_meta_clear_classification(indirect-image materialization assertion), andvirtual_memory_allocation(fiber stack fixture). Their relationship to these changes has not been established. A shader_cfg attempt without the imported shader changes also stalled and was bounded by a timeout; that alone does not establish the cause.Validation used base
d2413fc2. The committed branch was checked to merge without conflicts withorigin/mainat45b6d2c5; that merged result has not been built or game-tested. The Debug-compatibleValue.hsize assertion used during validation is included in this PR at the user's request.One earlier native run ended in a Vulkan semaphore failure while GPU tests were running concurrently, with an NVIDIA driver reset recorded by Windows. Causality remains unknown. The subsequent launcher run was tested without concurrent GPU tests. This is startup/early-game validation, not full-game compatibility or sustained 60 fps validation. Current launcher file logging was disabled, so its console output was not archived.
AI disclosure
OpenAI Codex imported the upstream patch, adapted the Windows retry guards, wrote the Windows test and Vulkan diagnostic change, built and ran tests, inspected the running game through computer-use tools, and prepared this PR at the user's explicit request. The original upstream contributions are credited above. The human user supplied the
Instsize assertion, operated the launcher/game, and reported the runtime result; independent human review of the complete PR has not yet been completed. This PR remains a draft for that review and the outstanding test failures.No game binaries, JSON cheats, game assets, local launch helpers, monitoring files, or user save data are included.
@coderabbitai[bot] on GitHub · 2026-10-07 20:09 UTC · original
📝 Walkthrough
Walkthrough
Windows file reads now retry eligible buffer errors through a thread-local buffer, and a Windows test covers ordinary and read-only destination reads. Shader resource reads use checked callbacks, while flat-buffer refresh tracks definite and speculative paths. Semaphore wait failures include Vulkan result details. The
Instsize assertion now accounts separately for the vector object.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: 🟡 Moderate · up to
be27bThe new shader flat-buffer refresh logic can accept an unreadable descriptor-table read on a path the shader will definitely execute. The shader then uses a zero resource value. That can cause incorrect rendering or crashes in affected shaders. These cases should be fixed before merging.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 8 files. (1 skipped: 1 unsupported.)
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
Comment
@coderabbitai helpto get the list of available commands.@ -969,3 +979,3 @@for (const auto source: block.sources) active[source] = 1u;for (const auto slot: block.srt_reads) {if (!refresh(slot)) return false;if (!refresh(slot) && !speculative) return false;@coderabbitai[bot] on GitHub · 2026-10-07 20:09 UTC · original
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Evaluate memory-independent conditions without a specialization reader.
If
read_specialization_memoryis null, the predicate check at Line 985 skips even an immediate or user-data condition. The selected successor becomes speculative, so this new failure rule ignores a failed ordinary SRT read on a known-taken path. Evaluate conditions through the clean evaluator when it can resolve them without a specialization read. Keep conditions that require an unavailable checked read undecided.@ -980,0 +990,4 @@// A single successor is no choice: it is as definite as the block that leads to it.const bool undecided = block.successors.size() > 1u;for (const auto successor: block.successors)pending.push_back(successor | (speculative || undecided ? Speculative : 0u));@coderabbitai[bot] on GitHub · 2026-10-07 20:09 UTC · original
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Mark an unavoidable join as definite.
If an undecidable branch has two paths that converge, both paths mark the join speculative. A failed SRT read in that join is then ignored, although the guest must execute the join.
RefreshFlatBufferreturns success with the slot left at zero. Track whether a block is unavoidable across the possible paths, and retry its reads as definite. Add an undecidable diamond with an unreadable read in its common successor to the regression test.@coderabbitai[bot] on GitHub · 2026-10-07 20:09 UTC · original · reviewed
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
d6b14f22-2334-4723-9e29-9d587c1a7f94📥 Commits
Reviewing files that changed from the base of the PR and between
45b6d2c597andbe27b10504.📒 Files selected for processing (9)
CMakeLists.txtsrc/common/platform/sysWindowsFileIO.cppsrc/graphics/host_gpu/renderer/masterSemaphore.cppsrc/graphics/shader/recompiler/ir/Value.hsrc/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cppsrc/graphics/shader/recompiler/ir/passes/SrtWalker.cpptests/ResourceMaterializationTests.cpptests/ResourceTrackingTests.cpptests/WindowsFileReadTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@theantipopau on GitHub · 2026-10-07 23:47 UTC · original
Integrated into our fork (theantipopau/KytyPS5
main, 4 commits throughcdd66e25) on Windows x64 against current upstream/main (420bb51d):windows_file_read_tests,resource_materialization_tests,resource_tracking_testsall pass — 14/14 in our local ctest sweep (CI subset +kernel_file_read-style coverage +virtual_memory_allocation).The protected Windows file-read path is the part we're most interested in for our local game-run testing; will report back if anything surfaces on real dumps.
@Nmzik on GitHub · 2026-10-21 19:42 UTC · original
Superseded by #838 and #1365.
Pull request closed