Skip to content

fix(tests): open the remaining scratch streams under a Unicode TEMP on Windows - #13706

Closed
Noxy-HNR wants to merge 1 commit into
boykopovar:mainfrom
Noxy-HNR:fix/tests-wide-tmpfile-agc
Closed

Noxy-HNR wants to merge 1 commit into
boykopovar:mainfrom
Noxy-HNR:fix/tests-wide-tmpfile-agc

Conversation

@Noxy-HNR

Copy link
Copy Markdown
Contributor

What

#13104 added core/libs/tests/TemporaryFile.hpp and moved the 15 tests named in #13083 off std::tmpfile(). 13 more test files still call it, so they abort the same way when %TEMP% contains a character outside the ANSI code page (GetTempPathA turns it into ?, and tmpfile() returns NULL with errno 22):

  • libSceAgcDriver/tests: AsyncLog.cpp, FrameDumpIo.cpp, Pm4Replay.cpp, Recorder.cpp
  • 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 now includes the header and calls TemporaryFile::Open() instead of std::tmpfile() (18 calls). No other lines change. GuestSyslog.cpp stays on std::tmpfile() until #9929 merges, as #13104 left it.

No production code changes.

Tested

Windows 11, Intel Core Ultra 7 255HX, code page 1252, WinLibs GCC 15.2.0 (UCRT, posix-seh), Ninja, Release, BUILD_TESTING=ON, main 7ceda13. All 15 targets that compile the changed files build.

CPU tests, ctest -R '^(agc_async_log|agc_async_log_fatal|agc_frame_dump_io|guest_sce_net)$', 3 runs per cell:

TEMP and TMP main 7ceda13 this PR
...\zh_Ж (outside code page 1252) 3 of 4 fail in 3 of 3 runs: agc_frame_dump_io (cannot create BMP test file), agc_async_log (temporary file), guest_sce_net (abort) 4 of 4 pass in 2 of 3 runs; one guest_sce_net abort (0xc0000409) in run 3
normal profile TEMP 4 of 4 pass 4 of 4 pass

I couldn't reproduce that single branch-side guest_sce_net abort. A further 10 ctest runs under zh_Ж and 10 under the normal TEMP all passed, and a later 20-run loop under each recorded no failures. On main it aborts in every zh_Ж run.

GPU tests: the 141 tests the 10 changed agc executables register (agc_driver_recorder_tests, the eight execution tests, agc_driver_pm4_replay_tests plus agc_driver_pm4_replay_tool), one run per cell, ctest -j 1, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, on an NVIDIA GeForce RTX 5070 Ti (driver 621.01):

TEMP and TMP main 7ceda13 this PR
...\zh_Ж 19 of 141 fail (agc_pipeline_cache_file, agc_pipeline_cache_header, agc_recorder_deferred_failure_report, 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_sample_multisample_target, agc_driver_window_lane_spill, agc_driver_lds_lock_budget, six agc_driver_prepared_shaders_abi_deferred_*, agc_driver_pm4_replay; agc_driver_pm4_replay_tool not run, since its fixture failed) 140 of 141 pass; agc_pipeline_cache_header still fails
normal profile TEMP 141 of 141 pass 141 of 141 pass

agc_pipeline_cache_header fails for another reason that this PR doesn't touch. It passes the cache directory to _putenv_s through directory.string(), and libstdc++ throws filesystem_error there for a character outside the code page. It fails the same way on main. That belongs to the in-code-page/narrow-path group of #12993 and #12996 and can go in a separate PR.

Checklist

…n Windows

boykopovar#13104 added TemporaryFile::Open() and moved the 15 tests named in boykopovar#13083
off std::tmpfile(). The agc driver tests and guest_sce_net still call it,
so they abort the same way when %TEMP% holds a character outside the
ANSI code page. Switch their 18 calls to the helper.

GuestSyslog.cpp stays on std::tmpfile() until boykopovar#9929 merges.

@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 — changes requested

This draft exactly duplicates open PR #13704: both heads change the same 13 files with identical added and removed lines.

Findings

Blocking

PR #13704 is already open at 48191a538bcdb91812320df8d38c0c7936b69b18, and its patch matches this draft at 5b8f32eb1e67fb79fb25fbd187cbc96484336552 across all 13 changed files. Please coordinate with #13704's author and keep one PR for this work; update this draft only if it contains distinct changes.

Non-blocking

None.

Sources

@github-actions

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 9875 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp L48
PR 10846 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp L8

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 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 6971 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 7684 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 8484 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 9915 core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 9932 core/libs/tests/GuestSceNet.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/PreparedShaders.cpp
PR 10233 core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 10442 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10920 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13146 core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp

@Noxy-HNR

Copy link
Copy Markdown
Contributor Author

Closing this as a duplicate of #13704 by @dmto. That PR was opened about six minutes before this one and makes the same change to the same 13 files. I wrote this branch on my own from #13083 and #13104, but my last overlap check ran before #13704 existed, and I didn't run it again right before opening this. I'm sorry for the noise, and thanks to @MarcZX10 for catching it.

In case it's useful for #13704: on Windows 11 with an RTX 5070 Ti (driver 621.01) and TEMP set to a folder with Ж in its name, the identical patch took the agc GPU suites from 19 of 141 failing to 1 of 141. The remaining failure, agc_pipeline_cache_header, also fails on main. It passes directory.string() to _putenv_s in Recorder.cpp, and libstdc++ throws filesystem_error there, so it isn't a tmpfile issue.

@Noxy-HNR Noxy-HNR closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants