fix(libkernel): preserve DOS device names and trailing dots or spaces on Windows #12560

Merged
Kikoarl merged 1 commit from upstream-pr/12560 into main 2026-11-03 05:09:20 +00:00
Kikoarl commented 2026-10-28 20:17:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-28T20:17:27Z.


What

On Windows hosts, Win32 path canonicalization rewrites file paths shorter than MAX_PATH whose components end in a dot (.) or a space ( ), or whose stem matches a DOS device name (NUL, CON, PRN, AUX, COM1-9, COM¹-³, LPT1-9, LPT¹-³, CONIN$, CONOUT$ with or without an extension). This silently redirects guest file operations to host character devices (e.g. nul dropping data) or strips trailing dots and spaces (e.g. file. collapsing to file), causing guest filesystem corruption or ENOENT.

This PR introduces WindowsVerbatimPath.hpp and extends NativeVerbatimPath_nid_no_patch:

  • Detects DOS device stems (including superscript forms COM¹-³ and LPT¹-³) and path components ending with a dot or space.
  • Prefixes host paths with the Win32 verbatim extended-length syntax (\\?\ for drive paths, \\?\UNC\ for network shares) whenever such components are present, bypassing Win32 canonicalization regardless of path length.
  • Preserves idempotency on paths already prefixed with \\?\ or \\.\ and normalizes / to \.
  • Enforces WindowsMaxDirectoryPathLength = 248 (MAX_PATH - 12) for Win32 directory operations (CreateDirectoryW, RemoveDirectoryW), prefixing \\?\ when directory paths reach 248+ characters to eliminate Win32 directory creation failures in the [248, 259] range.
  • Updates OpenNative, sceKernelUnlink, opendir, rename, and fopen to route paths through NativeVerbatimPath_nid_no_patch.
  • Adds comprehensive unit tests in core/libs/tests/GuestFilesystem.cpp verifying both path formatting logic and Windows filesystem syscall behavior, omitting assumptions about com0/lpt0 reserved device mapping (Rule L44).

Fixes #12550

Tested

  • Unit tests (guest_filesystem): added TestWindowsVerbatimPath testing DOS device stems (NUL, CON, AUX, PRN, COM1-9, COM¹-³, LPT1-9, LPT¹-³), console devices (CONIN$, CONOUT$), trailing dots/spaces, forward slash normalization, idempotency, non-DOS stems, and length thresholds 247/248/259/260.
  • 14/14 libc/filesystem tests passed cleanly in RAM disk (ctest --test-dir /tmp/anyps5_build -R "libc|guest_file|filesystem").
  • Cross-compiled standalone Windows PE executable via llvm-mingw and executed under Wine: verified CreateFileW, _wstat64, and DeleteFileW on file., nul, and conin$.txt passing all Win32 assertions.
  • python3 tools/check_conventions.py passed with 0 errors.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: #12550
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5057080015 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12560). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-28T20:17:27Z. --- ### What On Windows hosts, Win32 path canonicalization rewrites file paths shorter than `MAX_PATH` whose components end in a dot (`.`) or a space (` `), or whose stem matches a DOS device name (`NUL`, `CON`, `PRN`, `AUX`, `COM1-9`, `COM¹-³`, `LPT1-9`, `LPT¹-³`, `CONIN$`, `CONOUT$` with or without an extension). This silently redirects guest file operations to host character devices (e.g. `nul` dropping data) or strips trailing dots and spaces (e.g. `file.` collapsing to `file`), causing guest filesystem corruption or `ENOENT`. This PR introduces `WindowsVerbatimPath.hpp` and extends `NativeVerbatimPath_nid_no_patch`: - Detects DOS device stems (including superscript forms `COM¹-³` and `LPT¹-³`) and path components ending with a dot or space. - Prefixes host paths with the Win32 verbatim extended-length syntax (`\\?\` for drive paths, `\\?\UNC\` for network shares) whenever such components are present, bypassing Win32 canonicalization regardless of path length. - Preserves idempotency on paths already prefixed with `\\?\` or `\\.\` and normalizes `/` to `\`. - Enforces `WindowsMaxDirectoryPathLength = 248` (`MAX_PATH - 12`) for Win32 directory operations (`CreateDirectoryW`, `RemoveDirectoryW`), prefixing `\\?\` when directory paths reach 248+ characters to eliminate Win32 directory creation failures in the [248, 259] range. - Updates `OpenNative`, `sceKernelUnlink`, `opendir`, `rename`, and `fopen` to route paths through `NativeVerbatimPath_nid_no_patch`. - Adds comprehensive unit tests in `core/libs/tests/GuestFilesystem.cpp` verifying both path formatting logic and Windows filesystem syscall behavior, omitting assumptions about `com0`/`lpt0` reserved device mapping (Rule L44). Fixes #12550 ### Tested - Unit tests (`guest_filesystem`): added `TestWindowsVerbatimPath` testing DOS device stems (`NUL`, `CON`, `AUX`, `PRN`, `COM1-9`, `COM¹-³`, `LPT1-9`, `LPT¹-³`), console devices (`CONIN$`, `CONOUT$`), trailing dots/spaces, forward slash normalization, idempotency, non-DOS stems, and length thresholds 247/248/259/260. - 14/14 libc/filesystem tests passed cleanly in RAM disk (`ctest --test-dir /tmp/anyps5_build -R "libc|guest_file|filesystem"`). - Cross-compiled standalone Windows PE executable via llvm-mingw and executed under Wine: verified `CreateFileW`, `_wstat64`, and `DeleteFileW` on `file.`, `nul`, and `conin$.txt` passing all Win32 assertions. - `python3 tools/check_conventions.py` passed with 0 errors. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: #12550 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-28 20:25:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T20:25:48Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The Windows path helper misses the superscript-digit COM and LPT device aliases, so those valid reserved names bypass the new verbatim-path handling.

What I ran

  • PR head: 476f65332d09398311207a8fdf0a57d2a63962bf; base: 319621ba2e578bd053b0baba2877fe70520e0737.

  • Linux x86_64, GCC 12.2.0; this exercised the platform-independent path-name helper, not Win32 file I/O.

  • git diff --check 319621ba2e578bd053b0baba2877fe70520e0737...refs/review/pr-12560-current — passed.

  • git merge-tree --write-tree 319621ba2e578bd053b0baba2877fe70520e0737 refs/review/pr-12560-current — clean, tree 4f03c607285648e9b093972dc1b8374fbc438fdd.

  • git show 476f65332d09398311207a8fdf0a57d2a63962bf:core/libs/prx/libc/include/WindowsVerbatimPath.hpp > /tmp/WindowsVerbatimPath.hpp

  • The probe source /tmp/test-verbatim-superscript.cpp was:

    #include <iostream>
    #include <string>
    #include "WindowsVerbatimPath.hpp"
    int main() {
        for (const std::wstring value : {L"COM1.txt", L"COM\u00b9.txt", L"LPT3.log", L"LPT\u00b3.log"}) {
            std::wcout << (value[3] == L'1' || value[3] == L'3' ? L"ASCII " : L"SUPERSCRIPT ");
            std::wcout << PathNeedsVerbatimPrefix_nid_no_patch(std::wstring_view(value)) << L" ";
            std::wcout << MakeVerbatimWindowsPathForTest_nid_no_patch(std::wstring_view(value)) << L"\n";
        }
    }
    
  • g++ -std=c++20 -I /tmp /tmp/test-verbatim-superscript.cpp -o /tmp/test-verbatim-superscript && LC_ALL=C.UTF-8 /tmp/test-verbatim-superscript

Results

Check Result
Merge preview onto stated base Clean
Diff check Passed
ASCII COM/LPT aliases Prefix detected
Superscript COM/LPT aliases Prefix not detected
Probe output
ASCII 1 \\?\COM1.txt
SUPERSCRIPT 0 COM?.txt
ASCII 1 \\?\LPT3.log
SUPERSCRIPT 0 LPT?.log

Negative control

No source mutation was run. The probe compared the documented ASCII and superscript aliases directly; the ASCII cases are detected and prefixed, while the superscript cases are not.

Findings

Blocking

  • IsDosDeviceStem_nid_no_patch accepts only ASCII '1'–'9' for COM#/LPT#. Windows also reserves COM¹, COM², COM³, LPT¹, LPT², and LPT³, including names followed by extensions. A short path such as COM¹.txt therefore returns false from PathNeedsVerbatimPrefix_nid_no_patch and receives no \\?\ prefix. Please recognize U+00B9/U+00B2/U+00B3 after COM/LPT and add narrow/wide tests that verify the detector and final formatted path. The current ASCII boundary cases such as COM0 and COM10 should remain unreserved.

Non-blocking

The merge preview is clean and the local diff check passes. The hosted Windows build and runtime behavior were not complete when I checked; the helper probe alone does not verify Win32 I/O.

Sources

Not verified

I did not run Windows/macOS builds, a full project build, or Win32 filesystem tests. I did not verify the added behavior on NTFS/FAT or a console.

To get this to a good state

Recognize and test the superscript aliases above, then I can rerun the helper probe and review the updated Windows checks on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5689216317 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12560#pullrequestreview-5689216317). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T20:25:48Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The Windows path helper misses the superscript-digit COM and LPT device aliases, so those valid reserved names bypass the new verbatim-path handling. ## What I ran - PR head: `476f65332d09398311207a8fdf0a57d2a63962bf`; base: `319621ba2e578bd053b0baba2877fe70520e0737`. - Linux x86_64, GCC 12.2.0; this exercised the platform-independent path-name helper, not Win32 file I/O. - `git diff --check 319621ba2e578bd053b0baba2877fe70520e0737...refs/review/pr-12560-current` — passed. - `git merge-tree --write-tree 319621ba2e578bd053b0baba2877fe70520e0737 refs/review/pr-12560-current` — clean, tree `4f03c607285648e9b093972dc1b8374fbc438fdd`. - `git show 476f65332d09398311207a8fdf0a57d2a63962bf:core/libs/prx/libc/include/WindowsVerbatimPath.hpp > /tmp/WindowsVerbatimPath.hpp` - The probe source `/tmp/test-verbatim-superscript.cpp` was: ```cpp #include <iostream> #include <string> #include "WindowsVerbatimPath.hpp" int main() { for (const std::wstring value : {L"COM1.txt", L"COM\u00b9.txt", L"LPT3.log", L"LPT\u00b3.log"}) { std::wcout << (value[3] == L'1' || value[3] == L'3' ? L"ASCII " : L"SUPERSCRIPT "); std::wcout << PathNeedsVerbatimPrefix_nid_no_patch(std::wstring_view(value)) << L" "; std::wcout << MakeVerbatimWindowsPathForTest_nid_no_patch(std::wstring_view(value)) << L"\n"; } } ``` - `g++ -std=c++20 -I /tmp /tmp/test-verbatim-superscript.cpp -o /tmp/test-verbatim-superscript && LC_ALL=C.UTF-8 /tmp/test-verbatim-superscript` ## Results | Check | Result | |---|---| | Merge preview onto stated base | Clean | | Diff check | Passed | | ASCII COM/LPT aliases | Prefix detected | | Superscript COM/LPT aliases | Prefix not detected | <details> <summary>Probe output</summary> ```text ASCII 1 \\?\COM1.txt SUPERSCRIPT 0 COM?.txt ASCII 1 \\?\LPT3.log SUPERSCRIPT 0 LPT?.log ``` </details> ## Negative control No source mutation was run. The probe compared the documented ASCII and superscript aliases directly; the ASCII cases are detected and prefixed, while the superscript cases are not. ## Findings ### Blocking - `IsDosDeviceStem_nid_no_patch` accepts only ASCII `'1'`–`'9'` for `COM#`/`LPT#`. Windows also reserves `COM¹`, `COM²`, `COM³`, `LPT¹`, `LPT²`, and `LPT³`, including names followed by extensions. A short path such as `COM¹.txt` therefore returns false from `PathNeedsVerbatimPrefix_nid_no_patch` and receives no `\\?\` prefix. Please recognize U+00B9/U+00B2/U+00B3 after `COM`/`LPT` and add narrow/wide tests that verify the detector and final formatted path. The current ASCII boundary cases such as `COM0` and `COM10` should remain unreserved. ### Non-blocking The merge preview is clean and the local diff check passes. The hosted Windows build and runtime behavior were not complete when I checked; the helper probe alone does not verify Win32 I/O. ## Sources - [Device-name detection in this PR head](https://github.com/boykopovar/AnyPS5/blob/476f65332d09398311207a8fdf0a57d2a63962bf/core/libs/prx/libc/include/WindowsVerbatimPath.hpp#L15-L56) - [Microsoft Windows reserved names, including superscript COM/LPT digits](https://github.com/MicrosoftDocs/win32/blob/63e70903d18b0637e62ffab6656c4a388ef0f2ce/desktop-src/FileIO/naming-a-file.md#L53-L60) ## Not verified I did not run Windows/macOS builds, a full project build, or Win32 filesystem tests. I did not verify the added behavior on NTFS/FAT or a console. ## To get this to a good state Recognize and test the superscript aliases above, then I can rerun the helper probe and review the updated Windows checks on the new head.
MarcZX10 commented 2026-10-28 20:33:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T20:33:09Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes still requested

The Windows path change remains incomplete across guest filesystem operations, and this head also omits documented device aliases and removes an unrelated debt entry.

What I ran

  • Reviewed exact head 476f65332d09398311207a8fdf0a57d2a63962bf against base 319621ba2e578bd053b0baba2877fe70520e0737.

  • git diff --check 319621ba2e578bd053b0baba2877fe70520e0737...refs/review/pr-12560-current — passed.

  • git merge-tree --write-tree 319621ba2e578bd053b0baba2877fe70520e0737 refs/review/pr-12560-current — clean, tree 4f03c607285648e9b093972dc1b8374fbc438fdd.

  • Extracted the PR header and compiled a C++20 probe with GCC 12.2.0 on Linux:

    git show 476f65332d09398311207a8fdf0a57d2a63962bf:core/libs/prx/libc/include/WindowsVerbatimPath.hpp > /tmp/WindowsVerbatimPath.hpp
    g++ -std=c++20 -I /tmp /tmp/test-verbatim-superscript.cpp -o /tmp/test-verbatim-superscript
    LC_ALL=C.UTF-8 /tmp/test-verbatim-superscript
    

    The probe passed ASCII COM1.txt and LPT3.log through the prefix logic, but did not do so for Unicode COM¹.txt and LPT³.log.

Results

Check Result
Current-main merge preview Clean
Diff check Passed
ASCII vs. superscript device-name probe ASCII detected; superscript aliases missed
Source audit of mkdir/rmdir/remove/rename paths Several call sites still use unprefixed paths
Existing strtoq debt entry Replaced by this unrelated entry
Native Windows guest_filesystem runtime test Not verified by me; CI's Windows job compiles only
Probe output
ASCII 1 \\?\COM1.txt
SUPERSCRIPT 0 COM?.txt
ASCII 1 \\?\LPT3.log
SUPERSCRIPT 0 LPT?.log

Negative control

I did not run source mutations or the Windows filesystem test binary. The helper probe directly compared ASCII names with U+00B9/U+00B3 names; the latter bypass the detection that triggers prefixing.

Findings

Blocking

  • The helper is not applied consistently. The PR routes selected open/unlink/opendir calls through NativeVerbatimPath_nid_no_patch, but NativeMkdir and NativeRmdir still pass the original path to _wmkdir/_wrmdir; libc remove still passes the original resolved path to GetFileAttributesW, SetFileAttributesW, RemoveDirectoryW/DeleteFileW; and rename's preflight checks use the original source and destination. In RenameNative_nid_no_patch, the verbatim conversion is only used when replacesExisting is true; the new-destination branch calls std::filesystem::rename(source, destination) unchanged. Thus operations on the same guest name can target different host names or still reach a device. Please use one consistently resolved host path for metadata checks and the final operation, and add Windows live regressions for mkdir/rmdir/remove/rename on trailing-dot and device-stem paths, including a file/file. sibling control.
  • Superscript device aliases are missed. IsDosDeviceStem_nid_no_patch only accepts ASCII digits for COM#/LPT#. Microsoft's pinned naming reference also reserves COM¹–COM³ and LPT¹–LPT³, with or without extensions. Please recognize U+00B9, U+00B2, and U+00B3 and test narrow/wide detection plus final path formatting.
  • An unrelated technical-debt record is deleted. This diff replaces the existing strtoq entry in docs/dev/debt/libc.md. Please restore that entry and add the Windows path note as a separate bullet.
  • The platform-specific regression has no reported native Windows CTest run. The PR-triggered Windows job compiles but does not run guest_filesystem; the reported Wine probe is not the same as running the integrated test on Windows. Please attach the guest_filesystem CTest output from the revised Windows head so the live API behavior in the new test is exercised.

Non-blocking

The merge preview with current main and whitespace check are clean. The current PR's macOS hosted jobs were queued at last refresh; macOS is not the target platform for this change.

Sources

Not verified

I did not run Win32 filesystem operations, the PR's CTest suite, a Windows native build, or console behavior. I did not independently test alternate data streams; the PR's own debt note leaves colon handling out of scope.

To get this to a good state

Make the path representation consistent for every affected filesystem operation, retain the existing strtoq debt entry, cover the superscript aliases, and run guest_filesystem on native Windows. I can rerun the helper probe and inspect the resulting exact-head diff and test evidence.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5689313117 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12560#pullrequestreview-5689313117). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T20:33:09Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes still requested The Windows path change remains incomplete across guest filesystem operations, and this head also omits documented device aliases and removes an unrelated debt entry. ## What I ran - Reviewed exact head `476f65332d09398311207a8fdf0a57d2a63962bf` against base `319621ba2e578bd053b0baba2877fe70520e0737`. - `git diff --check 319621ba2e578bd053b0baba2877fe70520e0737...refs/review/pr-12560-current` — passed. - `git merge-tree --write-tree 319621ba2e578bd053b0baba2877fe70520e0737 refs/review/pr-12560-current` — clean, tree `4f03c607285648e9b093972dc1b8374fbc438fdd`. - Extracted the PR header and compiled a C++20 probe with GCC 12.2.0 on Linux: ```sh git show 476f65332d09398311207a8fdf0a57d2a63962bf:core/libs/prx/libc/include/WindowsVerbatimPath.hpp > /tmp/WindowsVerbatimPath.hpp g++ -std=c++20 -I /tmp /tmp/test-verbatim-superscript.cpp -o /tmp/test-verbatim-superscript LC_ALL=C.UTF-8 /tmp/test-verbatim-superscript ``` The probe passed ASCII `COM1.txt` and `LPT3.log` through the prefix logic, but did not do so for Unicode `COM¹.txt` and `LPT³.log`. ## Results | Check | Result | |---|---| | Current-main merge preview | Clean | | Diff check | Passed | | ASCII vs. superscript device-name probe | ASCII detected; superscript aliases missed | | Source audit of mkdir/rmdir/remove/rename paths | Several call sites still use unprefixed paths | | Existing `strtoq` debt entry | Replaced by this unrelated entry | | Native Windows `guest_filesystem` runtime test | Not verified by me; CI's Windows job compiles only | <details> <summary>Probe output</summary> ```text ASCII 1 \\?\COM1.txt SUPERSCRIPT 0 COM?.txt ASCII 1 \\?\LPT3.log SUPERSCRIPT 0 LPT?.log ``` </details> ## Negative control I did not run source mutations or the Windows filesystem test binary. The helper probe directly compared ASCII names with U+00B9/U+00B3 names; the latter bypass the detection that triggers prefixing. ## Findings ### Blocking - **The helper is not applied consistently.** The PR routes selected open/unlink/opendir calls through `NativeVerbatimPath_nid_no_patch`, but `NativeMkdir` and `NativeRmdir` still pass the original path to `_wmkdir`/`_wrmdir`; libc remove still passes the original `resolved` path to `GetFileAttributesW`, `SetFileAttributesW`, `RemoveDirectoryW`/`DeleteFileW`; and rename's preflight checks use the original source and destination. In `RenameNative_nid_no_patch`, the verbatim conversion is only used when `replacesExisting` is true; the new-destination branch calls `std::filesystem::rename(source, destination)` unchanged. Thus operations on the same guest name can target different host names or still reach a device. Please use one consistently resolved host path for metadata checks and the final operation, and add Windows live regressions for mkdir/rmdir/remove/rename on trailing-dot and device-stem paths, including a `file`/`file.` sibling control. - **Superscript device aliases are missed.** `IsDosDeviceStem_nid_no_patch` only accepts ASCII digits for `COM#`/`LPT#`. Microsoft's pinned naming reference also reserves `COM¹`–`COM³` and `LPT¹`–`LPT³`, with or without extensions. Please recognize U+00B9, U+00B2, and U+00B3 and test narrow/wide detection plus final path formatting. - **An unrelated technical-debt record is deleted.** This diff replaces the existing `strtoq` entry in `docs/dev/debt/libc.md`. Please restore that entry and add the Windows path note as a separate bullet. - **The platform-specific regression has no reported native Windows CTest run.** The PR-triggered Windows job compiles but does not run `guest_filesystem`; the reported Wine probe is not the same as running the integrated test on Windows. Please attach the `guest_filesystem` CTest output from the revised Windows head so the live API behavior in the new test is exercised. ### Non-blocking The merge preview with current main and whitespace check are clean. The current PR's macOS hosted jobs were queued at last refresh; macOS is not the target platform for this change. ## Sources - [Unprefixed mkdir/rmdir helpers at this PR head](https://github.com/boykopovar/AnyPS5/blob/476f65332d09398311207a8fdf0a57d2a63962bf/core/libs/prx/libkernel/File/src/Stdio.cpp#L76-L90) - [Unprefixed remove operations at this PR head](https://github.com/boykopovar/AnyPS5/blob/476f65332d09398311207a8fdf0a57d2a63962bf/core/libs/prx/libc/src/Filesystem.cpp#L149-L170) - [Rename preflight and conditional path conversion at this PR head](https://github.com/boykopovar/AnyPS5/blob/476f65332d09398311207a8fdf0a57d2a63962bf/core/libs/prx/libc/src/Rename.cpp#L16-L40) - [ASCII-only COM/LPT digit check at this PR head](https://github.com/boykopovar/AnyPS5/blob/476f65332d09398311207a8fdf0a57d2a63962bf/core/libs/prx/libc/include/WindowsVerbatimPath.hpp#L36-L45) - [Microsoft's reserved COM/LPT names at a pinned documentation commit](https://github.com/MicrosoftDocs/win32/blob/63e70903d18b0637e62ffab6656c4a388ef0f2ce/desktop-src/FileIO/naming-a-file.md#L53-L60) - [The `strtoq` entry in the base](https://github.com/boykopovar/AnyPS5/blob/319621ba2e578bd053b0baba2877fe70520e0737/docs/dev/debt/libc.md#L91) - [The replacement debt entry in this PR head](https://github.com/boykopovar/AnyPS5/blob/476f65332d09398311207a8fdf0a57d2a63962bf/docs/dev/debt/libc.md#L91) ## Not verified I did not run Win32 filesystem operations, the PR's CTest suite, a Windows native build, or console behavior. I did not independently test alternate data streams; the PR's own debt note leaves colon handling out of scope. ## To get this to a good state Make the path representation consistent for every affected filesystem operation, retain the existing `strtoq` debt entry, cover the superscript aliases, and run `guest_filesystem` on native Windows. I can rerun the helper probe and inspect the resulting exact-head diff and test evidence.
MarcZX10 commented 2026-10-28 21:04:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T21:04:45Z.

