Skip to content

xgameruntime: forward XAsyncBeginAlloc and XTaskQueueIsEmpty to xtaskqueue (OLD-9917) - #1145

Closed
ambroseautomation wants to merge 1 commit into
ProjectLeonida:mainfrom
ambroseautomation:carry/old-9917-xasync-begin-alloc
Closed

ambroseautomation wants to merge 1 commit into
ProjectLeonida:mainfrom
ambroseautomation:carry/old-9917-xasync-begin-alloc

Conversation

@ambroseautomation

Copy link
Copy Markdown

Claimed in the coordination issue as: OLD-9917 (#14 (comment))

What and why

Carries forward old-pr/9917 (draft #185, originally authored by tedin7, commit author preserved; indexed in #17), rebased cleanly onto current main.

Replaces the two private stubs in XThreadingImpl (runtime/shims/xgameruntime.cpp) with direct forwarding to the vendored xtaskqueue implementations:

  • Slot 8 (XAsyncBeginAlloc): forwards to XAsyncBeginAlloc from XAsyncProviderPriv.h, allocating and copying the provider context/parameter block and invoking XAsyncOp::Begin.
  • Slot 28 (XTaskQueueIsEmpty): forwards to XTaskQueueIsEmpty from XTaskQueuePriv.h, taking (queue, port) instead of returning a stub 0.
  • Updates docs/runtime_imports.md to record XTaskQueueIsEmpty's (queue, port) signature and extends runtime/test/xgameruntime_test.cpp to verify both slots end-to-end.

Tested

  • Compiled and ran xgameruntime_test.exe natively on Windows 11 with MSVC (/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2): xgameruntime_test: OK (163 checks).
  • python -I tests/test_docs_links.py: 16 tests, OK.
  • python -I scripts/check_no_game_data.py docs/runtime_imports.md runtime/shims/xgameruntime.cpp runtime/test/xgameruntime_test.cpp: exit 0 (no game data).

GPUs tested: n/a (CPU/OS runtime shim; built and tested on Windows 11 Pro 64-bit, MSVC VS 18)

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. (n/a — xgameruntime shim)

…ty are forwarded to the real task queue

Squashed from ItsNotRexed/Leonida#8588 by tedin7, head e09f0a9bd (security scan PASS).

Applied as the PR's own diff (gh pr diff); head matches the watcher's scan. xgameruntime_test keeps Wave 1's per-thread time-sensitive flag checks (#7957); the old slot-8 comment that preceded this PR's new slot-8 test is dropped.

@abnalstlll-byte abnalstlll-byte 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.

Reviewed and verified. Replaces non-functional stubs for slot 8 (XAsyncBeginAlloc) and slot 28 (XTaskQueueIsEmpty) in runtime/shims/xgameruntime.cpp with direct forwarding to vendored xtaskqueue implementations. Tested end-to-end with xgameruntime_test.exe (163/163 checks PASS). 100% clean-room.

@madhyn

madhyn commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Tested 877b6d234 on Arch Linux + Wine 11.22 (clang-cl + xwin cross-build):

  • ctest --test-dir runtime/build/win -R "^xgameruntime$" --output-on-failure: Passed (5.32 s)

AI-assisted: yes

@Deedlyy

Deedlyy commented Nov 24, 2026

Copy link
Copy Markdown

Recommendation: [MERGE]

Reasoning: Carries #185: XThreadingImpl slots 8 and 28 forward to the vendored xtaskqueue XAsyncBeginAlloc/XTaskQueueIsEmpty instead of private stubs. Net code reduction with test coverage. Verified on Wine by madhyn. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 4/10

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