Skip to content

Runtime tests: exercise XAsync callbacks across the mapped guest boundary - #1022

Merged
ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
tylerstraub:experiment/loaded-async
Nov 22, 2026
Merged

ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
tylerstraub:experiment/loaded-async

Conversation

@tylerstraub

@tylerstraub tylerstraub commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Implements the pilot proposed in #1021. Scoped TEST claim on #1006.

Add a synthetic Windows executable, tiny_async, built against the existing link-time stub. Through gta6rt --run it initializes the runtime, creates a queue, and submits a worker that returns E_ACCESSDENIED. Submission itself must return S_OK. The guest dispatches the completion, reads the operation's status from inside the callback, and checks the invocation counts and thread identities. A five-second deadline bounds the dispatch loop.

The existing registry test covers the service. This fixture also exercises import binding, host calls into the mapped image, and the guest's return call to the service. The external check requires the guest's pass marker, the loader's reported zero and a successful process exit. Windows CTest and the two Wine CI jobs invoke the same check.

Local validation. Ubuntu 26.04.1, Wine 10.0 under Xvfb. The guest was built with MinGW-w64 GCC 13. It passed 25 consecutive CTest runs with the upstream MSVC loader at dcd8ecf and 25 with our CPU-only MinGW loader at the PR base, 43d4703. The direct test passed all 21 checks with each build.

Negative controls. Direct launch encountered the stub's initialization failure. With completion dispatch withheld, one worker ran and no completion arrived. With the guest's status import deliberately bound to a stub returning E_NOTIMPL, both callbacks ran and the observer rejected the wrong result. These experimental variants stayed local.

Native and Wine validation at 924a2db. MSVC initially rejected the stub export declarations. The current head exports those SDK-declared functions through a DLL definition file. In the dedicated Windows job, the direct and mapped tests each passed ten consecutive times. With only the guest status import deliberately pointed at the failing stub, both callbacks still ran once, the guest read E_NOTIMPL, and the observer rejected it. The direct service test immediately passed all 21 checks again.

The same MSVC-built loader and guest passed the hosted Ubuntu Wine 9.0 and WineHQ 11.0 checks and ten replays on AREA52 with Wine 10.0. The fork validation branch differs from this PR head only by the workflow that runs those checks. The upstream base Windows CI job previously stopped at descriptor-test shader verification.

AI-assisted with Codex. All fixtures are synthetic. This is a CPU test.

On Windows, build the runtime in RelWithDebInfo and run ctest --test-dir runtime/build -C RelWithDebInfo -R "^run_tiny_async$" --output-on-failure. Does the work count, completion count, thread identity and observed result give you enough information to choose which stage to inspect? Maintainer feedback on that question would help decide whether to keep the fixture.

@kapitche

Copy link
Copy Markdown
Contributor

Tested 924a2db on Windows 11, MSVC 14.51, full shader toolchain: ctest 48/48 on an RTX 4080 SUPER (32.0.16.1714), including the new run_tiny_async. On an Intel UHD 770 the only failures are d3d12_vulkan_device (#962) and d3d12_descriptor's min-LOD case (filed in #634), which both fail on main too. run_tiny_async passes there as well.

@quackottu quackottu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 924a2db on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass

  • ctest -C RelWithDebInfo: 100% tests passed, 0 tests failed out of 48
  • every test program in the build passes. d3d12_vulkan_device_test and d3d12_fence_timing_test each report 3 validation errors (VUID-vkCreateDevice-ppEnabledExtensionNames-01387), but main 43d4703 shows the same: the standalone instance drops VK_KHR_surface, which #1027 fixes. Not from this PR.
  • d3d12_clear_test differs from WARP exactly as on main (#521).

Implicit Vulkan layers (overlays) were off through an empty VK_IMPLICIT_LAYER_PATH.

@tylerstraub
tylerstraub force-pushed the experiment/loaded-async branch from 924a2db to cf71ee3 Compare November 22, 2026 09:43
@tylerstraub

Copy link
Copy Markdown
Contributor Author

Rebased this draft onto e7584c52. New head cf71ee38 keeps both the existing run_tiny_game_exit_code requirement and the separate mapped-async Wine observer. The fixture and stub sources are byte-identical to 924a2db.

For the local check I cross-built the fixture with MinGW-w64 GCC 13 and used the unchanged MSVC loader from the base Runtime build. On Wine 10.0 and 11.22, the mapped guest emitted its pass marker with loader and process status 0. The existing wrong-argument stand-in printed and returned 1 on both. Native Windows and hosted Wine checks for the new head are queued.

AI-assisted. Synthetic fixtures only.

@tylerstraub

Copy link
Copy Markdown
Contributor Author

Hosted Runtime checks are complete at cf71ee38. Native Windows CTest passed all 63 tests that ran, including run_tiny_async. The dedicated mapped-async observer and the required run_tiny_game_exit_code check passed on both Ubuntu Wine 9.0 and WineHQ 11.0. The general Wine sweep logged the same 14 non-required failures on both this head and the e7584c52 base. The extra skipped CTest entry is the async test that runs via the dedicated observer. PR Runtime run · Base Runtime run

AI-assisted. Synthetic fixtures only.

@ItsNotRexed
ItsNotRexed merged commit dabd806 into ItsNotRexed:main Nov 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants