Add opt-in automatic connection for Switch 2 controllers - #4
Conversation
Start continuous discovery once on the main run loop after saved consent. Keep explicit Disconnect authoritative, preserve live input on opt-out, and retain controller identities and mappings. Persist the setting atomically without replacing malformed configuration; keep action errors visible. Pin the matching SDK SDLHost adapter, add lifecycle/configuration regressions and integration guards, retain native build gates, and document acceptance limits.
Remove incidental layout, expression, comment and whitespace edits from the automatic-connection change. Retain only the intended startup/settings behavior.
|
Validation update for
The SDK dependency PR jmonster/Switch2Kit#74 is not CI-green: its Linux job failed at Keeping this PR draft pending that SDK failure and complete native validation. No merge performed. |
Reproduce the exact-limit true-to-false growth and missing-setting overflow, retain both disk bytes and runtime consent on refusal, and test successful 64 KiB round trips. Run the new regression through the existing sanitizer runner. Pin Switch2Kit to its direct SDLHost lifecycle coverage and CI fixes.
Incorporate main 9614613 after PR #3 merged, preserving the original automatic-connection history. Resolve the SDK, provider/session, test-runner and documentation overlap without dropping either feature. Pin Switch2Kit 1e6eac15fd4d4c93f15244eb66d79021c92d29fc: SDLHost automatic policy/start plus merged native desktop transport/runtime fixes. Update the exact-pin guard and user guide together. Keep main-thread SDL lifecycle on all enabled platforms, disabled-build behavior, static adapter CRT matching, bounded file access and all existing packaging/launch gates. Preserve saved-consent one-shot startup, authoritative Disconnect, live opt-out, sticky failures and the 64 KiB configuration output bound. Validated the exact combined tree ac75e8d locally with Clang and GCC, C++20 warnings-as-errors, AddressSanitizer and UndefinedBehaviorSanitizer. Both complete runs pass mapping/identity/notification/rollback policies, bounded-file tests, nine wiring tests, automatic-connection and configuration/size regressions, six automatic wiring checks and three desktop lifecycle/CMake/CRT test methods. External SDK selection remains supported; the reconstructed SDK tree and commit match the published immutable revision. The prior separate Cemu heads were CI-green, but those runs do not qualify this combined revision. Keep PR #4 draft until current SDK cemu-project#74 and full pinned Cemu native application/extracted GUI checks pass. No tests or safety checks are disabled. No physical-controller, gameplay, pristine first-use or production release qualification is claimed.
|
Independent merge-readiness check after Cemu #3 merged into main at The branch advanced to I independently checked the published production and test Git trees ( Not ready to merge yet: the unfiltered Actions query for Cemu head |
Select d9129e3876f0d68aa7d13395dcff8e2abb38d609 after Switch2Kit cemu-project#74 merged. Its source tree 50e0685fc5503ebcf1bbdcb5dac1f08007d94f5a is identical to the previously selected 1e6eac15fd4d4c93f15244eb66d79021c92d29fc; retain the full desktop transport/runtime fixes and SDLHost automatic-discovery methods without relying on a deleted feature branch. Update the gitlink, exact-pin integration guard and guide together. All Cemu production code, workflows and regression assertions remain unchanged. Verified original documentation/test blob hashes, the matching immutable SDK tree, Python syntax and whitespace locally. Earlier full Clang/GCC sanitizer results apply to the unchanged production source, not to a new native application CI run. Current-head native Cemu checks remain required before merge. No force-push, test bypass or release is performed.
|
Merged after current-head CI completed successfully. Validated head: All six current-head workflow runs completed successfully, covering 15 jobs total: Native Switch2Kit (policies, SDK, macOS arm64/x86_64), Linux application, Windows application, ordinary builds (Windows, macOS arm64/x86_64, Ubuntu arm/x64, AppImage arm/x64), source provenance, and translation template. Native application jobs included exact packaged/extracted application launch, normal quit/relaunch, packaged SDK/runtime inspection, policy coverage, and the disabled-backend checks. No test, safety limit, repository setting, or release policy was bypassed. Hardware/gameplay and production signing/notarization remain separate acceptance boundaries, as documented. |
Main advanced to 94937a0 when automatic-connection PR #4 merged during publication of this cleanup. Preserve its complete production source tree, SDK pin, controller documentation and hardware acceptance guidance. Resolve workflow/test conflicts in favor of the requested single-test policy, including removing the four newly merged test files. Adapt the same dependency-free lifecycle scenario to the current session API. Exercise failed save, opt-in, explicit Disconnect, restart, opt-out preserving input and terminal shutdown without an additional test or runner. GCC, Clang and optimized NDEBUG builds pass; all ten disposable mutation controls are rejected. Five inherited workflows remain byte-identical, and the final diff against current main is limited to 18 CI/test/documentation paths. No native application or current-head GitHub CI pass is claimed.
Current-head CI started; merge authorized
Current head:
d0fbce0b0cdb594cc84f133d1b6d9f943b81db13.Source tree:
bf5667104bc5133546aaff53a28799bcfe57f892.Main incorporated:
96146134e41ce3f8190a11e4139cafef474b3fd4(merged Cemu #3).SDK pin:
d9129e3876f0d68aa7d13395dcff8e2abb38d609(merged Switch2Kit cemu-project#74).The owner has requested finishing and merging this PR. It is ready for review, not draft. No additional discretionary approval round or physical-controller testing is being added as a merge condition. Preserve the existing automated checks and actual blocking-review/conflict requirements.
GitHub native auto-merge is disabled for this repository. The existing hourly conditional completion task now tracks the runs below and will squash-merge this PR with an expected-head-SHA guard once all applicable jobs pass, then verify and report the merge. It must not merge on absent/pending/failed checks or change repository settings to bypass them.
Actions re-enabled and checks triggered
The owner reported re-enabling Actions and explicitly requested running the checks. After confirming the unchanged head still had no runs, this PR was closed/reopened once on September 20, 2026 at 00:01:43–00:01:50 UTC (September 19 evening, America/New_York). GitHub then created all six existing pull-request workflows for
d0fbce0; execution is confirmed, not inferred from the metadata change. No source commit, SDK pin, workflow, test, or repository setting was changed.Current-revision runs:
At trigger verification, all six workflows were in progress. The four Native Switch2Kit jobs and five initial ordinary build jobs were executing; the two dependent AppImage jobs remain part of the expected build matrix. Read the linked runs for the latest results. Started is not passed, and the PR has not been merged. Do not retrigger or cancel these active runs merely because builds take longer than the portable checks.
This supersedes the earlier absent-CI status and unsuccessful triggers while Actions was disabled. The completion task has been updated with these exact run IDs; another owner approval is not required after passing validation.
Completed dependency reconciliation
Switch2Kit cemu-project#74 has merged as
d9129e3. Its source tree,50e0685fc5503ebcf1bbdcb5dac1f08007d94f5a, exactly matches the formerly selected SDK1e6eac1. The permanent pin includes SDLHost automatic-policy/start methods and all merged cemu-project#75 desktop transport/runtime repairs without depending on a feature branch surviving deletion.Commit
d0fbce0changes only three paths: the SDK gitlink, its exact-pin integration guard, anddocs/Switch2Kit.md. They now agree on the merged revision. GitHub's comparison confirms a one-commit fast-forward with no production Cemu source, workflow, or regression-assertion changes. Published test blob14028d13274e0be38b02cf398e367297d4318d37and guide blobc713a1a30c0ee9108a3b38257b4716ebd6b64951match the locally prepared files. Original blob hashes, Python syntax, matching pin and whitespace were checked. No force-push was used.The earlier integration commit
9e31006incorporated merged #3 while preserving the original #4 history. The total feature diff remains 15 files, not a replacement of desktop support.Behavior and retained protections
Add Automatically connect Switch 2 controllers, off by default, to Input settings. Persist
[Settings] AutoConnectinSwitch2Kit.inibeside Cemu's settings before changing radio policy, using the application's atomic writer and preserving unrelated INI entries.Saved consent starts support once on the GUI main run loop after SDL initialization on each enabled native platform. Continuous discovery is not repeated Find calls or renewed 60-second windows. Input/UI polling does not start support or read preferences. Disconnect remains authoritative for the current run, including against a queued startup callback. Find or explicit re-enabling resumes support; saved consent applies on a later launch. Opt-out preserves ready controllers; reconnecting does not assign slots or reset mappings. Configuration/action failures remain visible through successful polling, and the checkbox reflects the saved choice.
The 64 KiB serialization bound remains enforced before writing, including true-to-false growth and missing-setting insertion. Rejected updates preserve disk bytes, runtime consent and radio policy. Exact-limit round trips and malformed/inaccessible/non-regular-file rejection remain covered.
Retain #3's main-thread SDL owner, backend-disabled worker behavior, Windows Debug/Release static adapter CRT matching, bounded host-file access, extracted-application packaging/launch gates, mappings, physical identity, rollback, measured motion and runtime/license checks. Both the desktop and automatic-connection suites remain in the same runner. No test or safety check was removed or weakened.
Validation evidence and remaining automated gate
The previous integration review recorded complete Clang and GCC C++20 runs with warnings-as-errors, AddressSanitizer and UndefinedBehaviorSanitizer against the combined production source. Coverage included mappings/identity/notification/session/rollback, bounded files, nine wiring tests, automatic connection and real INI/configuration-size regressions, six automatic integration guards and three desktop lifecycle/CMake/CRT methods. Those results remain prior local evidence; the repin did not rerun or relabel them as new native application CI.
Require the applicable checks for the actual current PR revision: Native Switch2Kit policies/SDK/macOS arm64/macOS x86_64; Linux and Windows complete applications; exact extracted GUI, packaged-library-origin, normal-quit/relaunch and existing disabled-backend checks; ordinary Build check jobs; source provenance and translation checks. These workflows normally produce 15 jobs. Read individual job conclusions, not only the aggregate status, and do not treat missing or unexpectedly skipped jobs as passes.
When they pass and no real blocking review or conflict remains, use Squash and merge with the exact validated head SHA. The repository allows squash/rebase but not merge commits. No release is requested.
Hardware/gameplay, pristine first-use and production signing/notarization are not established by this work and are not additional approval gates for this merge. The guide retains the separate physical acceptance checklist and user-data protections.
Prepared with AI assistance.