HLE: implement remaining XAccessibility closed-caption, high-contrast, and speech-to-text slots #865

Open
opened 2026-11-26 04:14:05 +00:00 by github-bot · 2 comments
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 12:57 UTC · original

Summary

Implements the 9 remaining missing::<N> vtable slots (0x18, 0x20, 0x28, 0x30, 0x38, 0x88, 0x90, 0x98, 0xa0) in crates/victory-hle/src/modules/speech.rs for the XAccessibility COM provider, plus 3 deterministic unit tests with compile-time ABI assertions.

Because external PR creation is currently restricted (collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:

  • Branch: geiyiliyabumo/VIctory@feat/speech-accessibility-slots
  • Commit: geiyiliyabumo/VIctory@212778a (based on main ffe310e)

Changes (crates/victory-hle/src/modules/speech.rs)

  • Closed captions (0x18, 0x20):
    • Added #[repr(C)] pub struct ClosedCaptionProperties with compile-time layout assertions (size_of == 28, align_of == 4, matching GDK XAccessibility.h).
    • Wired 0x18 (XClosedCaptionGetProperties) returning default colors/scale 1.0 and the tracked enabled flag (E_INVALIDARG on null out), and 0x20 (XClosedCaptionSetEnabled) updating CAPTIONS: AtomicBool.
  • High contrast (0x28):
    • Wired 0x28 (XHighContrastGetMode) returning 0u32 (XHighContrastMode::Off, E_INVALIDARG on null out).
  • Speech-to-text (0x30, 0x38, 0x88, 0x90, 0x98, 0xa0):
    • Wired position_hint (0x30), send_string (0x38), begin_hypothesis (0x88, monotonic non-zero u32 ID via put, E_INVALIDARG on null out), update_hypothesis (0x90), finalize_hypothesis (0x98), and cancel_hypothesis (0xa0) with null-safe tracing::debug! logging.
  • Unit tests (3 new, 4 total in speech):
    • captions_are_off_with_the_default_colors
    • high_contrast_is_off
    • speech_to_text_takes_its_strings_and_hands_out_ids

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/speech.rs: PASS
  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings (default + --features diagnostics): PASS (0 warnings)
  • cargo test -p victory-hle --locked -- speech: 4/4 PASS (victory-hle 97/97 PASS)

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 12:57 UTC · [original](https://github.com/Marvisak/VIctory/issues/865) ### Summary Implements the 9 remaining `missing::<N>` vtable slots (`0x18`, `0x20`, `0x28`, `0x30`, `0x38`, `0x88`, `0x90`, `0x98`, `0xa0`) in `crates/victory-hle/src/modules/speech.rs` for the `XAccessibility` COM provider, plus 3 deterministic unit tests with compile-time ABI assertions. Because external PR creation is currently restricted (`collaborators_only`), the CI-green branch is ready on my fork for cherry-pick / review: - **Branch**: `geiyiliyabumo/VIctory@feat/speech-accessibility-slots` - **Commit**: `geiyiliyabumo/VIctory@212778a` (based on `main` `ffe310e`) ### Changes (`crates/victory-hle/src/modules/speech.rs`) - **Closed captions (`0x18`, `0x20`)**: - Added `#[repr(C)] pub struct ClosedCaptionProperties` with compile-time layout assertions (`size_of == 28`, `align_of == 4`, matching GDK `XAccessibility.h`). - Wired `0x18` (`XClosedCaptionGetProperties`) returning default colors/scale `1.0` and the tracked enabled flag (`E_INVALIDARG` on null `out`), and `0x20` (`XClosedCaptionSetEnabled`) updating `CAPTIONS: AtomicBool`. - **High contrast (`0x28`)**: - Wired `0x28` (`XHighContrastGetMode`) returning `0u32` (`XHighContrastMode::Off`, `E_INVALIDARG` on null `out`). - **Speech-to-text (`0x30`, `0x38`, `0x88`, `0x90`, `0x98`, `0xa0`)**: - Wired `position_hint` (`0x30`), `send_string` (`0x38`), `begin_hypothesis` (`0x88`, monotonic non-zero `u32` ID via `put`, `E_INVALIDARG` on null `out`), `update_hypothesis` (`0x90`), `finalize_hypothesis` (`0x98`), and `cancel_hypothesis` (`0xa0`) with null-safe `tracing::debug!` logging. - **Unit tests (3 new, 4 total in `speech`)**: - `captions_are_off_with_the_default_colors` - `high_contrast_is_off` - `speech_to_text_takes_its_strings_and_hands_out_ids` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/speech.rs`: **PASS** - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy -p victory-hle --all-targets --locked -- -D warnings` (default + `--features diagnostics`): **PASS** (0 warnings) - `cargo test -p victory-hle --locked -- speech`: **4/4 PASS** (`victory-hle` `97/97 PASS`) *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:05 +00:00
Author
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-24 13:03 UTC · original

Melissa ran the four speech-module tests on exact 212778a under Wine; all four passed. One caller-visible difference is worth documenting in the captions-off test. With a valid output pointer, slot 0x18 currently succeeds and returns default properties when captions are off. The public GDK contract requires captions to be enabled for the query to succeed, and its example branches on SUCCEEDED(hr). A caller following that example would take the enabled path with the current stub. XClosedCaptionGetProperties return contract

A disabled → enabled → disabled sequence with a valid output pointer would distinguish the behaviors. The documentation supports checking failure, success, then failure for the public export. It leaves the precise disabled HRESULT unspecified, and we have no console measurement for the underlying provider slot. The speech-to-text tests cover accepting calls and assigning hypothesis IDs; a visible overlay remains unimplemented.

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 13:03 UTC · [original](https://github.com/Marvisak/VIctory/issues/865#issuecomment-7132290701) Melissa ran the four speech-module tests on exact `212778a` under Wine; all four passed. One caller-visible difference is worth documenting in the captions-off test. With a valid output pointer, slot 0x18 currently succeeds and returns default properties when captions are off. The public GDK contract requires captions to be enabled for the query to succeed, and its example branches on `SUCCEEDED(hr)`. A caller following that example would take the enabled path with the current stub. [XClosedCaptionGetProperties return contract](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/xaccessibility/functions/xclosedcaptiongetproperties?view=gdk-2604) A disabled → enabled → disabled sequence with a valid output pointer would distinguish the behaviors. The documentation supports checking failure, success, then failure for the public export. It leaves the precise disabled HRESULT unspecified, and we have no console measurement for the underlying provider slot. The speech-to-text tests cover accepting calls and assigning hypothesis IDs; a visible overlay remains unimplemented.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:58 UTC · original

Automated triage for the maintainers.

crates/victory-hle/src/modules/speech.rs on main still leaves these accessibility and speech-to-text slots missing. The pull request for this branch, #1169, was closed under the repository rule that nothing taken from the console SDK may enter the tree (see docs/asset-policy.md): the struct layout is described as matching an SDK header. SDK material, including header names and layouts copied from it, must not be posted here. A version written only from public documentation and observed behaviour can be proposed in a new PR; whether these slots are wanted is for the maintainers.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:58 UTC · [original](https://github.com/Marvisak/VIctory/issues/865#issuecomment-7155352293) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T13:03:35Z at=2026-11-25T06:58:27Z --> Automated triage for the maintainers. `crates/victory-hle/src/modules/speech.rs` on `main` still leaves these accessibility and speech-to-text slots missing. The pull request for this branch, #1169, was closed under the repository rule that nothing taken from the console SDK may enter the tree (see `docs/asset-policy.md`): the struct layout is described as matching an SDK header. SDK material, including header names and layouts copied from it, must not be posted here. A version written only from public documentation and observed behaviour can be proposed in a new PR; whether these slots are wanted is for the maintainers. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#865
No description provided.