Skip to content

fix(tests): open AGC and SceNet scratch streams under a Unicode TEMP on Windows - #13704

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
dmto:claude/tests-unicode-tmpfile-3e21f5
Oct 31, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
dmto:claude/tests-unicode-tmpfile-3e21f5

Conversation

@dmto

@dmto dmto commented Oct 31, 2026

Copy link
Copy Markdown

What

On Windows, std::tmpfile() returns NULL with errno 22 when %TEMP% contains a character outside the ANSI code page, where GetTempPathA returns ? in its place (#13083). #13104 added TemporaryFile::Open() and converted the libc, filesystem and trophy tests. Thirteen test files still called std::tmpfile(), and the tests that capture output through them abort with cannot open a temporary file for stderr or fail their temporary file check:

  • core/libs/prx/libSceAgcDriver/tests: AsyncLog.cpp, FrameDumpIo.cpp, Pm4Replay.cpp, Recorder.cpp
  • core/libs/prx/libSceAgcDriver/tests/execution: ComputeTableCalls.cpp, DescriptorWebFaults.cpp, GuardedNullPointer.cpp, ImageTable.cpp, LdsMixedWidthAtomics.cpp, PreparedShaders.cpp, SampleMultisampleTarget.cpp, WindowLaneSpill.cpp
  • core/libs/tests/GuestSceNet.cpp

Each file includes tests/TemporaryFile.hpp and replaces every std::tmpfile() with TemporaryFile::Open() (18 calls). No other line changes, and no production code changes.

core/libs/tests/GuestSyslog.cpp is left out again, because #9929 rewrites the lines around its call.

Still failing under such a TEMP, for a later pull request:

  • agc_pipeline_cache_header, agc_driver_lazy_resolved_abi and agc_driver_lazy_resolved_abi_switch_set pass a directory to the driver as path.string() through _putenv_s, so the driver writes the cache to D:\tmp-unicode\zh_Ж instead of zh_Ж. The driver reads ANYPS5_SHADER_CACHE_DIR with _wgetenv, so the fix is in the tests.
  • agc_driver_skip_shader_file: the driver reads APS5_SKIP_SHADER_FILE with std::getenv (Execution/src/Driver/Diagnostics.cpp), so the fix needs a driver change.
  • guest_syslog, after fix(libc): restore syslog program-name fallback #9929.

Tested

Windows 11 Pro 10.0.26200 (ANSI code page 1252), i7-12700K, NVIDIA GeForce RTX 5070 Ti (driver 621.01), Vulkan SDK 1.4.363.0, WinLibs GCC 15.2.0 UCRT r7, Ninja, Release, BUILD_TESTING=ON, full build including all AGC execution tests. main 93c71cc and this branch were built in the same build directory, and each ran:

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R 'agc|sce_net|scenet|syslog' -j 8 --timeout 300 -V
TEMP and TMP main 93c71cc this PR
D:\tmp-unicode\zh_Ж (outside code page 1252) 26 of 1184 fail 5 of 1184 fail, 2 of 2 runs: guest_syslog and the four tests above
normal profile TEMP 1 of 1184 fails: agc_driver_pm4_stall_watchdog_invalid (Attempt to access invalid address, unchanged source, then 200 of 200 passes with --repeat until-fail:200) 1184 of 1184 pass, 3 of 3 runs

The last run in each row is of head 48191a5; the earlier runs differ from it only in where Recorder.cpp and ImageTable.cpp place the include.

The 21 tests that pass under zh_Ж with this change: agc_async_log, agc_frame_dump_io, agc_pipeline_cache_file, agc_recorder_deferred_failure_report, agc_driver_pm4_replay, agc_driver_pm4_replay_tool (not run on main because its fixture failed), agc_driver_compute_table_calls, agc_driver_descriptor_web_faults, agc_driver_guarded_null_pointer, agc_driver_guarded_direct_root, agc_driver_image_table, agc_driver_lds_lock_budget, agc_driver_sample_multisample_target, agc_driver_window_lane_spill, the six agc_driver_prepared_shaders_abi_deferred_* tests, and guest_sce_net.

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: none (Tests: 16 tests abort when TEMP has a character outside the ANSI code page (host std::tmpfile returns NULL) #13083 stays open for the four path tests and guest_syslog)
  • Unblocks: none
  • GPUs tested: AGC — NVIDIA GeForce RTX 5070 Ti, driver 621.01, Windows 11 Pro 10.0.26200, Vulkan SDK 1.4.363.0; shader recompiler and VideoOut n/a
  • AI-assisted: yes (Claude Code)

…on Windows

On Windows, std::tmpfile() returns NULL with errno 22 when %TEMP%
contains a character outside the ANSI code page. Thirteen more test
files still called it: the AGC async log, frame dump, PM4 replay and
recorder tests, eight AGC execution tests and the SceNet test. They
now use TemporaryFile::Open(), as boykopovar#13104 did for the libc tests.

Part of boykopovar#13083

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The change replaces remaining test-only std::tmpfile() calls with the repository’s Unicode-safe temporary-file helper; I found no blocking issue in the inspected call sites.

What I ran

Reviewed head 48191a538bcdb91812320df8d38c0c7936b69b18 against PR base bff0289787c98570491c8f175179c8a5651c8017. The fresh merge preview against current main 65f68c1d5cc7ae468b771e9e6c84fc5e9a52e450 was clean. Environment: Debian 6.1 x86_64, GCC 12.2.0. I did not build or run C++ tests locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13704
python3 tools/pr_stack_check.py 13704 --repo boykopovar/AnyPS5

Results

Check Result
Diff and conventions Passed.
Current-base merge preview Passed; exact head merges cleanly against current main.
Hosted CI Conventions, intake, and labels passed. No hosted build/test job was present in the snapshot.
Windows test evidence The PR description reports a full Windows build and 1,184/1,184 tests on the normal profile, and five unchanged failures on the Unicode profile (the four known path tests plus guest_syslog). This is author-reported, not independently reproduced here.
Raw local check output

Precheck stdout:

/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13704-48191a538bcd/report.md
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13704-48191a538bcd/report.json
Conclusion: checks failed

The precheck's ABI and test-quality helper invocations could not run because those workspace-local scripts are absent from the isolated PR checkout. The changed files contain no ABI changes. Its diff and conventions checks passed.

Conventions stdout:

All conventions checks passed.

Sources

Not verified

I did not independently run the Windows suite or test Linux/macOS. The PR reports that its non-Windows helper path delegates to std::tmpfile(); those platforms therefore retain the prior behavior.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

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 5836 core/libs/tests/GuestSceNet.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6182 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6185 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 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 6412 core/libs/prx/libSceAgcDriver/tests/execution/GuardedNullPointer.cpp
PR 6481 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 6743 core/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 6867 core/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cpp
PR 6905 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6970 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6973 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 6987 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 6989 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 6995 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 7002 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 7048 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7085 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7223 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 7395 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.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/PreparedShaders.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 7684 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 8484 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 8707 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 8887 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 8939 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 9445 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9457 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 9508 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 9633 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 9712 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9749 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 9790 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 9875 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 9915 core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 9932 core/libs/tests/GuestSceNet.cpp
PR 9969 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 10026 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10159 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10193 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 10233 core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 10333 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10442 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10443 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10472 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10773 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10846 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 10920 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 12745 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 12840 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 12921 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13044 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13146 core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.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/PreparedShaders.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 13929 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 13931 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13942 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp

@JJenkx

JJenkx commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Windows check under a Unicode TEMP: TEMP and TMP set to C:\Users\Windows\AnyPS5-agent\work\Темп-тест. 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, no Vulkan driver visible.

The CTest entries of agc_async_log_tests, agc_frame_dump_io_tests, agc_driver_pm4_replay_tests, agc_driver_recorder_tests and guest_sce_net_tests (110 entries) were run with --repeat until-fail:3:

  • This PR's head 48191a538b: 110 of 110 passed. The GPU-only recorder entries skip without a Vulkan driver.
  • Its parent main 93c71cc1bb, same build options and same TEMP: 4 failed:
    • agc_frame_dump_io, agc_async_log and agc_driver_pm4_replay fail with temporary file;
    • guest_sce_net aborts with 0xc0000409.

The execution-test files this PR changes need a GPU and were not run here.

AI-assisted: yes (Claude Code).

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

JJenkx commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

The GPU half of the Unicode TEMP check, which my earlier comment left out. Radeon RX 6700 XT, AMD proprietary driver 26.10.1, VVL 1.4.309, same Windows host, TEMP/TMP = C:\Users\Windows\AnyPS5-agent\work\Темп-тест. I ran the 34 CTest entries of the eight changed execution-test executables (ComputeTableCalls, DescriptorWebFaults, GuardedNullPointer, ImageTable, LdsMixedWidthAtomics, PreparedShaders, SampleMultisampleTarget, WindowLaneSpill) with --repeat until-fail:3:

  • This PR's head 48191a538b: 34 of 34 passed, 189 validation-layer insertions, no VUIDs.
  • Its parent main 93c71cc1bb, same TEMP: 14 of 34 failed, all with cannot open a temporary file for stderr. The failures are agc_driver_compute_table_calls, agc_driver_descriptor_web_faults, agc_driver_guarded_direct_root, agc_driver_guarded_null_pointer, agc_driver_image_table, agc_driver_lds_lock_budget, six agc_driver_prepared_shaders_abi_deferred_*, agc_driver_sample_multisample_target and agc_driver_window_lane_spill.

AI-assisted: yes (Claude Code).

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 48191a5 merged onto main 828ac0b · tested 2026-10-31 09:36 UTC · 20 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 ✅ 1,014 passed · 2 failed (0 new, 0 also fail on main, 2 unstable on main) · 10 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 1,026 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 (485 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_graphics 32.0 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 190 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (190 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 182 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 (10)
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_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
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 48191a538bcdb91812320df8d38c0c7936b69b18 828ac0b2ae74aac181ba128fb59b08a1534f2041
git checkout 828ac0b2ae74aac181ba128fb59b08a1534f2041 && git merge --no-ff 48191a538bcdb91812320df8d38c0c7936b69b18
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 500d37a into boykopovar:main Oct 31, 2026
12 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the 18 std::tmpfile() to TemporaryFile::Open() replacements across the 13 test files: each only adds the include and swaps the call, Open() is unchanged on non-Windows, and the Windows Unicode-TEMP runs (author, JJenkx, NVIDIA CI) show the targeted tests passing with no new VUIDs; 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.

5 participants