Clarify gfx11 BVH image instruction failures #803

Closed
github-bot wants to merge 7 commits from gh-pr/803/head into gh-pr/803/base
Owner

@⁠theantipopau on GitHub · 2026-09-24 09:18 UTC · original
theantipopau:mimg-bvh-diagnostic → main · +328 −19 · 4 files · 7 commits · closed without merging

Summary

  • Classify gfx11 MIMG opcodes 0xe6 and 0xe7 as BVH ray-intersection forms in the unsupported-instruction diagnostic.
  • Explain that a host BVH traversal backend is required instead of allowing a misleading image-operation fallback.
  • Add regression coverage for the captured five-word instruction and the BVH64 opcode form.

Validation

  • CCACHE_DISABLE=1 ninja -C _Build/windows shader_cfg_tests -j 8
  • ctest --test-dir _Build/windows -R '^(shader_cfg|resource_tracking|resource_materialization)$' --output-on-failure
  • All three focused tests passed.

This change intentionally stops at an explicit unsupported diagnostic; it does not synthesize BVH traversal results.

**@⁠theantipopau** on GitHub · 2026-09-24 09:18 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/803) `theantipopau:mimg-bvh-diagnostic` → `main` · +328 −19 · 4 files · 7 commits · closed without merging ## Summary - Classify gfx11 MIMG opcodes `0xe6` and `0xe7` as BVH ray-intersection forms in the unsupported-instruction diagnostic. - Explain that a host BVH traversal backend is required instead of allowing a misleading image-operation fallback. - Add regression coverage for the captured five-word instruction and the BVH64 opcode form. ## Validation - `CCACHE_DISABLE=1 ninja -C _Build/windows shader_cfg_tests -j 8` - `ctest --test-dir _Build/windows -R '^(shader_cfg|resource_tracking|resource_materialization)$' --output-on-failure` - All three focused tests passed. This change intentionally stops at an explicit unsupported diagnostic; it does not synthesize BVH traversal results.
Keep Windows accepted sockets aligned with FreeBSD nonblocking semantics and preserve source addresses for zero-length datagram peeks.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <[email protected]>
Allow the asynchronous receive worker enough time to start before checking the inherited nonblocking behavior, while retaining the suffix fallback for a blocking implementation.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <[email protected]>
Reject MIMG BVH ray opcodes with an explicit traversal-backend diagnostic and regression coverage for the captured Astro Bot instruction, rather than leaving a generic unsupported-opcode failure.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:33:00 +00:00
github-bot closed this pull request 2026-11-26 09:33:00 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-24 09:30 UTC · original

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

The Windows socket transport now tracks guest nonblocking mode, propagates it to accepted sockets, and handles peek-plus-wait-all receives. Socket tests cover TCP and UDP reads, nonblocking behavior, and EOF. The MIMG decoder now reports specific unsupported reasons for GFX11 opcodes 0xe6 and 0xe7, with regression tests for their diagnostics and instruction data.

Suggested reviewers: nmzik, mehmetcambaz, brandostrong

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: 🔵 Low · up to 1c1b8

Two narrow socket behaviors need correction: a zero-length datagram read can report a byte, and accepting a UDPP2P socket can return the wrong error. The change is otherwise mergeable with these fixes or explicit owner acceptance.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 3 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: clarifying failures for GFX11 BVH image instructions. It is concise and specific.
Description check ✅ Passed The description directly explains the diagnostic changes, the required BVH traversal backend, regression coverage, and validation results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 3 files. (1 skipped: 1 too large.)

Warning

