test(libkernel): don't require restoring the directory time on Windows #3518

Merged
Silverash-i8 merged 1 commit from upstream-pr/3518 into main 2026-10-11 19:45:49 +00:00
Silverash-i8 commented 2026-10-11 12:10:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-11T12:10:20Z.


What

guest_filesystem aborts on Windows on current main since #3465:

Filesystem check failed at line 286 (guest errno 13, Win32 error 5)

Line 286 is Require(!restoreTimeError). The empty-path sceKernelUtimes check saves the working directory's write time, calls sceKernelUtimes(""), then restores the time with std::filesystem::last_write_time(".", ...) and requires the restore to succeed. With MinGW that call fails with EACCES for a directory. A standalone program built with the same g++ shows it: setting the time of a directory (or .) gives 13 Permission denied, a file's works. The emulator's own NativeUtimes is fine with directories on Windows, since it opens them with FILE_FLAG_BACKUP_SEMANTICS; only the test's host-side restore is affected.

This drops the Require on the restore and keeps the restore itself, so Linux still puts the time back and the sceKernelUtimes("") == ENOENT check from #3465 is unchanged.

Tested

Windows 11, WinLibs GCC 15.2.0 r7, Release, on main 2220effb: guest_filesystem fails at line 286 without the change and passes 3/3 with it. Not run on Linux (the change only removes a check). tools/check_conventions.py --base upstream/main passes.

guest_kernel_sys also fails on Windows on main, but that's the symlink ENOSYS from #3491, which screamm reported there and #3510 fixes; it's unrelated to this.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes (Claude Code); I ran the above on my machine

https://claude.ai/code/session_012SLQbhAiexxW6TtjYToW8a

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4818945570 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3518). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-11T12:10:20Z. --- ### What `guest_filesystem` aborts on Windows on current `main` since #3465: ``` Filesystem check failed at line 286 (guest errno 13, Win32 error 5) ``` Line 286 is `Require(!restoreTimeError)`. The empty-path `sceKernelUtimes` check saves the working directory's write time, calls `sceKernelUtimes("")`, then restores the time with `std::filesystem::last_write_time(".", ...)` and requires the restore to succeed. With MinGW that call fails with EACCES for a directory. A standalone program built with the same g++ shows it: setting the time of a directory (or `.`) gives `13 Permission denied`, a file's works. The emulator's own `NativeUtimes` is fine with directories on Windows, since it opens them with `FILE_FLAG_BACKUP_SEMANTICS`; only the test's host-side restore is affected. This drops the `Require` on the restore and keeps the restore itself, so Linux still puts the time back and the `sceKernelUtimes("") == ENOENT` check from #3465 is unchanged. ### Tested Windows 11, WinLibs GCC 15.2.0 r7, Release, on `main` 2220effb: `guest_filesystem` fails at line 286 without the change and passes 3/3 with it. Not run on Linux (the change only removes a check). `tools/check_conventions.py --base upstream/main` passes. `guest_kernel_sys` also fails on Windows on `main`, but that's the `symlink` ENOSYS from #3491, which screamm reported there and #3510 fixes; it's unrelated to this. ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes (Claude Code); I ran the above on my machine https://claude.ai/code/session_012SLQbhAiexxW6TtjYToW8a
screamm commented 2026-10-11 12:24:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T12:24:11Z.


Windows validation of the current head cec3777a merged onto main 1e8fff68 (Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON): on unchanged main guest_filesystem fails here at GuestFilesystem.cpp:286 (Filesystem check failed at line 286 (guest errno 13, Win32 error 5), the directory-time restore); with this change it passes 3/3 (--repeat until-fail:3).

Validation run with Claude Code assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108986211 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3518#issuecomment-6108986211). Originally posted by [screamm](https://github.com/screamm) on 2026-10-11T12:24:11Z. --- Windows validation of the current head `cec3777a` merged onto `main` `1e8fff68` (Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`): on unchanged `main` `guest_filesystem` fails here at `GuestFilesystem.cpp:286` (`Filesystem check failed at line 286 (guest errno 13, Win32 error 5)`, the directory-time restore); with this change it passes 3/3 (`--repeat until-fail:3`). Validation run with Claude Code assistance.
Amoenus commented 2026-10-11 12:39:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-11T12:39:51Z.


Independent Windows validation (2026-10-11, Amoenus)

Independently reproduced the host-fixture failure on main 2220effbe with our existing integration prerequisites, on Windows 11 Enterprise build 26200, WinLibs GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON:

Filesystem check failed at line 286 (guest errno 13, Win32 error 5)

