Preserve queued SDL button and analog-trigger transitions - #2
Merged
Merged
Conversation
* fix(sdl): bind vendor commands to the HID device's exact USB ancestry Resolve the HID registry service to its USB ancestor and match bus plus address, not the first VID/PID entry. Unknown/ambiguous identity fails closed. The same path initializes wired devices, so hardware identity coverage is an explicit compatibility gate. BLE and command bytes remain unchanged. Test actual production function bodies with fake IOKit/libusb boundaries and compile the full wired SDL driver against the real Apple SDK. The baseline wrong-device reproducer exits 42; corrected selection/cleanup cases must pass. * test(sdl): explicitly enable libusb and inspect the generated configuration header The initial check looked in include/ rather than SDL's include-config-* path. Keep the assertion that HAVE_LIBUSB is enabled so the real wired driver cannot silently be preprocessed out of the Apple-SDK build. * ci(sdl): preserve compiler diagnostics and surface concise failure tails * fix(sdl): include the CoreFoundation number API used by registry validation * test: keep SDL source-dependent checks out of the Swift suite discovery
jmonster
added a commit
that referenced
this pull request
Sep 10, 2026
* feat(browser): stage attributed browser bridge for guarded integration Adapted from Andrei-Kondrykau/switch2mac browser-bridge at 24b0cd3 (upstream PR #2). Keep the output sink unregistered until access and lifecycle guards are added. Retain the contributor's source and documentation, with our read-only checks. * fix(browser): guard replay, rumble ownership, and opt-in WebSocket access Preserve complete connection/state replay after rename and reject obsolete socket callbacks. Keep long effects alive only for their requested lifetime, settle cancelled effects, and reject retired actuators. Eight deterministic Node regressions cover these behaviors (seven fail on the imported source). Add an opt-in settings window, exact extension-Origin checks, bounded clients and messages, and per-client rumble ownership. GameCube HD rumble is withheld using the existing model capability. Origin checks are not native-process authentication. Exercise the actual Network.framework listener in macOS CI. Adapted browser feature retains attribution to Andrei-Kondrykau's upstream browser-bridge at 24b0cd3. * fix(browser): distinguish validated rumble values from clamped magnitudes * docs(browser): document fork opt-in setup and actual compatibility limits * fix(browser): preserve bridged controllers when native gamepads hotplug Move only a conflicting virtual index and announce the old/new indices, without mutating prior snapshots or hiding the native device. A regression fails against the previous shim and all nine Node cases pass after repair. * Adopt optional RetroArch network output with input-delivery regressions (#6) * feat(retroarch): import the optional network gamepad sink for regression validation Adapted from vialoh/switch2mac retroarch-network-gamepad at 2c7a396 (upstream PR #1). Retain the contributor's opt-in default and attribution; validate actual Swift builds and repair edge/lifecycle behavior before marking ready. * fix(retroarch): preserve edges, refresh releases and retire old destinations Retain the attributed optional fork output and existing remote_message bytes. Replace latest-only button state with a bounded edge queue; overflow explicitly neutralizes this output until disable/re-enable. Include zeros in periodic refreshes and clear the old port before switching destinations. Reject nonfinite axes and remove the imported Array safe-subscript compile failure. Eight synthetic/real-loopback cases pass locally; the tap, release refresh, destination, overflow and finite-axis cases fail against the imported source. UDP acceptance is not acknowledgement; no physical-gameplay claim is made. * fix(retroarch): resume ordered input after cancelling a destination change A partially completed reset left switchIndex active when the user changed back to the original port. Subsequent button edges were never queued. Reassert the desired state and retire that reset; the new real-loopback regression fails against the previous head and the nine-case suite passes. * fix(fork): isolate app identity and disable upstream automatic updates (#9) Use io.github.jmonster.switch2mac and a distinct bundle name/defaults domain. Keep upstream credits but reject default or saved update feeds and updater entry points until a fork-specific signing/update trust path is established. Require explicit signing identities, notary credentials and fork-matching entitlements instead of silently consuming upstream signing configuration. No certificate, profile, notarization request or release is created here. Add metadata, actual feed-resolver and early signing-refusal regressions and build the actual ad-hoc fork app in the existing read-only macOS check.
jmonster
added a commit
that referenced
this pull request
Sep 10, 2026
* test: add protocol fixtures and read-only macOS app build checks * test: run isolated regression groups alongside protocol fixtures * Adopt the browser bridge with replay, lifecycle, and access guards (#5) * feat(browser): stage attributed browser bridge for guarded integration Adapted from Andrei-Kondrykau/switch2mac browser-bridge at 24b0cd3 (upstream PR #2). Keep the output sink unregistered until access and lifecycle guards are added. Retain the contributor's source and documentation, with our read-only checks. * fix(browser): guard replay, rumble ownership, and opt-in WebSocket access Preserve complete connection/state replay after rename and reject obsolete socket callbacks. Keep long effects alive only for their requested lifetime, settle cancelled effects, and reject retired actuators. Eight deterministic Node regressions cover these behaviors (seven fail on the imported source). Add an opt-in settings window, exact extension-Origin checks, bounded clients and messages, and per-client rumble ownership. GameCube HD rumble is withheld using the existing model capability. Origin checks are not native-process authentication. Exercise the actual Network.framework listener in macOS CI. Adapted browser feature retains attribution to Andrei-Kondrykau's upstream browser-bridge at 24b0cd3. * fix(browser): distinguish validated rumble values from clamped magnitudes * docs(browser): document fork opt-in setup and actual compatibility limits * fix(browser): preserve bridged controllers when native gamepads hotplug Move only a conflicting virtual index and announce the old/new indices, without mutating prior snapshots or hiding the native device. A regression fails against the previous shim and all nine Node cases pass after repair. * Adopt optional RetroArch network output with input-delivery regressions (#6) * feat(retroarch): import the optional network gamepad sink for regression validation Adapted from vialoh/switch2mac retroarch-network-gamepad at 2c7a396 (upstream PR #1). Retain the contributor's opt-in default and attribution; validate actual Swift builds and repair edge/lifecycle behavior before marking ready. * fix(retroarch): preserve edges, refresh releases and retire old destinations Retain the attributed optional fork output and existing remote_message bytes. Replace latest-only button state with a bounded edge queue; overflow explicitly neutralizes this output until disable/re-enable. Include zeros in periodic refreshes and clear the old port before switching destinations. Reject nonfinite axes and remove the imported Array safe-subscript compile failure. Eight synthetic/real-loopback cases pass locally; the tap, release refresh, destination, overflow and finite-axis cases fail against the imported source. UDP acceptance is not acknowledgement; no physical-gameplay claim is made. * fix(retroarch): resume ordered input after cancelling a destination change A partially completed reset left switchIndex active when the user changed back to the original port. Subsequent button edges were never queued. Reassert the desired state and retire that reset; the new real-loopback regression fails against the previous head and the nine-case suite passes. * fix(fork): isolate app identity and disable upstream automatic updates (#9) Use io.github.jmonster.switch2mac and a distinct bundle name/defaults domain. Keep upstream credits but reject default or saved update feeds and updater entry points until a fork-specific signing/update trust path is established. Require explicit signing identities, notary credentials and fork-matching entitlements instead of silently consuming upstream signing configuration. No certificate, profile, notarization request or release is created here. Add metadata, actual feed-resolver and early signing-refusal regressions and build the actual ad-hoc fork app in the existing read-only macOS check. * Neutralize disconnected UDP controllers and bound subscriber processing (#4) * fix(udp): neutralize disconnected slots and bound subscriber handling * test(udp): synchronize real datagram arrival before subscriber assertions * Fix session response matching, fallback sticks, and GameCube motor gating (#3) * fix(session): preserve command correlation and respect model capabilities * fix(session): retire callbacks before teardown and require usable input for readiness (#8) Guard late notifications, queued commands and timers after session retirement. Clear notify completion before invocation to preserve reentrant replacement. Require isNotifying on essential channels and one existing-decoder input report before readiness, retaining the established keep-alive and handshake bytes. Eleven synthetic production-session tests pass locally; five new targeted cases fail against the prior session source. Full Apple-framework build and regressions remain the hosted gate. No new connection deadline or protocol.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ready for review — host SDL input fidelity
Head
ae5996d5254ca96971087ed33c1fe08b48862de6. Exact-head SDL build/regression passed.The original UDP receiver retained only the newest queued state and erased complete button taps and trigger excursions between updates. A small follow-on source patch emits each received state to its opened joystick and clears the opened-instance association on removal/close. Nintendo pairing, command payloads, input packet format, button layout and keep-alives are unchanged.
CI builds pinned SDL 3.4.14 (
147a8ee32dbf9ac02f3794964490687b6bbda1bc) with the original patch and requires the actual missing-transition failure (exit 42). It then builds the corrected library and requires the same real SDL/localhost-UDP test to pass. Other baseline failures do not count as reproduction.Binary delivery: the checked-in upstream dylib is not represented as fixed. Use
sdl/build-sdl.shwith the pinned SDL checkout to producebuild/sdl/libSDL3.0.dylib, or inspect the development artifact from the successful workflow.sdl/INPUT-DELIVERY.mdexplains selecting the rebuilt library. Updating a source patch alone does not alter an existing emulator installation.UDP loss before receipt and applications that only poll the latest state remain limitations. These tests do not establish physical controller timing or gameplay compatibility.
Independent of #1. Merge before its wired-device-identity follow-up #7. The combined nine-PR source also passed SDL integration validation. No merge, binary installation or release has been performed.