Repository navigation
Conversation
…GP 9.2.1 baseline
🛡️ R8 Optimization & Shrinking Gate (
|
| Metric | Baseline | Current | Delta | Threshold | Status |
|---|---|---|---|---|---|
| Shrinking Score | 51.15% | 50.36% | -0.79% pts |
max -2.00% pts |
✅ PASS |
| Optimization Score | 50.81% | 50.02% | -0.79% pts |
max -2.00% pts |
✅ PASS |
| Obfuscation Score | 51.11% | 50.33% | -0.78% pts |
max -2.00% pts |
✅ PASS |
| Uncompressed DEX Size | 18.32 MB | 17.90 MB | -0.42 MB (-2.3%) |
max +5.0% / +500KB |
✅ PASS |
📚 Library Shrinking Percentage (Min Threshold: 90.0%)
Library (.aar / .jar) |
D8 DEX | R8 Kept DEX | DEX Shrinking % | Classes Shrunk | Methods Shrunk | Pkg-Wide Rules | Status |
|---|---|---|---|---|---|---|---|
network-release.aar |
64.35 KB | 0.00 KB | 100.00% | 100.0% (49/49) | 100.0% (250/250) | 0 | ✅ PASS |
testing-release.aar |
29.22 KB | 0.00 KB | 100.00% | 100.0% (17/17) | 100.0% (119/119) | 0 | ✅ PASS |
theme-release.aar |
209.49 KB | 0.00 KB | 100.00% | 100.0% (51/51) | 100.0% (405/405) | 0 | ✅ PASS |
util-release.aar |
44.71 KB | 0.00 KB | 100.00% | 100.0% (24/24) | 100.0% (111/111) | 0 | ✅ PASS |
xr-release.aar |
44.73 KB | 0.00 KB | 100.00% | 100.0% (13/13) | 100.0% (64/64) | 0 | ✅ PASS |
data-release.aar |
55.13 KB | 0.00 KB | 100.00% | 100.0% (54/54) | 100.0% (193/193) | 0 | ✅ PASS |
camera-release.aar |
289.75 KB | 0.00 KB | 100.00% | 100.0% (93/93) | 100.0% (550/550) | 0 | ✅ PASS |
creation-release.aar |
343.21 KB | 0.00 KB | 100.00% | 100.0% (86/86) | 100.0% (610/610) | 0 | ✅ PASS |
home-release.aar |
186.55 KB | 0.00 KB | 100.00% | 100.0% (47/47) | 100.0% (310/310) | 0 | ✅ PASS |
results-release.aar |
602.10 KB | 0.00 KB | 100.00% | 100.0% (200/200) | 100.0% (1127/1127) | 0 | ✅ PASS |
watchface-release.aar |
72.20 KB | 2.73 KB | 96.21% | 100.0% (46/46) | 100.0% (256/256) | 0 | ✅ PASS |
common-release.aar |
45.32 KB | 0.00 KB | 100.00% | 100.0% (31/31) | 100.0% (229/229) | 0 | ✅ PASS |
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.
Automated R8 & App Shrinking Regression Gates (
android analyze)Automated presubmit (Git hooks) and CI (GitHub Actions) regression gates powered by
ANDROID_CLI_ANALYZE=1 android analyzeto catch R8 configuration regressions, unshrunk libraries, and DEX size bloat before merge.1. Modular Check Scripts (
scripts/)Teams can adopt all three checks or pick only the ones that fit their workflow:
check_staged_r8_diff.pygit diff,*.pro,libs.versions.tomlenableR8.fullMode=false, newly added-keep class <pkg>.** { *; }rules, and audits newly added Maven dependencies in~/.gradle/cachespre-commit(<1s)check_library_shrinking.py.aar&.jarmodules/libraries(1 - r8DexSize / d8DexSize) * 100) and flags consumerproguard.txtrules with package-wide wildcardspre-commit/ CIcheck_app_r8_score.py.aab)shrinkingRatio,optimizationRatio,obfuscationRatio(0–100) anduncompressedDexSizeBytesagainstr8-baseline.jsonpre-push/ CI2. GitHub Actions Workflow (
.github/workflows/r8_regression_check.yml)Triggers & Inputs
pull_request/push(main): Runs automatically whenever ProGuard/R8 files (**/*.pro), Gradle build scripts (**/build.gradle.kts,gradle/libs.versions.toml,gradle.properties),r8-baseline.json, orscripts/check_*.pychange.workflow_dispatch: Supports manual execution against any PR or commit with configurable thresholds:pr_number: Optional PR number to checkout and comment on.max_score_drop(default2.0): Maximum allowed drop in R8 shrinking, optimization, or obfuscation scores (percentage points).max_dex_growth_pct(default5.0): Maximum allowed uncompressed DEX size increase (%).min_lib_shrinking_pct(default90.0): Minimum required isolated DEX shrinking percentage for module AARs (%).Workflow Pipeline Steps
.pro,.gradle.kts,libs.versions.toml, andgradle.propertieschanges into.gemini/pr_diff.patch.androidCLI (https://dl.google.com/android/cli/latest/linux_x86_64/install.sh) and adds ther8-analyzerskill (android skills add --agent=gemini --project=. r8-analyzer)../gradlew :app:bundleRelease assembleReleaseto produce the release App Bundle (app-release.aab) and module AARs (*-release.aar).app_r8_gate): Runscheck_app_r8_score.pyto compare the release.aabagainstr8-baseline.jsonand writes the scorecard to.gemini/r8_summary.mdand$GITHUB_STEP_SUMMARY.lib_r8_gate): Runscheck_library_shrinking.py(--scan-libraries --append-summary) across built module AARs to verify isolated R8 shrinking ratios and flag package-wide consumer keep rules.main: Onpushtomainwhen both gates pass, runscheck_app_r8_score.py --save-baselineand auto-commits updated metrics tor8-baseline.json.gemini_review): If either gate fails, invokesgoogle-github-actions/run-gemini-cliwith ther8-analyzerskill to inspect.gemini/pr_diff.patchand pinpoint the exact keep rule or dependency causing the regression.r8-analyzerremediation recommendations directly to the PR viagh pr comment, uploadsr8-config-analyzer-report(r8-config-analyzer-release.html), and fails the check if any regression threshold was breached.3. Presubmit Git Hooks (
scripts/git-hooks/&.pre-commit-config.yaml)scripts/git-hooks/pre-commit: Runscheck_staged_r8_diff.pyon staged changes andcheck_library_shrinking.pyon built module AARs.scripts/git-hooks/pre-push: Runscheck_app_r8_score.pyagainstr8-baseline.jsonwhen a release.aabis present..pre-commit-config.yaml: Exposes three independent hook IDs (r8-staged-diff-and-deps,r8-library-shrinking-gate,r8-app-bundle-score-gate) so teams usingpre-commitcan enable individual checks.