⚠️ This pull request shows signs of AI-generated slop (description_diff_mismatch). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.


Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-24 09:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/803#issuecomment-5811544427) <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/803"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> Navigate logical layers of code changes, visualize relationships, and explore their blast radius. <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough The Windows socket transport now tracks guest nonblocking mode, propagates it to accepted sockets, and handles peek-plus-wait-all receives. Socket tests cover TCP and UDP reads, nonblocking behavior, and EOF. The MIMG decoder now reports specific unsupported reasons for GFX11 opcodes `0xe6` and `0xe7`, with regression tests for their diagnostics and instruction data. **Suggested reviewers:** `nmzik`, `mehmetcambaz`, `brandostrong` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"1c1b819648f2f571411a06c3dc00888efaaa089d" --> **Change:** Bug fix <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _🔵 Low_ · up to `1c1b8` <!-- final_review_risk_coverage:{"sourceCommitId":"1c1b819648f2f571411a06c3dc00888efaaa089d","coveredCommitId":"1c1b819648f2f571411a06c3dc00888efaaa089d","kind":"reviewed"} --> Two narrow socket behaviors need correction: a zero-length datagram read can report a byte, and accepting a UDPP2P socket can return the wrong error. The change is otherwise mergeable with these fixes or explicit owner acceptance. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 4 | ❌ 1</summary> ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 3 files. (1 skipped: … | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :----------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ✅ Passed | The title clearly summarizes the main change: clarifying failures for GFX11 BVH image instructions. It is concise and specific. | | Description check | ✅ Passed | The description directly explains the diagnostic changes, the required BVH traversal backend, regression coverage, and validation results. | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | </details> <details> <summary>Full details: Docstring Coverage</summary> **Explanation** Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 3 files. (1 skipped: 1 too large.) </details> </details> <!-- pre_merge_checks_walkthrough_end --> > [!WARNING] > ⚠️ This pull request shows signs of AI-generated slop (description_diff_mismatch). It has been flagged by CodeRabbit slop detection and should be reviewed carefully. <!-- tips_start --> --- <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
@ -1079,0 +1166,4 @@
}
if (peeked >= host_len || peeked == 0 || peer_closed || nonblocking || no_wait ||
!SocketIsStream(socket)) {
return peeked;
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-24 09:30 UTC · original

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Limit the scratch-buffer peek result to the requested length.

For a zero-length datagram peek with an address buffer, lines 1151-1156 peek 1 byte into scratch. If the queued datagram is exactly 1 byte, RecvHost returns 1. Line 1167 then returns 1 because peeked >= host_len.

The guest asked for 0 bytes and received no data, but Recvfrom reports 1. FreeBSD returns 0 for a datagram truncated to the requested length. The WSAEMSGSIZE branch already returns host_len for datagrams longer than 1 byte.

🐛 Proposed fix
 		if (peeked >= host_len || peeked == 0 || peer_closed || nonblocking || no_wait ||
 		    !SocketIsStream(socket)) {
-			return peeked;
+			return std::min<int64_t>(peeked, static_cast<int64_t>(host_len));
 		}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

		if (peeked >= host_len || peeked == 0 || peer_closed || nonblocking || no_wait ||
		    !SocketIsStream(socket)) {
			return std::min<int64_t>(peeked, static_cast<int64_t>(host_len));
**@⁠coderabbitai[bot]** on GitHub · 2026-09-24 09:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/803#discussion_r4092044276) _🎯 Functional Correctness_ | _🟡 Minor_ | _⚡ Quick win_ **Limit the scratch-buffer peek result to the requested length.** For a zero-length datagram peek with an address buffer, lines 1151-1156 peek 1 byte into `scratch`. If the queued datagram is exactly 1 byte, `RecvHost` returns 1. Line 1167 then returns 1 because `peeked >= host_len`. The guest asked for 0 bytes and received no data, but `Recvfrom` reports 1. FreeBSD returns 0 for a datagram truncated to the requested length. The `WSAEMSGSIZE` branch already returns `host_len` for datagrams longer than 1 byte. <details> <summary>🐛 Proposed fix</summary> ```diff if (peeked >= host_len || peeked == 0 || peer_closed || nonblocking || no_wait || !SocketIsStream(socket)) { - return peeked; + return std::min<int64_t>(peeked, static_cast<int64_t>(host_len)); } ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion if (peeked >= host_len || peeked == 0 || peer_closed || nonblocking || no_wait || !SocketIsStream(socket)) { return std::min<int64_t>(peeked, static_cast<int64_t>(host_len)); ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:a58a29886597b784d71b44e2 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -1911,2 +2008,3 @@
NativeSocket socket = INVALID_NATIVE_SOCKET;
if (!GetSocketBackend(s, &socket)) {
SocketSlot state;
if (!GetSocketBackend(s, &socket, &state)) {
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-24 09:30 UTC · original

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject UDPP2P sockets explicitly in Accept.

Accept now passes &state to GetSocketBackend. GetSocketBackend enforces its slot.p2p rejection (lines 1261-1264) only when state == nullptr. As a result, a guest accept on a UDPP2P descriptor now reaches ::accept on the shared UDP transport.

Before this change, the guest received POSIX_EOPNOTSUPP. On Linux, the host now returns EOPNOTSUPP, and ConvertHostSocketError does not map it. The guest therefore gets POSIX_EIO. Restore the guard after the lookup.

🐛 Proposed fix
 	SocketSlot   state;
 	if (!GetSocketBackend(s, &socket, &state)) {
 		return -1;
 	}
+	if (state.p2p) {
+		return SetGuestSocketError(Posix::POSIX_EOPNOTSUPP);
+	}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

	SocketSlot   state;
	if (!GetSocketBackend(s, &socket, &state)) {
		return -1;
	}
	if (state.p2p) {
		return SetGuestSocketError(Posix::POSIX_EOPNOTSUPP);
	}
**@⁠coderabbitai[bot]** on GitHub · 2026-09-24 09:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/803#discussion_r4092044305) _🎯 Functional Correctness_ | _🟡 Minor_ | _⚡ Quick win_ **Reject UDPP2P sockets explicitly in `Accept`.** `Accept` now passes `&state` to `GetSocketBackend`. `GetSocketBackend` enforces its `slot.p2p` rejection (lines 1261-1264) only when `state == nullptr`. As a result, a guest `accept` on a UDPP2P descriptor now reaches `::accept` on the shared UDP transport. Before this change, the guest received `POSIX_EOPNOTSUPP`. On Linux, the host now returns `EOPNOTSUPP`, and `ConvertHostSocketError` does not map it. The guest therefore gets `POSIX_EIO`. Restore the guard after the lookup. <details> <summary>🐛 Proposed fix</summary> ```diff SocketSlot state; if (!GetSocketBackend(s, &socket, &state)) { return -1; } + if (state.p2p) { + return SetGuestSocketError(Posix::POSIX_EOPNOTSUPP); + } ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion SocketSlot state; if (!GetSocketBackend(s, &socket, &state)) { return -1; } if (state.p2p) { return SetGuestSocketError(Posix::POSIX_EOPNOTSUPP); } ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:5a6b599ebf8de2cd41fc5fef --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-24 09:30 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: 3efc9a1e-9148-44d8-8d77-db4eddca7ffc

📥 Commits

Reviewing files that changed from the base of the PR and between db7745ef41 and 1c1b819648.

📒 Files selected for processing (4)
  • src/graphics/shader/recompiler/frontend/decode/ImageOps.cpp
  • src/libs/network.cpp
  • tests/KernelFileSystemTests.cpp
  • tests/shaderCfgTests.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-24 09:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/803#pullrequestreview-5302522448) · **reviewed** **Actionable comments posted: 2** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `3efc9a1e-9148-44d8-8d77-db4eddca7ffc` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between db7745ef414b0e04afca7be9ead71434033f6051 and 1c1b819648f2f571411a06c3dc00888efaaa089d. </details> <details> <summary>📒 Files selected for processing (4)</summary> * `src/graphics/shader/recompiler/frontend/decode/ImageOps.cpp` * `src/libs/network.cpp` * `tests/KernelFileSystemTests.cpp` * `tests/shaderCfgTests.cpp` </details> **Included review availability:** Your plan provides up to 10 included reviews per hour; 8 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Author
Owner

@⁠Nmzik on GitHub · 2026-09-24 17:04 UTC · original

We will currently skip as workaround since some games precompile shaders before allowing the user to choose Performance mode (non-RT).

**@⁠Nmzik** on GitHub · 2026-09-24 17:04 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/803#issuecomment-5818586558) We will currently skip as workaround since some games precompile shaders before allowing the user to choose Performance mode (non-RT).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.