Review: CHANGES_REQUESTED


Findings

Blocking: the Windows regression test does not compile on the reviewed head

An independent native Windows run of head 476f65332d reports that GuestFilesystem.cpp fails to compile under _WIN32: SCE_KERNEL_O_RDWR and SCE_KERNEL_O_CREAT are undeclared. The required declarations are in prx/libkernel/File/include/FileFlags.hpp, which this test does not include. The hosted Windows workflow passed, but its Windows job only linked changed host-only test executables; it did not compile or run guest_filesystem, so it did not catch this failure. Please include the defining header and make sure the Windows test is actually built and run.

Blocking: path operations use inconsistent forms

The new verbatim form is not applied consistently across guest-path operations. In particular, sceKernelMkdir still passes its resolved path to std::filesystem::create_directory, while sceKernelOpen uses the verbatim form. A native Windows reproduction reported that mkdir("d.") followed by open("d./save", O_CREAT) now fails with ENOENT on this head, while it succeeded on base (though base created the wrongly normalized d). sceKernelRmdir, rename paths and other libc/libkernel path operations also remain on the plain form. Please route all affected guest-path operations through a consistent representation and add live Windows coverage for mkdir/open, rmdir, rename and same-name siblings such as file and file..

Blocking: an unrelated debt entry was removed

The current debt diff replaces the existing strtoq entry with the new Windows path note. Please restore strtoq as its own entry and preserve the existing “Guest file names on Windows” debt while narrowing it to the characters and cases that remain unsupported. The verbatim-path entry should state the remaining gap rather than replace unrelated documentation.

Checks and limits

  • git diff --check upstream/main...refs/review/pr-12560-current passed.
  • Hosted eligibility, conventions, intake and labels passed; the Windows job reported success but skipped compiling/running guest_filesystem. Linux product tests were skipped.
  • I did not independently run Windows tests. The compile failure and path behavior above are from the native Windows run reported in the PR discussion; please verify the linked comment is attached to the exact current head before relying on it.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5689675119 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12560#pullrequestreview-5689675119). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T21:04:45Z. **Review:** CHANGES_REQUESTED --- ## Findings ### Blocking: the Windows regression test does not compile on the reviewed head An independent native Windows run of head `476f65332d` reports that `GuestFilesystem.cpp` fails to compile under `_WIN32`: `SCE_KERNEL_O_RDWR` and `SCE_KERNEL_O_CREAT` are undeclared. The required declarations are in `prx/libkernel/File/include/FileFlags.hpp`, which this test does not include. The hosted Windows workflow passed, but its Windows job only linked changed host-only test executables; it did not compile or run `guest_filesystem`, so it did not catch this failure. Please include the defining header and make sure the Windows test is actually built and run. ### Blocking: path operations use inconsistent forms The new verbatim form is not applied consistently across guest-path operations. In particular, `sceKernelMkdir` still passes its resolved path to `std::filesystem::create_directory`, while `sceKernelOpen` uses the verbatim form. A native Windows reproduction reported that `mkdir("d.")` followed by `open("d./save", O_CREAT)` now fails with `ENOENT` on this head, while it succeeded on base (though base created the wrongly normalized `d`). `sceKernelRmdir`, rename paths and other libc/libkernel path operations also remain on the plain form. Please route all affected guest-path operations through a consistent representation and add live Windows coverage for mkdir/open, rmdir, rename and same-name siblings such as `file` and `file.`. ### Blocking: an unrelated debt entry was removed The current debt diff replaces the existing `strtoq` entry with the new Windows path note. Please restore `strtoq` as its own entry and preserve the existing “Guest file names on Windows” debt while narrowing it to the characters and cases that remain unsupported. The verbatim-path entry should state the remaining gap rather than replace unrelated documentation. ## Checks and limits - `git diff --check upstream/main...refs/review/pr-12560-current` passed. - Hosted eligibility, conventions, intake and labels passed; the Windows job reported success but skipped compiling/running `guest_filesystem`. Linux product tests were skipped. - I did not independently run Windows tests. The compile failure and path behavior above are from the native Windows run reported in [the PR discussion](https://github.com/boykopovar/AnyPS5/pull/12560#issuecomment-6480521473); please verify the linked comment is attached to the exact current head before relying on it.
MarcZX10 commented 2026-10-28 23:52:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T23:52:12Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested for native Windows runtime evidence

The current head addresses the reported path consistency, superscript device-name, Windows test compilation, and debt-documentation issues; the remaining blocking gap is execution of the live regression test on Windows.

What I ran

  • Reviewed exact head 4309769ffc02c6f3139de61a8db0b1177aded163 against current base 3a2b91981651569163768854a1fcdc7193b6667b.
  • git diff --check upstream/main...upstream/pr-12560 — passed.
  • python3 tools/check_conventions.py --base upstream/main --head upstream/pr-12560 — passed.
  • Compiled and ran a temporary GCC 12.2 probe against this head's WindowsVerbatimPath.hpp; narrow UTF-8 and wide superscript COM/LPT cases and trailing-dot/space formatting passed.
  • Cross-compiled the same helper probe with MinGW GCC using x86_64-w64-mingw32-g++ -std=c++20; compilation passed. This checks the platform-independent helper and Windows compiler compatibility, not Win32 filesystem behavior.
  • I did not run the integrated guest_filesystem executable or the new live Win32 filesystem cases.

Results

Check Result
Convention and whitespace checks Passed
Superscript COM/LPT helper behavior Passed on the pure helper probe
MinGW helper compilation Passed
Native Windows guest_filesystem CTest Not verified
Current hosted Windows job Does not establish execution of the live test; the author reports MinGW cross-compilation only

Findings