It reproduces both in the parallel relevant-suite run and serially. The failed line is the host directory-time restore assertion, not the guest empty-path errno assertion.

With your exact one-line change from cec3777a986ded42ba955958e48b6874679022de, guest_filesystem passes 5/5. The empty-path guest ENOENT check remains present. A standalone host-only probe with the same toolchain, 5/5 runs, confirms:

std::filesystem regular-file same-time set: succeeds
std::filesystem directory same-time set: generic 13, Permission denied
native directory GetFileTime/SetFileTime using FILE_FLAG_BACKUP_SEMANTICS: succeeds

The complete build and all 122 patched libraries succeed. After also carrying #3510's rework, all 19 selected relevant test groups pass five times each (95 passes); conventions pass against 2220effbe. This is combined integration validation, not a full repository-suite or unchanged-main claim. The before/after 122-library profiles differ only in libkernel_sys from the symlink change: this timestamp change alters the fixture, with no production-library change.

Integration source (your author attribution retained; fork only, no PR created). Linux was not run here. No game-startup or console-equivalence claim. AI-assisted execution and report: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109114947 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3518#issuecomment-6109114947). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-11T12:39:51Z. --- ### Independent Windows validation (2026-10-11, Amoenus) Independently reproduced the host-fixture failure on `main` `2220effbe` with our existing integration prerequisites, on Windows 11 Enterprise build 26200, WinLibs GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON: ``` Filesystem check failed at line 286 (guest errno 13, Win32 error 5) ``` It reproduces both in the parallel relevant-suite run and serially. The failed line is the host directory-time restore assertion, not the guest empty-path errno assertion. With your exact one-line change from `cec3777a986ded42ba955958e48b6874679022de`, **guest_filesystem passes 5/5**. The empty-path guest ENOENT check remains present. A standalone host-only probe with the same toolchain, **5/5 runs**, confirms: ``` std::filesystem regular-file same-time set: succeeds std::filesystem directory same-time set: generic 13, Permission denied native directory GetFileTime/SetFileTime using FILE_FLAG_BACKUP_SEMANTICS: succeeds ``` The complete build and all 122 patched libraries succeed. After also carrying #3510's rework, all **19 selected relevant test groups pass five times each (95 passes)**; conventions pass against `2220effbe`. This is combined integration validation, not a full repository-suite or unchanged-main claim. The before/after 122-library profiles differ only in libkernel_sys from the symlink change: this timestamp change alters the fixture, with no production-library change. [Integration source](https://github.com/Amoenus/AnyPS5/commit/e5a62c5941d534299bd870852700d2846227dad4) (your author attribution retained; fork only, no PR created). Linux was not run here. No game-startup or console-equivalence claim. AI-assisted execution and report: Codex.
screamm commented 2026-10-11 15:01:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T15:01:11Z.


Windows rerun of the rebased head 8b0b78f5, which is one commit on current main a11c8f7f (my earlier run was on cec3777a): Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including libs.

  • guest_filesystem: passes 3/3 (--repeat until-fail:3). On main a11c8f7f it still fails at GuestFilesystem.cpp:286 (guest errno 13, Win32 error 5).
  • ctest -R '^guest_' (parallel, -j8): 288 of 290. guest_kernel_sys fails with symlink: Function not implemented, which is #3510, not this PR. guest_ampr_markers failed once in the parallel run and passed 5/5 serially afterwards (--repeat until-fail:5), as in #3371. guest_video_out_wqhd_detection_no_vulkan skipped.
  • check_conventions.py --base origin/main is clean.

AI-assisted (Claude Code); run on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110348281 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3518#issuecomment-6110348281). Originally posted by [screamm](https://github.com/screamm) on 2026-10-11T15:01:11Z. --- Windows rerun of the rebased head `8b0b78f5`, which is one commit on current `main` `a11c8f7f` (my earlier run was on `cec3777a`): Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including `libs`. - `guest_filesystem`: passes 3/3 (`--repeat until-fail:3`). On `main` `a11c8f7f` it still fails at `GuestFilesystem.cpp:286` (guest errno 13, Win32 error 5). - `ctest -R '^guest_'` (parallel, -j8): 288 of 290. `guest_kernel_sys` fails with `symlink: Function not implemented`, which is #3510, not this PR. `guest_ampr_markers` failed once in the parallel run and passed 5/5 serially afterwards (`--repeat until-fail:5`), as in #3371. `guest_video_out_wqhd_detection_no_vulkan` skipped. - `check_conventions.py --base origin/main` is clean. AI-assisted (Claude Code); run on my machine.
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!3518
No description provided.