Fix baseline profile generation 8630355174009459809#640
Merged
theovilardo merged 22 commits intoperf/baseline-prof-integrationfrom Dec 25, 2025
Merged
Conversation
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.
…t frame detection checks that cause timeouts on some devices.
…n Xiaomi devices during Baseline Profile generation.
…click retry logic.
…ypass profile flush errors.
…adle plugin detects the profile.
…o capture complex animations and heavy UI components.
…finding Play/Pause buttons.
…o ensure playback starts in BaselineProfileGenerator.
…re UnifiedPlayerSheet profiling.
Improves the reliability and robustness of the `BaselineProfileGenerator` and `StartupBenchmarks` to handle inconsistencies across different devices and languages.
- **`gradle.properties`**:
- Adds `androidx.benchmark.suppressErrors=EMULATOR,LOW-BATTERY,THERMAL` to prevent benchmark failures in non-ideal CI environments.
- **`StartupBenchmarks.kt`**:
- Switches to `BaselineProfileMode.UseIfAvailable` from `Require` to prevent failures on devices where profiles aren't strictly enforced (e.g., Samsung/OneUI).
- Simplifies the benchmark setup by hardcoding the package name and reducing iterations to 5 for faster validation.
- Removes the complex setup block in favor of a straightforward `pressHome()` and `startActivityAndWait()`.
- **`BaselineProfileGenerator.kt`**:
- **Internationalization**: Replaces hardcoded English UI strings with regex patterns (`Pattern.compile`) to match both English and Spanish text (e.g., "Queue|Cola", "Library|Biblioteca").
- **Error Handling**: Implements a robust rescue mechanism for profile generation failures. If a `flush profiles` error occurs, it now attempts to copy the generated profile to multiple common storage locations (`/Download`, `/sdcard`, and app-specific external storage) and logs `adb pull` commands for easy manual retrieval.
- **UI Interaction**:
- Simplifies and stabilizes UI interaction logic, making clicks more resilient and removing brittle waits.
- Improves navigation between tabs and interaction with the player sheet.
- Increases `maxIterations` from 1 to 3 for a more comprehensive profile.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
No description provided.