tests: make kyty_tests build and run every test without LTO #1110

Manually merged
github merged 1 commit from gh-pr/1110/head into gh-pr/1110/base 2026-11-26 09:43:21 +00:00
Owner

@⁠NevesHenry on GitHub · 2026-10-06 17:29 UTC · original
NevesHenry:tests/fix-linux-test-build → main · +7 −2 · 2 files · 1 commits · merged 2026-10-06 17:56 UTC

Summary

On current main, the README's no-Qt Linux steps (-DCMAKE_BUILD_TYPE=Release, clang, no LTO) fail at cmake --build ... --target kyty_emulator kyty_tests, and ctest skips one test. Three small fixes:

  1. avplayer_file_tests doesn't link: undefined reference to Loader::Timer::GetTimeMs(), called from Libs::PrintName (src/libs/libs.h:66). The test compiles libs/avPlayer.cpp, whose PRINT_NAME() uses the timer, but the target doesn't compile loader/timer.cpp. The other tests that compile HLE sources (audio_out2_port_tests, ngs2_sampler_tests, event_queue_lifetime_tests) already add it.
  2. ShaderRecompilerComputeTests.cpp:33544 doesn't compile with clang and libstdc++: no matching member function for call to 'emplace', because is_constructible_v<IndirectDescriptor> is false there. A standalone repro of the struct fails with clang 18, 19 and 20 on libstdc++ 13 and 14, and compiles with libc++ or g++ 14. The line now assigns DescriptorSource::IndirectDescriptor{.table_stride = 16}, the same way as the test right below it. #1092 also changes this line as part of a larger change; if it lands first, I'll drop this part.
  3. trophy_system is never run: it is registered with ctest, but kyty_tests doesn't build trophy_system_tests, so ctest reports it as Not Run. This is the same gap #798 fixed for save_data_memory.

CI doesn't hit 1 or 2: it links with -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON, and LTO drops the unused reference. It also doesn't build the compute tests.

Validation

Ubuntu 24.04 container, clang 18.1.3, CMake 3.28.3, with the README's no-Qt configure:

  • main (fb7ff7ec): the build fails on 1 and 2. With -k 0 these are the only two failures.
  • this branch: kyty_emulator and kyty_tests build. All 32 ctest tests that don't need a Vulkan device pass, including avplayer_file and trophy_system. The other 18 run the Vulkan compute harness or open a Vulkan window, and I have no suitable device to run them.

Not tested on Windows or macOS.

AI assistance

An AI coding assistant (Claude Code) helped me find these failures, reduce the emplace error to a standalone repro, and run the container builds above. I reviewed the diff and the build and test output. All communication on this PR comes from me.

🤖 Generated with Claude Code

**@⁠NevesHenry** on GitHub · 2026-10-06 17:29 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1110) `NevesHenry:tests/fix-linux-test-build` → `main` · +7 −2 · 2 files · 1 commits · merged 2026-10-06 17:56 UTC ## Summary On current main, the README's no-Qt Linux steps (`-DCMAKE_BUILD_TYPE=Release`, clang, no LTO) fail at `cmake --build ... --target kyty_emulator kyty_tests`, and `ctest` skips one test. Three small fixes: 1. **`avplayer_file_tests` doesn't link:** `undefined reference to Loader::Timer::GetTimeMs()`, called from `Libs::PrintName` (`src/libs/libs.h:66`). The test compiles `libs/avPlayer.cpp`, whose `PRINT_NAME()` uses the timer, but the target doesn't compile `loader/timer.cpp`. The other tests that compile HLE sources (`audio_out2_port_tests`, `ngs2_sampler_tests`, `event_queue_lifetime_tests`) already add it. 2. **`ShaderRecompilerComputeTests.cpp:33544` doesn't compile with clang and libstdc++:** `no matching member function for call to 'emplace'`, because `is_constructible_v<IndirectDescriptor>` is false there. A standalone repro of the struct fails with clang 18, 19 and 20 on libstdc++ 13 and 14, and compiles with libc++ or g++ 14. The line now assigns `DescriptorSource::IndirectDescriptor{.table_stride = 16}`, the same way as the test right below it. #1092 also changes this line as part of a larger change; if it lands first, I'll drop this part. 3. **`trophy_system` is never run:** it is registered with ctest, but `kyty_tests` doesn't build `trophy_system_tests`, so ctest reports it as Not Run. This is the same gap #798 fixed for `save_data_memory`. CI doesn't hit 1 or 2: it links with `-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON`, and LTO drops the unused reference. It also doesn't build the compute tests. ## Validation Ubuntu 24.04 container, clang 18.1.3, CMake 3.28.3, with the README's no-Qt configure: - **main (fb7ff7ec):** the build fails on 1 and 2. With `-k 0` these are the only two failures. - **this branch:** `kyty_emulator` and `kyty_tests` build. All 32 ctest tests that don't need a Vulkan device pass, including `avplayer_file` and `trophy_system`. The other 18 run the Vulkan compute harness or open a Vulkan window, and I have no suitable device to run them. Not tested on Windows or macOS. ## AI assistance An AI coding assistant (Claude Code) helped me find these failures, reduce the `emplace` error to a standalone repro, and run the container builds above. I reviewed the diff and the build and test output. All communication on this PR comes from me. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
avplayer_file_tests compiles libs/avPlayer.cpp into the test, and its
PRINT_NAME() calls Loader::Timer::GetTimeMs(). Add loader/timer.cpp to the
target, like the other tests that compile HLE library sources. CI links the
test with LTO, which drops the unused reference, so the failure only shows
in non-LTO builds such as the README's no-Qt instructions.

