process_cmdline: restore the thread after the absent-core probe #2849

Closed
leonida/mandy
aznohonza wants to merge 0 commits from test/process-cmdline-restore into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

aznohonza commented 2026-12-01 08:47:24 +00:00

Claimed in the coordination issue as: CXX-PROCESS-CMDLINE-MASK

What and why

KelboLive's 557/576 C++-suite report (failure 1) is a latent bug in process_cmdline_test: its "cores of the thread's own group that the process lacks" probe asks the shim to pin the thread to a CPU outside the process affinity, then the next check, "a mask the host accepts is applied with the old mask answered", assumes the thread is still where the block found it.

  • On Wine and on most Windows builds, SetThreadGroupAffinity refuses that mask with ERROR_INVALID_PARAMETER; the shim substitutes the thread's own mask and leaves it where it was, so the probe is harmless.
  • On the build in the report (process confined to 0xffff0000 of 32 CPUs, mask 0x1 asked), the host accepted the out-of-process mask and moved the thread, so the next call answered prior=0x1 and the test failed at process_cmdline_test.cpp:459.
  • The probe now puts the thread back on own after the call. It is a no-op where the host refused; where the host accepted, the following checks start from the mask the block found. No shim or runtime change.

Tested

  • Configured runtime/build/windows with runtime/cmake/clang-cl-xwin.cmake, -DXWIN_DIR=$HOME/.local/share/xwin-sdk, -DLEONIDA_SDL3=OFF -DLEONIDA_VULKAN_HEADERS_FETCH=OFF, then built process_cmdline_test (2.5 s).
  • Ran it under Wine 11.22 (staging): exit 0. The log shows the probe's branch does run here (process mask 0xfff, asked 0x1000) and that Wine refuses the mask, so the substitution path is exercised; the new restore is a no-op on that path.
  • The native Windows case where the host accepts the mask cannot be reproduced on Linux/Wine; that is the path the new line covers, and it is the one to re-check on a restricted-affinity Windows host.
  • python -I scripts/check_no_game_data.py runtime/test/process_cmdline_test.cpp is clean. No game data.

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md. (n/a: test-only change)
Claimed in the coordination issue as: [CXX-PROCESS-CMDLINE-MASK](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7305715498) ### What and why KelboLive's 557/576 C++-suite report (failure 1) is a latent bug in `process_cmdline_test`: its "cores of the thread's own group that the process lacks" probe asks the shim to pin the thread to a CPU outside the process affinity, then the next check, "a mask the host accepts is applied with the old mask answered", assumes the thread is still where the block found it. - On Wine and on most Windows builds, `SetThreadGroupAffinity` refuses that mask with `ERROR_INVALID_PARAMETER`; the shim substitutes the thread's own mask and leaves it where it was, so the probe is harmless. - On the build in the report (process confined to `0xffff0000` of 32 CPUs, mask `0x1` asked), the host accepted the out-of-process mask and moved the thread, so the next call answered `prior=0x1` and the test failed at `process_cmdline_test.cpp:459`. - The probe now puts the thread back on `own` after the call. It is a no-op where the host refused; where the host accepted, the following checks start from the mask the block found. No shim or runtime change. ### Tested - Configured `runtime/build/windows` with `runtime/cmake/clang-cl-xwin.cmake`, `-DXWIN_DIR=$HOME/.local/share/xwin-sdk`, `-DLEONIDA_SDL3=OFF -DLEONIDA_VULKAN_HEADERS_FETCH=OFF`, then built `process_cmdline_test` (2.5 s). - Ran it under Wine 11.22 (staging): exit 0. The log shows the probe's branch does run here (process mask `0xfff`, asked `0x1000`) and that Wine refuses the mask, so the substitution path is exercised; the new restore is a no-op on that path. - The native Windows case where the host accepts the mask cannot be reproduced on Linux/Wine; that is the path the new line covers, and it is the one to re-check on a restricted-affinity Windows host. - `python -I scripts/check_no_game_data.py runtime/test/process_cmdline_test.cpp` is clean. No game data. AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption. - [x] A new translator rule is in the contract table of `docs/design.md`. (n/a: test-only change)
aslan2142 commented 2026-12-01 16:47:12 +00:00

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
Sign in to join this conversation.
No description provided.