Skip to content

Input hub: typed events, no device reference, no direct-write MCP tools - #2585

Merged
maximilien-noal merged 4 commits into
feature/reproducible-run-optionfrom
feature/input-event-hub
Dec 2, 2026
Merged

maximilien-noal merged 4 commits into
feature/reproducible-run-optionfrom
feature/input-event-hub

Conversation

@kevinferrare

@kevinferrare kevinferrare commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Rename InputEventQueue.cs to InputEventHub.cs in its own commit to preserve history.
  • Restore the input_timer_keys fixture and add InputEventHubTests.ReleaseAllKeysReachesTheProgramAsABreakCode to pin break-code delivery on ReleaseAllKeys.
  • Remove the direct-write MCP tools press_key and send_mouse_packet (and EmulatorMcpServices.Intel8042Controller / BiosKeyboardBuffer), moving pause-time key release directly into Spice86DependencyInjection.
  • Queue typed InputEvent records in InputEventHub, remove PostToEmulatorThread and InputEventHub.KeyboardDevice, expose IKeyboardInputEvents.AllKeysReleased for PS2Keyboard, and route UI ITimeMultiplier changes through InputEventHub.

Stack

PR 3 of 4 in the input recording stack:

Decisions made overnight

None.

Test plan

  • dotnet build src/Spice86.sln: Build succeeded (0 Warning(s), 0 Error(s)).
  • dotnet test --project tests/Spice86.Tests --no-build -- --filter-class '*InputEventHubTests*' --filter-class '*CSharpOverrideHelperTest*' --filter-class '*PS2KeyboardReleaseAllKeysTests*' --filter-class '*MouseStateTests*' --filter-class '*MouseInputTests*' --filter-class '*MouseDriverTests*': Passed! total: 121, failed: 0, succeeded: 121, skipped: 0.
  • dotnet test --project tests/Spice86.Tests --no-build -- --filter-not-class '*SingleStepTest*': Passed! total: 8477, failed: 0, succeeded: 8477, skipped: 0.

Gaps

  • Running McpServerToolStateTests alone (outside the full suite) triggers a pre-existing MachineLeakGuard assembly cleanup failure on VideoWritePixelAndReadPixel_ShouldRoundTripColorAsync (all 62 test bodies pass; reproduced identically on the base branch feature/reproducible-run-option, and passes cleanly in the full suite).

Restore the input_timer_keys fixture and pin the current behavior that
InputEventHub.ReleaseAllKeys delivers a break scan code to the guest
before refactoring the input hub.
…se to composition root

Direct-write MCP tools bypass InputEventHub by writing BIOS and PS/2
controller state directly. Remove press_key and send_mouse_packet along
with the Intel8042Controller and BiosKeyboardBuffer properties on
EmulatorMcpServices, and wire pause-time key release directly in
Spice86DependencyInjection.
…r through InputEventHub

Replace ConcurrentQueue<Action> with typed InputEvent records so every host
input action passes through one inspectable pipeline. Remove PostToEmulatorThread
and InputEventHub.KeyboardDevice, raise AllKeysReleased for PS2Keyboard to
subscribe to, and route UI time multiplier changes through the hub.
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

No change in generated code or listings. Base f94a969c, head ad7b5571.

Full diff and dumps (zip) · Run

@maximilien-noal
maximilien-noal merged commit 2d6739b into feature/reproducible-run-option Dec 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants