Skip to content

Improve baseline profile generation flow#635

Merged
theovilardo merged 4 commits intoperf/baseline-prof-integrationfrom
codex/generate-and-integrate-baseline-profile
Dec 25, 2025
Merged

Improve baseline profile generation flow#635
theovilardo merged 4 commits intoperf/baseline-prof-integrationfrom
codex/generate-and-integrate-baseline-profile

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

Summary

  • align the baselineprofile module SDK configuration and add dependencies required for deterministic profile generation
  • program realistic macrobenchmark flows that set up the app, navigate primary tabs, and open player/queue/lyrics/cast sheets before collecting the baseline profile
  • ensure the baseline profile task reliably passes the target app id to instrumentation

Testing

  • ./gradlew :baselineprofile:assembleAndroidTest

Codex Task

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Introduces a `is_benchmark` intent flag to streamline app startup during Baseline Profile generation, bypassing setup screens and permission dialogs for a more stable and direct launch to the main screen.

- **MainActivity.kt**:
  - Reads a new `is_benchmark` boolean extra from the intent.
  - Skips the `SetupScreen` if `is_benchmark` is true.
  - Prevents the "All Files Access" dialog from appearing during benchmark runs.

- **BaselineProfileGenerator.kt**:
  - Simplifies the generation script to perform only a cold start and a brief wait, removing complex UI interactions (tab navigation, scrolling, sheet opening) that caused instability.
  - Launches the app with the `--ez is_benchmark true` flag to ensure a direct path to the `HomeScreen`.
  - Grants `MANAGE_EXTERNAL_STORAGE` and `POST_NOTIFICATIONS` permissions via shell commands before the run to avoid system dialogs.

- **HomeScreen.kt**:
  - Adds `ReportDrawnWhen` to signal when the screen is fully drawn, using the presence of songs or the `is_benchmark` flag as a trigger.
  - Suppresses the app rebrand dialog when in benchmark mode.

- **Build & Dependencies**:
  - Adds a new `benchmark` build type in `app/build.gradle.kts` that inherits from `release` but is debuggable.
  - Updates `benchmark-macro-junit4` and `baselineprofile` libraries to version `1.3.3`.
  - Includes the `baselineprofile` module in the Gradle project settings.
@theovilardo theovilardo merged commit c1bdc04 into perf/baseline-prof-integration Dec 25, 2025
@lostf1sh lostf1sh deleted the codex/generate-and-integrate-baseline-profile branch January 16, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant