runtime: return documented GameInput v0 temporal refusal #2269

Manually merged
github merged 1 commit from gh-pr/2269/head into gh-pr/2269/base 2026-11-27 00:11:25 +00:00
Owner

@⁠chadhyatt on GitHub · 2026-11-25 09:00 UTC · original
chadhyatt:backport/gameinput-temporal-refusal → main · +38 −0 · 3 files · 1 commits · merged 2026-11-25 09:18 UTC

AI-assisted backport patch from x2w-microlift.

The published v0 GameInput.h places GetTemporalReading in slot 7 with timestamp, device, and reading arguments. Microsoft documents it as never implemented (E_NOTIMPL); bind the typed refusal instead of the generic unknown-slot result. Retain the existing output-pointer checks and add an authored contract case.

Verification at 7f2da71822: Clang 23.1.6, Windows x86_64 GNU target and MinGW headers, compiled src/startup_stubs/gameinput.cpp to an AMD64 COFF object. The local full build is blocked by existing MSVC-specific casts in runtime_proxy.cpp and the GameInput fixture vtable wrappers; no workaround applied and no native runtime pass claimed at this exact head. The same refusal and ABI were independently checked on native Windows with SDK 10.0.26100.0 and an equivalent source-built fixture on another revision. Pending exact public branch reproduction: ctest --preset dev --no-tests=error -R "^startup_gameinput_(contracts_check|history)$" -V.

**@⁠chadhyatt** on GitHub · 2026-11-25 09:00 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2269) `chadhyatt:backport/gameinput-temporal-refusal` → `main` · +38 −0 · 3 files · 1 commits · merged 2026-11-25 09:18 UTC AI-assisted backport patch from x2w-microlift. The published v0 GameInput.h places GetTemporalReading in slot 7 with timestamp, device, and reading arguments. Microsoft documents it as never implemented (`E_NOTIMPL`); bind the typed refusal instead of the generic unknown-slot result. Retain the existing output-pointer checks and add an authored contract case. Verification at `7f2da71822`: Clang 23.1.6, Windows x86_64 GNU target and MinGW headers, compiled `src/startup_stubs/gameinput.cpp` to an AMD64 COFF object. The local full build is blocked by existing MSVC-specific casts in `runtime_proxy.cpp` and the GameInput fixture vtable wrappers; no workaround applied and no native runtime pass claimed at this exact head. The same refusal and ABI were independently checked on native Windows with SDK 10.0.26100.0 and an equivalent source-built fixture on another revision. Pending exact public branch reproduction: `ctest --preset dev --no-tests=error -R "^startup_gameinput_(contracts_check|history)$" -V`.
- Bind the actual v0 slot-7 ABI and return E_NOTIMPL with the existing output-pointer contract.
- Exercise the refusal through the authored GameInput contract fixture.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:11:23 +00:00
github manually merged commit 7f2da71822 into gh-pr/2269/base 2026-11-27 00:11:25 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-25 09:05 UTC · original

Independent Windows Release startup_gameinput_contracts_check passed at 7f2da718. The Windows SDK 10.0.26100.0 um/GameInput.h confirms the slot 7 parameters are timestamp, device, and reading output. The Learn page supports the E_NOTIMPL result, but its prototype lists extra parameters. Use the shipped header for the ABI and the page for the status. The local fixture also verified null output and unwritable output refusals.

**@⁠R0Y00** on GitHub · 2026-11-25 09:05 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2269#issuecomment-7157872246) Independent Windows Release `startup_gameinput_contracts_check` passed at `7f2da718`. The Windows SDK 10.0.26100.0 `um/GameInput.h` confirms the slot 7 parameters are timestamp, device, and reading output. The [Learn page](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_gettemporalreading) supports the `E_NOTIMPL` result, but its prototype lists extra parameters. Use the shipped header for the ABI and the page for the status. The local fixture also verified null output and unwritable output refusals.
Author
Owner

@⁠chadhyatt on GitHub · 2026-11-25 09:09 UTC · original

Thanks for the exact-head Windows verification and SDK confirmation. Agreed: the shipped v0 header defines the three-argument ABI, and the Learn page establishes E_NOTIMPL. The contract and output-pointer refusal checks are now verified on Windows.

**@⁠chadhyatt** on GitHub · 2026-11-25 09:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2269#issuecomment-7157942579) Thanks for the exact-head Windows verification and SDK confirmation. Agreed: the shipped v0 header defines the three-argument ABI, and the Learn page establishes E_NOTIMPL. The contract and output-pointer refusal checks are now verified on Windows.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 09:13 UTC · original · reviewed

Review at head 7f2da71822876363d0c307706d950fffbe9bb08e (3 files, +38).

Verdict: no blocking findings (P1=0, P2=0).

What I checked

  • src/startup_stubs/gameinput.cpp:724-732: new input_temporal_reading(Object*, u64 timestamp, Object* device, Reading** out) matches the v0 slot-7 signature (timestamp, device, out). It uses the same output-pointer guard (!out || !writable -> E_POINTER) and *out = nullptr pattern as input_previous_reading, then returns E_NOTIMPL. Consistent with the documented behavior.
  • gameinput.cpp:830: slot 7 is bound between slot 6 (GetPreviousReading) and slot 8 (RegisterReadingCallback); no overlap with other bindings. Before this change slot 7 fell to unknown_slot<0,7>, which returns 0 (S_OK) without writing *out, so a caller could read an uninitialized pointer. The typed refusal is a real improvement.
  • tests/startup_gameinput_contracts_check.cpp: wrapper uses vtbl[7] with the right argument types. The new cases cover E_NOTIMPL with a non-null sentinel that must become null, null out -> E_POINTER, and read-only page -> E_POINTER. The read-only case is guarded by if (ro_page).
  • docs/startup-runtime.md: short and accurate; the link resolves under the docs link check.
  • Title is neutral, PR is mergeable, CI green (Linux Python checks, gfx1013 fixtures, Windows build and test; /O2 and coverage publish skipped).

Nits

  • nit: the PR body says exact-head native runtime verification is pending. CI "Build and test on Windows" passes at this head, so the body could cite it.
  • nit: the static LONG calls counter in the new stub is only used by note; fine, matches siblings.

Commands run locally in a worktree at the head above

  • git diff --stat origin/main...HEAD -> 3 files, 38 insertions
  • git diff --check origin/main...HEAD -> clean
  • python3 tests/docs_links_check.py -> self-test passed, 18 files, 433 links
  • python3 tests/bidi_controls_check.py -> self-test passed, 1562 files, no bidi controls
  • gh pr checks 2269 -> see CI summary above

Not done: the touched C++ test is Windows-only, so I did not run it locally, and I did not run a mutation (for example removing the slot-7 binding) here. By reading, dropping the binding would restore the old unknown_slot result (0) and fail the E_NOTIMPL check, so the test should kill it. No Win2025 run was requested for this change.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 09:13 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2269#pullrequestreview-6054725578) · **reviewed** Review at head `7f2da71822876363d0c307706d950fffbe9bb08e` (3 files, +38). **Verdict: no blocking findings (P1=0, P2=0).** What I checked - `src/startup_stubs/gameinput.cpp:724-732`: new `input_temporal_reading(Object*, u64 timestamp, Object* device, Reading** out)` matches the v0 slot-7 signature (timestamp, device, out). It uses the same output-pointer guard (`!out || !writable` -> `E_POINTER`) and `*out = nullptr` pattern as `input_previous_reading`, then returns `E_NOTIMPL`. Consistent with the documented behavior. - `gameinput.cpp:830`: slot 7 is bound between slot 6 (`GetPreviousReading`) and slot 8 (`RegisterReadingCallback`); no overlap with other bindings. Before this change slot 7 fell to `unknown_slot<0,7>`, which returns 0 (`S_OK`) without writing `*out`, so a caller could read an uninitialized pointer. The typed refusal is a real improvement. - `tests/startup_gameinput_contracts_check.cpp`: wrapper uses `vtbl[7]` with the right argument types. The new cases cover `E_NOTIMPL` with a non-null sentinel that must become null, null out -> `E_POINTER`, and read-only page -> `E_POINTER`. The read-only case is guarded by `if (ro_page)`. - `docs/startup-runtime.md`: short and accurate; the link resolves under the docs link check. - Title is neutral, PR is mergeable, CI green (Linux Python checks, gfx1013 fixtures, Windows build and test; `/O2` and coverage publish skipped). Nits - nit: the PR body says exact-head native runtime verification is pending. CI "Build and test on Windows" passes at this head, so the body could cite it. - nit: the `static LONG calls` counter in the new stub is only used by `note`; fine, matches siblings. Commands run locally in a worktree at the head above - `git diff --stat origin/main...HEAD` -> 3 files, 38 insertions - `git diff --check origin/main...HEAD` -> clean - `python3 tests/docs_links_check.py` -> self-test passed, 18 files, 433 links - `python3 tests/bidi_controls_check.py` -> self-test passed, 1562 files, no bidi controls - `gh pr checks 2269` -> see CI summary above Not done: the touched C++ test is Windows-only, so I did not run it locally, and I did not run a mutation (for example removing the slot-7 binding) here. By reading, dropping the binding would restore the old `unknown_slot` result (0) and fail the `E_NOTIMPL` check, so the test should kill it. No Win2025 run was requested for this change. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.