runtime/shims: shim Win32 localization, priority-boost, and named-pipe APIs (RT-WIN32-ENV-LOC-PIPE) #1242

Closed
piyonchu wants to merge 1 commit from upstream-pr/1242 into main
piyonchu commented 2026-11-24 20:43:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by piyonchu on 2026-11-24T20:43:51Z.


Summary

Claim ID: RT-WIN32-ENV-LOC-PIPE

Adds runtime/shims/win32_env.cpp, runtime/test/win32_env_test.cpp, and documents LEONIDA_GEO / LEONIDA_LOCALE in runtime/README.md (wired into runtime/CMakeLists.txt and scripts/build_runtime.ps1, rebased onto cont/main 16f505304 at 1a5b65a38):

  • Shims GetUserDefaultGeoName, GetUserDefaultLocaleName, and LocaleNameToLCID (api-ms-win-core-localization-l1-2-{0,3}.dll, kernel32.dll, kernelbase.dll) with offline fallback and LEONIDA_GEO / LEONIDA_LOCALE overrides.
  • Shims SetProcessPriorityBoost (api-ms-win-core-processthreads-l1-1-2.dll, kernel32.dll, kernelbase.dll) in-process so title priority-boost toggles do not mutate the host gta6rt scheduler policy.
  • Shims WaitNamedPipeA/W and SetNamedPipeHandleState (api-ms-win-core-namedpipe-l1-1-0.dll, kernel32.dll, kernelbase.dll), returning ERROR_BAD_PATHNAME for WaitNamedPipeA(nullptr) and ERROR_INVALID_PARAMETER for WaitNamedPipeW(nullptr) without faulting on Windows 11.
  • Adds win32_env and win32_env_override CTest cases in runtime/test/win32_env_test.cpp.

Verification

  • Host: Windows 11 (10.0.26100 SDK), MSVC (RelWithDebInfo), at 1a5b65a38.
  • ctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env" --output-on-failure: 100% tests passed out of 2 (win32_env, win32_env_override).
  • python -I tests/test_docs_env_vars.py: Ran 5 tests ... OK.
  • python -I tests/test_docs_encoding.py: Ran 1 test ... OK.
  • python -I tests/test_text_encoding.py: Ran 2 tests ... OK.
  • python -I tests/test_ctest_registration.py: Ran 7 tests ... OK.
  • python -I scripts/check_no_game_data.py ... and git diff --check cont/main..HEAD: clean.
  • No game files used; CPU runtime test only (no GPU required). AI-assisted.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480014881 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1242). Originally posted by [piyonchu](https://github.com/piyonchu) on 2026-11-24T20:43:51Z. --- ### Summary Claim ID: `RT-WIN32-ENV-LOC-PIPE` Adds `runtime/shims/win32_env.cpp`, `runtime/test/win32_env_test.cpp`, and documents `LEONIDA_GEO` / `LEONIDA_LOCALE` in `runtime/README.md` (wired into `runtime/CMakeLists.txt` and `scripts/build_runtime.ps1`, rebased onto `cont/main` `16f505304` at `1a5b65a38`): - Shims `GetUserDefaultGeoName`, `GetUserDefaultLocaleName`, and `LocaleNameToLCID` (`api-ms-win-core-localization-l1-2-{0,3}.dll`, `kernel32.dll`, `kernelbase.dll`) with offline fallback and `LEONIDA_GEO` / `LEONIDA_LOCALE` overrides. - Shims `SetProcessPriorityBoost` (`api-ms-win-core-processthreads-l1-1-2.dll`, `kernel32.dll`, `kernelbase.dll`) in-process so title priority-boost toggles do not mutate the host `gta6rt` scheduler policy. - Shims `WaitNamedPipeA/W` and `SetNamedPipeHandleState` (`api-ms-win-core-namedpipe-l1-1-0.dll`, `kernel32.dll`, `kernelbase.dll`), returning `ERROR_BAD_PATHNAME` for `WaitNamedPipeA(nullptr)` and `ERROR_INVALID_PARAMETER` for `WaitNamedPipeW(nullptr)` without faulting on Windows 11. - Adds `win32_env` and `win32_env_override` CTest cases in `runtime/test/win32_env_test.cpp`. ### Verification - Host: Windows 11 (`10.0.26100` SDK), MSVC (`RelWithDebInfo`), at `1a5b65a38`. - `ctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env" --output-on-failure`: `100% tests passed out of 2` (`win32_env`, `win32_env_override`). - `python -I tests/test_docs_env_vars.py`: `Ran 5 tests ... OK`. - `python -I tests/test_docs_encoding.py`: `Ran 1 test ... OK`. - `python -I tests/test_text_encoding.py`: `Ran 2 tests ... OK`. - `python -I tests/test_ctest_registration.py`: `Ran 7 tests ... OK`. - `python -I scripts/check_no_game_data.py ...` and `git diff --check cont/main..HEAD`: clean. - No game files used; CPU runtime test only (no GPU required). AI-assisted.
piyonchu commented 2026-11-26 21:36:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by piyonchu on 2026-11-26T21:36:24Z.


Rebased onto latest main (fac8b4bb9, head commit f22205149), resolving the scripts/build_runtime.ps1 fallback file list conflict cleanly (shims\xapu_queue.cpp + shims\win32_env.cpp).

Verified locally after rebase:

  • git diff --check cont/main..HEAD
  • python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/shims/win32_env.cpp runtime/test/win32_env_test.cpp scripts/build_runtime.ps1
  • cmake --build runtime/build --config RelWithDebInfo --target gta6rt win32_env_test
  • ctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env$" --output-on-failure (1/1 passed)
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7203887560 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1242#issuecomment-7203887560). Originally posted by [piyonchu](https://github.com/piyonchu) on 2026-11-26T21:36:24Z. --- Rebased onto latest `main` (`fac8b4bb9`, head commit `f22205149`), resolving the `scripts/build_runtime.ps1` fallback file list conflict cleanly (`shims\xapu_queue.cpp` + `shims\win32_env.cpp`). Verified locally after rebase: - `git diff --check cont/main..HEAD` - `python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/shims/win32_env.cpp runtime/test/win32_env_test.cpp scripts/build_runtime.ps1` - `cmake --build runtime/build --config RelWithDebInfo --target gta6rt win32_env_test` - `ctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env$" --output-on-failure` (1/1 passed)
MoonEyes commented 2026-11-28 17:53:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T17:53:06Z.


Blocker: tests/test_docs_env_vars.py fails with this PR merged onto main: LEONIDA_GEO and LEONIDA_LOCALE (read in runtime/shims/win32_env.cpp) are documented in no .md. Could you add them to the docs page that lists the runtime variables?

Checked locally on main c1ecf04ed: the same test file(s) pass on main without this PR.

AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7243362470 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1242#issuecomment-7243362470). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T17:53:06Z. --- Blocker: `tests/test_docs_env_vars.py` fails with this PR merged onto `main`: `LEONIDA_GEO` and `LEONIDA_LOCALE` (read in `runtime/shims/win32_env.cpp`) are documented in no `.md`. Could you add them to the docs page that lists the runtime variables? Checked locally on `main` c1ecf04ed: the same test file(s) pass on `main` without this PR. _AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes._
zmasi commented 2026-11-28 23:06:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:06:40Z.


Native Windows 11 + MSVC 19.44 Verification (f222051496 + origin/main adfb3821a2)

Verdict: C++ shim & tests PASS (0 /W4 warnings), 1 CI blocker + 2 hygiene/doc items below

Environment & Merge Check

  • Host: Windows 11 (10.0.26200), MSVC 19.44.35228 (x64, /W4 /permissive- /utf-8 /O2 /EHsc)
  • Merge hygiene: Clean merge onto origin/main (adfb3821a2, git merge-tree --write-tree rc=0); check_no_game_data.py, test_ctest_registration.py (7/7), test_build_runtime_batch.py (1/1), test_build_runtime_cmake.py (1/1), and test_text_encoding.py (2/2) all OK (and all 10/10 fallback file-list checks in test_build_runtime_fallback.py pass).

C++ Shim & Live Host Windows 11 Results

  • Live host Windows 11 (10.0.26200) SEH probe: Confirmed native ::WaitNamedPipeW(nullptr, 0) raises hardware SEH 0xC0000005 (EXCEPTION_ACCESS_VIOLATION), whereas ::WaitNamedPipeA(nullptr, 0) returns FALSE with ERROR_BAD_PATHNAME (161).
  • win32_env_test.exe (default): PASS (28 check(s), 0 failure(s), 0.10 s, 0 /W4 warnings).
  • win32_env_test.exe --expect-override (LEONIDA_GEO=jp, LEONIDA_LOCALE=en-GB): PASS (30 check(s), 0 failure(s), 0.06 s).

Findings to Address Before Merge

  1. [Blocker — CI failure] tests/test_docs_env_vars.py fails on PR #1242 + origin/main (adfb3821a2): LEONIDA_GEO (runtime/shims/win32_env.cpp:69) and LEONIDA_LOCALE (runtime/shims/win32_env.cpp:81) are read by the runtime shim without being documented in docs/ (test_docs_env_vars.py passes rc=0 on origin/main alone).
  2. [Encoding hygiene] UTF-8 BOM in scripts/build_runtime.ps1: Head f222051496 prepends a 3-byte UTF-8 BOM (EF BB BF) at byte 0 of scripts/build_runtime.ps1 (origin/main is BOM-free UTF-8). Please strip those 3 leading bytes when updating the branch.
  3. [Minor PR summary / error-code note] WaitNamedPipeW(nullptr, ...) last-error value: The PR description states "preserving ERROR_BAD_PATHNAME for WaitNamedPipeA/W(nullptr)", while wait_named_pipe_w (runtime/shims/win32_env.cpp:197) sets ERROR_INVALID_PARAMETER (87, tested at win32_env_test.cpp:131) and wait_named_pipe_a sets ERROR_BAD_PATHNAME (161). Either error code avoids the Windows 11 null-dereference fault, so just align whichever side was intended.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247206530 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1242#issuecomment-7247206530). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T23:06:40Z. --- ### Native Windows 11 + MSVC `19.44` Verification (`f222051496` + `origin/main` `adfb3821a2`) **Verdict**: **C++ shim & tests PASS** (`0` `/W4` warnings), **1 CI blocker + 2 hygiene/doc items below** #### Environment & Merge Check - **Host**: Windows 11 (`10.0.26200`), MSVC `19.44.35228` (`x64`, `/W4 /permissive- /utf-8 /O2 /EHsc`) - **Merge hygiene**: Clean merge onto `origin/main` (`adfb3821a2`, `git merge-tree --write-tree` `rc=0`); `check_no_game_data.py`, `test_ctest_registration.py` (`7/7`), `test_build_runtime_batch.py` (`1/1`), `test_build_runtime_cmake.py` (`1/1`), and `test_text_encoding.py` (`2/2`) all `OK` (and all `10/10` fallback file-list checks in `test_build_runtime_fallback.py` pass). #### C++ Shim & Live Host Windows 11 Results - **Live host Windows 11 (`10.0.26200`) SEH probe**: Confirmed native `::WaitNamedPipeW(nullptr, 0)` raises hardware SEH `0xC0000005` (`EXCEPTION_ACCESS_VIOLATION`), whereas `::WaitNamedPipeA(nullptr, 0)` returns `FALSE` with `ERROR_BAD_PATHNAME` (`161`). - **`win32_env_test.exe` (default)**: **PASS** (`28 check(s), 0 failure(s)`, `0.10 s`, `0` `/W4` warnings). - **`win32_env_test.exe --expect-override` (`LEONIDA_GEO=jp`, `LEONIDA_LOCALE=en-GB`)**: **PASS** (`30 check(s), 0 failure(s)`, `0.06 s`). #### Findings to Address Before Merge 1. **[Blocker — CI failure] `tests/test_docs_env_vars.py` fails on `PR #1242 + origin/main` (`adfb3821a2`)**: `LEONIDA_GEO` (`runtime/shims/win32_env.cpp:69`) and `LEONIDA_LOCALE` (`runtime/shims/win32_env.cpp:81`) are read by the runtime shim without being documented in `docs/` (`test_docs_env_vars.py` passes `rc=0` on `origin/main` alone). 2. **[Encoding hygiene] UTF-8 BOM in `scripts/build_runtime.ps1`**: Head `f222051496` prepends a 3-byte UTF-8 BOM (`EF BB BF`) at byte `0` of `scripts/build_runtime.ps1` (`origin/main` is BOM-free UTF-8). Please strip those 3 leading bytes when updating the branch. 3. **[Minor PR summary / error-code note] `WaitNamedPipeW(nullptr, ...)` last-error value**: The PR description states *"preserving `ERROR_BAD_PATHNAME` for `WaitNamedPipeA/W(nullptr)`"*, while `wait_named_pipe_w` (`runtime/shims/win32_env.cpp:197`) sets `ERROR_INVALID_PARAMETER` (`87`, tested at `win32_env_test.cpp:131`) and `wait_named_pipe_a` sets `ERROR_BAD_PATHNAME` (`161`). Either error code avoids the Windows 11 null-dereference fault, so just align whichever side was intended. AI-assisted.
piyonchu commented 2026-11-29 01:09:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by piyonchu on 2026-11-29T01:09:02Z.


Addressed all three findings and rebased onto cont/main (16f505304, head 1a5b65a38), thanks @MoonEyes and @zmasi!

  1. test_docs_env_vars.py blocker (runtime/README.md): Documented LEONIDA_GEO and LEONIDA_LOCALE under ### Win32 localization overrides in runtime/README.md.
  2. UTF-8 BOM (scripts/build_runtime.ps1): Stripped the 3-byte UTF-8 BOM from scripts/build_runtime.ps1.
  3. PR summary alignment: Updated the PR description to state ERROR_BAD_PATHNAME for WaitNamedPipeA(nullptr) and ERROR_INVALID_PARAMETER for WaitNamedPipeW(nullptr), matching win32_env.cpp and win32_env_test.cpp.

Verified locally after 1a5b65a38:

  • python -I tests/test_docs_env_vars.py: Ran 5 tests ... OK
  • python -I tests/test_docs_encoding.py: Ran 1 test ... OK
  • python -I tests/test_text_encoding.py: Ran 2 tests ... OK
  • python -I tests/test_ctest_registration.py: Ran 7 tests ... OK
  • ctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env" --output-on-failure: 2/2 passed (win32_env, win32_env_override)
  • (Note: tests/test_build_runtime_fallback.py passed 10/11; only test_the_loader_gets_the_stack_reserve_cmake_gives_it failed on cont/main's runtime/CMakeLists.txt layout, untouched by this PR.)
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248593386 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1242#issuecomment-7248593386). Originally posted by [piyonchu](https://github.com/piyonchu) on 2026-11-29T01:09:02Z. --- Addressed all three findings and rebased onto `cont/main` (`16f505304`, head `1a5b65a38`), thanks @MoonEyes and @zmasi! 1. **`test_docs_env_vars.py` blocker (`runtime/README.md`)**: Documented `LEONIDA_GEO` and `LEONIDA_LOCALE` under `### Win32 localization overrides` in `runtime/README.md`. 2. **UTF-8 BOM (`scripts/build_runtime.ps1`)**: Stripped the 3-byte UTF-8 BOM from `scripts/build_runtime.ps1`. 3. **PR summary alignment**: Updated the PR description to state `ERROR_BAD_PATHNAME` for `WaitNamedPipeA(nullptr)` and `ERROR_INVALID_PARAMETER` for `WaitNamedPipeW(nullptr)`, matching `win32_env.cpp` and `win32_env_test.cpp`. Verified locally after `1a5b65a38`: - `python -I tests/test_docs_env_vars.py`: `Ran 5 tests ... OK` - `python -I tests/test_docs_encoding.py`: `Ran 1 test ... OK` - `python -I tests/test_text_encoding.py`: `Ran 2 tests ... OK` - `python -I tests/test_ctest_registration.py`: `Ran 7 tests ... OK` - `ctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env" --output-on-failure`: `2/2` passed (`win32_env`, `win32_env_override`) - *(Note: `tests/test_build_runtime_fallback.py` passed 10/11; only `test_the_loader_gets_the_stack_reserve_cmake_gives_it` failed on `cont/main`'s `runtime/CMakeLists.txt` layout, untouched by this PR.)*
zmasi commented 2026-11-29 02:37:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T02:37:17Z.


#1242 | head 1a5b65a38e (merged cleanly onto origin/main c8bf0e7b65) | Windows 11 (10.0.26200.9974), MSVC 19.44.35228 (x64), Python 3.12.10 | AI-assisted: yes

Summary — PASS (Re-verification of updated head 1a5b65a38e8d)

Re-verified 1a5b65a38e8d0846537f948beb9e43b0b74c0252 merged cleanly onto origin/main (c8bf0e7b6568f471b42540010e335ca6413d4c58, git merge-tree --write-tree exit 0) on native Windows 11 (x64).

Red -> Green Verification

  1. Red (origin/main c8bf0e7b65):
    • runtime/shims/win32_env.cpp and runtime/test/win32_env_test.cpp are absent on origin/main.
  2. Green (origin/main + #1242):
    • MSVC 19.44.35228 build (/std:c++20 /O2 /MD /EHsc /W4 /permissive- /utf-8 /link /OPT:NOREF):
      • win32_env_test.cpp + win32_env.cpp + registry.cpp compiled cleanly with 0 warnings.
    • Native Windows 11 execution:
      • Default (LEONIDA_GEO / LEONIDA_LOCALE unset) -> 28 check(s), 0 failure(s) (GetUserDefaultGeoName, GetUserDefaultLocaleName, LocaleNameToLCID("en-US") == 0x0409, guest SetProcessPriorityBoost / GetProcessPriorityBoost isolation leaving host process priority-boost state untouched, WaitNamedPipeW / WaitNamedPipeA / SetNamedPipeHandleState).
      • Env override (LEONIDA_GEO=jp, LEONIDA_LOCALE=en-GB, --expect-override) -> 30 check(s), 0 failure(s) (LEONIDA_GEO uppercased to JP, LEONIDA_LOCALE honored across GetUserDefaultLocaleName and LocaleNameToLCID(nullptr)).
    • CMake & Docs Gates:
      • python tests/test_ctest_registration.py -> OK
      • runtime/README.md link & anchor check -> 0 issues

Cross-PR Note (#1240)

  • Merges cleanly (rc=0) with origin/main (c8bf0e7b65) and #1931. Co-merging alongside sibling PR #1240 touches the same target/source list lines in runtime/CMakeLists.txt and scripts/build_runtime.ps1 (runtime/README.md auto-merges cleanly), so whichever lands second will need a trivial 2-file merge.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7249542463 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1242#issuecomment-7249542463). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T02:37:17Z. --- #1242 | head 1a5b65a38e8d0846537f948beb9e43b0b74c0252 (merged cleanly onto origin/main c8bf0e7b65) | Windows 11 (10.0.26200.9974), MSVC 19.44.35228 (x64), Python 3.12.10 | AI-assisted: yes ### Summary — PASS (Re-verification of updated head `1a5b65a38e8d`) Re-verified `1a5b65a38e8d0846537f948beb9e43b0b74c0252` merged cleanly onto `origin/main` (`c8bf0e7b6568f471b42540010e335ca6413d4c58`, `git merge-tree --write-tree` exit `0`) on native Windows 11 (`x64`). ### Red -> Green Verification 1. **Red (`origin/main` `c8bf0e7b65`)**: - `runtime/shims/win32_env.cpp` and `runtime/test/win32_env_test.cpp` are absent on `origin/main`. 2. **Green (`origin/main` + `#1242`)**: - **MSVC `19.44.35228` build (`/std:c++20 /O2 /MD /EHsc /W4 /permissive- /utf-8 /link /OPT:NOREF`)**: - `win32_env_test.cpp + win32_env.cpp + registry.cpp` compiled cleanly with `0` warnings. - **Native Windows 11 execution**: - Default (`LEONIDA_GEO` / `LEONIDA_LOCALE` unset) -> **`28 check(s), 0 failure(s)`** (`GetUserDefaultGeoName`, `GetUserDefaultLocaleName`, `LocaleNameToLCID("en-US") == 0x0409`, guest `SetProcessPriorityBoost` / `GetProcessPriorityBoost` isolation leaving host process priority-boost state untouched, `WaitNamedPipeW` / `WaitNamedPipeA` / `SetNamedPipeHandleState`). - Env override (`LEONIDA_GEO=jp`, `LEONIDA_LOCALE=en-GB`, `--expect-override`) -> **`30 check(s), 0 failure(s)`** (`LEONIDA_GEO` uppercased to `JP`, `LEONIDA_LOCALE` honored across `GetUserDefaultLocaleName` and `LocaleNameToLCID(nullptr)`). - **CMake & Docs Gates**: - `python tests/test_ctest_registration.py` -> **`OK`** - `runtime/README.md` link & anchor check -> **`0` issues** ### Cross-PR Note (`#1240`) - Merges cleanly (`rc=0`) with `origin/main` (`c8bf0e7b65`) and `#1931`. Co-merging alongside sibling PR `#1240` touches the same target/source list lines in `runtime/CMakeLists.txt` and `scripts/build_runtime.ps1` (`runtime/README.md` auto-merges cleanly), so whichever lands second will need a trivial 2-file merge.
piyonchu commented 2026-11-29 14:43:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by piyonchu on 2026-11-29T14:43:54Z.


Rebased onto main (91bab934d) at 736e1a1d4 after sibling PR #1240 (pr/psm-appnotify-wer-shims) merged:

  • Resolved the expected 2-file conflict in runtime/CMakeLists.txt and scripts/build_runtime.ps1 by keeping both appnotify.cpp/appnotify_test and win32_env.cpp/win32_env_test (win32_env, win32_env_override), and verified scripts/build_runtime.ps1 has no UTF-8 BOM.
  • Verified:
    • git diff --check cont/main..HEAD: clean
    • python -I scripts/check_no_game_data.py ...: PASS
    • python -I tests/test_docs_env_vars.py: 5/5 OK
    • python -I tests/test_docs_encoding.py: 1/1 OK
    • python -I tests/test_ctest_registration.py: 11/11 OK
    • cmake --build runtime/build --config RelWithDebInfo --target gta6rt win32_env_test appnotify_test: build succeeded
    • ctest --test-dir runtime/build -C RelWithDebInfo -R "^(win32_env|appnotify)" --output-on-failure: 3/3 passed (appnotify, win32_env, win32_env_override)
    • (Note: tests/test_text_encoding.py passes the BOM/UTF-8 check 1/2 and fails only on pre-existing main scripts/windows-boot/test_crash_monitor.py:37,90.)
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257531727 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1242#issuecomment-7257531727). Originally posted by [piyonchu](https://github.com/piyonchu) on 2026-11-29T14:43:54Z. --- Rebased onto `main` (`91bab934d`) at `736e1a1d4` after sibling PR `#1240` (`pr/psm-appnotify-wer-shims`) merged: - Resolved the expected 2-file conflict in `runtime/CMakeLists.txt` and `scripts/build_runtime.ps1` by keeping both `appnotify.cpp`/`appnotify_test` and `win32_env.cpp`/`win32_env_test` (`win32_env`, `win32_env_override`), and verified `scripts/build_runtime.ps1` has no UTF-8 BOM. - Verified: - `git diff --check cont/main..HEAD`: clean - `python -I scripts/check_no_game_data.py ...`: PASS - `python -I tests/test_docs_env_vars.py`: 5/5 OK - `python -I tests/test_docs_encoding.py`: 1/1 OK - `python -I tests/test_ctest_registration.py`: 11/11 OK - `cmake --build runtime/build --config RelWithDebInfo --target gta6rt win32_env_test appnotify_test`: build succeeded - `ctest --test-dir runtime/build -C RelWithDebInfo -R "^(win32_env|appnotify)" --output-on-failure`: 3/3 passed (`appnotify`, `win32_env`, `win32_env_override`) - *(Note: `tests/test_text_encoding.py` passes the BOM/UTF-8 check 1/2 and fails only on pre-existing `main` `scripts/windows-boot/test_crash_monitor.py:37,90`.)*
fiestorra commented 2026-11-30 08:46:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T08:46:58Z.


Independent verification on this machine (Windows 11, MSVC 19.44.35226): the two tests this pull request registers cannot run - ctest lists them with an empty command - while their executable builds.

1. It applies. merge-tree clean; the commits cherry-pick onto main e236b19c6 without a conflict.

2. The registration is there (runtime/CMakeLists.txt in the diff):

add_executable(win32_env_test
  test/win32_env_test.cpp shims/win32_env.cpp shims/registry.cpp)
…
add_test(NAME win32_env          COMMAND win32_env_test …)
add_test(NAME win32_env_override COMMAND win32_env_test …)

3. What CTest actually has (ctest --show-only=json-v1):

tests win32_env en ctest: 2
  name=win32_env           cmdVacio=True cmd=
  name=win32_env_override  cmdVacio=True cmd=

Both registered tests carry an empty command, so they are Not Run in any suite and ctest counts them as failures:

1/1 Test #N: win32_env …***Not Run   0.00 sec

4. This is not something main already has: on main e236b19c6 the manifest has 541 tests and none with an empty command, so this is introduced by the registration in this branch.

The likely cause, and the fix: add_test(COMMAND <name>) resolves <name> to a target's output only when that target is visible in the same directory scope at that point. Either move the add_test calls into the same scope as the add_executable, or use $<TARGET_FILE:win32_env_test> instead of the bare target name - the generator expression always resolves.

How it was found: a sweep of open pull requests that replay onto main, reading each test's command[0] from ctest --show-only=json-v1 to decide what to build, then running it. #1182 has the same shape - registered test, empty command - and it is the only other one I have found so far.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7273336068 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1242#issuecomment-7273336068). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T08:46:58Z. --- Independent verification on this machine (Windows 11, MSVC 19.44.35226): **the two tests this pull request registers cannot run - `ctest` lists them with an empty command** - while their executable builds. **1. It applies.** `merge-tree` clean; the commits cherry-pick onto `main` `e236b19c6` without a conflict. **2. The registration is there** (`runtime/CMakeLists.txt` in the diff): ```cmake add_executable(win32_env_test test/win32_env_test.cpp shims/win32_env.cpp shims/registry.cpp) … add_test(NAME win32_env COMMAND win32_env_test …) add_test(NAME win32_env_override COMMAND win32_env_test …) ``` **3. What CTest actually has** (`ctest --show-only=json-v1`): ``` tests win32_env en ctest: 2 name=win32_env cmdVacio=True cmd= name=win32_env_override cmdVacio=True cmd= ``` **Both registered tests carry an empty `command`**, so they are `Not Run` in any suite and `ctest` counts them as failures: ``` 1/1 Test #N: win32_env …***Not Run 0.00 sec ``` **4. This is not something `main` already has:** on `main` `e236b19c6` the manifest has **541 tests and none with an empty command**, so this is introduced by the registration in this branch. **The likely cause, and the fix:** `add_test(COMMAND <name>)` resolves `<name>` to a target's output only when that target is visible **in the same directory scope at that point**. Either move the `add_test` calls into the same scope as the `add_executable`, or use `$<TARGET_FILE:win32_env_test>` instead of the bare target name - the generator expression always resolves. **How it was found:** a sweep of open pull requests that replay onto `main`, reading each test's `command[0]` from `ctest --show-only=json-v1` to decide what to build, then running it. **#1182 has the same shape** - registered test, empty command - and it is the only other one I have found so far. Written with an AI assistant.
fiestorra commented 2026-11-30 11:14:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T11:14:45Z.


Re-confirmed on current main with a clean configure: both tests in this pull request are registered with an empty command. No correction - this one stands.

rm runtime/build-ninja/ctest.json
cmake -S runtime -B runtime/build-ninja -G Ninja …      (main d367675c7)
ctest --show-only=json-v1

win32_env           : cmdVacio=True
win32_env_override  : cmdVacio=True

What that costs, again: ctest reports them as Not Run, which it counts as a failure, so the branch turns the suite red while exercising nothing. main has 546+ tests and none of them is in this state.

The registration in the branch:

add_executable(win32_env_test
  test/win32_env_test.cpp shims/win32_env.cpp shims/registry.cpp)
…
add_test(NAME win32_env          COMMAND win32_env_test …)
add_test(NAME win32_env_override COMMAND win32_env_test …)

Two fixes, both tested on a sibling in this queue (#2344, same symptom): $<TARGET_FILE:win32_env_test> resolves regardless of scope, and moving the add_test into the block that creates the executable resolves as well.

Why I am re-posting: I had reported the same symptom on three other pull requests earlier today, and two of those turned out to be artefacts of a stale ctest.json in my build directory (#1182 and #1419). This one survived the clean re-run, so it is the real thing.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7276753048 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1242#issuecomment-7276753048). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T11:14:45Z. --- **Re-confirmed on current `main` with a clean configure: both tests in this pull request are registered with an empty command.** No correction - this one stands. ``` rm runtime/build-ninja/ctest.json cmake -S runtime -B runtime/build-ninja -G Ninja … (main d367675c7) ctest --show-only=json-v1 win32_env : cmdVacio=True win32_env_override : cmdVacio=True ``` **What that costs, again:** `ctest` reports them as **`Not Run`**, which it counts as a **failure**, so the branch turns the suite red while exercising nothing. **`main` has 546+ tests and none of them is in this state.** **The registration in the branch:** ```cmake add_executable(win32_env_test test/win32_env_test.cpp shims/win32_env.cpp shims/registry.cpp) … add_test(NAME win32_env COMMAND win32_env_test …) add_test(NAME win32_env_override COMMAND win32_env_test …) ``` **Two fixes, both tested on a sibling in this queue** (#2344, same symptom): **`$<TARGET_FILE:win32_env_test>`** resolves regardless of scope, and **moving the `add_test` into the block that creates the executable** resolves as well. **Why I am re-posting:** I had reported the same symptom on three other pull requests earlier today, and **two of those turned out to be artefacts of a stale `ctest.json` in my build directory** (#1182 and #1419). **This one survived the clean re-run, so it is the real thing.** Written with an AI assistant.
fiestorra commented 2026-11-30 11:17:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T11:17:46Z.


Correction, and it retracts the defect: the empty command I reported is an artefact of how I read the manifest, not a defect in this pull request.

The mechanism, measured on this machine:

fresh build directory, nothing built:
  ctest --show-only=json-v1  ->  546 of 573 tests have an empty command

build ONE target (win32_env_test):
  cmake --build … --target win32_env_test      [5/5] Linking CXX executable win32_env_test.exe
  ctest --show-only=json-v1  ->  544 of 573 empty, and:
      win32_env            cmdVacio=False        <- resolved
      win32_env_override   cmdVacio=False        <- resolved
      appnotify            cmdVacio=True         <- not built yet

add_test(NAME x COMMAND y_test) writes the target name into the test file, and CTest fills command with the executable's path only when that executable exists. So an empty command means "this binary has not been built in this directory", not "this registration is broken".

What that does to my earlier report: I said these two tests were registered with an empty command and came up Not Run. They are not. With the binary built, both resolve, and the fix I proposed ($<TARGET_FILE:…>) "worked" only because a generator expression is resolved at configure time into a literal path, which sidesteps the build state instead of fixing anything.

The four pull requests I flagged with this symptom deserve the retraction: #1182 and #1419 I had already withdrawn (stale manifest), and #1242 and #2344 are the same artefact - I am withdrawing them now, #2344 too.

What I actually got wrong, in one line: I read ctest --show-only=json-v1 as a description of the registration, when it is a description of what is built and registered. The manifest is a build artefact, and I read it before the build.

What still stands for this pull request: it applies to main d367675c7, win32_env_test builds, and its tests run — I will re-run them and say so in a follow-up if anything is red.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7276825035 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1242#issuecomment-7276825035). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T11:17:46Z. --- **Correction, and it retracts the defect: the empty `command` I reported is an artefact of how I read the manifest, not a defect in this pull request.** **The mechanism, measured on this machine:** ``` fresh build directory, nothing built: ctest --show-only=json-v1 -> 546 of 573 tests have an empty command build ONE target (win32_env_test): cmake --build … --target win32_env_test [5/5] Linking CXX executable win32_env_test.exe ctest --show-only=json-v1 -> 544 of 573 empty, and: win32_env cmdVacio=False <- resolved win32_env_override cmdVacio=False <- resolved appnotify cmdVacio=True <- not built yet ``` **`add_test(NAME x COMMAND y_test)` writes the target name into the test file, and CTest fills `command` with the executable's path only when that executable exists.** **So an empty `command` means "this binary has not been built in this directory", not "this registration is broken".** **What that does to my earlier report:** I said these two tests were registered with an empty command and came up `Not Run`. **They are not.** With the binary built, **both resolve**, and the fix I proposed (`$<TARGET_FILE:…>`) "worked" only because a generator expression is resolved at **configure** time into a literal path, **which sidesteps the build state instead of fixing anything**. **The four pull requests I flagged with this symptom deserve the retraction:** **#1182 and #1419 I had already withdrawn** (stale manifest), and **#1242 and #2344 are the same artefact** - I am withdrawing them now, #2344 too. **What I actually got wrong, in one line:** I read `ctest --show-only=json-v1` **as a description of the registration**, when it is a description of **what is built and registered**. **The manifest is a build artefact, and I read it before the build.** **What still stands for this pull request:** it applies to `main` `d367675c7`, `win32_env_test` builds, and its tests run — **I will re-run them and say so in a follow-up if anything is red.** Written with an AI assistant.
aslan2142 commented 2026-12-01 17:22:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T17:22:36Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7319200095 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1242#issuecomment-7319200095). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T17:22:36Z. --- 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.

Pull request closed

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
ProjectLeonida/mandy!1242
No description provided.