Skip to content

fix(tests): run syslog, console identity, Audio3d and shader cache directory tests under a Unicode TEMP on Windows - #13758

Merged
adriadam10 merged 3 commits into
boykopovar:mainfrom
JJenkx:windows/tests-unicode-temp-syslog-identity
Oct 31, 2026
Merged

adriadam10 merged 3 commits into
boykopovar:mainfrom
JJenkx:windows/tests-unicode-temp-syslog-identity

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What

With %TEMP% holding a character outside the ANSI code page, Windows tests still abort. All of these are test-side problems:

  • guest_syslog captures stderr through std::tmpfile(). That returns NULL there (Tests: 16 tests abort when TEMP has a character outside the ANSI code page (host std::tmpfile returns NULL) #13083) because the UCRT builds its path with GetTempPathA. It now opens the capture with TemporaryFile::Open() (tests/TemporaryFile.hpp), as the other libc tests have done since fix(tests): open scratch streams under a Unicode TEMP on Windows #13104. After fix(tests): open AGC and SceNet scratch streams under a Unicode TEMP on Windows #13704, this is the last std::tmpfile() call in a test.

  • guest_kernel_sys_console_identity starts its PS4 child with std::system and a command built from directory.string() and argv[0]. Both are narrow, so cd /d receives ? in place of the character and fails ("The system cannot find the path specified"). On Windows the command is now built from directory.wstring() and GetModuleFileNameW and run with _wsystem, as AsyncLog's child does. The other platforms keep std::system.

  • guest_audio3d_port reruns itself as a PS4 process the same way: std::system with cd /d and a command built from directory.string() and argv[0]. On Windows it now builds the command from directory.wstring() and GetModuleFileNameW, and runs it with _wsystem, as the console identity test does (third commit eab4fef05c).

  • agc_pipeline_cache_header and agc_driver_lazy_resolved_abi (+ _switch_set) pass ANYPS5_SHADER_CACHE_DIR through the narrow _putenv_s with path::string(), which is UTF-8 in MinGW's libstdc++. The driver reads the variable wide (ShaderDiskCache.cpp, _wgetenv), so it got a mangled directory. The header test's directory scan threw a filesystem_error, and the lazy test's reference process saved its cache under the mangled name and the test found no files. On Windows both now set the variable with _wputenv_s from the wide path (second commit).

Tested

Windows 11 Enterprise 10.0.22621 (ANSI code page 1252), Ryzen 9 5950X, WinLibs GCC 15.2.0 UCRT r7, Ninja, Release, BUILD_TESTING=ON. Same build directory for both commits. TEMP and TMP set to C:\Users\Windows\AnyPS5-agent\work\Темп-тест, with ctest -R "^(guest_syslog|guest_kernel_sys_console_identity)$" --repeat until-fail:3:

parent main 0835ec8bdc this PR
guest_syslog abort (0xc0000409) pass 3/3
guest_kernel_sys_console_identity abort (0xc0000409) pass 3/3
  • With the normal TEMP, both pass 3/3 with this PR.
    Shader cache directory (second commit 3dd3b532b5), on the RX 6700 XT (AMD 26.10.1), VVL 1.4.309, same TEMP, --repeat until-fail:3:
parent 0835ec8bdc this PR this PR + #13704 (local merge)
agc_driver_lazy_resolved_abi fail pass 3/3
agc_driver_lazy_resolved_abi_switch_set fail pass 3/3
agc_pipeline_cache_header fail (filesystem_error) fail, now at cannot open a temporary file for stderr pass 3/3, no VUIDs

agc_pipeline_cache_header also captures stderr through std::tmpfile() in Recorder.cpp, which #13704 fixes. With both, it passes.

Audio3d PS4-process child (third commit eab4fef05c), on the rebased branch, main 73f4f7e06e. Same build directory for both; I put back only GuestAudio3dPort.cpp from main for the control, then restored it. Each ran --repeat until-fail:3:

main's test file this PR
guest_audio3d_port, Unicode TEMP abort (0xc0000409) pass 3/3
guest_audio3d_port, normal TEMP pass 3/3

I found this one in a full-suite run with the Unicode TEMP on main 8f55414024: "The system cannot find the path specified", then "the PS4 process checks must pass". It passed with the normal TEMP. In that run every other failure that appears only under the Unicode TEMP is either in a file #13704 changes, a video_out_flip_* test (the display was off), or a tool test whose MinGW objdump/compiler receives the path in the ANSI code page.

I found the first ones in a full GPU-suite run with that TEMP on #13704's head (3,159 entries). Its other native failures:

  • video_out_flip_* failed because the display was off;
  • ngs2_pitchshift, guest_filesystem and agc_driver_sample_order_grid_reference fail on main too and have open fixes;
  • agc_driver_skip_shader_file is a product-side path bug, fixed separately in fix(agc): read APS5_SKIP_SHADER_FILE as a wide path on Windows #13762;
  • agc_performance_overlay timed out with either TEMP. Its 30 s budget was taken by K32GetPerformanceInfo calls, which fix(agc): read the overlay's commit charge without a system-wide scan #13788 replaces. It is not TEMP-related.
  • Rebase: the branch is now rebased onto main 73f4f7e06e (head eab4fef05c). The first two commits came over unchanged, and their results above are from before the rebase.
  • python tools/check_conventions.py --base origin/main: all checks passed.
  • Not run: Linux, macOS. Only the Windows branches of GuestKernelSysConsoleIdentity.cpp and GuestAudio3dPort.cpp change; GuestSyslog.cpp uses the helper, which returns std::tmpfile() off Windows.

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 (agc_pipeline_cache_header additionally needs fix(tests): open AGC and SceNet scratch streams under a Unicode TEMP on Windows #13704 to pass under a non-ANSI TEMP). fix(libc): restore syslog program-name fallback #9929 also edits GuestSyslog.cpp (lines 16–17, syslog program-name fallback); the two do not implement the same thing, and whichever lands second needs a small rebase.
  • Fixes: none
  • Unblocks: none
  • GPUs tested: none needed (CPU tests)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@JJenkx JJenkx changed the title fix(tests): run the syslog and console identity tests under a Unicode TEMP on Windows fix(tests): run syslog, console identity and shader cache directory tests under a Unicode TEMP on Windows Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9929 core/libs/tests/GuestSyslog.cpp L16-17

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5021 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6182 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6187 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6209 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6905 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6970 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7048 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7457 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7604 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7642 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/LazyResolvedAbi.cpp
PR 8484 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 8707 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9445 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9712 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9884 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9898 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10026 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10193 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/LazyResolvedAbi.cpp
PR 10442 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10773 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10920 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13044 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13251 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13263 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13793 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13809 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13920 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13928 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/LazyResolvedAbi.cpp
PR 13929 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/LazyResolvedAbi.cpp
PR 13942 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp

@github-actions github-actions Bot added the agc libSceAgc* label Oct 31, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 3dd3b53 merged onto main 828ac0b · tested 2026-10-31 09:30 UTC · 19 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 977 passed · 2 failed (0 new, 0 also fail on main, 2 unstable on main) · 9 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 988 of 3,048 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (480 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 49.8 s, ⚠️ agc_driver_graphics 31.8 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_submit_progress: failed in 6 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 8 of the last 10 main runs
Validation IDs already present on main (3 IDs in 185 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (185 tests): agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bda_span_reads_draw_pipeline, and 177 more
VUID-vkCmdCopyImage-srcImage-01548 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_plane_sampling_evicting, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_plane_sampling_evicting, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
Skipped (9)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
Reproduce
git fetch origin 3dd3b532b5ab37cebd01db716cf8958245dcc979 828ac0b2ae74aac181ba128fb59b08a1534f2041
git checkout 828ac0b2ae74aac181ba128fb59b08a1534f2041 && git merge --no-ff 3dd3b532b5ab37cebd01db716cf8958245dcc979
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

JJenkx and others added 3 commits October 31, 2026 09:29
… TEMP on Windows

With %TEMP% holding a character outside the ANSI code page, two
Windows tests still abort:

- guest_syslog captures stderr through std::tmpfile(), which returns
  NULL there (boykopovar#13083). It now opens the capture with
  TemporaryFile::Open(), as the other libc tests do since boykopovar#13104.
- guest_kernel_sys_console_identity starts its PS4 child with
  std::system and a command built from directory.string() and
  argv[0]. Both are narrow, so `cd /d` gets '?' in place of the
  character and fails. On Windows the command is now built from
  directory.wstring() and GetModuleFileNameW and run with _wsystem,
  as AsyncLog's child does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Unicode TEMP on Windows

agc_pipeline_cache_header and agc_driver_lazy_resolved_abi passed
ANYPS5_SHADER_CACHE_DIR through the narrow _putenv_s with
path::string(), which is UTF-8 in MinGW's libstdc++. The driver reads
the variable wide, so under a TEMP outside the ANSI code page it got a
mangled directory: the header test's directory scan threw, and the lazy
test found no cache files where it looked. On Windows both tests now
set it with _wputenv_s from the wide path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d on Windows

guest_audio3d_port reruns its own executable from a temporary
directory, and built the command from directory.string() and argv[0]
for std::system. Under a TEMP with characters outside the active code
page the narrow command lost them, cmd.exe could not change into the
directory, and the test aborted at "the PS4 process checks must pass".
On Windows the command is now built from directory.wstring() and the
module's own path from GetModuleFileNameW, and run with _wsystem, as
the console identity test does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JJenkx
JJenkx force-pushed the windows/tests-unicode-temp-syslog-identity branch from 3dd3b53 to eab4fef Compare October 31, 2026 13:32
@JJenkx JJenkx changed the title fix(tests): run syslog, console identity and shader cache directory tests under a Unicode TEMP on Windows fix(tests): run syslog, console identity, Audio3d and shader cache directory tests under a Unicode TEMP on Windows Oct 31, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head eab4fef merged onto main 73f4f7e · tested 2026-10-31 17:52 UTC · 16 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 981 passed · 0 failed · 9 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 990 of 3,072 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (480 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 47.9 s, ⚠️ agc_driver_graphics 31.6 s
Validation IDs already present on main (3 IDs in 184 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (184 tests): agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bda_span_reads_draw_pipeline, and 176 more
VUID-vkCmdCopyImage-srcImage-01548 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_plane_sampling_evicting, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_plane_sampling_evicting, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
Skipped (9)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
Reproduce
git fetch origin eab4fef05cf1e6047634abc2caa0e6f0cc597142 73f4f7e06e4f210a8c6570e335fd654dc0a86134
git checkout 73f4f7e06e4f210a8c6570e335fd654dc0a86134 && git merge --no-ff eab4fef05cf1e6047634abc2caa0e6f0cc597142
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@adriadam10 adriadam10 self-assigned this Oct 31, 2026
@adriadam10
adriadam10 merged commit edbee34 into boykopovar:main Oct 31, 2026
13 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the diff: GuestSyslog.cpp uses TemporaryFile::Open(), the console identity and Audio3d PS4 children build a wide command with GetModuleFileNameW and run through _wsystem on Windows only, and ANYPS5_SHADER_CACHE_DIR is set with _wputenv_s to match the driver's _wgetenv. Non-Windows paths are unchanged. NVIDIA CI on this head passes (981 passed, 0 failed) and the author's Unicode-TEMP Windows runs show the aborts gone; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants