HLE: trace the XUserAddAsync completion and the create thread's next calls #10

Open
github-bot wants to merge 1 commit from github-bot/gh-10 into main AGit
Owner

@⁠Headache3318 on GitHub · 2026-12-04 10:54 UTC · original
Headache3318:xuser-gameinput-trace → main · +74 −3 · 2 files · 1 commits · open

Follows the request from issue #4 (2026-12-03T17:23Z):

A PR with the XUserAddAsync completion trace is welcome. Given the above, it would help to log the next few system calls the GameInputCreate thread makes after it returns too, since that thread seems to stop there.

Logging only — no behaviour change.

What it logs

XUserAddAsync completion (modules/xuser.rs): when the add provider's async block completes, one INFO line with the result it completed with (0x0) and the user handle the result branch hands back, as a number:

INFO longroad_hle::modules::xuser: XUserAddAsync: the async block completed result=0x0 handle=140721...

The GameInputCreate thread (modules/gameinput.rs): the create line now names its calling thread (thread=ThreadId(n)), and every later call that same thread makes into this module logs one INFO line — slot name, thread, timestamp — for a budget of 40 lines:

INFO longroad_hle::modules::gameinput: GameInputCreate thread=ThreadId(7)
INFO longroad_hle::modules::gameinput: gameinput call after the create call=register_device thread=ThreadId(7)

The honest scope: there is no call-time choke point to follow that thread across every layer boundary — every import binds straight to its implementation or the host at load time (HleResolver::resolve), and the only central call path is the loader's unimplemented_import stub, which sees just the unresolved imports. So this traces calls into the gameinput module from that thread; other threads' calls never spend the budget. Silence after the create then means the thread left this module — which is exactly the fork that matters for the "the thread stops there" question, and a later unimplemented import called line (already logged by the loader) names the boundary it did reach.

Reading the output

One binary runs on both sides, so read the same lines on each (console or LONGROAD_LOG_FILE, INFO is the default):

  • Windows: the create line, then the same thread's next calls — the register_device lines for the gamepad callback (the +0.4 ms registration), then whatever the thread keeps calling, until the budget ends.
  • Wine: the create line, then either the same sequence (the thread continued) or no gameinput call after the create line from that thread at all (it left this module right after the create — that's run 8's suspected stop). Cross-reference the XUserAddAsync completion line's timestamp to place the stop in the boot timeline.

Build evidence

  • cargo check -p longroad-hle (native Linux): fails on main too — longroad-gpu/longroad-loader need the Windows SDK (cargo xwin build ... --target x86_64-pc-windows-msvc is the documented route). Verified against a clean main checkout (git stash), so this PR neither fixes nor breaks it.
  • rustup target list --installed → x86_64-pc-windows-msvc present.
  • cargo check -p longroad-hle --target x86_64-pc-windows-msvc → fails only for a missing lib.exe (no MSVC tools on PATH here).
  • cargo xwin check -p longroad-hle --target x86_64-pc-windows-msvc → Checking longroad-hle v0.1.0 ... Finished dev profile ... exit 0 (repo-pinned toolchain, rustc 1.98.1; SDK fetched by cargo-xwin).
  • cargo fmt -- --check: none of the added lines show a diff (the crate's pre-existing rustfmt drift on this toolchain is untouched).

AI-assisted (Hermes Agent).

**@⁠Headache3318** on GitHub · 2026-12-04 10:54 UTC · [original](https://github.com/Lesloo/longroad/pull/10) `Headache3318:xuser-gameinput-trace` → `main` · +74 −3 · 2 files · 1 commits · open Follows the request from issue #4 (2026-12-03T17:23Z): > A PR with the `XUserAddAsync` completion trace is welcome. Given the above, it would help to log the next few system calls the `GameInputCreate` thread makes after it returns too, since that thread seems to stop there. Logging only — no behaviour change. ## What it logs **`XUserAddAsync` completion** (`modules/xuser.rs`): when the add provider's async block completes, one INFO line with the result it completed with (`0x0`) and the user handle the result branch hands back, as a number: ``` INFO longroad_hle::modules::xuser: XUserAddAsync: the async block completed result=0x0 handle=140721... ``` **The `GameInputCreate` thread** (`modules/gameinput.rs`): the create line now names its calling thread (`thread=ThreadId(n)`), and every later call that same thread makes into this module logs one INFO line — slot name, thread, timestamp — for a budget of 40 lines: ``` INFO longroad_hle::modules::gameinput: GameInputCreate thread=ThreadId(7) INFO longroad_hle::modules::gameinput: gameinput call after the create call=register_device thread=ThreadId(7) ``` The honest scope: there is no call-time choke point to follow that thread across *every* layer boundary — every import binds straight to its implementation or the host at load time (`HleResolver::resolve`), and the only central call path is the loader's `unimplemented_import` stub, which sees just the unresolved imports. So this traces calls into the gameinput module from that thread; other threads' calls never spend the budget. Silence after the create then means the thread left this module — which is exactly the fork that matters for the "the thread stops there" question, and a later `unimplemented import called` line (already logged by the loader) names the boundary it did reach. ## Reading the output One binary runs on both sides, so read the same lines on each (console or `LONGROAD_LOG_FILE`, INFO is the default): - **Windows**: the create line, then the same thread's next calls — the `register_device` lines for the gamepad callback (the `+0.4 ms` registration), then whatever the thread keeps calling, until the budget ends. - **Wine**: the create line, then either the same sequence (the thread continued) or no `gameinput call after the create` line from that thread at all (it left this module right after the create — that's run 8's suspected stop). Cross-reference the `XUserAddAsync` completion line's timestamp to place the stop in the boot timeline. ## Build evidence - `cargo check -p longroad-hle` (native Linux): fails on `main` too — `longroad-gpu`/`longroad-loader` need the Windows SDK (`cargo xwin build ... --target x86_64-pc-windows-msvc` is the documented route). Verified against a clean `main` checkout (`git stash`), so this PR neither fixes nor breaks it. - `rustup target list --installed` → `x86_64-pc-windows-msvc` present. - `cargo check -p longroad-hle --target x86_64-pc-windows-msvc` → fails only for a missing `lib.exe` (no MSVC tools on PATH here). - `cargo xwin check -p longroad-hle --target x86_64-pc-windows-msvc` → `Checking longroad-hle v0.1.0 ... Finished dev profile ... exit 0` (repo-pinned toolchain, rustc 1.98.1; SDK fetched by cargo-xwin). - `cargo fmt -- --check`: none of the added lines show a diff (the crate's pre-existing rustfmt drift on this toolchain is untouched). AI-assisted (Hermes Agent).
The GameInputCreate thread seems to stop right after the create in
bring-up runs. Log the create's calling thread, then every later call
into this module from that same thread, for a budget of 40 lines, so a
run shows how far that thread got. And log what the XUserAddAsync
provider completed with, plus the user handle it hands back.

Logging only: no behaviour change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 11:03:45 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/10/head:github-bot/gh-10'
git switch 'github-bot/gh-10'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-10'
git switch 'github-bot/gh-10'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-10'
git switch 'github-bot/gh-10'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-10'
git switch 'main'
git merge --squash 'github-bot/gh-10'
git switch 'main'
git merge --ff-only 'github-bot/gh-10'
git switch 'main'
git merge 'github-bot/gh-10'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.