test: fix Windows portability issues #1695

Closed
github-bot wants to merge 1 commit from gh-pr/1695/head into gh-pr/1695/base
Owner

@⁠vipulojha on GitHub · 2026-10-19 09:18 UTC · original
vipulojha:fix/windows-portability-tests → main · +34 −2 · 2 files · 1 commits · closed without merging

Summary

Fix three Windows-specific portability issues found while validating the current KytyPS5 main branch with a native Windows toolchain.

Changes

  • Fix unknown Windows socket-level options so they correctly report ENOPROTOOPT.
  • Rename a shader recompiler test local that collides with the Windows SDK small macro.
  • Use _aligned_malloc / _aligned_free for the Vdecsw test on Windows, preserving the required 256-byte alignment.

Validation

Validated on native Windows 11 x64 with:

  • Visual Studio 2026
  • clang-cl 22.1.3
  • CMake 4.4.4
  • Ninja 1.13.2
  • NVIDIA RTX 5060 Laptop GPU
  • NVIDIA driver 617.42
  • Vulkan API 1.4.351

Full unfiltered CTest result:

  • 55 total
  • 55 passed
  • 0 failed
  • 0 skipped
  • 0 crashed

CTest exit code: 0

The fixes were validated against:

9e41d8320a2774b303fbad344c2347e8d0292e83

Related upstream work:

  • Network fix corresponds to PR #1159.
  • Shader Windows build fix corresponds to the Windows portion of PR #1504.
  • Vdecsw Windows alignment fix corresponds to PR #1527.

All three changes were validated together on the current main-branch HEAD.

**@⁠vipulojha** on GitHub · 2026-10-19 09:18 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1695) `vipulojha:fix/windows-portability-tests` → `main` · +34 −2 · 2 files · 1 commits · closed without merging ## Summary Fix three Windows-specific portability issues found while validating the current KytyPS5 main branch with a native Windows toolchain. ### Changes - Fix unknown Windows socket-level options so they correctly report `ENOPROTOOPT`. - Rename a shader recompiler test local that collides with the Windows SDK `small` macro. - Use `_aligned_malloc` / `_aligned_free` for the Vdecsw test on Windows, preserving the required 256-byte alignment. ### Validation Validated on native Windows 11 x64 with: - Visual Studio 2026 - clang-cl 22.1.3 - CMake 4.4.4 - Ninja 1.13.2 - NVIDIA RTX 5060 Laptop GPU - NVIDIA driver 617.42 - Vulkan API 1.4.351 Full unfiltered CTest result: - 55 total - 55 passed - 0 failed - 0 skipped - 0 crashed CTest exit code: 0 The fixes were validated against: `9e41d8320a2774b303fbad344c2347e8d0292e83` Related upstream work: - Network fix corresponds to PR #1159. - Shader Windows build fix corresponds to the Windows portion of PR #1504. - Vdecsw Windows alignment fix corresponds to PR #1527. All three changes were validated together on the current main-branch HEAD.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:03:32 +00:00
github-bot closed this pull request 2026-11-26 10:03:32 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-19 09:58 UTC · original · edited 2026-10-20 13:42 UTC

Review in Change Stack →

📝 Walkthrough

On Windows, recognized BSD socket-level options now return their corresponding host values, and unknown options at that level return -1. Other Windows option levels retain their existing fallback behavior. The GuardedMemory test helper now uses Windows aligned allocation and deallocation functions. Other platforms retain the existing allocation functions.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: 🔵 Low · up to 3fe66