The latest diff now routes the reported mkdir/rmdir/rename and libc path operations through the verbatim path helper, recognizes the documented superscript device aliases, restores the unrelated strtoq debt record, and adds the missing Windows test header. I found no remaining source-level blocker in those reviewed findings.

The PR adds TestWindowsVerbatimPathLive, which exercises native create/open/remove behavior. The new-head report says it cross-compiles with MinGW but does not provide a native Windows run. Since the Windows behavior is the core of this change and earlier review reports identified Windows-only test compilation gaps, compilation alone does not verify that the live operations work.

Sources

Not verified

I did not run native Win32 filesystem operations, ctest -R '^guest_filesystem$', a full Windows build, macOS tests, or console behavior. The temporary helper probe is not a substitute for the integration test.

To get this to a good state

Please run ctest --test-dir <Windows build> -R '^guest_filesystem$' --output-on-failure on the exact head and attach the output. I can then re-check the live cases and update this review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5691189193 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12560#pullrequestreview-5691189193). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T23:52:12Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested for native Windows runtime evidence The current head addresses the reported path consistency, superscript device-name, Windows test compilation, and debt-documentation issues; the remaining blocking gap is execution of the live regression test on Windows. ## What I ran - Reviewed exact head `4309769ffc02c6f3139de61a8db0b1177aded163` against current base `3a2b91981651569163768854a1fcdc7193b6667b`. - `git diff --check upstream/main...upstream/pr-12560` — passed. - `python3 tools/check_conventions.py --base upstream/main --head upstream/pr-12560` — passed. - Compiled and ran a temporary GCC 12.2 probe against this head's `WindowsVerbatimPath.hpp`; narrow UTF-8 and wide superscript COM/LPT cases and trailing-dot/space formatting passed. - Cross-compiled the same helper probe with MinGW GCC using `x86_64-w64-mingw32-g++ -std=c++20`; compilation passed. This checks the platform-independent helper and Windows compiler compatibility, not Win32 filesystem behavior. - I did not run the integrated `guest_filesystem` executable or the new live Win32 filesystem cases. ## Results | Check | Result | |---|---| | Convention and whitespace checks | Passed | | Superscript COM/LPT helper behavior | Passed on the pure helper probe | | MinGW helper compilation | Passed | | Native Windows `guest_filesystem` CTest | Not verified | | Current hosted Windows job | Does not establish execution of the live test; the author reports MinGW cross-compilation only | ## Findings The latest diff now routes the reported mkdir/rmdir/rename and libc path operations through the verbatim path helper, recognizes the documented superscript device aliases, restores the unrelated `strtoq` debt record, and adds the missing Windows test header. I found no remaining source-level blocker in those reviewed findings. The PR adds `TestWindowsVerbatimPathLive`, which exercises native create/open/remove behavior. The new-head report says it cross-compiles with MinGW but does not provide a native Windows run. Since the Windows behavior is the core of this change and earlier review reports identified Windows-only test compilation gaps, compilation alone does not verify that the live operations work. ## Sources - [Current PR head](https://github.com/boykopovar/AnyPS5/commit/4309769ffc02c6f3139de61a8db0b1177aded163) - [Author's new-head verification report](https://github.com/boykopovar/AnyPS5/pull/12560#issuecomment-6483539908) - [Microsoft's reserved Windows names and verbatim-path guidance](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file) ## Not verified I did not run native Win32 filesystem operations, `ctest -R '^guest_filesystem$'`, a full Windows build, macOS tests, or console behavior. The temporary helper probe is not a substitute for the integration test. ## To get this to a good state Please run `ctest --test-dir <Windows build> -R '^guest_filesystem$' --output-on-failure` on the exact head and attach the output. I can then re-check the live cases and update this review.
MarcZX10 commented 2026-10-29 01:44:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T01:44:42Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The new native Windows run confirms that sceKernelRmdir fails on an empty directory ending in a dot, so the verbatim-path change still cannot remove a path it now preserves.

What I ran

Reviewed exact head 4309769ffc02c6f3139de61a8db0b1177aded163 against base 319621ba2e578bd053b0baba2877fe70520e0737; the current-main merge preview is clean (tree dbb9aefb11189d4288eae0915f16802c416bf20e). Environment: Debian GNU/Linux x86_64, Python 3.11.2. I inspected the changed sceKernelRmdir path and the author-supplied Windows 10 test report.

git diff --check upstream/main...refs/remotes/review/12560
python3 tools/check_conventions.py --base upstream/main --head refs/remotes/review/12560
git merge-tree --write-tree upstream/main refs/remotes/review/12560

Results

Check Result
Conventions Passed
Whitespace / conflict markers Passed; no output
Current-main merge preview Clean; tree dbb9aefb11189d4288eae0915f16802c416bf20e
Native Windows guest_filesystem Author-reported failure at sceKernelRmdir("/verbatim-test/d."); see linked exact-head report
Raw local output
All conventions checks passed.
dbb9aefb11189d4288eae0915f16802c416bf20e

git diff --check produced no output and exited successfully.

Author-reported Windows test output
Filesystem check failed at line 460 (guest errno 0, Win32 error 3)
FATAL: abort() (SIGABRT) on thread 31456
...
0% tests passed, 1 tests failed out of 1
	2491 - guest_filesystem (Exit code 0xc0000409)

The author reports this is the sceKernelRmdir("/verbatim-test/d.") assertion after creating and emptying d.. A standalone probe on the same Windows 10 system reports std::filesystem::is_empty returns false with error 2 for the verbatim path, while FindFirstFileW(path + L"\\*") succeeds.

Negative control

Assertion Change to code under test Result
Remove an empty trailing-dot directory through sceKernelRmdir None; I did not alter the code The author-reported new regression test fails on native Windows at the removal assertion

Findings

Blocking

  • sceKernelRmdir treats every false result from std::filesystem::is_empty(targetNative, error) as ENOTEMPTY and does not inspect error (Stdio.cpp at this head). On the reported Windows 10 / libstdc++ setup, is_empty cannot enumerate the verbatim path d., so the implementation rejects an empty directory and the new live test fails. Please use an emptiness check that supports the verbatim Windows path (or otherwise handle this filesystem error correctly), then remove the directory and rerun the exact Windows test. The native failure report is here.

Non-blocking

  • The other changes from the previous review are present: the path helper is applied to mkdir/rmdir/rename and the libc helpers, superscript device aliases are recognized, and the Windows test includes the needed flags header. I found no new issue in those changes in this pass.

Sources

Not verified

I did not run native Windows filesystem tests, the full guest_filesystem test binary, macOS tests, or PS5 hardware/title behavior. The native Windows failure is from the author's exact-head report, not a run on this Linux host.

To get this to a good state

Fix the Windows emptiness check for verbatim paths and rerun ctest --test-dir <Windows build> -R '^guest_filesystem$' --output-on-failure on the updated head; I will re-run the local checks above and review the new native output.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5691886247 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12560#pullrequestreview-5691886247). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T01:44:42Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The new native Windows run confirms that `sceKernelRmdir` fails on an empty directory ending in a dot, so the verbatim-path change still cannot remove a path it now preserves. ## What I ran Reviewed exact head `4309769ffc02c6f3139de61a8db0b1177aded163` against base `319621ba2e578bd053b0baba2877fe70520e0737`; the current-main merge preview is clean (tree `dbb9aefb11189d4288eae0915f16802c416bf20e`). Environment: Debian GNU/Linux x86_64, Python 3.11.2. I inspected the changed `sceKernelRmdir` path and the author-supplied Windows 10 test report. ```sh git diff --check upstream/main...refs/remotes/review/12560 python3 tools/check_conventions.py --base upstream/main --head refs/remotes/review/12560 git merge-tree --write-tree upstream/main refs/remotes/review/12560 ``` ## Results | Check | Result | |---|---| | Conventions | Passed | | Whitespace / conflict markers | Passed; no output | | Current-main merge preview | Clean; tree `dbb9aefb11189d4288eae0915f16802c416bf20e` | | Native Windows `guest_filesystem` | Author-reported failure at `sceKernelRmdir("/verbatim-test/d.")`; see linked exact-head report | <details> <summary>Raw local output</summary> ```text All conventions checks passed. dbb9aefb11189d4288eae0915f16802c416bf20e ``` `git diff --check` produced no output and exited successfully. </details> <details> <summary>Author-reported Windows test output</summary> ```text Filesystem check failed at line 460 (guest errno 0, Win32 error 3) FATAL: abort() (SIGABRT) on thread 31456 ... 0% tests passed, 1 tests failed out of 1 2491 - guest_filesystem (Exit code 0xc0000409) ``` The author reports this is the `sceKernelRmdir("/verbatim-test/d.")` assertion after creating and emptying `d.`. A standalone probe on the same Windows 10 system reports `std::filesystem::is_empty` returns false with error 2 for the verbatim path, while `FindFirstFileW(path + L"\\*")` succeeds. </details> ## Negative control | Assertion | Change to code under test | Result | |---|---|---| | Remove an empty trailing-dot directory through `sceKernelRmdir` | None; I did not alter the code | The author-reported new regression test fails on native Windows at the removal assertion | ## Findings ### Blocking - `sceKernelRmdir` treats every false result from `std::filesystem::is_empty(targetNative, error)` as `ENOTEMPTY` and does not inspect `error` ([`Stdio.cpp` at this head](https://github.com/boykopovar/AnyPS5/blob/4309769ffc02c6f3139de61a8db0b1177aded163/core/libs/prx/libkernel/File/src/Stdio.cpp#L1693-L1721)). On the reported Windows 10 / libstdc++ setup, `is_empty` cannot enumerate the verbatim path `d.`, so the implementation rejects an empty directory and the new live test fails. Please use an emptiness check that supports the verbatim Windows path (or otherwise handle this filesystem error correctly), then remove the directory and rerun the exact Windows test. The native failure report is [here](https://github.com/boykopovar/AnyPS5/pull/12560#issuecomment-6485382916). ### Non-blocking - The other changes from the previous review are present: the path helper is applied to mkdir/rmdir/rename and the libc helpers, superscript device aliases are recognized, and the Windows test includes the needed flags header. I found no new issue in those changes in this pass. ## Sources - [PR source at `4309769ffc02c6f3139de61a8db0b1177aded163`](https://github.com/boykopovar/AnyPS5/tree/4309769ffc02c6f3139de61a8db0b1177aded163) - [`sceKernelRmdir` at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/4309769ffc02c6f3139de61a8db0b1177aded163/core/libs/prx/libkernel/File/src/Stdio.cpp#L1693-L1721) - [Author's native Windows report](https://github.com/boykopovar/AnyPS5/pull/12560#issuecomment-6485382916) ## Not verified I did not run native Windows filesystem tests, the full `guest_filesystem` test binary, macOS tests, or PS5 hardware/title behavior. The native Windows failure is from the author's exact-head report, not a run on this Linux host. ## To get this to a good state Fix the Windows emptiness check for verbatim paths and rerun `ctest --test-dir <Windows build> -R '^guest_filesystem$' --output-on-failure` on the updated head; I will re-run the local checks above and review the new native output.
MarcZX10 commented 2026-10-29 08:37:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:37:55Z.

Review: CHANGES_REQUESTED


Re-reviewed exact head 4309769ffc02c6f3139de61a8db0b1177aded163 after the new Windows run. The author-run guest_filesystem test fails 3/3 on this head while the same test passes 3/3 on main; the failure is the new sceKernelRmdir("/verbatim-test/d.") case (Win32 error 3). The preceding mkdir, file creation/stat/unlink and sibling-name checks pass, so the trailing-dot directory is created and used but cannot be removed. Please fix the complete sceKernelRmdir path handling for that name and rerun guest_filesystem on Windows, retaining the regression. This is a blocking runtime failure; the hosted Windows job does not run this guest test. I did not run Windows tests locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5694895154 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12560#pullrequestreview-5694895154). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T08:37:55Z. **Review:** CHANGES_REQUESTED --- Re-reviewed exact head `4309769ffc02c6f3139de61a8db0b1177aded163` after the new Windows run. The author-run `guest_filesystem` test fails 3/3 on this head while the same test passes 3/3 on `main`; the failure is the new `sceKernelRmdir("/verbatim-test/d.")` case (`Win32 error 3`). The preceding mkdir, file creation/stat/unlink and sibling-name checks pass, so the trailing-dot directory is created and used but cannot be removed. Please fix the complete `sceKernelRmdir` path handling for that name and rerun `guest_filesystem` on Windows, retaining the regression. This is a blocking runtime failure; the hosted Windows job does not run this guest test. I did not run Windows tests locally.
MarcZX10 commented 2026-10-30 08:28:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T08:28:29Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested

The current branch conflicts with upstream main; the new path-length report is also not evidence that the earlier sceKernelRmdir failure is fixed on this head.

What I ran

Reviewed PR head 42d1ec15867f5faa2c9fad45ca0850f5122cf06c; its PR base is bb04a4f1ea0175e9e4f149f0359a764d62ff3296. I compared it with current main at 98ddd9c1792bbab016ceed5db267a93d1d61f00a. Environment: Debian 12, Linux x86_64, Python 3.11.2, Git 2.39.5. No compiler or project build was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12560
git diff --check bb04a4f1ea0175e9e4f149f0359a764d62ff3296...refs/review/pr-12560-live
python3 tools/check_conventions.py --base bb04a4f1ea0175e9e4f149f0359a764d62ff3296 --head refs/review/pr-12560-live
python3 /marc/AnyPS5/tools/pr_abi_audit.py --repo /marc/AnyPS5 --base bb04a4f1ea0175e9e4f149f0359a764d62ff3296 --head 42d1ec15867f5faa2c9fad45ca0850f5122cf06c --json
python3 /marc/AnyPS5/tools/pr_test_quality.py --root /tmp/AnyPS5-pr12560-check --json core/libs/tests/GuestFilesystem.cpp
git merge-tree --write-tree refs/review/main-live refs/review/pr-12560-live

Results

Check Result
Patch whitespace Passed; no output
Repository conventions and PR template Passed
Export/ABI audit Passed; no findings
Test-quality heuristic Flagged possible missing CMake registration; manually checked and core/libs/prx/libkernel/CMakeLists.txt:347 registers GuestFilesystem.cpp as guest_filesystem_tests
Current-main merge preview Conflicts in core/libs/prx/libc/src/Rename.cpp and core/libs/prx/libkernel/File/src/Open.cpp
Native Windows regression test Not run by me; the latest Windows report only covers path lengths for sceKernelMkdir, not the prior sceKernelRmdir case
Hosted CI Only conventions and labels are present, both pass; no Windows guest test is reported
Raw command output
All conventions checks passed.

git diff --check produced no output and exited successfully.

caffdc82854044257f4f7c1fd71970f19090e707
100644 cdad0eff615ff10e5fb4f3d52503ce3c972bb87b 1	core/libs/prx/libc/src/Rename.cpp
100644 f8e4941f4ce3d0bd7b9649267a622b739713107d 2	core/libs/prx/libc/src/Rename.cpp
100644 8192ae21a76bb1fca7618a91ba5ed675c7bd7a0a 3	core/libs/prx/libc/src/Rename.cpp
100644 13bfaf43b814c57ee2e3212991728472687a4e59 1	core/libs/prx/libkernel/File/src/Open.cpp
100644 3b0a3bbd2733a72655bbe9b6cabf2b4dfd0681ec 2	core/libs/prx/libkernel/File/src/Open.cpp
100644 bdd43046b5bc7dc919b0b9d9fc1653419fe8d575 3	core/libs/prx/libkernel/File/src/Open.cpp

Auto-merging core/libs/prx/libc/src/FileAndHeap.cpp
Auto-merging core/libs/prx/libc/src/Rename.cpp
CONFLICT (content): Merge conflict in core/libs/prx/libc/src/Rename.cpp
Auto-merging core/libs/prx/libkernel/File/src/Open.cpp
CONFLICT (content): Merge conflict in core/libs/prx/libkernel/File/src/Open.cpp
Auto-merging core/libs/prx/libkernel/File/src/Stdio.cpp
Auto-merging core/libs/tests/GuestFilesystem.cpp
Auto-merging docs/dev/debt/libc.md
Auto-merging docs/dev/debt/libkernel.md

The precheck's isolated worktree did not contain the local-only audit helper scripts; I ran the ABI and test-quality helpers directly against the exact PR checkout. Their raw outputs were JSON; the ABI audit reported "status": "passed" and "findings": []. The test heuristic's registration warning is shown above and was checked against CMake.

Negative control

Not run. The Windows filesystem assertion requires the native Windows test environment; I did not alter the code under test.

Findings

Blocking

  • The current-main merge preview conflicts in Rename.cpp and Open.cpp. Please update the branch and resolve those conflicts before merge.

Non-blocking

  • The latest path-length report says paths of 248–256 characters fail on both the reported main baseline and this PR, while 260+ succeeds only on the PR. That does not establish a regression introduced by this change. Current main still passes an unprefixed path to std::filesystem::create_directory in sceKernelMkdir (source at current main). The new report does not test the earlier sceKernelRmdir(".../d.") failure on this PR head.

Sources

Not verified

I did not build the project or run guest_filesystem on Windows. The earlier native Windows failure report is for head 4309769ffc02c6f3139de61a8db0b1177aded163, not this head. No console or macOS behavior was tested.

To get this to a good state

Please resolve the two current-main conflicts and run ctest --test-dir <Windows build> -R '^guest_filesystem$' --output-on-failure on the updated head, including the trailing-dot sceKernelRmdir case. I will rerun the same relevant checks on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5709812183 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12560#pullrequestreview-5709812183). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T08:28:29Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested The current branch conflicts with upstream `main`; the new path-length report is also not evidence that the earlier `sceKernelRmdir` failure is fixed on this head. ## What I ran Reviewed PR head `42d1ec15867f5faa2c9fad45ca0850f5122cf06c`; its PR base is `bb04a4f1ea0175e9e4f149f0359a764d62ff3296`. I compared it with current `main` at `98ddd9c1792bbab016ceed5db267a93d1d61f00a`. Environment: Debian 12, Linux x86_64, Python 3.11.2, Git 2.39.5. No compiler or project build was run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12560 git diff --check bb04a4f1ea0175e9e4f149f0359a764d62ff3296...refs/review/pr-12560-live python3 tools/check_conventions.py --base bb04a4f1ea0175e9e4f149f0359a764d62ff3296 --head refs/review/pr-12560-live python3 /marc/AnyPS5/tools/pr_abi_audit.py --repo /marc/AnyPS5 --base bb04a4f1ea0175e9e4f149f0359a764d62ff3296 --head 42d1ec15867f5faa2c9fad45ca0850f5122cf06c --json python3 /marc/AnyPS5/tools/pr_test_quality.py --root /tmp/AnyPS5-pr12560-check --json core/libs/tests/GuestFilesystem.cpp git merge-tree --write-tree refs/review/main-live refs/review/pr-12560-live ``` ## Results | Check | Result | |---|---| | Patch whitespace | Passed; no output | | Repository conventions and PR template | Passed | | Export/ABI audit | Passed; no findings | | Test-quality heuristic | Flagged possible missing CMake registration; manually checked and `core/libs/prx/libkernel/CMakeLists.txt:347` registers `GuestFilesystem.cpp` as `guest_filesystem_tests` | | Current-main merge preview | Conflicts in `core/libs/prx/libc/src/Rename.cpp` and `core/libs/prx/libkernel/File/src/Open.cpp` | | Native Windows regression test | Not run by me; the latest Windows report only covers path lengths for `sceKernelMkdir`, not the prior `sceKernelRmdir` case | | Hosted CI | Only conventions and labels are present, both pass; no Windows guest test is reported | <details> <summary>Raw command output</summary> ```text All conventions checks passed. ``` `git diff --check` produced no output and exited successfully. ```text caffdc82854044257f4f7c1fd71970f19090e707 100644 cdad0eff615ff10e5fb4f3d52503ce3c972bb87b 1 core/libs/prx/libc/src/Rename.cpp 100644 f8e4941f4ce3d0bd7b9649267a622b739713107d 2 core/libs/prx/libc/src/Rename.cpp 100644 8192ae21a76bb1fca7618a91ba5ed675c7bd7a0a 3 core/libs/prx/libc/src/Rename.cpp 100644 13bfaf43b814c57ee2e3212991728472687a4e59 1 core/libs/prx/libkernel/File/src/Open.cpp 100644 3b0a3bbd2733a72655bbe9b6cabf2b4dfd0681ec 2 core/libs/prx/libkernel/File/src/Open.cpp 100644 bdd43046b5bc7dc919b0b9d9fc1653419fe8d575 3 core/libs/prx/libkernel/File/src/Open.cpp Auto-merging core/libs/prx/libc/src/FileAndHeap.cpp Auto-merging core/libs/prx/libc/src/Rename.cpp CONFLICT (content): Merge conflict in core/libs/prx/libc/src/Rename.cpp Auto-merging core/libs/prx/libkernel/File/src/Open.cpp CONFLICT (content): Merge conflict in core/libs/prx/libkernel/File/src/Open.cpp Auto-merging core/libs/prx/libkernel/File/src/Stdio.cpp Auto-merging core/libs/tests/GuestFilesystem.cpp Auto-merging docs/dev/debt/libc.md Auto-merging docs/dev/debt/libkernel.md ``` The precheck's isolated worktree did not contain the local-only audit helper scripts; I ran the ABI and test-quality helpers directly against the exact PR checkout. Their raw outputs were JSON; the ABI audit reported `"status": "passed"` and `"findings": []`. The test heuristic's registration warning is shown above and was checked against CMake. </details> ## Negative control Not run. The Windows filesystem assertion requires the native Windows test environment; I did not alter the code under test. ## Findings ### Blocking - The current-main merge preview conflicts in `Rename.cpp` and `Open.cpp`. Please update the branch and resolve those conflicts before merge. ### Non-blocking - The latest path-length report says paths of 248–256 characters fail on both the reported main baseline and this PR, while 260+ succeeds only on the PR. That does not establish a regression introduced by this change. Current `main` still passes an unprefixed path to `std::filesystem::create_directory` in `sceKernelMkdir` ([source at current main](https://github.com/boykopovar/AnyPS5/blob/98ddd9c1792bbab016ceed5db267a93d1d61f00a/core/libs/prx/libkernel/File/src/Stdio.cpp#L1345-L1364)). The new report does not test the earlier `sceKernelRmdir(".../d.")` failure on this PR head. ## Sources - [PR head `42d1ec15867f5faa2c9fad45ca0850f5122cf06c`](https://github.com/boykopovar/AnyPS5/tree/42d1ec15867f5faa2c9fad45ca0850f5122cf06c) - [Current-main `sceKernelMkdir`](https://github.com/boykopovar/AnyPS5/blob/98ddd9c1792bbab016ceed5db267a93d1d61f00a/core/libs/prx/libkernel/File/src/Stdio.cpp#L1345-L1364) - [Windows path-length report](https://github.com/boykopovar/AnyPS5/pull/12560#issuecomment-6518397841) ## Not verified I did not build the project or run `guest_filesystem` on Windows. The earlier native Windows failure report is for head `4309769ffc02c6f3139de61a8db0b1177aded163`, not this head. No console or macOS behavior was tested. ## To get this to a good state Please resolve the two current-main conflicts and run `ctest --test-dir <Windows build> -R '^guest_filesystem$' --output-on-failure` on the updated head, including the trailing-dot `sceKernelRmdir` case. I will rerun the same relevant checks on the new head.
MarcZX10 commented 2026-10-30 11:29:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T11:29:58Z.

Review: APPROVED


Re-checked — new head, looks good

The updated head adds live Windows regression coverage for the previously failing trailing-dot directory removal and long directory-path cases, and the hosted Windows test job passed; I approve this revision.

What I ran

Reviewed head 718027132c6aadb27f792e552327c05f77540072 against base e049725553c4cf9770eb06d2ab1a211059efd29d on Linux x86_64 (Debian 12, Python 3.11.2, GCC 12.2.0). The local precheck ran diff and convention checks; I inspected the exact-head Windows test changes and current GitHub check results. I did not build locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12560
git diff --check e049725553c4cf9770eb06d2ab1a211059efd29d...718027132c6aadb27f792e552327c05f77540072
python3 tools/check_conventions.py --base e049725553c4cf9770eb06d2ab1a211059efd29d --head 718027132c6aadb27f792e552327c05f77540072 --title 'fix(libkernel): preserve DOS device names and trailing dots or spaces on Windows' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-12560-718027132c6a/pr-body.md
gh pr checks 12560 --repo boykopovar/AnyPS5 --watch=false

Results

Check Result
Diff check Passed
Conventions and PR template Passed locally and hosted
Stack and mergeability Passed; GitHub reports mergeable
Windows workflow Passed, including the registered guest_filesystem CTest target
macOS write-watch Failed during standalone CMake configure; log is not yet available while the workflow run remains in progress
Local C++ build/tests Not run
Observed command output
All conventions checks passed.
write-watch (macos-15) fail 37s
conventions pass 16s
eligibility pass 4s
labels pass 9s
register-context (ubuntu-latest, Debug) pass 30s
register-context (ubuntu-latest, Release) pass 30s
relinker (ubuntu-latest, g++) pass 4m27s
relinker (windows-latest, g++) pass 6m39s
relinker-asan pass 1m42s
windows pass 9m7s
linux skipping

Negative control

Assertion Change to code under test Result
Windows regression assertions fail without the fix Not run; no exact-head Windows negative-control build was available Could not be exercised

Findings

Blocking

None found in the reviewed revision.

Non-blocking

The macOS write-watch job failed at its standalone CMake configure step. The run is still in progress, so its diagnostic log is not available; this PR does not modify that test project's files. The remaining queued macOS jobs were not complete at review time.

Sources

Not verified

No local build or C++ tests; no console or GPU behavior; remaining queued macOS checks; exact cause of the macOS write-watch configure failure.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5711585603 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12560#pullrequestreview-5711585603). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T11:29:58Z. **Review:** APPROVED --- # Re-checked — new head, looks good The updated head adds live Windows regression coverage for the previously failing trailing-dot directory removal and long directory-path cases, and the hosted Windows test job passed; I approve this revision. ## What I ran Reviewed head `718027132c6aadb27f792e552327c05f77540072` against base `e049725553c4cf9770eb06d2ab1a211059efd29d` on Linux x86_64 (Debian 12, Python 3.11.2, GCC 12.2.0). The local precheck ran diff and convention checks; I inspected the exact-head Windows test changes and current GitHub check results. I did not build locally. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12560 git diff --check e049725553c4cf9770eb06d2ab1a211059efd29d...718027132c6aadb27f792e552327c05f77540072 python3 tools/check_conventions.py --base e049725553c4cf9770eb06d2ab1a211059efd29d --head 718027132c6aadb27f792e552327c05f77540072 --title 'fix(libkernel): preserve DOS device names and trailing dots or spaces on Windows' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-12560-718027132c6a/pr-body.md gh pr checks 12560 --repo boykopovar/AnyPS5 --watch=false ``` ## Results | Check | Result | |---|---| | Diff check | Passed | | Conventions and PR template | Passed locally and hosted | | Stack and mergeability | Passed; GitHub reports mergeable | | Windows workflow | Passed, including the registered `guest_filesystem` CTest target | | macOS `write-watch` | Failed during standalone CMake configure; log is not yet available while the workflow run remains in progress | | Local C++ build/tests | Not run | <details><summary>Observed command output</summary> ```text All conventions checks passed. write-watch (macos-15) fail 37s conventions pass 16s eligibility pass 4s labels pass 9s register-context (ubuntu-latest, Debug) pass 30s register-context (ubuntu-latest, Release) pass 30s relinker (ubuntu-latest, g++) pass 4m27s relinker (windows-latest, g++) pass 6m39s relinker-asan pass 1m42s windows pass 9m7s linux skipping ``` </details> ## Negative control | Assertion | Change to code under test | Result | |---|---|---| | Windows regression assertions fail without the fix | Not run; no exact-head Windows negative-control build was available | Could not be exercised | ## Findings ### Blocking None found in the reviewed revision. ### Non-blocking The macOS `write-watch` job failed at its standalone CMake configure step. The run is still in progress, so its diagnostic log is not available; this PR does not modify that test project's files. The remaining queued macOS jobs were not complete at review time. ## Sources - [Windows path threshold and conversion helper at reviewed head](https://github.com/boykopovar/AnyPS5/blob/718027132c6aadb27f792e552327c05f77540072/core/libs/prx/libc/include/WindowsVerbatimPath.hpp) - [Live Windows directory regression tests at reviewed head](https://github.com/boykopovar/AnyPS5/blob/718027132c6aadb27f792e552327c05f77540072/core/libs/tests/GuestFilesystem.cpp) - [Windows test workflow at reviewed head](https://github.com/boykopovar/AnyPS5/blob/718027132c6aadb27f792e552327c05f77540072/.github/workflows/windows-msys2.yml) ## Not verified No local build or C++ tests; no console or GPU behavior; remaining queued macOS checks; exact cause of the macOS `write-watch` configure failure.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12560
No description provided.