Fix Linux file locations #740

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

@⁠Kody-Schram on GitHub · 2026-09-20 20:37 UTC · original
Kody-Schram:main → main · +127 −65 · 5 files · 17 commits · closed without merging

Defines "_SaveData", "_Textures" and similar paths in a single spot and implements an enum and getter function for other code to use instead of copying the string literals all over and being more mistake prone.

Doesn't change MacOS or Windows, this does however change Linux

_TempData is now routed to /tmp/kyty
_DownloadData, _SaveData, _PipelineCache, _Textures are now at ~/.local/share/kyty

These changes are made to follow standard linux application file conventions

**@⁠Kody-Schram** on GitHub · 2026-09-20 20:37 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740) `Kody-Schram:main` → `main` · +127 −65 · 5 files · 17 commits · closed without merging Defines "_SaveData", "_Textures" and similar paths in a single spot and implements an enum and getter function for other code to use instead of copying the string literals all over and being more mistake prone. Doesn't change MacOS or Windows, this does however change Linux _TempData is now routed to /tmp/kyty _DownloadData, _SaveData, _PipelineCache, _Textures are now at ~/.local/share/kyty These changes are made to follow standard linux application file conventions
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:31:18 +00:00
github-bot closed this pull request 2026-11-26 09:31:18 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-20 20:50 UTC · original · edited 2026-10-07 16:36 UTC

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added PathUtil with platform-specific resolution for save, temporary, pipeline-cache, download, and texture directories. Updated emulator sandbox mounts and texture cleanup to use resolved paths. Updated pipeline-cache storage and save-data directory operations to use centralized paths. Shader compilation options now receive the full params.user_data value. Removed an unused declaration and reformatted other code.

Suggested reviewers: nmzik

Merge Risk: 🔴 Critical · up to 26877

This change moves emulator data to standard Linux locations, but the save-data code currently does not compile, so the build breaks. A transfer mount can also claim a second slot for a save that is already mounted. Shader compilation now sees more user-data registers than the pipeline cache key accounts for. Existing Linux saves are not carried over to the new location, and path resolution with an unset HOME variable remains unresolved. This is not mergeable until at least the compile error is fixed.

🚥 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 17 functions across 5 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 clearly summarizes the main change: updating file locations for Linux while preserving the scope of the changeset.
Description check ✅ Passed The description directly explains the centralized path handling and the Linux-specific locations for temporary, save, download, pipeline-cache, and texture data.
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-20 20:50 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#issuecomment-5752575056) · edited 2026-10-07 16:36 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/740"><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 --> <!-- This is an auto-generated comment: review paused by coderabbit.ai --> > [!NOTE] > ## Reviews paused > > It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the `reviews.auto_review.auto_pause_after_reviewed_commits` setting. > > Use the following commands to manage reviews: > - `@coderabbitai resume` to resume automatic reviews. > - `@coderabbitai review` to trigger a single review. > > Use the checkboxes below for quick actions: > - [ ] <!-- {"checkboxId":"7f6cc2e2-2e4e-497a-8c31-c9e4573e93d1"} --> ▶️ Resume reviews > - [ ] <!-- {"checkboxId":"e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review <!-- end of auto-generated comment: review paused by coderabbit.ai --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough Added `PathUtil` with platform-specific resolution for save, temporary, pipeline-cache, download, and texture directories. Updated emulator sandbox mounts and texture cleanup to use resolved paths. Updated pipeline-cache storage and save-data directory operations to use centralized paths. Shader compilation options now receive the full `params.user_data` value. Removed an unused declaration and reformatted other code. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- final_review_risk_start --> **Merge Risk:** _🔴 Critical_ · up to `26877` <!-- final_review_risk_coverage:{"sourceCommitId":"26877fc1cf0a9012ab2a384bb72141758ce725bc","coveredCommitId":"26877fc1cf0a9012ab2a384bb72141758ce725bc","kind":"reviewed"} --> This change moves emulator data to standard Linux locations, but the save-data code currently does not compile, so the build breaks. A transfer mount can also claim a second slot for a save that is already mounted. Shader compilation now sees more user-data registers than the pipeline cache key accounts for. Existing Linux saves are not carried over to the new location, and path resolution with an unset HOME variable remains unresolved. This is not mergeable until at least the compile error is fixed. <!-- 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 17 functions across 5 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 clearly summarizes the main change: updating file locations for Linux while preserving the scope of the changeset. | | Description check | ✅ Passed | The description directly explains the centralized path handling and the Linux-specific locations for temporary, save, download, pipeline-cache, and texture data. | | 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=740)! 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-20 20:51 UTC · original
On src/common/path_util.cpp line 17 (outdated):