Some Windows socket configurations may use incorrect timeouts or fail; removing the incompatible passthrough cases is a localized fix.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the pull request as a test change that fixes Windows portability issues, which matches the main changeset.
Description check Passed The description directly explains all three Windows-specific fixes and includes relevant 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.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-19 09:58 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1695#issuecomment-6264579017) · edited 2026-10-20 13:42 UTC <!-- 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/1695?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> On Windows, recognized BSD socket-level options now return their corresponding host values, and unknown options at that level return -1. Other Windows option levels retain their existing fallback behavior. The `GuardedMemory` test helper now uses Windows aligned allocation and deallocation functions. Other platforms retain the existing allocation functions. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"3fe660fd510c48b363b047e0223e49e1e29785c7" --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong>🔵 Low</strong> · up to <code>3fe66</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🔵 Low** · up to `3fe66` --> <!-- final_review_risk_coverage:{"sourceCommitId":"3fe660fd510c48b363b047e0223e49e1e29785c7","coveredCommitId":"3fe660fd510c48b363b047e0223e49e1e29785c7","kind":"reviewed"} --> Some Windows socket configurations may use incorrect timeouts or fail; removing the incompatible passthrough cases is a localized fix. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> 1</strong></summary> <dl> <dd> <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 warning</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :----------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Warning](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-warning.svg) | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 4 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 4 passed</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly identifies the pull request as a test change that fixes Windows portability issues, which matches the main changeset. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description directly explains all three Windows-specific fixes and includes relevant validation results. | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1695)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>❤️ Share</strong></summary> <dl> <dd> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Author
Owner

@⁠theantipopau on GitHub · 2026-10-20 00:50 UTC · original

This is currently CONFLICTING with main, which blocks both CI and review — it needs a rebase and conflict resolution first. It touches ResourceTracking.cpp and three test TUs, all of which moved recently. Worth prioritizing: the Windows-portability fixes here would unblock local test builds for MinGW/Windows contributors (right now several test TUs only compile under MSVC).

**@⁠theantipopau** on GitHub · 2026-10-20 00:50 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1695#issuecomment-6280694786) This is currently CONFLICTING with main, which blocks both CI and review — it needs a rebase and conflict resolution first. It touches ResourceTracking.cpp and three test TUs, all of which moved recently. Worth prioritizing: the Windows-portability fixes here would unblock local test builds for MinGW/Windows contributors (right now several test TUs only compile under MSVC).
Author
Owner

@⁠vipulojha on GitHub · 2026-10-20 13:41 UTC · original

This is currently CONFLICTING with main, which blocks both CI and review — it needs a rebase and conflict resolution first. It touches ResourceTracking.cpp and three test TUs, all of which moved recently. Worth prioritizing: the Windows-portability fixes here would unblock local test builds for MinGW/Windows contributors (right now several test TUs only compile under MSVC).

hi plz i pushed a new commit addressing your commentss

**@⁠vipulojha** on GitHub · 2026-10-20 13:41 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1695#issuecomment-6292249965) > This is currently CONFLICTING with main, which blocks both CI and review — it needs a rebase and conflict resolution first. It touches ResourceTracking.cpp and three test TUs, all of which moved recently. Worth prioritizing: the Windows-portability fixes here would unblock local test builds for MinGW/Windows contributors (right now several test TUs only compile under MSVC). hi plz i pushed a new commit addressing your commentss
@ -1089,0 +1100,4 @@
case SO_RCVLOWAT:
case SO_SNDTIMEO:
case SO_RCVTIMEO:
case SO_TYPE: return option;
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-20 13:42 UTC · original

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '2140,2370p' src/libs/network.cpp
rg -n 'struct .*linger|struct .*timeval|SO_LINGER|SO_SNDTIMEO|SO_RCVTIMEO|timeout|ConvertSocketOption' src/libs/network.cpp src/libs src/common tests/KernelFileSystemTests.cpp
git show 1a053f9e13405bf34171a47aae9f2b9a6e7afd7d:src/libs/network.cpp | sed -n '2140,2370p'

Repository: KytyPS5/KytyPS5

Length of output: 36182


Remove options with incompatible guest and Winsock payload layouts.

