lifecycle: subclass the title window in its own character set (LIFECYCLE-ANSI-SUBCLASS) #2344

Closed
syfyra wants to merge 1 commit from upstream-pr/2344 into main
syfyra commented 2026-11-26 14:18:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by syfyra on 2026-11-26T14:18:23Z.


Claimed in the coordination issue as: LIFECYCLE-ANSI-SUBCLASS

What and why

runtime/shims/lifecycle.cpp subclasses the title's first top-level window so SC_CLOSE runs the suspend callbacks. It always did so with GetWindowLongPtrW/SetWindowLongPtrW. The retail title creates its window with CreateWindowExA (its import table names it from the -ansi- window set), which makes an ANSI window when the class was registered with the A function too; the title's class registration is not recorded in docs/, so whether the retail window is ANSI is not measured here. Setting a W procedure on an ANSI window turns it into a Unicode window: IsWindowUnicode becomes TRUE, and every text message the title posts and dispatches with the A functions is converted to Unicode for the hook. CallWindowProcW then converts it back for the title's ANSI procedure.

With a single-byte code page the round trip is lossless. With UTF-8 as the ANSI code page it is not. That is the code page of Windows' "Beta: Use Unicode UTF-8 for worldwide language support" option, or of a process whose manifest asks for it. Measured on Windows 11 with a small probe, an ANSI window with PostMessageA(WM_CHAR, byte) for each byte of "é€" (C3 A9 E2 82 AC), then DispatchMessageA:

window procedure chain the title's procedure receives
no hook c3 a9 e2 82 ac
hook set with SetWindowLongPtrW (main) 83 c3 a9 c2 a2 c3 80 e2 ac c2
hook set with SetWindowLongPtrA (this change) c3 a9 e2 82 ac

With code page 1252 all three receive the bytes unchanged. Only IsWindowUnicode differs there.

The hook now reads and sets the window procedure in the window's own character set (IsWindowUnicode), with an A and a W variant of the procedure that call the title's with CallWindowProcA/CallWindowProcW and fall back to DefWindowProcA/DefWindowProcW. A Unicode window is hooked as before.

Tested

Windows 11, MSVC 14.44 (Build Tools), RelWithDebInfo:

  • lifecycle_test gets a section 5. An ANSI class's window is created through the CreateWindowExA shim, and the test checks that it is hooked, that it stays an ANSI window, that the five WM_CHAR codes reach its procedure unchanged and in order, and that WM_SETTEXT/WM_GETTEXT still forward. A further check confirms a Unicode title window stays Unicode.
    • main: 1 of 35 checks fails (the window becomes Unicode).
    • this branch: 35 of 35 pass.
  • New lifecycle_utf8_test (MSVC only): the same source with test/utf8_codepage.manifest embedded (activeCodePage UTF-8), plus a check that GetACP() is 65001.
    • main: 2 of 36 checks fail; the title's procedure receives 83 c3 a9 c2 a2 c3 80 e2 ac c2.
    • this branch: 36 of 36 pass.
  • Full ctest -j 8 over the 170 CPU tests (no Vulkan SDK here): all pass.
  • Merges without new conflicts against every pull request that touches runtime/CMakeLists.txt, runtime/shims/lifecycle.cpp or runtime/test/lifecycle_test.cpp, including #2054.
  • scripts/check_no_game_data.py on the four files.

Not tested under Wine, where the manifest test may need Wine's own activeCodePage support.

GPUs tested: n/a (CPU tests)

AI-assisted: yes (Claude Code, Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5511678592 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2344). Originally posted by [syfyra](https://github.com/syfyra) on 2026-11-26T14:18:23Z. --- Claimed in the coordination issue as: LIFECYCLE-ANSI-SUBCLASS ### What and why `runtime/shims/lifecycle.cpp` subclasses the title's first top-level window so `SC_CLOSE` runs the suspend callbacks. It always did so with `GetWindowLongPtrW`/`SetWindowLongPtrW`. The retail title creates its window with `CreateWindowExA` (its import table names it from the `-ansi-` window set), which makes an ANSI window when the class was registered with the A function too; the title's class registration is not recorded in `docs/`, so whether the retail window is ANSI is not measured here. Setting a W procedure on an ANSI window turns it into a Unicode window: `IsWindowUnicode` becomes `TRUE`, and every text message the title posts and dispatches with the A functions is converted to Unicode for the hook. `CallWindowProcW` then converts it back for the title's ANSI procedure. With a single-byte code page the round trip is lossless. With UTF-8 as the ANSI code page it is not. That is the code page of Windows' "Beta: Use Unicode UTF-8 for worldwide language support" option, or of a process whose manifest asks for it. Measured on Windows 11 with a small probe, an ANSI window with `PostMessageA(WM_CHAR, byte)` for each byte of "é€" (`C3 A9 E2 82 AC`), then `DispatchMessageA`: | window procedure chain | the title's procedure receives | |---|---| | no hook | `c3 a9 e2 82 ac` | | hook set with `SetWindowLongPtrW` (`main`) | `83 c3 a9 c2 a2 c3 80 e2 ac c2` | | hook set with `SetWindowLongPtrA` (this change) | `c3 a9 e2 82 ac` | With code page 1252 all three receive the bytes unchanged. Only `IsWindowUnicode` differs there. The hook now reads and sets the window procedure in the window's own character set (`IsWindowUnicode`), with an A and a W variant of the procedure that call the title's with `CallWindowProcA`/`CallWindowProcW` and fall back to `DefWindowProcA`/`DefWindowProcW`. A Unicode window is hooked as before. ### Tested Windows 11, MSVC 14.44 (Build Tools), RelWithDebInfo: - `lifecycle_test` gets a section 5. An ANSI class's window is created through the `CreateWindowExA` shim, and the test checks that it is hooked, that it stays an ANSI window, that the five `WM_CHAR` codes reach its procedure unchanged and in order, and that `WM_SETTEXT`/`WM_GETTEXT` still forward. A further check confirms a Unicode title window stays Unicode. - `main`: 1 of 35 checks fails (the window becomes Unicode). - this branch: 35 of 35 pass. - New `lifecycle_utf8_test` (MSVC only): the same source with `test/utf8_codepage.manifest` embedded (`activeCodePage` UTF-8), plus a check that `GetACP()` is 65001. - `main`: 2 of 36 checks fail; the title's procedure receives `83 c3 a9 c2 a2 c3 80 e2 ac c2`. - this branch: 36 of 36 pass. - Full `ctest -j 8` over the 170 CPU tests (no Vulkan SDK here): all pass. - Merges without new conflicts against every pull request that touches `runtime/CMakeLists.txt`, `runtime/shims/lifecycle.cpp` or `runtime/test/lifecycle_test.cpp`, including #2054. - `scripts/check_no_game_data.py` on the four files. Not tested under Wine, where the manifest test may need Wine's own `activeCodePage` support. GPUs tested: n/a (CPU tests) AI-assisted: yes (Claude Code, Claude Opus 5.5) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lixonik commented 2026-11-26 15:37:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T15:37:24Z.

Review: COMMENTED


Built lifecycle_test with MSVC on Windows 11. The CTest run passed and exercised both ANSI and Unicode windows. The hooked ANSI window stayed ANSI, received the original WM_CHAR values in order and forwarded WM_SETTEXT/WM_GETTEXT. No findings.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6076879482 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2344#pullrequestreview-6076879482). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-26T15:37:24Z. **Review:** COMMENTED --- Built `lifecycle_test` with MSVC on Windows 11. The CTest run passed and exercised both ANSI and Unicode windows. The hooked ANSI window stayed ANSI, received the original WM_CHAR values in order and forwarded WM_SETTEXT/WM_GETTEXT. No findings. AI-assisted.
fiestorra commented 2026-11-30 11:10:25 +00:00 (Migrated from github.com)

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


Independent verification on this machine (Windows 11, MSVC 19.44.35226): the test this branch adds is registered with no command, so ctest reports it as "Not Run" - and it turns a two-test target into a red one.

1. It applies and builds. merge-tree clean onto main d367675c7; lifecycle_test links ([3/3] Linking CXX executable lifecycle_test.exe, built at 12:09:30 during this run - the binary is not stale).

2. Running the target's two tests:

50% tests passed, 1 tests failed out of 2
111 - lifecycle_utf8 (Not Run)

3. Why, from ctest --show-only=json-v1:

lifecycle:       cmd = …\lifecycle_test.exe
lifecycle_utf8:  cmd = (empty)          <- this is the new test

lifecycle_utf8 is the test this pull request adds, and its command is empty, so CTest has a test with nothing to run. lifecycle - the pre-existing one - resolves normally and passes.

4. This is the fourth pull request in the queue with the same defect, and main has none of them in its 546 tests:

PR test with an empty command
#1182 vk_sparse_queue_order
#1242 win32_env, win32_env_override
#1419 d3d12_skip_compute_{unset,one,all}
#2344 lifecycle_utf8

The cost in each case is the same and double: the test never runs, and ctest counts Not Run as a failure - so the branch turns the suite red while testing nothing.

The likely fix, and it is one line: add_test(NAME lifecycle_utf8 COMMAND lifecycle_test …) resolves only if lifecycle_test is visible in the same directory scope at that point; $<TARGET_FILE:lifecycle_test> always resolves, and so does moving the add_test next to its add_executable.

What I did not test: whether the UTF-8 case itself passes once it runs - that needs the registration fixed first, and I did not add it locally to find out, because the fix belongs to the author.

Why I am commenting: I verify open pull requests that replay onto current main, build the binaries their tests name, and run them. A Not Run is the one result that looks like a failure and is really an unfinished registration.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7276641366 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2344#issuecomment-7276641366). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T11:10:25Z. --- Independent verification on this machine (Windows 11, MSVC 19.44.35226): **the test this branch adds is registered with no command, so `ctest` reports it as "Not Run" - and it turns a two-test target into a red one.** **1. It applies and builds.** `merge-tree` clean onto `main` `d367675c7`; `lifecycle_test` links (`[3/3] Linking CXX executable lifecycle_test.exe`, built at 12:09:30 during this run - **the binary is not stale**). **2. Running the target's two tests:** ``` 50% tests passed, 1 tests failed out of 2 111 - lifecycle_utf8 (Not Run) ``` **3. Why, from `ctest --show-only=json-v1`:** ``` lifecycle: cmd = …\lifecycle_test.exe lifecycle_utf8: cmd = (empty) <- this is the new test ``` **`lifecycle_utf8` is the test this pull request adds**, and its `command` is empty, so CTest has a test with nothing to run. `lifecycle` - the pre-existing one - resolves normally and passes. **4. This is the fourth pull request in the queue with the same defect**, and `main` has none of them in its 546 tests: | PR | test with an empty command | |---|---| | #1182 | `vk_sparse_queue_order` | | #1242 | `win32_env`, `win32_env_override` | | #1419 | `d3d12_skip_compute_{unset,one,all}` | | **#2344** | **`lifecycle_utf8`** | **The cost in each case is the same and double:** the test **never runs**, and `ctest` counts `Not Run` as a **failure** - so the branch turns the suite red while testing nothing. **The likely fix, and it is one line:** `add_test(NAME lifecycle_utf8 COMMAND lifecycle_test …)` resolves only if `lifecycle_test` is visible in the same directory scope at that point; **`$<TARGET_FILE:lifecycle_test>` always resolves**, and so does moving the `add_test` next to its `add_executable`. **What I did not test:** whether the UTF-8 case itself passes once it runs - **that needs the registration fixed first**, and I did not add it locally to find out, because the fix belongs to the author. **Why I am commenting:** I verify open pull requests that replay onto current `main`, build the binaries their tests name, and run them. **A `Not Run` is the one result that looks like a failure and is really an unfinished registration.** Written with an AI assistant.
fiestorra commented 2026-11-30 11:11:24 +00:00 (Migrated from github.com)

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


Follow-up with the extra evidence, because the cause is not what I first implied: the target exists, builds, and the registration is shaped exactly like its working sibling.

cmake --build … --target lifecycle_utf8_test   -> [4/4] Linking CXX executable lifecycle_utf8_test.exe
cmake --build … --target lifecycle_test        -> [3/3] Linking CXX executable lifecycle_test.exe
ctest --show-only=json-v1:
  lifecycle       cmd = …\lifecycle_test.exe
  lifecycle_utf8  cmd = (empty)

So $<TARGET_FILE:…> would fix the symptom, and so would whatever makes the sibling work - but the sibling is not different in the way I assumed. Here is the whole structural difference, side by side:

  # L433 - unconditional, inside the WIN32 block
  add_executable(lifecycle_test test/lifecycle_test.cpp shims/lifecycle.cpp shims/registry.cpp)

  if(MSVC)                                    # L443
    # L446 - inside a conditional
    add_executable(lifecycle_utf8_test
      test/lifecycle_test.cpp test/utf8_codepage.manifest shims/lifecycle.cpp shims/registry.cpp)
  endif()                                     # L457

  if(WIN32 AND TARGET lifecycle_test)         # L1623
    add_test(NAME lifecycle COMMAND lifecycle_test)
  endif()
  if(WIN32 AND TARGET lifecycle_utf8_test)    # L1626
    add_test(NAME lifecycle_utf8 COMMAND lifecycle_utf8_test)   # <- empty command
  endif()

The only difference I can find is that lifecycle_utf8_test is created inside if(MSVC) while its add_test sits outside that block. Both guards pass on this machine (MSVC 19.44.35226), the target exists and links, and the manifest it references (test/utf8_codepage.manifest) is present.

I am not going to assert that the if(MSVC) is the cause - I could not reproduce a minimal case for it, and CMake's target scoping in add_test is not something I want to guess about. What is proven: target builds, file exists, guard passes, and CTest still has the test with no command. What would settle it in one edit: move the add_test(NAME lifecycle_utf8 …) inside the if(MSVC) block, or use $<TARGET_FILE:lifecycle_utf8_test>; either change is one line and the author can test both.

Why this matters beyond this pull request: four pull requests in the queue have a test with an empty command (#1182, #1242, #1419, #2344) and main has none. If the if() placement is the shared cause, one contiguous edit fixes all four - and if it is not, knowing that saves the next person from trying it.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7276664611 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2344#issuecomment-7276664611). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T11:11:24Z. --- **Follow-up with the extra evidence, because the cause is not what I first implied: the target exists, builds, and the registration is shaped exactly like its working sibling.** ``` cmake --build … --target lifecycle_utf8_test -> [4/4] Linking CXX executable lifecycle_utf8_test.exe cmake --build … --target lifecycle_test -> [3/3] Linking CXX executable lifecycle_test.exe ctest --show-only=json-v1: lifecycle cmd = …\lifecycle_test.exe lifecycle_utf8 cmd = (empty) ``` So `$<TARGET_FILE:…>` would fix the symptom, **and so would whatever makes the sibling work** - but the sibling is not different in the way I assumed. Here is the whole structural difference, side by side: ```cmake # L433 - unconditional, inside the WIN32 block add_executable(lifecycle_test test/lifecycle_test.cpp shims/lifecycle.cpp shims/registry.cpp) if(MSVC) # L443 # L446 - inside a conditional add_executable(lifecycle_utf8_test test/lifecycle_test.cpp test/utf8_codepage.manifest shims/lifecycle.cpp shims/registry.cpp) endif() # L457 if(WIN32 AND TARGET lifecycle_test) # L1623 add_test(NAME lifecycle COMMAND lifecycle_test) endif() if(WIN32 AND TARGET lifecycle_utf8_test) # L1626 add_test(NAME lifecycle_utf8 COMMAND lifecycle_utf8_test) # <- empty command endif() ``` **The only difference I can find is that `lifecycle_utf8_test` is created inside `if(MSVC)` while its `add_test` sits outside that block.** Both guards pass on this machine (MSVC 19.44.35226), the target exists and links, and the manifest it references (`test/utf8_codepage.manifest`) is present. **I am not going to assert that the `if(MSVC)` is the cause** - I could not reproduce a minimal case for it, and CMake's target scoping in `add_test` is not something I want to guess about. **What is proven:** target builds, file exists, guard passes, and CTest still has the test with no command. **What would settle it in one edit:** move the `add_test(NAME lifecycle_utf8 …)` **inside** the `if(MSVC)` block, or use `$<TARGET_FILE:lifecycle_utf8_test>`; either change is one line and the author can test both. **Why this matters beyond this pull request:** **four pull requests in the queue have a test with an empty command** (#1182, #1242, #1419, #2344) and `main` has none. **If the `if()` placement is the shared cause, one contiguous edit fixes all four** - and if it is not, knowing that saves the next person from trying it. Written with an AI assistant.
fiestorra commented 2026-11-30 11:12:09 +00:00 (Migrated from github.com)

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


I tested both fixes on this machine, and both make the command resolve. Here are the results, so the author does not have to run the experiment.

Baseline (the branch as it is):

lifecycle_utf8  cmd = (empty)          <- registered, "Not Run"

Variant 1 - generator expression, nothing moved:

add_test(NAME lifecycle_utf8 COMMAND $<TARGET_FILE:lifecycle_utf8_test>)
lifecycle_utf8  cmd = …\runtime\build-ninja\lifecycle_utf8_test.exe      <- resolves

Variant 2 - move the add_test inside the block that creates the executable:

    add_executable(lifecycle_utf8_test …)          # inside if(MSVC)
    …
    if(WIN32)
      add_test(NAME lifecycle_utf8 COMMAND lifecycle_utf8_test)
    endif()
lifecycle_utf8  cmd = …\runtime\build-ninja\lifecycle_utf8_test.exe      <- resolves

So the cause is the placement relative to the conditional: the same add_test line, with the same target name, resolves once it is inside the block that created the target, and does not resolve when it is 1400 lines below it and outside that block. Variant 2 is the more informative of the two: it shows the target name alone is enough when the registration sits in the same scope, which is what I could not establish by reading.

What I did not do: decide which variant the author should take. Variant 1 is the smaller diff and cannot be affected by scope at all; variant 2 keeps the file's existing style (every other test registers where its executable is defined, as far as the blocks I looked at).

And the part that may help the other three: #1182, #1242 and #1419 have the same symptom - a test with an empty command, main has none. If their add_test lines are also separated from their add_executable by a conditional, one contiguous edit fixes all four. I have not checked those three blocks, so treat that as the next thing to look at rather than a conclusion.

How this was measured: applied the branch to main d367675c7, made one edit, re-ran cmake -S runtime -B …, read ctest --show-only=json-v1, reverted the edit. Nothing was pushed - both edits were local to a scratch worktree.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7276684209 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2344#issuecomment-7276684209). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T11:12:09Z. --- **I tested both fixes on this machine, and both make the command resolve. Here are the results, so the author does not have to run the experiment.** **Baseline (the branch as it is):** ``` lifecycle_utf8 cmd = (empty) <- registered, "Not Run" ``` **Variant 1 - generator expression, nothing moved:** ```cmake add_test(NAME lifecycle_utf8 COMMAND $<TARGET_FILE:lifecycle_utf8_test>) ``` ``` lifecycle_utf8 cmd = …\runtime\build-ninja\lifecycle_utf8_test.exe <- resolves ``` **Variant 2 - move the `add_test` inside the block that creates the executable:** ```cmake add_executable(lifecycle_utf8_test …) # inside if(MSVC) … if(WIN32) add_test(NAME lifecycle_utf8 COMMAND lifecycle_utf8_test) endif() ``` ``` lifecycle_utf8 cmd = …\runtime\build-ninja\lifecycle_utf8_test.exe <- resolves ``` **So the cause is the placement relative to the conditional**: the same `add_test` line, with the same target name, resolves once it is inside the block that created the target, and does not resolve when it is 1400 lines below it and outside that block. **Variant 2 is the more informative of the two**: it shows the target name alone is enough **when the registration sits in the same scope**, which is what I could not establish by reading. **What I did not do:** decide which variant the author should take. **Variant 1 is the smaller diff and cannot be affected by scope at all; variant 2 keeps the file's existing style** (every other test registers where its executable is defined, as far as the blocks I looked at). **And the part that may help the other three:** **#1182, #1242 and #1419 have the same symptom** - a test with an empty command, `main` has none. **If their `add_test` lines are also separated from their `add_executable` by a conditional, one contiguous edit fixes all four.** **I have not checked those three blocks**, so treat that as the next thing to look at rather than a conclusion. **How this was measured:** applied the branch to `main` `d367675c7`, made one edit, re-ran `cmake -S runtime -B …`, read `ctest --show-only=json-v1`, reverted the edit. **Nothing was pushed** - both edits were local to a scratch worktree. Written with an AI assistant.
fiestorra commented 2026-11-30 11:17:49 +00:00 (Migrated from github.com)

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


Correction, and it retracts the defect: lifecycle_utf8 is not registered with an empty command. The empty command came from reading the manifest before building that executable.

The mechanism, measured here:

fresh build directory, nothing built           -> 546 of 573 tests have an empty command
build ONE target (win32_env_test)              -> 544 empty; that target's two tests now resolve
build nothing else                             -> the rest stay empty

add_test(NAME lifecycle_utf8 COMMAND lifecycle_utf8_test) writes the target name into the test file; CTest substitutes the executable's path only once that executable exists. When I read the manifest I had built lifecycle_test (because I was chasing the sibling) and not lifecycle_utf8_test - which is exactly why one resolved and the other did not.

And my two "fixes" were not fixes: $<TARGET_FILE:…> resolves at configure time into a literal path, so it bypasses the build state; moving the add_test inside if(MSVC) changed which configure I compared against, not the cause. Both made the empty value go away without touching anything real - which should have made me suspicious, and did not.

So the whole "empty command" family was mine: four pull requests (#1182, #1242, #1419, #2344) reported with a defect none of them has. Two were withdrawn earlier today for a stale manifest; the other two are withdrawn now.

What the correct method is, and it is embarrassingly simple: build the test's target first, then read the manifest.

What still stands for this pull request: it applies to main d367675c7, lifecycle_test and lifecycle_utf8_test both build, and with both built the tests resolve - I will re-run the pair and report the result rather than the registration.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7276826180 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2344#issuecomment-7276826180). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T11:17:49Z. --- **Correction, and it retracts the defect: `lifecycle_utf8` is not registered with an empty command. The empty command came from reading the manifest before building that executable.** **The mechanism, measured here:** ``` fresh build directory, nothing built -> 546 of 573 tests have an empty command build ONE target (win32_env_test) -> 544 empty; that target's two tests now resolve build nothing else -> the rest stay empty ``` **`add_test(NAME lifecycle_utf8 COMMAND lifecycle_utf8_test)` writes the target **name** into the test file; CTest substitutes the executable's **path** only once that executable exists.** When I read the manifest I had built `lifecycle_test` (because I was chasing the sibling) and **not** `lifecycle_utf8_test` - which is exactly why one resolved and the other did not. **And my two "fixes" were not fixes:** `$<TARGET_FILE:…>` resolves at **configure** time into a literal path, so it bypasses the build state; moving the `add_test` **inside `if(MSVC)`** changed which configure I compared against, not the cause. **Both made the empty value go away without touching anything real** - which should have made me suspicious, and did not. **So the whole "empty command" family was mine:** four pull requests (#1182, #1242, #1419, #2344) reported with a defect none of them has. **Two were withdrawn earlier today for a stale manifest; the other two are withdrawn now.** **What the correct method is, and it is embarrassingly simple: build the test's target first, then read the manifest.** **What still stands for this pull request:** it applies to `main` `d367675c7`, `lifecycle_test` and `lifecycle_utf8_test` both build, and **with both built the tests resolve** - I will re-run the pair and report the result rather than the registration. Written with an AI assistant.
fiestorra commented 2026-11-30 11:20:08 +00:00 (Migrated from github.com)

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


After withdrawing my registration claim, here is the verification that one was standing in for: the change is covered by its own tests, and the control bites on both.

1. It applies and builds. merge-tree clean onto main d367675c7. Two executables built for this run:

cmake --build … --target lifecycle_test lifecycle_utf8_test
[6/6] Linking CXX executable lifecycle_utf8_test.exe

2. With the branch, both tests pass:

ctest -R '^lifecycle'
100% tests passed, 0 tests failed out of 2

lifecycle_utf8 runs - the "Not Run" I reported earlier was the manifest read before this binary existed, and I have retracted it above.

3. The control - revert only the shim, keep both tests, rebuild both:

git checkout origin/main -- runtime/shims/lifecycle.cpp
cmake --build … --target lifecycle_test lifecycle_utf8_test
ctest -R '^lifecycle' --output-on-failure
0% tests passed, 2 tests failed out of 2
FAIL the hooked ANSI title window stays an ANSI window      (x2: one per executable)

Both executables fail, with the same sentence, and that sentence is the change: a window the title hooked as ANSI must stay an ANSI window - the branch's subclassing keeps that property, main's lets it flip. The fact that the identical assertion fails in both the ANSI and the UTF-8 process is the point of the second executable: the same code path, a different active code page.

What I did not test: the other lifecycle paths the shim covers (RegisterAppStateChangeNotification, oversized-window fitting), and the GPU-side title behaviour.

Summary for this pull request, after the retraction:

check result
applies onto main d367675c7 clean
both test executables build yes
both tests 2/2 pass
control: shim reverted 2/2 fail, message names the change

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7276879574 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2344#issuecomment-7276879574). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T11:20:08Z. --- **After withdrawing my registration claim, here is the verification that one was standing in for: the change is covered by its own tests, and the control bites on both.** **1. It applies and builds.** `merge-tree` clean onto `main` `d367675c7`. Two executables built for this run: ``` cmake --build … --target lifecycle_test lifecycle_utf8_test [6/6] Linking CXX executable lifecycle_utf8_test.exe ``` **2. With the branch, both tests pass:** ``` ctest -R '^lifecycle' 100% tests passed, 0 tests failed out of 2 ``` **`lifecycle_utf8` runs** - the "Not Run" I reported earlier was the manifest read before this binary existed, and I have retracted it above. **3. The control - revert only the shim, keep both tests, rebuild both:** ``` git checkout origin/main -- runtime/shims/lifecycle.cpp cmake --build … --target lifecycle_test lifecycle_utf8_test ctest -R '^lifecycle' --output-on-failure 0% tests passed, 2 tests failed out of 2 FAIL the hooked ANSI title window stays an ANSI window (x2: one per executable) ``` **Both executables fail, with the same sentence**, and that sentence is the change: a window the title hooked as ANSI must **stay** an ANSI window - the branch's subclassing keeps that property, `main`'s lets it flip. **The fact that the identical assertion fails in both the ANSI and the UTF-8 process is the point of the second executable**: the same code path, a different active code page. **What I did not test:** the other lifecycle paths the shim covers (`RegisterAppStateChangeNotification`, oversized-window fitting), and the GPU-side title behaviour. **Summary for this pull request, after the retraction:** | check | result | |---|---| | applies onto `main` `d367675c7` | clean | | both test executables build | yes | | both tests | **2/2 pass** | | **control: shim reverted** | **2/2 fail, message names the change** | Written with an AI assistant.
aslan2142 commented 2026-12-01 12:30:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:30:46Z.


Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.

(AI-assisted triage.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7311237336 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2344#issuecomment-7311237336). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T12:30:46Z. --- Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. *(AI-assisted triage.)*
aslan2142 commented 2026-12-01 16:44:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:44:05Z.


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:7318126348 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2344#issuecomment-7318126348). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:44:05Z. --- 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!2344
No description provided.