@@ -0,0 +1,40 @@
+#include "path_util.h"
+
+#include <cstdlib>
+#include <filesystem>
+
+namespace PathUtil {
+
+// String definitions for used folders
+static constexpr auto save_dir           = "_SaveData/";
+static constexpr auto temp_dir           = "_TempData/";
+static constexpr auto pipeline_cache_dir = "_PipelineCache/";
+static constexpr auto download_dir       = "_DownloadData/";
+static constexpr auto texture_dir        = "_Textures/";
+
+static inline std::filesystem::path GetUserPath() {
+#if KYTY_PLATFORM == KYTY_PLATFORM_LINUX
+	return std::filesystem::path(std::getenv("HOME")) / ".local/share/kyty";

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Handle an unset HOME variable.

If HOME is unset, std::getenv("HOME") returns nullptr. Constructing std::filesystem::path from that pointer has undefined behavior. This can terminate startup when the emulator resolves a save, texture, download, or pipeline-cache path.

Check for a non-empty value and use a reliable home-directory fallback or fail with a controlled error.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-20 20:51 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#discussion_r4058053932) On `src/common/path_util.cpp` line 17 (outdated): ```diff @@ -0,0 +1,40 @@ +#include "path_util.h" + +#include <cstdlib> +#include <filesystem> + +namespace PathUtil { + +// String definitions for used folders +static constexpr auto save_dir = "_SaveData/"; +static constexpr auto temp_dir = "_TempData/"; +static constexpr auto pipeline_cache_dir = "_PipelineCache/"; +static constexpr auto download_dir = "_DownloadData/"; +static constexpr auto texture_dir = "_Textures/"; + +static inline std::filesystem::path GetUserPath() { +#if KYTY_PLATFORM == KYTY_PLATFORM_LINUX + return std::filesystem::path(std::getenv("HOME")) / ".local/share/kyty"; ``` _🩺 Stability & Availability_ | _🟠 Major_ | _⚡ Quick win_ **Handle an unset `HOME` variable.** If `HOME` is unset, `std::getenv("HOME")` returns `nullptr`. Constructing `std::filesystem::path` from that pointer has undefined behavior. This can terminate startup when the emulator resolves a save, texture, download, or pipeline-cache path. Check for a non-empty value and use a reliable home-directory fallback or fail with a controlled error. <!-- fingerprinting:phantom:poseidon:tapir --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:8e90c2bd79287e71e6b16424 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-20 20:51 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: 413f3ae5-36ed-4578-aeab-88a939d57ebb

📥 Commits

Reviewing files that changed from the base of the PR and between fe4f9423e3 and 755b439306.

📒 Files selected for processing (5)
  • src/common/path_util.cpp
  • src/common/path_util.h
  • src/emulator.cpp
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/libs/libSaveData.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-09-20 20:51 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#pullrequestreview-5261707782) · **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**: `413f3ae5-36ed-4578-aeab-88a939d57ebb` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between fe4f9423e3a364515c6fc5af6b7e75666b6ece2e and 755b43930623502350880e3f2504dfd4713e84b2. </details> <details> <summary>📒 Files selected for processing (5)</summary> * `src/common/path_util.cpp` * `src/common/path_util.h` * `src/emulator.cpp` * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` * `src/libs/libSaveData.cpp` </details> **Included review availability:** Your plan provides up to 10 included reviews per hour; 9 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
@ -352,3 +354,2 @@
options.shader_hash = params.hash;
options.user_data = user_data;
options.back_code = params.back_code;
options.user_data = params.user_data;
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-23 17:39 UTC · original

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Inspect the shader input types and compiler reads without running repository code.
rg -n -C 3 'struct ShaderParams|struct CompileOptions|user_data_count|options\.user_data|user_data\.size\(' src/graphics

Repository: KytyPS5/KytyPS5

Length of output: 19121


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- pipeline cache ---'
sed -n '260,350p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
printf '%s\n' '--- CompileOptions and compiler setup ---'
sed -n '1,40p' src/graphics/shader/recompiler/ShaderRecompiler.h
sed -n '540,590p' src/graphics/shader/recompiler/ShaderRecompiler.cpp
printf '%s\n' '--- translation user-data handling ---'
sed -n '990,1020p' src/graphics/shader/recompiler/frontend/translate/Translate.cpp
printf '%s\n' '--- direct compiler user-data accesses ---'
rg -n -C 3 'options\.user_data|user_data\[[^]]+\]|user_data\.size\(\)' src/graphics/shader/recompiler src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp

Repository: KytyPS5/KytyPS5

Length of output: 16109


Pass the bounded user-data span to the compiler.

options.user_data determines TranslateOptions::user_data_count. Passing the full array makes the compiler handle entries beyond params.user_data_count. Resource materialization uses the shorter runtime span and can reject those accesses.

Suggested fix
-		options.user_data   = params.user_data;
+		options.user_data   = user_data;
📝 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.

		options.user_data   = user_data;
**@⁠coderabbitai[bot]** on GitHub · 2026-09-23 17:39 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#discussion_r4085448150) _🎯 Functional Correctness_ | _🟡 Minor_ | _⚡ Quick win_ <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash # Inspect the shader input types and compiler reads without running repository code. rg -n -C 3 'struct ShaderParams|struct CompileOptions|user_data_count|options\.user_data|user_data\.size\(' src/graphics ``` Repository: KytyPS5/KytyPS5 Length of output: 19121 --- 🏁 Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- pipeline cache ---' sed -n '260,350p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp printf '%s\n' '--- CompileOptions and compiler setup ---' sed -n '1,40p' src/graphics/shader/recompiler/ShaderRecompiler.h sed -n '540,590p' src/graphics/shader/recompiler/ShaderRecompiler.cpp printf '%s\n' '--- translation user-data handling ---' sed -n '990,1020p' src/graphics/shader/recompiler/frontend/translate/Translate.cpp printf '%s\n' '--- direct compiler user-data accesses ---' rg -n -C 3 'options\.user_data|user_data\[[^]]+\]|user_data\.size\(\)' src/graphics/shader/recompiler src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 16109 --- </details> **Pass the bounded user-data span to the compiler.** `options.user_data` determines `TranslateOptions::user_data_count`. Passing the full array makes the compiler handle entries beyond `params.user_data_count`. Resource materialization uses the shorter runtime span and can reject those accesses. <details> <summary>Suggested fix</summary> ```diff - options.user_data = params.user_data; + options.user_data = user_data; ``` </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 options.user_data = user_data; ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:00c2e68bf9a21043b54027a9 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -303,3 +303,3 @@
static std::filesystem::path save_directory(std::string_view title_id, std::string_view dir_name,
int32_t user_id) {
const auto directory = std::filesystem::path(SAVE_DATA_DIR) / title_id / dir_name;
const auto directory = PathUtil::GetPath(PathUtil::SAVE_DIR) / title_id / dir_name;
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-23 17:39 UTC · original

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Preserve access to existing Linux saves.

After this root moves from _SaveData, existing saves remain at the old location. save_directory and SaveDataDirNameSearch both use the new root, so an upgrade can report an existing save as missing and create a separate save. Add a migration or an old-root fallback that moves the save before normal access. The PR objective identifies the Linux location change.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-23 17:39 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#discussion_r4085448180) _🗄️ Data Integrity & Integration_ | _🟠 Major_ | _🏗️ Heavy lift_ **Preserve access to existing Linux saves.** After this root moves from `_SaveData`, existing saves remain at the old location. `save_directory` and `SaveDataDirNameSearch` both use the new root, so an upgrade can report an existing save as missing and create a separate save. Add a migration or an old-root fallback that moves the save before normal access. The PR objective identifies the Linux location change. <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:bb0cbc0d4d143510491e4df1 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-23 17:39 UTC · original · reviewed

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟠 Major · Use a per-user Linux temporary directory. · path_util.cpp:22-38

src/common/path_util.cpp:22-38
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Use a per-user Linux temporary directory.

When two Linux users run the same title, both processes mount /tmp/kyty/<TITLE_ID>. Mount is process-local, but it does not isolate the shared host directory. The directory is created with mode 0777 before the umask, and files use fopen(..., "w+"); with a typical 022 umask, another user can enumerate and read the first user's temporary files.

Suggested fix
 		case TEMP_DIR:
 `#if` KYTY_PLATFORM == KYTY_PLATFORM_LINUX
-			return "/tmp/kyty/";
+			return GetUserPath() / temp_dir;
 `#endif`
 			return temp_dir;

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Advanced

Run ID: e17aac28-fc8c-4f81-8e7f-5fc8392056a1

📥 Commits

Reviewing files that changed from the base of the PR and between b97054ec5f and 8ea2bdb1de.

📒 Files selected for processing (2)
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/libs/libSaveData.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-09-23 17:39 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#pullrequestreview-5294599149) · **reviewed** **Actionable comments posted: 2** > [!CAUTION] > Some comments are outside the diff and can’t be posted inline due to GitHub limitations. > > **⚠️ Outside diff range comments (1)** > > <details> > <summary><em>🟠 Major</em> · Use a per-user Linux temporary directory. · <code>path_util.cpp:22-38</code></summary><blockquote> > > `src/common/path_util.cpp:22-38` > _🔒 Security & Privacy_ | _🟠 Major_ | _⚡ Quick win_ > > **Use a per-user Linux temporary directory.** > > When two Linux users run the same title, both processes mount `/tmp/kyty/<TITLE_ID>`. `Mount` is process-local, but it does not isolate the shared host directory. The directory is created with mode `0777` before the umask, and files use `fopen(..., "w+")`; with a typical `022` umask, another user can enumerate and read the first user's temporary files. > > <details><summary>Suggested fix</summary> > > ```diff > case TEMP_DIR: > `#if` KYTY_PLATFORM == KYTY_PLATFORM_LINUX > - return "/tmp/kyty/"; > + return GetUserPath() / temp_dir; > `#endif` > return temp_dir; > ``` > > </details> > > <!-- cr-comment:v1:e6a8c5c09c5e2486e50f58a8 --> > > </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**: `e17aac28-fc8c-4f81-8e7f-5fc8392056a1` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between b97054ec5f997f3dab45730614d56af0486f8266 and 8ea2bdb1de41b8b11b791f3d50ac1b92fdf17c92. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` * `src/libs/libSaveData.cpp` </details> **Included review availability:** Your plan provides up to 10 included reviews per hour; 9 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-23 20:06 UTC · original
On src/libs/libSaveData.cpp line 676 (outdated):

@@ -673,10 +673,10 @@ int KYTY_SYSV_ABI SaveDataMount3(const SaveDataMount3* mount, SaveDataMountResul
 
 	Common::LockGuard lock(g_mount_mutex);
 	const std::string dir_name  = mount->dir_name->data;
-	const auto        mount_dir = save_directory(get_title_id(), dir_name, mount->user_id);
-	const bool create  = ((mount->mount_mode & 4u) != 0);
-	const bool create2 = ((mount->mount_mode & 32u) != 0);
-	const bool open    = (!create && !create2 && ((mount->mount_mode & 3u) != 0));
+	const auto        mount_dir = save_directory(get_title_id(), dir_name, mount->user_id).string();

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Keep mount_dir as a filesystem path.

Line 706 uses mount_dir / "sce_sys". The new .string() makes mount_dir a std::string, which does not support that operator. SaveDataMount3 will not compile. Remove the conversion.

Proposed fix
-	const auto        mount_dir = save_directory(get_title_id(), dir_name, mount->user_id).string();
+	const auto        mount_dir = save_directory(get_title_id(), dir_name, mount->user_id);
📝 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.

	const auto        mount_dir = save_directory(get_title_id(), dir_name, mount->user_id);
**@⁠coderabbitai[bot]** on GitHub · 2026-09-23 20:06 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#discussion_r4086788528) On `src/libs/libSaveData.cpp` line 676 (outdated): ```diff @@ -673,10 +673,10 @@ int KYTY_SYSV_ABI SaveDataMount3(const SaveDataMount3* mount, SaveDataMountResul Common::LockGuard lock(g_mount_mutex); const std::string dir_name = mount->dir_name->data; - const auto mount_dir = save_directory(get_title_id(), dir_name, mount->user_id); - const bool create = ((mount->mount_mode & 4u) != 0); - const bool create2 = ((mount->mount_mode & 32u) != 0); - const bool open = (!create && !create2 && ((mount->mount_mode & 3u) != 0)); + const auto mount_dir = save_directory(get_title_id(), dir_name, mount->user_id).string(); ``` _🎯 Functional Correctness_ | _🔴 Critical_ | _⚡ Quick win_ **Keep `mount_dir` as a filesystem path.** Line 706 uses `mount_dir / "sce_sys"`. The new `.string()` makes `mount_dir` a `std::string`, which does not support that operator. `SaveDataMount3` will not compile. Remove the conversion. <details> <summary>Proposed fix</summary> ```diff - const auto mount_dir = save_directory(get_title_id(), dir_name, mount->user_id).string(); + const auto mount_dir = save_directory(get_title_id(), dir_name, mount->user_id); ``` </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 const auto mount_dir = save_directory(get_title_id(), dir_name, mount->user_id); ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:ea80f8c6526fae3490e2bfec --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -916,2 +914,2 @@
const auto mount_dir = save_directory(mount->title_id->data, dir_name, mount->user_id);
const int slot = g_mount_slots.FindAvailable(mount_dir);
const auto mount_dir = save_directory(mount->title_id->data, dir_name, mount->user_id).string();
const int slot = g_mount_slots.FindAvailable(dir_name);
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-23 20:06 UTC · original

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Check the full directory for an occupied mount slot.

FindAvailable compares its argument with mounted filesystem paths. If the requested save is already mounted, dir_name usually does not match its full path. The transfer mount can then take a second slot instead of returning SAVE_DATA_ERROR_BUSY. Pass mount_dir, as SaveDataMount3 does.

Proposed fix
-	const int  slot      = g_mount_slots.FindAvailable(dir_name);
+	const int  slot      = g_mount_slots.FindAvailable(mount_dir);
📝 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.

	const int  slot      = g_mount_slots.FindAvailable(mount_dir);
**@⁠coderabbitai[bot]** on GitHub · 2026-09-23 20:06 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#discussion_r4086788566) _🎯 Functional Correctness_ | _🟠 Major_ | _⚡ Quick win_ **Check the full directory for an occupied mount slot.** `FindAvailable` compares its argument with mounted filesystem paths. If the requested save is already mounted, `dir_name` usually does not match its full path. The transfer mount can then take a second slot instead of returning `SAVE_DATA_ERROR_BUSY`. Pass `mount_dir`, as `SaveDataMount3` does. <details> <summary>Proposed fix</summary> ```diff - const int slot = g_mount_slots.FindAvailable(dir_name); + const int slot = g_mount_slots.FindAvailable(mount_dir); ``` </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 const int slot = g_mount_slots.FindAvailable(mount_dir); ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:80a5b01e93095c58ad8eefa1 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-23 20:06 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: dcd14536-3d96-47a9-a8f7-28cdb66cc5b1

📥 Commits

Reviewing files that changed from the base of the PR and between 8ea2bdb1de and 26877fc1cf.

📒 Files selected for processing (1)
  • src/libs/libSaveData.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-09-23 20:06 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#pullrequestreview-5296188901) · **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**: `dcd14536-3d96-47a9-a8f7-28cdb66cc5b1` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 8ea2bdb1de41b8b11b791f3d50ac1b92fdf17c92 and 26877fc1cf0a9012ab2a384bb72141758ce725bc. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `src/libs/libSaveData.cpp` </details> **Included review availability:** Your plan provides up to 10 included reviews per hour; 9 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Author
Owner

@⁠awsms on GitHub · 2026-10-02 10:37 UTC · original

can this be reviewed?

**@⁠awsms** on GitHub · 2026-10-02 10:37 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#issuecomment-5950549550) can this be reviewed?
Author
Owner

@⁠C0rn3j on GitHub · 2026-10-06 10:53 UTC · original

These changes are made to follow standard linux application file conventions

I see you attempted that by following XDG but then tossed it.

"XDG_SHARE_HOME" does not exist in the spec - was that an LLM imagining it?
You should use $XDG_DATA_HOME and default to $HOME/.local/share if it is not set.

https://wiki.archlinux.org/title/XDG_Base_Directory#User_directories

**@⁠C0rn3j** on GitHub · 2026-10-06 10:53 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#issuecomment-6014703761) > These changes are made to follow standard linux application file conventions I see you attempted that by following XDG but then tossed it. "XDG_SHARE_HOME" does not exist in the spec - was that an LLM imagining it? You should use `$XDG_DATA_HOME` and default to `$HOME/.local/share` if it is not set. https://wiki.archlinux.org/title/XDG_Base_Directory#User_directories
Author
Owner

@⁠Kody-Schram on GitHub · 2026-10-07 15:38 UTC · original

These changes are made to follow standard linux application file conventions

I see you attempted that by following XDG but then tossed it.

"XDG_SHARE_HOME" does not exist in the spec - was that an LLM imagining it? You should use $XDG_DATA_HOME and default to $HOME/.local/share if it is not set.

https://wiki.archlinux.org/title/XDG_Base_Directory#User_directories

No, I did test XDG_SHARE_HOME as I similarily assumed that was the obvious solution. However if I remember correctly it wasn't set on my environment for some odd reason.

Doing a nullptr check for that environment var does make sense tho. I guess i just didnt do that because it basically always defaults to $HOME/.local/share

**@⁠Kody-Schram** on GitHub · 2026-10-07 15:38 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#issuecomment-6041284653) > > These changes are made to follow standard linux application file conventions > > I see you attempted that by following XDG but then tossed it. > > "XDG_SHARE_HOME" does not exist in the spec - was that an LLM imagining it? You should use `$XDG_DATA_HOME` and default to `$HOME/.local/share` if it is not set. > > https://wiki.archlinux.org/title/XDG_Base_Directory#User_directories No, I did test XDG_SHARE_HOME as I similarily assumed that was the obvious solution. However if I remember correctly it wasn't set on my environment for some odd reason. Doing a nullptr check for that environment var does make sense tho. I guess i just didnt do that because it basically always defaults to $HOME/.local/share
Author
Owner

@⁠lovemymobilewebsite-dotcom on GitHub · 2026-10-07 15:44 UTC · original · approved these changes

**@⁠lovemymobilewebsite-dotcom** on GitHub · 2026-10-07 15:44 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/740#pullrequestreview-5444734658) · **approved these changes**

Pull request closed

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