Repository navigation
Conversation
…ack token GAMEINPUT_CURRENT_CALLBACK_TOKEN_VALUE (all ones) names the callback that is running on the calling thread, as the host's GameInput does (measured by @Maraco91 on GameInput 0.2309): inside a callback, UnregisterCallback(CURRENT) removes it and returns true and StopCallback(CURRENT) stops it; outside one the token names nothing and UnregisterCallback returns false. The shim compared it with registered tokens, matched none, and the callback kept firing. call() records the running token in a thread_local, restored on return, and both methods resolve the constant through it. gameinput_test drives a self-cancelling reading callback through four button changes on the virtual Xbox pad, once per method. Finding: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7115359105 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urrent-callback-9769
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Audited and verified. Implements GAMEINPUT_CURRENT_CALLBACK_TOKEN_VALUE resolution via RAII-scoped hread_local t_running_token in
untime/shims/gameinput.cpp, allowing self-stopping and self-unregistering callbacks during execution while safely ignoring calls from outside callbacks. Comprehensive unit tests in
untime/test/gameinput_test.cpp pass cleanly. Approved.
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Clean-Room Audit — PR #1095 (OLD-9769 GameInput Current-Callback Token)
Clean resolution of GAMEINPUT_CURRENT_CALLBACK_TOKEN_VALUE (0xFFFFFFFFFFFFFFFFull) in runtime/shims/gameinput.cpp via thread-local running token RAII guard, allowing StopCallback and UnregisterCallback inside active callbacks without deadlock. Covered in runtime/test/gameinput_test.cpp; 0 game data.
Verdict: APPROVED
|
Recommendation: [MERGE] Reasoning: Carries #46's GameInput fix: Impact level: 4/10 |
|
Independent verification at head
The only PR check is the Verdict: verified, looks correct. — AI-assisted verification (Devin) |
Claimed in the coordination issue as: OLD-9769 (claim).
What and why
Carry forward @Joaco9020's GameInput fix from draft #46 (old PR 9769). The rebased commit retains the original authorship and has the same stable patch ID as
84dde3f1c. The branch includes current main75223235d.A reading callback can pass
GAMEINPUT_CURRENT_CALLBACK_TOKEN_VALUEto stop or unregister itself. The shim previously compared that special value directly with the registered tokens, so the callback kept receiving events. The fix resolves it to the callback running on the calling thread and restores the previous token when a nested delivery returns.Tested
Native Windows 11 build 26100.7623, MSVC 19.44, RelWithDebInfo, pinned SDL 3.4.20, synthetic virtual pad.
3aa975421with just the new test and ABI constant: 3 of 371 checks failed, covering self-stop and self-unregister.gta6rtexecutable. In a separate local merge with gameinput: keyboard pad input scripts of any length (RT-INPUT-SCRIPT-LENGTH) #1074 at5e86f4a3, the default and long-script tests passed (371/371 and 8/8).git diff --checkand the repository's game-data guard also passed.GPUs tested: n/a (GameInput and SDL virtual devices).
AI-assisted: yes, OpenAI Codex for the rebase and Windows verification. The original commit retains its co-author credit.
Checklist
mainand merges cleanly.