fix(libkernel): convert guest thread names from UTF-8 for the Windows thread description #14402

Merged
roboterspinne merged 1 commit from upstream-pr/14402 into main 2026-11-02 19:49:39 +00:00
roboterspinne commented 2026-11-01 11:34:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by roboterspinne on 2026-11-01T11:34:39Z.


What

On 26fa1212b8 (line numbers below refer to it) the Windows description of a guest thread garbles every non-ASCII name. StartNativeThread (core/libs/prx/libkernel/Pthread/src/Thread.cpp:912) and scePthreadRename (Thread.cpp:1321, also reached by pthread_rename_np and pthread_set_name_np, Pthread/Posix/Thread.cpp:355 and :368) build the SetThreadDescription string with std::wstring(name.begin(), name.end()), which sign-extends each char to wchar_t. Every byte from 0x80 up becomes a unit in U+FF80..U+FFFF, which is wrong under any encoding: a thread created or renamed as "Z\xc3\xa4hler-\xe6\x97\xa5" ("Zähler-日") reads back as 005a ffc3 ffa4 0068 006c 0065 0072 002d ffe6 ff97 ffa5 instead of 005a 00e4 0068 006c 0065 0072 002d 65e5. The repository already treats the description as the UTF-16 form of a UTF-8 name: the Windows crash report reads it back with WideCharToMultiByte(CP_UTF8, ...) for the faulting thread (core/libs/prx/libc/src/specifics/windows/CrashReport.cpp:374-376) and for the all-threads list (CrashReport.cpp:592-594), so today both lines print each non-ASCII byte as a three-byte sequence, and debuggers and ETW/profilers show the same garbage.

  • Rule. On Windows the description of a guest thread is MultiByteToWideChar(CP_UTF8, 0, ...) of the guest name bytes, as the host log file path conversion does (core/libs/prx/libc/src/LogFilePlatform.cpp:47-53); an empty name gives an empty description. Flags are 0 rather than MB_ERR_INVALID_CHARS because the description is host-only and best-effort: invalid UTF-8 becomes U+FFFD (checked with a probe: "bad\xff\xc3" gives 0062 0061 0064 fffd fffd) and never fails the guest call, and the SetThreadDescription result stays ignored as before. These two lines are the only places that set the description from a guest name. Guest-visible results do not change: scePthreadGetname and pthread_getname_np read thread->name, which this change does not touch. ThreadName::SetCurrent (core/libs/prx/libc/include/general/ThreadName.hpp:22-36) is not reused: it widens bytes as Latin-1 with a 63-character cap, which would still garble UTF-8, and its only production caller (libSceAgcDriver/Execution/src/Driver/Queues/WorkerAffinity.cpp:27) passes fixed ASCII role labels, so it stays unchanged.
  • Tests. guest_pthread_rename creates its worker as "Z\xc3\xa4hler" and, on Windows, requires GetThreadDescription in the worker to be L"Zähler" (creation path, Thread.cpp:912), then renames the worker with scePthreadRename to "Z\xc3\xa4hler-\xe6\x97\xa5" and requires L"Zähler-日" (rename path, Thread.cpp:1321). On a mismatch it prints the UTF-16 units it read and the expected ones. The stored-name checks of the test are unchanged.
  • Overlap. pr_overlap.py --branch finds no shared lines with the open pull requests it can compare and cannot compare 19 that also change Thread.cpp but do not merge with main (#3986, #4563, #5021, #7149, #7804, #8477, #8592, #9938, #11624, #11628, #11661, #11689, #11698, #12544, #12642, #12682, #12688, #12700, #12965). Checked by hand: a trial merge of this branch with each of them conflicts only in the files that main with it already conflicts in; within Thread.cpp, #4563, #8477 and #12642 conflict in the same hunks as with main, and #7149 and #9938 add one more conflict because each inserts its own helper directly after the #ifdef _WIN32 that precedes StartNativeThread, where this change adds ThreadDescription; keeping both helpers resolves it.

Tested

Windows 11, WinLibs GCC 15.2.0 (gcc.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r7) 15.2.0), Ninja, Release, BUILD_TESTING=ON, based on 26fa1212b8:

  • cmake --build build --target guest_pthread_rename_tests, then ctest --test-dir build -R '^guest_pthread_rename$' -V.
  • Counter-check with the new test and the Thread.cpp of 26fa1212b8: fails with thread description units: 005a ffc3 ffa4 0068 006c 0065 0072; expected: 005a 00e4 0068 006c 0065 0072 (Exit code 0xc0000409). With only the creation path converted (run with an earlier draft of the test that had the same two checks): fails at the rename check with thread description units: 005a ffc3 ffa4 0068 006c 0065 0072 002d ffe6 ff97 ffa5; expected: 005a 00e4 0068 006c 0065 0072 002d 65e5. With this change: Passed. The unchanged test of 26fa1212b8 passes on 26fa1212b8.
  • ctest --test-dir build -R '^(guest_pthread_rename|thread_name|guest_kernel_sys_pthread|guest_kernel_sys_pthread_np_rwlockattr|guest_kernel_sys_pthread_np_kind|guest_posix_thread_name|guest_pthread_cond_setname|guest_pthread_create_suspended|guest_pthread_getname|guest_pthread_setname|guest_pthread_start)$' with this change: 11 of 11 passed.
  • python tools/check_conventions.py --base 26fa1212b8 with this title and description passed.

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
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5106945776 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14402). Originally posted by [roboterspinne](https://github.com/roboterspinne) on 2026-11-01T11:34:39Z. --- ### What On 26fa1212b8 (line numbers below refer to it) the Windows description of a guest thread garbles every non-ASCII name. `StartNativeThread` (`core/libs/prx/libkernel/Pthread/src/Thread.cpp:912`) and `scePthreadRename` (`Thread.cpp:1321`, also reached by `pthread_rename_np` and `pthread_set_name_np`, `Pthread/Posix/Thread.cpp:355` and `:368`) build the `SetThreadDescription` string with `std::wstring(name.begin(), name.end())`, which sign-extends each `char` to `wchar_t`. Every byte from 0x80 up becomes a unit in U+FF80..U+FFFF, which is wrong under any encoding: a thread created or renamed as `"Z\xc3\xa4hler-\xe6\x97\xa5"` ("Zähler-日") reads back as `005a ffc3 ffa4 0068 006c 0065 0072 002d ffe6 ff97 ffa5` instead of `005a 00e4 0068 006c 0065 0072 002d 65e5`. The repository already treats the description as the UTF-16 form of a UTF-8 name: the Windows crash report reads it back with `WideCharToMultiByte(CP_UTF8, ...)` for the faulting thread (`core/libs/prx/libc/src/specifics/windows/CrashReport.cpp:374-376`) and for the all-threads list (`CrashReport.cpp:592-594`), so today both lines print each non-ASCII byte as a three-byte sequence, and debuggers and ETW/profilers show the same garbage. - **Rule.** On Windows the description of a guest thread is `MultiByteToWideChar(CP_UTF8, 0, ...)` of the guest name bytes, as the host log file path conversion does (`core/libs/prx/libc/src/LogFilePlatform.cpp:47-53`); an empty name gives an empty description. Flags are 0 rather than `MB_ERR_INVALID_CHARS` because the description is host-only and best-effort: invalid UTF-8 becomes U+FFFD (checked with a probe: `"bad\xff\xc3"` gives `0062 0061 0064 fffd fffd`) and never fails the guest call, and the `SetThreadDescription` result stays ignored as before. These two lines are the only places that set the description from a guest name. Guest-visible results do not change: `scePthreadGetname` and `pthread_getname_np` read `thread->name`, which this change does not touch. `ThreadName::SetCurrent` (`core/libs/prx/libc/include/general/ThreadName.hpp:22-36`) is not reused: it widens bytes as Latin-1 with a 63-character cap, which would still garble UTF-8, and its only production caller (`libSceAgcDriver/Execution/src/Driver/Queues/WorkerAffinity.cpp:27`) passes fixed ASCII role labels, so it stays unchanged. - **Tests.** `guest_pthread_rename` creates its worker as `"Z\xc3\xa4hler"` and, on Windows, requires `GetThreadDescription` in the worker to be `L"Zähler"` (creation path, `Thread.cpp:912`), then renames the worker with `scePthreadRename` to `"Z\xc3\xa4hler-\xe6\x97\xa5"` and requires `L"Zähler-日"` (rename path, `Thread.cpp:1321`). On a mismatch it prints the UTF-16 units it read and the expected ones. The stored-name checks of the test are unchanged. - **Overlap.** `pr_overlap.py --branch` finds no shared lines with the open pull requests it can compare and cannot compare 19 that also change `Thread.cpp` but do not merge with `main` (#3986, #4563, #5021, #7149, #7804, #8477, #8592, #9938, #11624, #11628, #11661, #11689, #11698, #12544, #12642, #12682, #12688, #12700, #12965). Checked by hand: a trial merge of this branch with each of them conflicts only in the files that `main` with it already conflicts in; within `Thread.cpp`, #4563, #8477 and #12642 conflict in the same hunks as with `main`, and #7149 and #9938 add one more conflict because each inserts its own helper directly after the `#ifdef _WIN32` that precedes `StartNativeThread`, where this change adds `ThreadDescription`; keeping both helpers resolves it. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11, WinLibs GCC 15.2.0 (`gcc.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r7) 15.2.0`), Ninja, Release, `BUILD_TESTING=ON`, based on 26fa1212b8: - `cmake --build build --target guest_pthread_rename_tests`, then `ctest --test-dir build -R '^guest_pthread_rename$' -V`. - Counter-check with the new test and the `Thread.cpp` of 26fa1212b8: fails with `thread description units: 005a ffc3 ffa4 0068 006c 0065 0072; expected: 005a 00e4 0068 006c 0065 0072` (`Exit code 0xc0000409`). With only the creation path converted (run with an earlier draft of the test that had the same two checks): fails at the rename check with `thread description units: 005a ffc3 ffa4 0068 006c 0065 0072 002d ffe6 ff97 ffa5; expected: 005a 00e4 0068 006c 0065 0072 002d 65e5`. With this change: `Passed`. The unchanged test of 26fa1212b8 passes on 26fa1212b8. - `ctest --test-dir build -R '^(guest_pthread_rename|thread_name|guest_kernel_sys_pthread|guest_kernel_sys_pthread_np_rwlockattr|guest_kernel_sys_pthread_np_kind|guest_posix_thread_name|guest_pthread_cond_setname|guest_pthread_create_suspended|guest_pthread_getname|guest_pthread_setname|guest_pthread_start)$'` with this change: 11 of 11 passed. - `python tools/check_conventions.py --base 26fa1212b8` with this title and description passed. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes (Claude Code)
MarcZX10 commented 2026-11-01 11:45:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T11:45:25Z.

Review: COMMENTED


Reviewed — looks good, one non-blocking note

The fix matches the code it replaces and the new test checks it on Windows, but the new test calls a Windows 10 API directly, which the repository handles differently in its other Windows test targets.

What I ran

Exact head fd1ec933155acf3aec5215c3a95b069333b183a8, base b2620e56d114ef053f8b45433b1d48aff7ec37ba (current main, so no merge preview was needed). Nothing was built or compiled, and no test was run, per the no-build protocol for initial review.

cd /marc/AnyPS5
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14402
python3 tools/pr_abi_audit.py --base b2620e56d114ef053f8b45433b1d48aff7ec37ba --head fd1ec933155acf3aec5215c3a95b069333b183a8 --json
git archive fd1ec933155acf3aec5215c3a95b069333b183a8 core/libs/prx/libkernel/Pthread/src/Thread.cpp core/libs/tests/GuestPthreadRename.cpp | tar -x -C /tmp/claude-0/reviewer-run-20261101-1140/tq-14402
python3 tools/pr_test_quality.py --root /tmp/claude-0/reviewer-run-20261101-1140/tq-14402 --json core/libs/prx/libkernel/Pthread/src/Thread.cpp core/libs/tests/GuestPthreadRename.cpp
git grep -n GetThreadDescription fd1ec933155acf3aec5215c3a95b069333b183a8 -- core

The precheck's ABI and test-quality helpers could not run in its isolated head tree (their scripts were missing there), so I ran both helpers by hand from /marc/AnyPS5, as shown above. The precheck's diff, conventions, and live dependency and mergeability checks ran inside the precheck.

Results

Check Result
Precheck diff check passed
Precheck conventions and PR template passed
Precheck live dependency and mergeability passed
Precheck changed-export ABI audit could not run in the isolated tree; by hand: passed_with_warnings, one lexical finding (ResetOnce, defined in Pthread/Posix/Once.cpp, which this PR does not touch)
Precheck test-quality heuristic could not run in the isolated tree; by hand: one finding, GuestPthreadRename.cpp not found literally in CMake; false positive, because core/libs/prx/libkernel/CMakeLists.txt:2307 registers it through ${LIBS_INCLUDE_DIR}/tests/GuestPthreadRename.cpp
Hosted CI at this head at triage: conventions, intake, labels, eligibility, library-portability and report were pending; no Windows test result yet
Test-quality helper, run by hand (unedited JSON)
{
  "findings": [
    {
      "path": "core/libs/tests/GuestPthreadRename.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

Findings

Blocking: none.

Non-blocking:

  1. GuestPthreadRename.cpp calls GetThreadDescription directly, and its target sets no Windows version macro. The call is at core/libs/tests/GuestPthreadRename.cpp:19, with <windows.h> at line 11. The target is defined at core/libs/prx/libkernel/CMakeLists.txt:2307-2309 and sets no _WIN32_WINNT. The repository handles this API differently elsewhere. The two Windows test targets that use Windows 10 APIs set _WIN32_WINNT=0x0A00 explicitly (core/libs/CMakeLists.txt:607 and :617). The other callers resolve the function at run time (core/libs/tests/ThreadName.cpp:10 and core/libs/prx/libc/src/specifics/windows/CrashReport.cpp:240). With a direct call, the declaration depends on the toolchain's default header version, and on a Windows version without GetThreadDescription the test executable would fail at load time, not report a test result. Smallest fix: add _WIN32_WINNT=0x0A00 to guest_pthread_rename_tests under if(WIN32), as lines 607 and 617 do, or resolve the function at run time as ThreadName.cpp does. This does not block the change: the author's Windows 11 build compiled it.

Checked from source with no issue found: the old std::wstring(name.begin(), name.end()) widens each char by sign extension, as the PR says. ThreadDescription uses CP_UTF8 with flags 0 and a buffer sized by a first call, so an empty name gives an empty description and invalid bytes become U+FFFD without failing the call. The name is stored at Thread.cpp:1001, before _beginthreadex at line 1015, so the creation path sees it. The rename path uses the same helper under nameLock.

Sources

Links pinned to the reviewed head:

Not verified

  • Nothing was built or run here. The author's counter-check (the new test fails on the old code and passes on the new code, and 11 of 11 related ctest cases pass) is author-reported and was not reproduced.
  • Hosted Windows results at this head were not available at review time, so approval waits for them.
  • The test's behavior on Windows versions older than 10 1607 is not tested.
  • The description text that a live Windows debugger or ETW consumer shows was not observed.

To get this to a good state

No change is required for approval beyond the optional fix in finding 1. If the author adds the Windows version define or the run-time resolution, the same test and the hosted Windows run of guest_pthread_rename on the new head are the evidence needed. I will re-check the head and its results before any approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727888572 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14402#pullrequestreview-5727888572). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T11:45:25Z. **Review:** COMMENTED --- # Reviewed — looks good, one non-blocking note The fix matches the code it replaces and the new test checks it on Windows, but the new test calls a Windows 10 API directly, which the repository handles differently in its other Windows test targets. ## What I ran Exact head `fd1ec933155acf3aec5215c3a95b069333b183a8`, base `b2620e56d114ef053f8b45433b1d48aff7ec37ba` (current `main`, so no merge preview was needed). Nothing was built or compiled, and no test was run, per the no-build protocol for initial review. ```sh cd /marc/AnyPS5 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14402 python3 tools/pr_abi_audit.py --base b2620e56d114ef053f8b45433b1d48aff7ec37ba --head fd1ec933155acf3aec5215c3a95b069333b183a8 --json git archive fd1ec933155acf3aec5215c3a95b069333b183a8 core/libs/prx/libkernel/Pthread/src/Thread.cpp core/libs/tests/GuestPthreadRename.cpp | tar -x -C /tmp/claude-0/reviewer-run-20261101-1140/tq-14402 python3 tools/pr_test_quality.py --root /tmp/claude-0/reviewer-run-20261101-1140/tq-14402 --json core/libs/prx/libkernel/Pthread/src/Thread.cpp core/libs/tests/GuestPthreadRename.cpp git grep -n GetThreadDescription fd1ec933155acf3aec5215c3a95b069333b183a8 -- core ``` The precheck's ABI and test-quality helpers could not run in its isolated head tree (their scripts were missing there), so I ran both helpers by hand from `/marc/AnyPS5`, as shown above. The precheck's diff, conventions, and live dependency and mergeability checks ran inside the precheck. ## Results | Check | Result | |---|---| | Precheck diff check | passed | | Precheck conventions and PR template | passed | | Precheck live dependency and mergeability | passed | | Precheck changed-export ABI audit | could not run in the isolated tree; by hand: `passed_with_warnings`, one lexical finding (`ResetOnce`, defined in `Pthread/Posix/Once.cpp`, which this PR does not touch) | | Precheck test-quality heuristic | could not run in the isolated tree; by hand: one finding, `GuestPthreadRename.cpp` not found literally in CMake; false positive, because `core/libs/prx/libkernel/CMakeLists.txt:2307` registers it through `${LIBS_INCLUDE_DIR}/tests/GuestPthreadRename.cpp` | | Hosted CI at this head | at triage: conventions, intake, labels, eligibility, library-portability and report were pending; no Windows test result yet | <details> <summary>Test-quality helper, run by hand (unedited JSON)</summary> ```json { "findings": [ { "path": "core/libs/tests/GuestPthreadRename.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` </details> ## Findings **Blocking:** none. **Non-blocking:** 1. `GuestPthreadRename.cpp` calls `GetThreadDescription` directly, and its target sets no Windows version macro. The call is at `core/libs/tests/GuestPthreadRename.cpp:19`, with `<windows.h>` at line 11. The target is defined at `core/libs/prx/libkernel/CMakeLists.txt:2307-2309` and sets no `_WIN32_WINNT`. The repository handles this API differently elsewhere. The two Windows test targets that use Windows 10 APIs set `_WIN32_WINNT=0x0A00` explicitly (`core/libs/CMakeLists.txt:607` and `:617`). The other callers resolve the function at run time (`core/libs/tests/ThreadName.cpp:10` and `core/libs/prx/libc/src/specifics/windows/CrashReport.cpp:240`). With a direct call, the declaration depends on the toolchain's default header version, and on a Windows version without `GetThreadDescription` the test executable would fail at load time, not report a test result. Smallest fix: add `_WIN32_WINNT=0x0A00` to `guest_pthread_rename_tests` under `if(WIN32)`, as lines 607 and 617 do, or resolve the function at run time as `ThreadName.cpp` does. This does not block the change: the author's Windows 11 build compiled it. Checked from source with no issue found: the old `std::wstring(name.begin(), name.end())` widens each `char` by sign extension, as the PR says. `ThreadDescription` uses `CP_UTF8` with flags 0 and a buffer sized by a first call, so an empty name gives an empty description and invalid bytes become U+FFFD without failing the call. The name is stored at `Thread.cpp:1001`, before `_beginthreadex` at line 1015, so the creation path sees it. The rename path uses the same helper under `nameLock`. ## Sources Links pinned to the reviewed head: - https://github.com/boykopovar/AnyPS5/blob/fd1ec933155acf3aec5215c3a95b069333b183a8/core/libs/tests/GuestPthreadRename.cpp#L19 - https://github.com/boykopovar/AnyPS5/blob/fd1ec933155acf3aec5215c3a95b069333b183a8/core/libs/CMakeLists.txt#L607 - https://github.com/boykopovar/AnyPS5/blob/fd1ec933155acf3aec5215c3a95b069333b183a8/core/libs/CMakeLists.txt#L617 - https://github.com/boykopovar/AnyPS5/blob/fd1ec933155acf3aec5215c3a95b069333b183a8/core/libs/prx/libkernel/CMakeLists.txt#L2307-L2309 - https://github.com/boykopovar/AnyPS5/blob/fd1ec933155acf3aec5215c3a95b069333b183a8/core/libs/tests/ThreadName.cpp#L10 - https://github.com/boykopovar/AnyPS5/blob/fd1ec933155acf3aec5215c3a95b069333b183a8/core/libs/prx/libc/src/specifics/windows/CrashReport.cpp#L240 ## Not verified - Nothing was built or run here. The author's counter-check (the new test fails on the old code and passes on the new code, and 11 of 11 related ctest cases pass) is author-reported and was not reproduced. - Hosted Windows results at this head were not available at review time, so approval waits for them. - The test's behavior on Windows versions older than 10 1607 is not tested. - The description text that a live Windows debugger or ETW consumer shows was not observed. ## To get this to a good state No change is required for approval beyond the optional fix in finding 1. If the author adds the Windows version define or the run-time resolution, the same test and the hosted Windows run of `guest_pthread_rename` on the new head are the evidence needed. I will re-check the head and its results before any approval.
MarcZX10 commented 2026-11-01 12:16:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T12:16:52Z.

Review: APPROVED


Reviewed — looks good

The Windows thread-name conversion is correct at fd1ec93315, and the hosted Windows run for this exact head passed the new rename test, which closes the approval gap left by my earlier comment.

What I ran

Exact head fd1ec933155acf3aec5215c3a95b069333b183a8; PR base b2620e56d114ef053f8b45433b1d48aff7ec37ba, unchanged at completion. No build and no local test run. Commands:

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14402
python3 tools/pr_abi_audit.py --base b2620e56d114ef053f8b45433b1d48aff7ec37ba --head fd1ec933155acf3aec5215c3a95b069333b183a8 --json

The precheck's ABI and test-quality helpers were missing from the isolated head tree; the ABI helper was run by hand from /marc/AnyPS5/tools.

Results

Check Result
Diff check, conventions and PR template (precheck) Passed
Live dependency and mergeability (precheck) Passed
ABI audit (by hand) Passed with one lexical finding: ResetOnce, a file-local helper in Pthread/Posix/Once.cpp that is not an export; no export declaration changed
Test-quality heuristic (by hand) Test registration is explicit in core/libs/prx/libkernel/CMakeLists.txt (L2307-L2311); the heuristic's finding is a path false positive
Hosted Windows, run 124840201089 at this head Success; guest_pthread_rename_tests built and passed (1 of 1 in that job)
Unedited hosted log lines (Windows job)
[3/4] Linking CXX executable tests\guest_pthread_rename_tests.exe
100% tests passed, 0 tests failed out of 1
guest_pthread_rename_tests

Findings

Blocking: none.

Non-blocking: the rename test calls GetThreadDescription statically without a _WIN32_WINNT definition for its own target (core/libs/tests/GuestPthreadRename.cpp L19; target at core/libs/prx/libkernel/CMakeLists.txt L2307-L2309). The hosted GCC 15 build accepted it, so this is only a portability note for other toolchains, as noted in my earlier comment.

Sources

Not verified

  • Hosted Linux was skipped for this change; the Linux paths were not run here.
  • No build or run was done locally.
  • Console behaviour of thread names is not in scope.

To get this to a good state

Nothing is required for the approval. The _WIN32_WINNT note is optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727984330 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14402#pullrequestreview-5727984330). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T12:16:52Z. **Review:** APPROVED --- # Reviewed — looks good The Windows thread-name conversion is correct at `fd1ec93315`, and the hosted Windows run for this exact head passed the new rename test, which closes the approval gap left by my earlier comment. ## What I ran Exact head `fd1ec933155acf3aec5215c3a95b069333b183a8`; PR base `b2620e56d114ef053f8b45433b1d48aff7ec37ba`, unchanged at completion. No build and no local test run. Commands: ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14402 python3 tools/pr_abi_audit.py --base b2620e56d114ef053f8b45433b1d48aff7ec37ba --head fd1ec933155acf3aec5215c3a95b069333b183a8 --json ``` The precheck's ABI and test-quality helpers were missing from the isolated head tree; the ABI helper was run by hand from `/marc/AnyPS5/tools`. ## Results | Check | Result | |---|---| | Diff check, conventions and PR template (precheck) | Passed | | Live dependency and mergeability (precheck) | Passed | | ABI audit (by hand) | Passed with one lexical finding: `ResetOnce`, a file-local helper in `Pthread/Posix/Once.cpp` that is not an export; no export declaration changed | | Test-quality heuristic (by hand) | Test registration is explicit in `core/libs/prx/libkernel/CMakeLists.txt` (L2307-L2311); the heuristic's finding is a path false positive | | Hosted Windows, run 124840201089 at this head | Success; `guest_pthread_rename_tests` built and passed (1 of 1 in that job) | <details><summary>Unedited hosted log lines (Windows job)</summary> ```text [3/4] Linking CXX executable tests\guest_pthread_rename_tests.exe 100% tests passed, 0 tests failed out of 1 guest_pthread_rename_tests ``` </details> ## Findings **Blocking:** none. **Non-blocking:** the rename test calls `GetThreadDescription` statically without a `_WIN32_WINNT` definition for its own target (`core/libs/tests/GuestPthreadRename.cpp` L19; target at `core/libs/prx/libkernel/CMakeLists.txt` L2307-L2309). The hosted GCC 15 build accepted it, so this is only a portability note for other toolchains, as noted in my earlier comment. ## Sources - [`GuestPthreadRename.cpp` at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/fd1ec933155acf3aec5215c3a95b069333b183a8/core/libs/tests/GuestPthreadRename.cpp#L19) ## Not verified - Hosted Linux was skipped for this change; the Linux paths were not run here. - No build or run was done locally. - Console behaviour of thread names is not in scope. ## To get this to a good state Nothing is required for the approval. The `_WIN32_WINNT` note is optional.
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!14402
No description provided.