Report the shader stage and hash in CFG build failures #799
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!799
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/799/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?
@theantipopau on GitHub · 2026-09-24 06:21 UTC · original
theantipopau:shader-cfg-error-context→main· +27 −26 · 3 files · 2 commits · closed without mergingWhat
CFG::BuildGraphreports structural problems withEXIT, which halts the emulator. Beforethis change the resulting line identified the pc but not which shader failed:
With hundreds of shaders in flight there is no way to act on that.
BuildGraphnow takes anoptional context string that is prefixed to every build-failure diagnostic, and
TranslateProgrampasses the stage name and shader hash:BuildGraph's manyExitBuildFailurecall sites are routed through a single localfaillambda so the prefix cannot be forgotten at one of them. The default argument is empty, so
every existing caller is unchanged and the unprefixed form is still available.
Scope
This replaces the branch with the same 3-file, +27/−26 footprint it had before. The previous
revision of this PR also carried a copy of the Windows socket work from #797 at an older
revision; that duplication is gone, and #797 is now the only carrier of it.
Testing
shader_cfg_testsbuilds clean and passes.There is deliberately no unit test for the new prefix. Every
BuildGraphfailure path runsthrough
ExitBuildFailure, which is[[noreturn]]and callsEXIT— it records the reasoninto the graph and then halts the process, so there is no way to observe the formatted string
from inside the test binary.
Common::DbgExitHandleris a strong symbol incommon, so thetest executable cannot substitute it either. Verifying this needs either a subprocess harness
or a refactor that separates message construction from the halt, and neither seems worth the
machinery for a diagnostic prefix.
The non-fatal sibling path is already covered:
LogDispatcherFallbackprintsstage=andhash=on its own line for structurize failures, which is why this change is scoped to thefatal build path only.
@coderabbitai[bot] on GitHub · 2026-09-24 06:26 UTC · original · edited 2026-10-06 04:32 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
78d6a4c0-4064-4789-b80f-0ce383d17683📥 Commits
Reviewing files that changed from the base of the PR and between a599ad42b926e408653a1f075855f178b4472ab1 and ddcefb3ea143ffa30c3f4f7492f1b2689cdd2625.
📒 Files selected for processing (2)
src/libs/network.cpptests/KernelFileSystemTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough
Windows socket transports now track guest nonblocking mode and add a peek-and-wait-all receive path. Tests cover stream and datagram receives, EOF, and accepted sockets.
BuildGraphaccepts optional diagnostic context and prefixes it to CFG failure messages.TranslateProgramsupplies shader stage and hash context.Suggested reviewers:
nmzikPriority: ⬇️ Low
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
ddcefNo confirmed issue remains that should block merging after normal checks.
Security Architecture Review
Security architecture risk: 🟡 Moderate · up to
ddcefA Windows guest receive can now wait on an incomplete message while repeatedly reading its buffered prefix. A network peer can prolong that work, and concurrent socket close or mode changes have unresolved behavior. The identified exposure is limited to a guest call using the affected flags; broader impact has not been established.
Retained concerns
Security review details
Security Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.@coderabbitai[bot] on GitHub · 2026-09-24 09:27 UTC · original · edited 2026-09-26 02:09 UTC
On
src/libs/network.cppline 1169 (outdated):🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Clamp the peek result to the requested length when the scratch buffer is used.
This path applies to a zero-length peek on a datagram socket that asks for the source address. In that case,
RecvPeekWaitAllpeeks into a 1-bytescratchbuffer. If the pending datagram is exactly 1 byte, Winsock returnspeeked == 1withoutWSAEMSGSIZE. The checkpeeked >= host_lenis then true, and the function returns 1.Recvfrompasses 1 to the guest, even though the guest requested 0 bytes and nothing was written tobuf. The guest-side (FreeBSD) behavior is a return value of 0. For datagrams of 2 bytes or more, theWSAEMSGSIZEbranch already returnshost_len(0). Only the 1-byte case gives the wrong count.🐛 Proposed fix
📝 Committable suggestion
✅ Confirmed as addressed by @theantipopau
@coderabbitai[bot] on GitHub · 2026-09-24 09:27 UTC · original · edited 2026-09-26 03:31 UTC
On
tests/KernelFileSystemTests.cppline 473 (outdated):🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Check the second send before waiting for the full message.
If this send fails or sends fewer than
second_lengthbytes, the blockingPEEK|WAITALLreceive can wait indefinitely because the writer stays open. Check the send result in the peer thread so the test fails instead of hanging. Winsock permits short sends. (learn.microsoft.com)✅ Addressed in commit a599ad4
@coderabbitai[bot] on GitHub · 2026-09-24 09:27 UTC · original · reviewed
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
c57153ad-1a1b-4ebc-982a-2313efa2cf25📥 Commits
Reviewing files that changed from the base of the PR and between 31cdf2524498caa0392e58fb29835ca0e5d0a614 and 71eafce3dd0bc452bbc157465b3c059404bc6ae1.
📒 Files selected for processing (2)
src/libs/network.cpptests/KernelFileSystemTests.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
@theantipopau on GitHub · 2026-09-26 01:43 UTC · original
On
src/libs/network.cppline 1169 (outdated):Fixed in
c2f3df6d, using the clamp you suggested:so the one-byte scratch byte can never be reported as guest data. I also took the chance to make it
std::minrather than ahost_len == 0special case, since that also keeps a short non-blocking or datagram result from exceeding what was requested.Covered by a new test in
a4bd1c02: a queued one-byte datagram followed by a zero-lengthRecvfromthat asks for the source address must return 0, report the sender, and leave the datagram readable afterwards. I confirmed the assertion is load-bearing by inverting it and watching the suite fail withzero-length peek does not report scratch data, then restoring it.The short-send finding on the same PR is also in
a4bd1c02: the peer thread now recordsNet::Sendfor the second fragment and the main thread asserts it returnedsecond_lengthafter the join, so a short or failed send fails the test instead of hanging in the blockingPEEK|WAITALLreceive.@theantipopau on GitHub · 2026-09-26 01:43 UTC · original
On
tests/KernelFileSystemTests.cppline 473 (outdated):Fixed in
c2f3df6d, using the clamp you suggested:so the one-byte scratch byte can never be reported as guest data. I also took the chance to make it
std::minrather than ahost_len == 0special case, since that also keeps a short non-blocking or datagram result from exceeding what was requested.Covered by a new test in
a4bd1c02: a queued one-byte datagram followed by a zero-lengthRecvfromthat asks for the source address must return 0, report the sender, and leave the datagram readable afterwards. I confirmed the assertion is load-bearing by inverting it and watching the suite fail withzero-length peek does not report scratch data, then restoring it.The short-send finding on the same PR is also in
a4bd1c02: the peer thread now recordsNet::Sendfor the second fragment and the main thread asserts it returnedsecond_lengthafter the join, so a short or failed send fails the test instead of hanging in the blockingPEEK|WAITALLreceive.@coderabbitai[bot] on GitHub · 2026-09-26 02:09 UTC · original
On
src/libs/network.cppline 1169 (outdated):🧩 Analysis chain
🏁 Script executed:
Length of output: 10254
🏁 Script executed:
Length of output: 10226
@theantipopau, the repository check is complete.RecvPeekWaitAllnow clampspeekedtohost_len. The regression test checks that a zero-length peek of a one-byte datagram returns 0, reports the sender, and leaves the datagram available to receive. My earlier reply said the repository check was incomplete; that is no longer the case. I did not run the test suite.✅ Review thread resolved.
You are interacting with an AI system.
@coderabbitai[bot] on GitHub · 2026-09-26 02:09 UTC · original
On
tests/KernelFileSystemTests.cppline 473 (outdated):🧩 Analysis chain
🏁 Script executed:
Length of output: 11804
🏁 Script executed:
Length of output: 12713
@theantipopau, I need to correct my earlier reply. I closed this finding too soon.The half-close can release the receive on Windows. On non-Windows builds,
Net::Shutdown(writer, 1)returnsPOSIX_ENOSYSand leaves the writer open. If the second send is short or fails, the blockingPEEK|WAITALLreceive can still wait indefinitely, before the test reaches the result check.Please close the writer on the non-Windows failure path as well. The finding remains open for that case.
You are interacting with an AI system.
@theantipopau on GitHub · 2026-09-26 03:24 UTC · original
On
tests/KernelFileSystemTests.cppline 473 (outdated):Fixed in a599ad42.
You are right about the platform gap:
Net::ShutdownwithSD_SENDmaps to a real half-close only on Windows and returnsPOSIX_ENOSYSelsewhere, so the guard I added was Windows-only. The failure path now closes the writer too (Net::SocketClose(writer)afterNet::Shutdown(writer, 1)), which produces a visible EOF/error on the reader on every platform, so the blockingPEEK|WAITALLreceive cannot strand when the second send is short or fails.kernel_file_system_testsbuilds clean and passed three consecutive full runs (the suite that previously hung without this class of guard).@coderabbitai[bot] on GitHub · 2026-09-26 03:27 UTC · original · reviewed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
e605856b-ed22-4b54-9a71-be43df685b66📥 Commits
Reviewing files that changed from the base of the PR and between 12647c97336883afa1e60c8a53d174dfc6cbfc06 and a599ad42b926e408653a1f075855f178b4472ab1.
📒 Files selected for processing (1)
tests/KernelFileSystemTests.cpp🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
@coderabbitai[bot] on GitHub · 2026-09-26 03:32 UTC · original
On
tests/KernelFileSystemTests.cppline 473 (outdated):@theantipopau, the updatedCheckSocketWakeup()failure path callsNet::SocketClose(writer)afterNet::Shutdown(writer, 1). That closes the writer on non-Windows builds even whenShutdownis a no-op. The thread also records the second send result for the test assertion. Thanks for the fix and the test results.✅ Review thread resolved.
You are interacting with an AI system.
@theantipopau on GitHub · 2026-09-27 13:04 UTC · original
Merged current
upstream/main(through025b39c0). One thing worth flagging foranyone else carrying a branch that touches
CheckSocketWakeup:#851added anet_recv(..., MSG_WAITALL)consume of the five wake bytes, andthis branch already consumed those same five bytes with
Net::Recv(..., MSG_WAITALL). Both survived the merge, so the second blockingreceive waited for bytes the first had already taken — the test hung instead of
failing, which is the worst shape for CI. The
#797commit already fixed thisclass of failure once (
f133b246, half-close the writer so a short sendsurfaces as a short read rather than a spin); this was the same hazard from the
consumer side.
Resolution, same on both PRs:
errno-preserving checks, drop the duplicate direct consume, and re-cover the
direct
Net::RecvguestMSG_WAITALLpath on a freshly sent whole message;end-of-file block closes the writer once, then upstream's errno-preserving EOF
check and its reader close end the function.
kernel_file_system_testsbuilds and passes 3x in a row on the merged result onWindows/clang-cl.
Pull request closed