SO_LINGER, SO_SNDTIMEO, and SO_RCVTIMEO are passed directly to Winsock after name conversion. Only the separate 0x1105 timeout path performs payload conversion. Remove these three options from the passthrough list until dedicated conversions are added.

Proposed change
--- "a/src/libs/network.cpp"
+++ "b/src/libs/network.cpp"
@@ -1094,13 +1094,10 @@
 			case SO_KEEPALIVE:
 			case SO_DONTROUTE:
 			case SO_USELOOPBACK:
-			case SO_LINGER:
 			case SO_OOBINLINE:
 			case SO_SNDLOWAT:
 			case SO_RCVLOWAT:
-			case SO_SNDTIMEO:
-			case SO_RCVTIMEO:
 			case SO_TYPE: return option;
 #endif
 			default: return -1;
 		}
📝 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.

			case SO_OOBINLINE:
			case SO_SNDLOWAT:
			case SO_RCVLOWAT:
			case SO_TYPE: return option;
**@⁠coderabbitai[bot]** on GitHub · 2026-10-20 13:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1695#discussion_r4325647729) **🗄️ Data Integrity & Integration** | **🟡 Minor** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash sed -n '2140,2370p' src/libs/network.cpp rg -n 'struct .*linger|struct .*timeval|SO_LINGER|SO_SNDTIMEO|SO_RCVTIMEO|timeout|ConvertSocketOption' src/libs/network.cpp src/libs src/common tests/KernelFileSystemTests.cpp git show 1a053f9e13405bf34171a47aae9f2b9a6e7afd7d:src/libs/network.cpp | sed -n '2140,2370p' ``` Repository: KytyPS5/KytyPS5 Length of output: 36182 --- </details> **Remove options with incompatible guest and Winsock payload layouts.** `SO_LINGER`, `SO_SNDTIMEO`, and `SO_RCVTIMEO` are passed directly to Winsock after name conversion. Only the separate `0x1105` timeout path performs payload conversion. Remove these three options from the passthrough list until dedicated conversions are added. <details> <summary>Proposed change</summary> ```diff --- "a/src/libs/network.cpp" +++ "b/src/libs/network.cpp" @@ -1094,13 +1094,10 @@ case SO_KEEPALIVE: case SO_DONTROUTE: case SO_USELOOPBACK: - case SO_LINGER: case SO_OOBINLINE: case SO_SNDLOWAT: case SO_RCVLOWAT: - case SO_SNDTIMEO: - case SO_RCVTIMEO: case SO_TYPE: return option; #endif default: return -1; } ``` </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 case SO_OOBINLINE: case SO_SNDLOWAT: case SO_RCVLOWAT: case SO_TYPE: return option; ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:caracal --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:6f6ebd3d29af69fe6562cf4a --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-20 13:42 UTC · original · reviewed

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 57e23b6c-fcec-4985-a412-cbbac065d59f
📥 Commits

Reviewing files that changed from the base of the PR and between a40fdf5bc5e7911f7e379f0f6fe0f806f4362290 and 3fe660fd51.

📒 Files selected for processing: 1
  • src/libs/network.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-20 13:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1695#pullrequestreview-5585877093) · **reviewed** **Actionable comments posted: 1** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `57e23b6c-fcec-4985-a412-cbbac065d59f` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between a40fdf5bc5e7911f7e379f0f6fe0f806f4362290 and 3fe660fd510c48b363b047e0223e49e1e29785c7. </details> <details> <summary>📒 Files selected for processing: 1</summary> * `src/libs/network.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=2760887b-b96b-4fc4-906e-0a132eccdb5e attempt=fbb3cb39-a4e8-4066-98e5-802b488d5396 batch=1/1 -->
Author
Owner

@⁠vipulojha on GitHub · 2026-10-29 21:29 UTC · original

@⁠theantipopau hi can you check now

**@⁠vipulojha** on GitHub · 2026-10-29 21:29 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1695#issuecomment-6508769631) @⁠theantipopau hi can you check now

Pull request closed

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