Bind wired SDL vendor commands to the correct physical controller - #7
Merged
jmonster merged 5 commits intoSep 10, 2026
Merged
Conversation
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.
…ration 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.
jmonster
marked this pull request as ready for review
September 9, 2026 23:47
jmonster
added a commit
that referenced
this pull request
Sep 10, 2026
* fix(sdl): preserve received button edges and trigger transitions * test(sdl): wait for throttled hotplug registration before checking edges * test(sdl): inspect queued SDL events after explicit update and axis warmup * build(sdl): use and test the corrected library instead of the stale bundled binary * Bind wired SDL vendor commands to the correct physical controller (#7) * 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
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 — wired device identity, depends on #2
Head
7a026de88151297913f4a4e061bc39800754c4cd. Exact-head SDL/USB regression and build passed.The original SDL patch opened the first matching VID/PID, potentially sending initialization or feedback to the wrong identical controller. The follow-on patch resolves the selected HID DevSrvsID through IOKit to its USB ancestor and matches the unique libusb bus/address plus model IDs. Unknown, invalid or ambiguous identities do not fall back to a different controller. Registry properties/entries are released.
The baseline acquisition function fails the wrong-identical-device test. The correction passes boundary tests for reverse enumeration, missing/ambiguous peers, failed claims, alternate registry properties, invalid paths and resource cleanup. CI explicitly enables libusb and compiles the real wired driver against Apple IOKit/CoreFoundation; the real SDL/UDP input test runs against the combined rebuilt library.
The latest integration repair renames the source-dependent harness to
tests/sdl-usb/check-sdl.sh, preventing the generic Swift test runner from invoking it without an SDL checkout. It stays fully exercised by its dedicated workflow. Both combined app tests and combined SDL tests passed.Compatibility tradeoff: this path performs wired initialization too. Unsupported HID/IOKit layouts can now prevent initialization instead of guessing another device. Physical same-hub device ancestry and driver behavior remain unqualified. BLE/UDP handling and Nintendo command bytes are unchanged.
The tracked upstream dylib is not silently updated; rebuild with
sdl/build-sdl.shor review the corrected development artifact. Merge #2 first, then retarget to main and recheck. No merge, binary installation or release performed.