Clang with libstdc++ rejects optional<IndirectDescriptor>::emplace() with
no arguments in ShaderRecompilerComputeTests.cpp. Assign the descriptor the
same way the neighbouring test does.

trophy_system is registered with ctest but kyty_tests did not build its
executable, so ctest reported it as Not Run.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:43:20 +00:00
github manually merged commit 17f78f31b0 into gh-pr/1110/base 2026-11-26 09:43:21 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-06 17:37 UTC · original

Review in Change Stack →

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: a0936794-9bbc-498d-b55f-65290095f997
📥 Commits

Reviewing files that changed from the base of the PR and between fb7ff7ec03 and 17f78f31b0.

📒 Files selected for processing (2)
  • CMakeLists.txt
  • tests/ShaderRecompilerComputeTests.cpp

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


📝 Walkthrough

Walkthrough

CMake now compiles src/loader/timer.cpp in avplayer_file_tests and includes trophy_system_tests in the dependencies of kyty_tests. The IndirectBufferStore test now assigns a complete indirect descriptor value with a stride of 16.

Suggested reviewers: nmzik

Priority: ➖ Normal

Change: Other

Merge Risk: ⚪ Minimal · up to 17f78

The test-target wiring and descriptor setup have no identified merge-blocking issue.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: making the test aggregate build and run all tests without LTO.
Description check ✅ Passed The description explains the three build and test issues addressed and reports validation results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
  • Autopilot · 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-06 17:37 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1110#issuecomment-6021912224) <!-- 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/1110?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;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> <!-- 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**: `a0936794-9bbc-498d-b55f-65290095f997` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between fb7ff7ec03e8b7a940b7debdc9f54892a98ab4a5 and 17f78f31b029ac37577b91bf40c203ab16bac179. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `CMakeLists.txt` * `tests/ShaderRecompilerComputeTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough CMake now compiles `src/loader/timer.cpp` in `avplayer_file_tests` and includes `trophy_system_tests` in the dependencies of `kyty_tests`. The `IndirectBufferStore` test now assigns a complete indirect descriptor value with a stride of 16. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"17f78f31b029ac37577b91bf40c203ab16bac179" --> **Change:** Other <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _⚪ Minimal_ · up to `17f78` <!-- final_review_risk_coverage:{"sourceCommitId":"17f78f31b029ac37577b91bf40c203ab16bac179","coveredCommitId":"17f78f31b029ac37577b91bf40c203ab16bac179","kind":"reviewed"} --> The test-target wiring and descriptor setup have no identified merge-blocking issue. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 5</summary> <details> <summary>✅ Passed checks (5 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ✅ Passed | The title clearly summarizes the main change: making the test aggregate build and run all tests without LTO. | | Description check | ✅ Passed | The description explains the three build and test issues addressed and reports validation results. | | Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0… | | 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 --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autopilot</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=1110)! 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 -->
This discussion has been locked. Commenting is limited to contributors.
No description provided.