Tests: seven runtime tests say what Wine's libraries answer and still check the shim (TEST-WINE-RUNTIME-TESTS) #983

Closed
milk4sale wants to merge 4 commits from upstream-pr/983 into main
milk4sale commented 2026-11-24 16:23:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by milk4sale on 2026-11-24T16:23:48Z.


Claimed in the coordination issue as: TEST-WINE-RUNTIME-TESTS (claim)

What and why

Seven runtime tests (six test programs) fail under Wine on what Wine's own libraries do, not on the shim or the loader they are there to check. Each now says what the host did and still checks our side where it can, as #519 did for the D3D12 and DXGI tests.

Test What happens under Wine on main With this change
bcrypt_rng, bcrypt_rng_seeded The shim hands back the host's status for an algorithm it does not serve. Wine's bcrypt answers 0xC0000002 for an unknown name, Microsoft's answers STATUS_NOT_FOUND, and the test expects the second. The test asks the host's BCryptOpenAlgorithmProvider directly and checks that the shim returns the same failure with a null handle. The value itself is still checked wherever the host is not Wine.
gameinput_host Wine's GameInput.dll loads, and its GameInputCreate answers E_NOTIMPL: 3 failures. The import binding is still checked. The calls into the library are skipped only when the host is Wine and its GameInputCreate, asked before anything is mapped, answers E_NOTIMPL.
root_sig Wine's deserializer refuses a container whose checksum is zeroed (E_INVALIDARG) and takes the same one with its checksum intact. The shim forwards the cleared copy, so it cannot succeed there. The host is asked about the cleared copy directly. Wine's refusal, and only Wine's, skips that one check.
run_startup_cmdline The native control fails: Wine's ucrtbase has __argc, __argv and __wargv set before process attach, and the fixture expects them unset there, as on Windows. When the control runs through an emulator (RUNNER set) it is reported and not required. Without one it is required as before. The run through gta6rt is checked on every host, and passes.
dstorage the copy reached the guard page and a running request is pending fail. The one-page allocation can land right above the queue worker's stack, and Wine drops the guard of a page that starts at the reading thread's StackBase without raising anything. One page higher the exception arrives. The guard page is the middle one of three, on every host. No host check.
xmem 2 failures. The first write to a SEC_RESERVE view goes through with no fault and VirtualQuery keeps reporting MEM_RESERVE, so xmem's first-touch handler never runs. Under Wine the page is committed with rt::xmem::commit_physical_range, the call the runtime makes before it imports title memory, and the bytes written before must still be there. On Windows the first touch has to have committed it, as before.

runtime/test/host_wine.h gets is_wine(), the host check with nothing printed; host_is_wine() calls it and behaves as before. docs/linux.md gets a section listing these differences, plus the two that still fail tests (file_system, device_proxy), and docs/testing.md points to it. Tests and docs only: no shim, loader or layer change.

Not in this pull request: file_system (a real shim difference under Wine, posted as a finding), device_proxy and device_proxy_trace (BL-2, #913), and the eight tests of #519. This shares no file with #519 and does not depend on it.

Tested

Cross-built on Linux with clang-cl 23.1.4 and xwin (SDK 10.0.26100), run under wine-staging 11.21.

  • The seven tests on this branch, on main cf4c00cba: all pass, with these SKIP lines: the unknown-algorithm value (2), the calls into GameInput.dll (1), the zero-checksum deserializer check (1), the first-touch commit (2), the native control for args and no_args (2). The branch was then rebased on 98a977b4b, two merges later, which touch only vk_store_test and shader fixtures; not rebuilt after that.
  • Control for the path Windows takes: with is_wine() forced to false and the four programs that use it rebuilt, bcrypt_rng, bcrypt_rng_seeded, gameinput_host, root_sig and xmem fail with the same eight FAIL lines they print on main (1 + 1, 3, 1 and 2). dstorage has no host check, and run_startup_cmdline keys on RUNNER, not on Wine.
  • The whole suite (301 tests run), ctest -j 4, on main 1504c1af6: 17 fail with this change. A run of the same tree with the seven files at main's versions gave 25. The seven go from failed to passed in that comparison. The two runs were not equally quiet: the machine was busy with other jobs during the second (load average above 40), and five more results differ between them: run_tiny_frame, run_tiny_frame_queue_test_settings and d3d12_queue_wait_timeout failed only in the base run, and d3d12_xdxr_rt timed out (so d3d12_xdxr_rt_check did not run) only in the patched one. None of those five uses a program that was rebuilt between the runs, so I count them as timing noise, not as an effect of the change. Without that pair the 15 still failing here are device_proxy, device_proxy_trace, file_system, d3d12_clear, d3d12_clear_formats, d3d12_present, xbox_present (a tiling compositor resizes their window) and the eight of #519.
  • The twelve tests/test_docs_*.py, python -I scripts/check_no_game_data.py on the nine files, and git diff --check.
  • After the merge of main 4a50cafc7 into the branch (e8ea3fa0c; it conflicted with #758 in root_sig_test.cpp): rebuilt, and the seven tests pass under Wine. #758's new check, that the versioned deserializer shim accepts a zero-checksum blob, is kept next to the legacy one and asks Wine's host the same way, since the versioned shim forwards the same cleared copy and Wine refuses a zero checksum there too; root_sig prints one more SKIP line for it. With the Wine check forced off in that file both zero-checksum checks run, so on Windows #758's check runs as it was written.

Not run on Windows, and not built with MSVC: I have neither here. On Windows is_wine() is false and RUNNER is empty, so each test takes the path it took before, except dstorage, whose guard page moves inside a three-page allocation on every host, and bcrypt_rng, which also compares the shim's status with the host's.

GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 620.70.06, Linux (CachyOS), through wine-staging 11.21

AI-assisted: yes

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.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5476101176 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/983). Originally posted by [milk4sale](https://github.com/milk4sale) on 2026-11-24T16:23:48Z. --- Claimed in the coordination issue as: TEST-WINE-RUNTIME-TESTS ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135606065)) ### What and why Seven runtime tests (six test programs) fail under Wine on what Wine's own libraries do, not on the shim or the loader they are there to check. Each now says what the host did and still checks our side where it can, as #519 did for the D3D12 and DXGI tests. | Test | What happens under Wine on `main` | With this change | |---|---|---| | `bcrypt_rng`, `bcrypt_rng_seeded` | The shim hands back the host's status for an algorithm it does not serve. Wine's bcrypt answers `0xC0000002` for an unknown name, Microsoft's answers `STATUS_NOT_FOUND`, and the test expects the second. | The test asks the host's `BCryptOpenAlgorithmProvider` directly and checks that the shim returns the same failure with a null handle. The value itself is still checked wherever the host is not Wine. | | `gameinput_host` | Wine's `GameInput.dll` loads, and its `GameInputCreate` answers `E_NOTIMPL`: 3 failures. | The import binding is still checked. The calls into the library are skipped only when the host is Wine and its `GameInputCreate`, asked before anything is mapped, answers `E_NOTIMPL`. | | `root_sig` | Wine's deserializer refuses a container whose checksum is zeroed (`E_INVALIDARG`) and takes the same one with its checksum intact. The shim forwards the cleared copy, so it cannot succeed there. | The host is asked about the cleared copy directly. Wine's refusal, and only Wine's, skips that one check. | | `run_startup_cmdline` | The native control fails: Wine's `ucrtbase` has `__argc`, `__argv` and `__wargv` set before process attach, and the fixture expects them unset there, as on Windows. | When the control runs through an emulator (`RUNNER` set) it is reported and not required. Without one it is required as before. The run through `gta6rt` is checked on every host, and passes. | | `dstorage` | `the copy reached the guard page` and `a running request is pending` fail. The one-page allocation can land right above the queue worker's stack, and Wine drops the guard of a page that starts at the reading thread's `StackBase` without raising anything. One page higher the exception arrives. | The guard page is the middle one of three, on every host. No host check. | | `xmem` | 2 failures. The first write to a `SEC_RESERVE` view goes through with no fault and `VirtualQuery` keeps reporting `MEM_RESERVE`, so xmem's first-touch handler never runs. | Under Wine the page is committed with `rt::xmem::commit_physical_range`, the call the runtime makes before it imports title memory, and the bytes written before must still be there. On Windows the first touch has to have committed it, as before. | `runtime/test/host_wine.h` gets `is_wine()`, the host check with nothing printed; `host_is_wine()` calls it and behaves as before. `docs/linux.md` gets a section listing these differences, plus the two that still fail tests (`file_system`, `device_proxy`), and `docs/testing.md` points to it. Tests and docs only: no shim, loader or layer change. Not in this pull request: `file_system` (a real shim difference under Wine, posted as a [finding](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135606714)), `device_proxy` and `device_proxy_trace` (BL-2, #913), and the eight tests of #519. This shares no file with #519 and does not depend on it. ### Tested Cross-built on Linux with clang-cl 23.1.4 and xwin (SDK 10.0.26100), run under wine-staging 11.21. - The seven tests on this branch, on `main` cf4c00cba: all pass, with these `SKIP` lines: the unknown-algorithm value (2), the calls into GameInput.dll (1), the zero-checksum deserializer check (1), the first-touch commit (2), the native control for `args` and `no_args` (2). The branch was then rebased on 98a977b4b, two merges later, which touch only `vk_store_test` and shader fixtures; not rebuilt after that. - Control for the path Windows takes: with `is_wine()` forced to `false` and the four programs that use it rebuilt, `bcrypt_rng`, `bcrypt_rng_seeded`, `gameinput_host`, `root_sig` and `xmem` fail with the same eight `FAIL` lines they print on `main` (1 + 1, 3, 1 and 2). `dstorage` has no host check, and `run_startup_cmdline` keys on `RUNNER`, not on Wine. - The whole suite (301 tests run), `ctest -j 4`, on `main` 1504c1af6: 17 fail with this change. A run of the same tree with the seven files at `main`'s versions gave 25. The seven go from failed to passed in that comparison. The two runs were not equally quiet: the machine was busy with other jobs during the second (load average above 40), and five more results differ between them: `run_tiny_frame`, `run_tiny_frame_queue_test_settings` and `d3d12_queue_wait_timeout` failed only in the base run, and `d3d12_xdxr_rt` timed out (so `d3d12_xdxr_rt_check` did not run) only in the patched one. None of those five uses a program that was rebuilt between the runs, so I count them as timing noise, not as an effect of the change. Without that pair the 15 still failing here are `device_proxy`, `device_proxy_trace`, `file_system`, `d3d12_clear`, `d3d12_clear_formats`, `d3d12_present`, `xbox_present` (a tiling compositor resizes their window) and the eight of #519. - The twelve `tests/test_docs_*.py`, `python -I scripts/check_no_game_data.py` on the nine files, and `git diff --check`. - After the merge of `main` 4a50cafc7 into the branch (`e8ea3fa0c`; it conflicted with #758 in `root_sig_test.cpp`): rebuilt, and the seven tests pass under Wine. #758's new check, that the versioned deserializer shim accepts a zero-checksum blob, is kept next to the legacy one and asks Wine's host the same way, since the versioned shim forwards the same cleared copy and Wine refuses a zero checksum there too; `root_sig` prints one more `SKIP` line for it. With the Wine check forced off in that file both zero-checksum checks run, so on Windows #758's check runs as it was written. Not run on Windows, and not built with MSVC: I have neither here. On Windows `is_wine()` is false and `RUNNER` is empty, so each test takes the path it took before, except `dstorage`, whose guard page moves inside a three-page allocation on every host, and `bcrypt_rng`, which also compares the shim's status with the host's. GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 620.70.06, Linux (CachyOS), through wine-staging 11.21 AI-assisted: yes ### 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. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
milk4sale commented 2026-11-24 20:18:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by milk4sale on 2026-11-24T20:18:38Z.


The red windows and linux-gpu-tools jobs come from main as it was when this run was created, not from this change. Their checkout step says Merge 81677234b into 98a977b4b, and 98a977b4b is older than two fixes:

  • windows: linking gta6rt.exe fails with __imp_WaitOnAddress, __imp_WakeByAddressSingle and __imp_WakeByAddressAll unresolved in leonida_xma2_decoder.lib. #877 (merged 16:58 UTC) adds synchronization to that library's link libraries.
  • linux-gpu-tools: cs_imgload_tfe and cs_imgload_d16_tfe fail (r32 sint (sint view): 64 bad, texel(5,3) = 2071). #892 (merged 17:15 UTC) corrected those two fixtures' expected TFE status.

This pull request touches none of the files #877 and #892 change, and it merges into current main (58be9cdf8) without conflict. Re-running the failed jobs would test the same old merge, so I'm not pushing just to restart CI. I haven't found a finished run of these jobs on a main that has both fixes yet.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143345550 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/983#issuecomment-7143345550). Originally posted by [milk4sale](https://github.com/milk4sale) on 2026-11-24T20:18:38Z. --- The red `windows` and `linux-gpu-tools` jobs come from `main` as it was when this run was created, not from this change. Their checkout step says `Merge 81677234b into 98a977b4b`, and `98a977b4b` is older than two fixes: - `windows`: linking `gta6rt.exe` fails with `__imp_WaitOnAddress`, `__imp_WakeByAddressSingle` and `__imp_WakeByAddressAll` unresolved in `leonida_xma2_decoder.lib`. #877 (merged 16:58 UTC) adds `synchronization` to that library's link libraries. - `linux-gpu-tools`: `cs_imgload_tfe` and `cs_imgload_d16_tfe` fail (`r32 sint (sint view): 64 bad, texel(5,3) = 2071`). #892 (merged 17:15 UTC) corrected those two fixtures' expected TFE status. This pull request touches none of the files #877 and #892 change, and it merges into current `main` (`58be9cdf8`) without conflict. Re-running the failed jobs would test the same old merge, so I'm not pushing just to restart CI. I haven't found a finished run of these jobs on a `main` that has both fixes yet. AI-assisted.
zmasi commented 2026-11-28 21:42:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:42:23Z.


#983 | head 898c1bd231 (merged cleanly with main aa918e5d9f) | ctest --test-dir runtime/build -C RelWithDebInfo -R "^(bcrypt_rng|bcrypt_rng_seeded|dstorage|gameinput_host|root_sig|run_startup_cmdline)$" --output-on-failure + python -m unittest tests/test_docs_encoding.py tests/test_docs_repo_paths.py | native Windows 11 control: hostwine::is_wine() == false and empty RUNNER keep every native Windows assertion active (host BCryptOpenAlgorithmProvider STATUS_NOT_FOUND parity, live GameInput.dll binding + calls, zero-checksum deserializer checks, native UCRT startup control, and three-page dstorage guard-page copy hold) | green on PR+main: 6/6 native Windows 11 MSVC CTests pass (bcrypt_rng, bcrypt_rng_seeded, dstorage, gameinput_host, root_sig, run_startup_cmdline) with 0 skips; test_docs_encoding.py, test_docs_repo_paths.py, and check_no_game_data.py 0 violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246211704 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/983#issuecomment-7246211704). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T21:42:23Z. --- #983 | head 898c1bd231ae122f178587107aba3701eda8730b (merged cleanly with main aa918e5d9f9e2f03e078d8f08854324890b5e176) | `ctest --test-dir runtime/build -C RelWithDebInfo -R "^(bcrypt_rng|bcrypt_rng_seeded|dstorage|gameinput_host|root_sig|run_startup_cmdline)$" --output-on-failure` + `python -m unittest tests/test_docs_encoding.py tests/test_docs_repo_paths.py` | native Windows 11 control: `hostwine::is_wine() == false` and empty `RUNNER` keep every native Windows assertion active (host `BCryptOpenAlgorithmProvider` `STATUS_NOT_FOUND` parity, live `GameInput.dll` binding + calls, zero-checksum deserializer checks, native UCRT startup control, and three-page `dstorage` guard-page copy hold) | green on PR+main: `6/6` native Windows 11 MSVC CTests pass (`bcrypt_rng`, `bcrypt_rng_seeded`, `dstorage`, `gameinput_host`, `root_sig`, `run_startup_cmdline`) with `0` skips; `test_docs_encoding.py`, `test_docs_repo_paths.py`, and `check_no_game_data.py` `0` violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes
OreoFR commented 2026-11-28 21:45:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:45:50Z.


Verified by OreoFR

  • Base: main c1ecf04ed + PR head 898c1bd23; green run in a merge package of 9 PRs, no new ctest failure vs main
  • Test: ctest -R ^(bcrypt_rng|bcrypt_rng_seeded|dstorage|gameinput_host|root_sig)$
  • Red on main: OK on main
  • Green with the PR: OK
  • Verdict: NO RED (test + docs PR for Wine: Wine branches not exercised on Windows; check_startup_cmdline.cmake only serves run_startup_cmdline, which launches gta6rt and was not run)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246253805 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/983#issuecomment-7246253805). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:45:50Z. --- **Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `898c1bd23`; green run in a merge package of 9 PRs, no new ctest failure vs main - Test: `ctest -R ^(bcrypt_rng|bcrypt_rng_seeded|dstorage|gameinput_host|root_sig)$` - Red on main: OK on main - Green with the PR: OK - Verdict: NO RED (test + docs PR for Wine: Wine branches not exercised on Windows; check_startup_cmdline.cmake only serves run_startup_cmdline, which launches gta6rt and was not run) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 commented 2026-12-01 17:21:44 +00:00 (Migrated from github.com)

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


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