fix(diagnostics): open VideoOut telemetry and sampler files under any Unicode path on Windows #12996
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12996"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-29T19:42:09Z.
What
Four diagnostic paths were read with
getenvand opened with the narrowfopen/ofstream:APS5_VIDEOOUT_TELEMETRY_DIRin VideoOut, andAPS5_SAMPLE_THREADS,APS5_SAMPLE_WORKERandAPS5_SAMPLE_COMMITTERin the AGC worker sampler. On Windows both sides use the ANSI code page, so these worked only for characters in it. A directory such asC:\x\東京テストon a code-page-1252 system could not be opened. Their tests also fail whenever%TEMP%is not ASCII, because they pass a UTF-8std::filesystem::path::string()into those APIs (follow-up to #12993, which fixes the pure test bugs).The other diagnostic directories already read the wide environment and use
std::filesystem::path:ANYPS5_SCREENSHOTS,APS5_DUMP_SUBMITS,APS5_DUMP_COMPUTE_PIPELINES,APS5_PAD_INPUT_FILEandAPS5_TRACE_CALLS_FILE. This makes these four match:Instance()takes the directory from_wgetenv(L"APS5_VIDEOOUT_TELEMETRY_DIR")as UTF-8 (getenvelsewhere).Writeropensvideoout.jsonlthroughstd::filesystem::path(u8 directory). Itsstd::stringdirectory is UTF-8 on every host, so the existing test, which passesdirectory.string(), now works unchanged._wgetenv(L"…")and kept as a UTF-8std::string, and the three output files, including the collapsed-stacks temporary, are opened with_wfopenthroughstd::filesystem::path, and the temporary is published withMoveFileExW(wasMoveFileExA, found in review). Its test now sets the variables with_wputenv_sand reads the files throughstd::filesystem::path, instead of narrow strings that the C runtime would read as ANSI. In the worker modes it also checks the published.collapsed.txtheader and that its.tmpis gone.Nothing changes for an ASCII path.
Tested
Windows 11 Enterprise 10.0.22621 (code page 1252), WinLibs GCC 15.2.0 UCRT r7, Ninja, Release,
BUILD_TESTING=ON, no Vulkan driver visible, this head (ec7d2f5b85) onmain58b2753d74.TEMPmain184afa49adC:\x\tëmpünïC:\x\東京テスト(outside code page 1252)TEMPThe four tests are
video_out_telemetry,agc_worker_sampler_default,agc_worker_sampler_selectedandagc_worker_sampler_process(ctest --repeat until-fail:3). The full build succeeded at the first head (74ec7311f1); the review fix touches onlyWorkerSampler.cppand its test, whose targets build at this head. With the previousMoveFileExAand the new test,agc_worker_sampler_defaultand_selectedfail under both non-ASCIITEMPvalues, so the test covers the publication step.python tools/check_conventions.py --base origin/main: all checks passed. Each variable is still read by a literal_wgetenv(L"…")call, so thedocs/dev/ENVIRONMENT.mdreference check keeps finding them._WIN32block. Telemetry there now opens throughstd::filesystem::pathof the same bytes and still readsgetenv.Independent Windows validation, reported by bunbeans2-arch for topic
ec7d2f5b85ffa83dc05d71051ba824177c1d7531against mainf7f03daf52: Windows 11 Pro 22631, i9-9900K, MSYS2 UCRT64 GCC 16.1, Release. Four telemetry/sampler tests pass 3/3 for each of theéand outside-code-pageЖtemporary paths, while main fails 3/3; normal-profile controls pass. The separately reported hoststd::tmpfile()failures concern #13083/#13104. This is the contributor's run, not a new local Windows execution.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Libc::StartHostJThreadwrapper and this PR’s[path = *path]capture; author confirmation)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:58:11Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The Unicode-path fix and current-main merge check look sound, but this branch conflicts with open #7622 and its checklist still says
Depends on: none.What I ran
ec7d2f5b85ffa83dc05d71051ba824177c1d7531.upstream/mainatd820fef1827f27247cd28da7b4eec7891904bae5; current-main merge preview was clean (b79f05d677514ef6af50495a011eaa8e6eb8334a). No touched paths changed onmainafter the reported comparison base58b2753d74.Results
b79f05d677514ef6af50495a011eaa8e6eb8334a.core/libs/prx/libSceAgcDriver/Execution/src/WorkerSampler.cpp; both PRs remain open.TEMPtests passing 4/4 in three runs, including the collapsed-file publication check. It also reports the Linux telemetry test passing. These results are author-reported, not independently reproduced here.Unedited local command output
python tools/check_conventions.py --base upstream/main --head refs/review/pr-12996-headgit merge-tree --write-tree upstream/main refs/review/pr-12996-headgit diff --check upstream/main...refs/review/pr-12996-headexited 0 with no output. The comparison of changed paths since58b2753d74also produced no output.The pairwise merge preview exited 1 and reported:
Findings
Blocking
WorkerSampler.cpp, while this PR saysDepends on: none. The current repository rule requires authors to agree which overlapping PR goes first and record that order withDepends on(pinned contribution rule). Please coordinate the order with #7622's author and update the dependency line; then I can recheck the combined merge.Non-blocking
Not verified
To get this to a good state
Please record the agreed order for the overlapping PRs in
Depends on. I will rerun the merge checks and review the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T03:59:57Z.
Review: APPROVED
Re-checked — new head, looks good
The Windows path publication fix and regression are present, the proposed overlap order is now agreed, and the current-main preview and non-build checks pass.
What I ran
ec7d2f5b85ffa83dc05d71051ba824177c1d7531; PR base:184afa49adce16e298c47d136706fd2356198852.main5ecef095b61e7a406b279c97896f3a8a6fbd6353; the preview merged cleanly as tree76a793b90747a855c7490f47727855dd0b8a7793.Results
76a793b90747a855c7490f47727855dd0b8a7793git diff --checkTEMPcases and Linux telemetry test passed on exact head; I did not independently run them.Unedited local command output
git diff --checkand the changed-path comparison exited 0 with no output.Findings
Blocking
None found. The publication path now uses
MoveFileExWwith native wide paths, and the Windows regression checks the collapsed file and temporary-file removal under Unicode temporary paths.Non-blocking
Linux product CI is skipped. The focused Linux test result is author-reported, not independently run here.
Not verified
I did not run local builds or tests, and did not test on macOS or console hardware.