Skip to content

fix(app): honor profile CPU recommendations by default - #1065

Open
NKU100 wants to merge 1 commit into
LSPosed:mainfrom
NKU100:codex/fix-profile-cpu-recommendation
Open

NKU100 wants to merge 1 commit into
LSPosed:mainfrom
NKU100:codex/fix-profile-cpu-recommendation

Conversation

@NKU100

@NKU100 NKU100 commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The CPU picker currently defaults to the first pair generated by the UI. Before serializing the profile, the app always writes that pair into execution.selected_cpus, so execution.recommended_cpus cannot seed the default selection.

This PR makes the picker use the effective profile recommendation when that pair is already present in the candidate list:

  • read execution.recommended_cpus from the loaded imported profile first;
  • fall back to the matching built-in profile;
  • preserve an explicitly saved picker choice;
  • keep the current selection when the recommendation is unavailable.

This matches the existing profile merge precedence.

This PR only addresses recommendations that are already available in the generated picker. It does not restore the old UI behavior that inserted a recommended pair spanning frequency clusters. The cross-cluster case needs separate discussion and validation.

Relates to #382.

Regression history

  • f98c06e9 added the manual "select recommended CPU pair" action.
  • 48303a9f merged selected_cpus into the recommendation slot of the native profile document and established that an explicit UI selection overrides the recommendation.
  • bfbe0026 implemented automatic adoption of the recommended pair in the old dev UI, including insertion of cross-frequency-cluster pairs.
  • b61ec7ca removed the old Kotlin UI. Its commit message explicitly records that abandoning the old Kotlin UI was a user decision, but it does not say whether the app should also stop consuming recommended_cpus.
  • The replacement UI does not restore the automatic path. Native and CLI can still read the field, and the ANC-01/ANC-02 logs show the recommendation reaching native, but I found no device evidence that the app automatically selected the recommended pair as its default.

Maintainer question

Was removing the app's automatic use of execution.recommended_cpus intentional, or was it an omission during the UI migration?

There are two possible outcomes:

  1. If intentional, recommended_cpus currently has no effect on the app's default selection. Please do not merge this behavioral fix. Instead, deprecate and remove the field in a separate profile-format change, including the schema, templates, and built-in profiles.
  2. If accidental, this PR restores the default selection only when the recommended pair is already offered in the picker. Inserting cross-frequency-cluster pairs remains a separate PR.

I would like to confirm the intended design before treating this as a fix. If removing the behavior was intentional, merging this change would work against that decision. The field should then be removed so profile authors are not left with a setting that appears meaningful but has no effect.

Tests

  • ./gradlew :app:testDebugUnitTest --tests '*CpuPairSelectionTest' --tests '*BuiltinProfilesTest' --tests '*UserProfileStoreTest' passed.
  • ./gradlew :app:assembleDebug passed.
  • Full ./gradlew :app:testDebugUnitTest ran 97 tests. The following three failures also reproduce on clean upstream 9b51c391:
    • ExporterAgreementTest
    • NativeDocumentEquivalenceTest
    • ProfileMigrationEquivalenceTest
  • No additional device UI verification was performed.

@NKU100 NKU100 closed this Dec 5, 2026
@NKU100 NKU100 reopened this Dec 5, 2026
@NKU100
NKU100 marked this pull request as ready for review December 5, 2026 09:16
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