Fix macOS aggregate test build #536

Manually merged
github merged 4 commits from gh-pr/536/head into gh-pr/536/base 2026-11-26 09:24:48 +00:00
Owner

@⁠SaifMalik0162 on GitHub · 2026-09-09 07:35 UTC · original
SaifMalik0162:macos-aggregate-tests → main · +152 −2 · 4 files · 4 commits · merged 2026-09-28 21:43 UTC

Fixed the macOS build for the test suite. The page manager and memory tracker tests were relying on Linux-only behaviour so I added macOS support without changing the existing Linux or Windows code. I also fixed a separate compiler issue that was preventing the full test target from building.

I tested everything with a x86_64 Release build under Rosetta. The tests, full test target, and launcher all passed successfully.

**@⁠SaifMalik0162** on GitHub · 2026-09-09 07:35 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/536) `SaifMalik0162:macos-aggregate-tests` → `main` · +152 −2 · 4 files · 4 commits · merged 2026-09-28 21:43 UTC Fixed the macOS build for the test suite. The page manager and memory tracker tests were relying on Linux-only behaviour so I added macOS support without changing the existing Linux or Windows code. I also fixed a separate compiler issue that was preventing the full test target from building. I tested everything with a x86_64 Release build under Rosetta. The tests, full test target, and launcher all passed successfully.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:24:45 +00:00
github manually merged commit a250cc18b0 into gh-pr/536/base 2026-11-26 09:24:48 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-28 20:42 UTC · original · edited 2026-09-28 21:08 UTC

Review in Change Stack →

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

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: 9438ca9b-b004-453c-9121-392ed3954e1a

📥 Commits

Reviewing files that changed from the base of the PR and between 250b1ba498 and a250cc18b0.

📒 Files selected for processing (2)
  • tests/MemoryTrackerTests.cpp
  • tests/PageManagerTests.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/PageManagerTests.cpp

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


📝 Walkthrough

Walkthrough

Apple test implementations now use Mach VM APIs for memory protection, allocation, deallocation, and protection changes. Apple death tests resolve the executable path with _NSGetExecutablePath. The macOS build adds three test targets and selects two additional CTest filters. A compute test address initializer explicitly casts base to uint64_t.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: 🔵 Low · up to a250c

The macOS workflow compiles the compute test suite but does not run it, leaving a bounded CI coverage gap. The change is mergeable with owner awareness of that gap.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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 16 functions across 2 files. 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 accurately and concisely describes the primary change: fixing the macOS aggregate test build.
Description check ✅ Passed The description directly explains the macOS test support, compiler fix, and reported 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.

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-09-28 20:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/536#issuecomment-5878149065) · edited 2026-09-28 21:08 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/536?cs_source=review_comment"><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 --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `9438ca9b-b004-453c-9121-392ed3954e1a` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 250b1ba498f0a7db300d66b4b6ad648fd38f7474 and a250cc18b0107f66a1130847d41d94fab7c81967. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `tests/MemoryTrackerTests.cpp` * `tests/PageManagerTests.cpp` </details> <details> <summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary> * tests/PageManagerTests.cpp </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough Apple test implementations now use Mach VM APIs for memory protection, allocation, deallocation, and protection changes. Apple death tests resolve the executable path with `_NSGetExecutablePath`. The macOS build adds three test targets and selects two additional CTest filters. A compute test address initializer explicitly casts `base` to `uint64_t`. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"a250cc18b0107f66a1130847d41d94fab7c81967" --> **Change:** Bug fix <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _🔵 Low_ · up to `a250c` <!-- final_review_risk_coverage:{"sourceCommitId":"a250cc18b0107f66a1130847d41d94fab7c81967","coveredCommitId":"a250cc18b0107f66a1130847d41d94fab7c81967","kind":"reviewed"} --> The macOS workflow compiles the compute test suite but does not run it, leaving a bounded CI coverage gap. The change is mergeable with owner awareness of that gap. <!-- 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 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 2 files. | 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 accurately and concisely describes the primary change: fixing the macOS aggregate test build. | | Description check | ✅ Passed | The description directly explains the macOS test support, compiler fix, and reported 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> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=536)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [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) </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-28 20:43 UTC · original · reviewed

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/build.yml (1)

214-214: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider running the macOS shader tests.

The macOS workflow builds shader_recompiler_compute_tests, but its CTest filter excludes the registered shader_recompiler_compute and shader_recompiler_alignbyte tests. Adding both names would provide additional macOS coverage. The repository does not establish this as a required macOS coverage contract.

Suggested filter update
-            -R '^(audio_out2_port|pad_haptics|ime_dialog|lru_cache|memory_tracker|page_manager|resource_tracking|scalar_provenance|resource_materialization|shader_vertex_metadata|archive_file|avplayer_file|virtual_memory_allocation)$'
+            -R '^(audio_out2_port|pad_haptics|ime_dialog|lru_cache|memory_tracker|page_manager|shader_recompiler_compute|shader_recompiler_alignbyte|resource_tracking|scalar_provenance|resource_materialization|shader_vertex_metadata|archive_file|avplayer_file|virtual_memory_allocation)$'

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 1dd7abf6-3f77-47ab-a974-27f36e99165d

📥 Commits

Reviewing files that changed from the base of the PR and between 4b0de1b672 and 250b1ba498.

📒 Files selected for processing (4)
  • .github/workflows/build.yml
  • tests/MemoryTrackerTests.cpp
  • tests/PageManagerTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-09-28 20:43 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/536#pullrequestreview-5344392312) · **reviewed** **Actionable comments posted: 1** <details> <summary>🧹 Nitpick comments (1)</summary><blockquote> <details> <summary>.github/workflows/build.yml (1)</summary><blockquote> `214-214`: _📐 Maintainability & Code Quality_ | _🔵 Trivial_ | _⚡ Quick win_ **Consider running the macOS shader tests.** The macOS workflow builds `shader_recompiler_compute_tests`, but its CTest filter excludes the registered `shader_recompiler_compute` and `shader_recompiler_alignbyte` tests. Adding both names would provide additional macOS coverage. The repository does not establish this as a required macOS coverage contract. <details> <summary>Suggested filter update</summary> ```diff - -R '^(audio_out2_port|pad_haptics|ime_dialog|lru_cache|memory_tracker|page_manager|resource_tracking|scalar_provenance|resource_materialization|shader_vertex_metadata|archive_file|avplayer_file|virtual_memory_allocation)$' + -R '^(audio_out2_port|pad_haptics|ime_dialog|lru_cache|memory_tracker|page_manager|shader_recompiler_compute|shader_recompiler_alignbyte|resource_tracking|scalar_provenance|resource_materialization|shader_vertex_metadata|archive_file|avplayer_file|virtual_memory_allocation)$' ``` </details> <!-- cr-comment:v1:0dc120668e0fbf9eb6f5f94f --> </blockquote></details> </blockquote></details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `1dd7abf6-3f77-47ab-a974-27f36e99165d` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 4b0de1b67265069110492e5e1005d5c7635043a9 and 250b1ba498f0a7db300d66b4b6ad648fd38f7474. </details> <details> <summary>📒 Files selected for processing (4)</summary> * `.github/workflows/build.yml` * `tests/MemoryTrackerTests.cpp` * `tests/PageManagerTests.cpp` * `tests/ShaderRecompilerComputeTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-28 20:43 UTC · original · edited 2026-09-28 21:01 UTC
On tests/MemoryTrackerTests.cpp line 909 (outdated):

@@ -836,7 +902,15 @@ void CheckDeathCase(const char *name) {
   const pid_t pid = ::fork();
   Check(pid >= 0, "fork failed");
   if (pid == 0) {
+#if defined(__APPLE__)
+    char path[PATH_MAX]{};
+    uint32_t path_size = sizeof(path);
+    Check(_NSGetExecutablePath(path, &path_size) == 0,
+          "_NSGetExecutablePath failed");

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep executable-path lookup failures from passing death tests.

Both children call Check when _NSGetExecutablePath fails, but both parents accept any child signal. If the path exceeds PATH_MAX, the lookup fails and Check aborts before the death case runs. Apple dyld returns the required buffer size on this failure. (github.com)

  • tests/MemoryTrackerTests.cpp#L908-L909: retry with the required buffer size; report any remaining setup failure with an exit status the parent rejects.
  • tests/PageManagerTests.cpp#L606-L607: apply the same lookup and setup-failure handling.
📍 Affects 2 files
  • tests/MemoryTrackerTests.cpp#L908-L909 (this comment)
  • tests/PageManagerTests.cpp#L606-L607

✅ Addressed in commit a250cc1

**@⁠coderabbitai[bot]** on GitHub · 2026-09-28 20:43 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/536#discussion_r4126837472) · edited 2026-09-28 21:01 UTC On `tests/MemoryTrackerTests.cpp` line 909 (outdated): ```diff @@ -836,7 +902,15 @@ void CheckDeathCase(const char *name) { const pid_t pid = ::fork(); Check(pid >= 0, "fork failed"); if (pid == 0) { +#if defined(__APPLE__) + char path[PATH_MAX]{}; + uint32_t path_size = sizeof(path); + Check(_NSGetExecutablePath(path, &path_size) == 0, + "_NSGetExecutablePath failed"); ``` _🎯 Functional Correctness_ | _🟡 Minor_ | _⚡ Quick win_ **Keep executable-path lookup failures from passing death tests.** Both children call `Check` when `_NSGetExecutablePath` fails, but both parents accept any child signal. If the path exceeds `PATH_MAX`, the lookup fails and `Check` aborts before the death case runs. Apple dyld returns the required buffer size on this failure. ([github.com](https://github.com/apple-oss-distributions/dyld/blob/main/dyld/DyldAPIs.cpp?utm_source=openai)) - `tests/MemoryTrackerTests.cpp#L908-L909`: retry with the required buffer size; report any remaining setup failure with an exit status the parent rejects. - `tests/PageManagerTests.cpp#L606-L607`: apply the same lookup and setup-failure handling. <details> <summary>📍 Affects 2 files</summary> - `tests/MemoryTrackerTests.cpp#L908-L909` (this comment) - `tests/PageManagerTests.cpp#L606-L607` </details> <!-- consolidated_sites_start --> <!-- <consolidated_sites> <site> <role>anchor</role> <file>tests/MemoryTrackerTests.cpp</file> <line_range>908-909</line_range> </site> <site> <role>sibling</role> <file>tests/PageManagerTests.cpp</file> <line_range>606-607</line_range> </site> </consolidated_sites> --> <!-- consolidated_sites_end --> <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:bd6514ec8de4c2c882ecdabf --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit a250cc1
This discussion has been locked. Commenting is limited to contributors.
No description provided.