Skip to content

Add opt-in automatic connection for Switch 2 controllers - #4

Merged
jmonster merged 5 commits into
mainfrom
feature/switch2kit-auto-connect
Sep 20, 2026
Merged

jmonster merged 5 commits into
mainfrom
feature/switch2kit-auto-connect

Conversation

@jmonster

@jmonster jmonster commented Sep 18, 2026

Copy link
Copy Markdown
Owner

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 SDK 1e6eac1. 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 d0fbce0 changes only three paths: the SDK gitlink, its exact-pin integration guard, and docs/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 blob 14028d13274e0be38b02cf398e367297d4318d37 and guide blob c713a1a30c0ee9108a3b38257b4716ebd6b64951 match the locally prepared files. Original blob hashes, Python syntax, matching pin and whitespace were checked. No force-push was used.

The earlier integration commit 9e31006 incorporated 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] AutoConnect in Switch2Kit.ini beside 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.

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.

Copy link
Copy Markdown
Owner Author

Validation update for a8788eda078ba9054d9bb41c6f4b7786e0ba70a2:

  • Cemu policy CI passed, including the existing mapping/identity/setup rollback tests plus the new automatic-connection/session/INI tests and source-wiring guards: https://github.com/jmonster/Cemu/actions/runs/35374592564/job/105696188743.
  • Standalone production-policy tests also passed again locally with both Clang and GCC, warnings as errors, AddressSanitizer and UndefinedBehaviorSanitizer.
  • The final UI/provider diff was checked and incidental surrounding edits removed in the second commit.
  • Full Cemu macOS arm64/x86_64 and SDK jobs were still queued at inspection. Physical pairing/reconnection/gameplay has not been tested.

The SDK dependency PR jmonster/Switch2Kit#74 is not CI-green: its Linux job failed at Package, Linux radio and retained portable regressions in https://github.com/jmonster/Switch2Kit/actions/runs/35372274174, before the relocated facade and SDL consumer steps. The precise failure is unresolved; do not assume it is unrelated. This connector did not expose the job logs/check annotations for diagnosis.

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.

Copy link
Copy Markdown
Owner Author

Independent merge-readiness check after Cemu #3 merged into main at 96146134e41ce3f8190a11e4139cafef474b3fd4:

The branch advanced to 9e310069785efdb2139886aec8a3b372a88249a8 while I was preparing a parallel reconciliation. GitHub correctly rejected my non-fast-forward update. I preserved the published commit; no force-push or history replacement was performed. GitHub now reports this PR mergeable against main, with both histories and the reconciled SDK pin retained.

I independently checked the published production and test Git trees (src = c35e9a8e58f43d2e2dc8f3fc27b380b4e495b9e3, tests = 26bc0c25a391d6cc4c468578440bff05eff4f056). After adopting its exact files, both complete local Cemu Switch2Kit runners passed again, separately with Clang and GCC, C++20 warnings-as-errors, AddressSanitizer and UndefinedBehaviorSanitizer, using verified SDK 1e6eac15fd4d4c93f15244eb66d79021c92d29fc and pinned SDL sources. This includes the existing controller/backup/rollback and bounded-file tests, nine wiring checks, all automatic-connection/configuration/size regressions, six automatic integration checks, and three desktop lifecycle/CMake/CRT tests. The published workflow/build/dependency trees also match the reviewed reconciliation. These are not full native application builds or physical-controller tests.

Not ready to merge yet: the unfiltered Actions query for Cemu head 9e31006 returned zero workflow runs, and the unfiltered query for SDK head 1e6eac1 likewise returned zero. Missing checks are not successful checks, and the old PR heads' green runs cannot validate this combination. Keep the existing draft status and the SDK cemu-project#74 merge/repin and current-head native Cemu application/package/GUI gates documented above. I have not merged #4 or bypassed any check.

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.
@jmonster
jmonster marked this pull request as ready for review September 19, 2026 22:28
@jmonster jmonster closed this Sep 19, 2026
@jmonster jmonster reopened this Sep 19, 2026
@jmonster jmonster closed this Sep 20, 2026
@jmonster jmonster reopened this Sep 20, 2026
@jmonster
jmonster merged commit 94937a0 into main Sep 20, 2026
15 checks passed
@jmonster
jmonster deleted the feature/switch2kit-auto-connect branch September 20, 2026 01:07

Copy link
Copy Markdown
Owner Author

Merged after current-head CI completed successfully.

Validated head: d0fbce0b0cdb594cc84f133d1b6d9f943b81db13.
Squash merge commit: 94937a02a1db83c30904bfedd66012c81144e8d1.

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.

jmonster added a commit that referenced this pull request Sep 20, 2026
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.
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.

1 participant