runtime: test the GameInput ordinal 1 caller with a recording provider #1069
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1076"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-24T00:25:35Z.
Change
Basis. The call shapes come from static disassembly of the main executable's GameInput caller, recorded in #1056 (ABI shapes and counts only). The method was pefile + capstone scripts over the file (import table,
.pdata-bounded disassembly, exhaustive reference scans), with IDA for orientation. Nothing was executed. What was read:The public v0 header only names these slots and structures, and each name was checked against the observed shape. The fixture reproduces the shapes; it does not take them from the header.
Adds a source-built check of the GameInput call contract recorded in #1056. A source-built caller imports
GameInput.dllordinal 1 with no name, as the console caller does, and drives the v0 objects with its call shapes. A test-only recording provider exportsGameInputCreateat ordinal 1 (NONAME). It runs under the Windows loader andpe_map. No productionGameInput.dllexport is added. Refs #1056, #870.tests/cpu/gameinput_caller.asm, viaexe_startup.asm+cpu_exe_io, as in #1047), 8 steps:FindDeviceFromIdon the device's own ID, thenSetRumbleStatewith zero trigger values;tests/cpu/gameinput_provider.cpp): v0 declarations restated from the public Windows SDKum/GameInput.h(10.0.26100.0), with sizes and offsets pinned bystatic_assert. Everything about runtime behaviour is fixture policy and labelled as such: synthetic devices and IDs, the three-entry history, synchronous callbacks for blocking enumeration, refusal codes.tests/cpu/gameinput_check.py, CTestcpu_native_gameinput) and adocs/experiments.mdsection.Verification
Commit
f3aebeb4(onmain110e1860), Windows 10 Pro 22H2 (build 19045), Visual Studio 2026 18.12 (MSVC 19.52), Windows SDK 10.0.26100, CMake 4.3.1, Python 3.13.7.ctest --preset dev --no-tests=error -R '^cpu_native_gameinput$' -V(provider records shortened):All 20 provider records matched after the
pe_maprun: no calls to unused slots, no outstanding references, and one rumble call with zero trigger values. No capability skips. The full suite was left to CI.Local mutations, not committed. Each one was caught:
0xF020xF06FindDeviceFromIdreturns the keyboard instead0xF070xF08true0xF08Evidence and follow-up
System32\GameInput.dll, as the last line above shows.Checklist
AI-assisted: prepared with Claude Code; the commands and results above were run on the author's PC.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-24T00:32:35Z.
Review: APPROVED
Independent Windows 11 run and review.
Environment
out/pe-env)f3aebeb4(branchruntime/gameinput-caller-fixture)Test Commands & Results
Dev Preset:
cpu_native_apu_alloc_caller(Passed 0.18 sec)cpu_native_apu_address(Passed 0.17 sec)cpu_native_acphal_hal(Passed 0.18 sec)cpu_native_gameinput(Passed 0.97 sec)Release Preset:
cpu_native_gameinput(Passed 0.97 sec)dev.Linters & Documentation:
Observations on Negative Controls
0xF01at Step 1.0xF02at Step 2 (bounded lock spin cleanly handles thread mismatch without hanging).0xF05at Step 5.pe_mapcatches unresolved ordinal 1 before entry; Windows loader exits0xC0000138(STATUS_ORDINAL_NOT_FOUND).GameInput.dll(missing the test query export) and exits0xC0000139(STATUS_ENTRYPOINT_NOT_FOUND).get_gameinput_outstanding_refs == 0, no leaked readings or device handles.Everything is reproducible and clean-room compliant. Looks great to merge!
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-24T00:56:14Z.
Review: APPROVED
Re-reviewed changes since
f3aebeb4(commite6361ca2):upstream/main(e5bfa0c9) intoruntime/gameinput-caller-fixture. ReconciledCMakeLists.txtanddocs/experiments.mdto preserve both the GameInput ordinal 1 fixture and the upstream XApu queue fixture. No changes were made to the GameInput test code (tests/cpu/gameinput_*).cpu_native_gameinput(0.99s) andcpu_native_xapu_queue(0.16s) passed 100%. All negative controls behaved as expected.tests/docs_links_check.py: Passed (15 Markdown files, 245 links).tests/bidi_controls_check.py: Passed (922 tracked files).Still clean, verified, and ready to merge.