Status Update
Comments
ch...@google.com <ch...@google.com>
ch...@google.com <ch...@google.com> #2
Hi,
I also see my text cut off when I set maxLines = 2
. Is it the same issue?
Box(
modifier =
Modifier.size(
width = 108dp,
height = 34dp,
),
contentAlignment = Alignment.Center,
) {
BasicText(
text = "text text text",
maxLines = 2,
autoSize = AutoSize.StepBased(minFontSize = 1.sp, maxFontSize = 13.sp, stepSize = 0.2.sp),
)
}
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
Author: Jossi Wolf <
Link:
Fix TextAutoSize bug with maxLines = 1
Expand for full commit details
Fix TextAutoSize bug with maxLines = 1
We were overcaching the paragraphIntrinsics in MultiParagraphLayoutCache when mutating the style. For `AutoSizeStepBased` instances with biased windows (more values smaller/bigger than the optimal), this could result in performing layout with outdated intrinsics, and thus an outdated style and font size, without surfacing this in the TextLayoutResult.
Test: New MultiParagraphLayoutCacheTests and manual testing
Relnote: Fixed a bug in BasicText with TextAutoSize and maxLines set to 1.
Fixes: 376834366
Change-Id: Ic0450c763c5d764492995b44ee1fe570246a9689
Files:
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/modifiers/MultiParagraphLayoutCacheTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/MultiParagraphLayoutCache.kt
Hash: e1b712d78cc60384ed67a56c006148291ba146a6
Date: Tue Jan 07 18:52:26 2025
ap...@google.com <ap...@google.com> #4
#2, yeah, that's the same issue.
ap...@google.com <ap...@google.com> #5
Thanks @jossiwolf@google.com for fixing this! Do you know when the fix would be available for g3 apps?
ap...@google.com <ap...@google.com> #6
Moving the internal discussion offline. The bug is fixed and the fix available in snapshot builds. We will comment on this issue when the bug fix is included in a release.
ap...@google.com <ap...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-beta01
androidx.compose.foundation:foundation-android:1.8.0-beta01
androidx.compose.foundation:foundation-jvmstubs:1.8.0-beta01
androidx.compose.foundation:foundation-linuxx64stubs:1.8.0-beta01
ap...@google.com <ap...@google.com> #8
Branch: 4.0
commit b86fdf2b2427605e6a238a0232932fa1268245f8
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Feb 09 11:16:04 2023
Refinements to value-is-dead analysis
Bug:
Fixes:
Change-Id: I8007b13e2a4e0c32dffc181a827867ff4ab0373e
M src/main/java/com/android/tools/r8/ir/code/ValueIsDeadAnalysis.java
M src/main/java/com/android/tools/r8/ir/optimize/DeadCodeRemover.java
ap...@google.com <ap...@google.com> #9
Branch: 4.0
commit 472c7fab11e7da906d07eb04d8600f6aea8d3c1e
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Feb 09 11:15:38 2023
Fix repeated analysis of values in dead code removal
Bug:
Change-Id: I9deebf700e936ad81a8fb25d067acc04637d980d
M src/main/java/com/android/tools/r8/ir/code/ArrayPut.java
M src/main/java/com/android/tools/r8/ir/code/ValueIsDeadAnalysis.java
M src/main/java/com/android/tools/r8/ir/optimize/DeadCodeRemover.java
M src/main/java/com/android/tools/r8/utils/MapUtils.java
ap...@google.com <ap...@google.com> #10
Branch: 4.0
commit b14e5bc4c5f41fc593cc6176de220ce43d9c899f
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Feb 09 11:15:14 2023
Rewrite value-is-dead analysis to a worklist algorithm
Bug:
Change-Id: I699f43eba8774083a4b5f2aa2edf7c5d80df4c8e
M src/main/java/com/android/tools/r8/ir/code/ValueIsDeadAnalysis.java
ap...@google.com <ap...@google.com> #11
Branch: 4.0
commit 4621177fe24819fe5459b065a9d6d138cb79b5b2
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Feb 09 11:14:33 2023
Refactor value-is-dead analysis to separate analysis class
Bug:
Change-Id: I8b881203ebe21395f48c8eeb6434faa03f7f9d46
M src/main/java/com/android/tools/r8/ir/code/BasicBlock.java
M src/main/java/com/android/tools/r8/ir/code/Value.java
A src/main/java/com/android/tools/r8/ir/code/ValueIsDeadAnalysis.java
M src/main/java/com/android/tools/r8/ir/optimize/DeadCodeRemover.java
ap...@google.com <ap...@google.com> #12
Branch: 8.0
commit 376af144cf327f0f2b0a2de0a38939a59216a08d
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Feb 09 11:25:18 2023
Version 8.0.29
Bug:
Bug:
Change-Id: I994d406bae7514482ffdf2ef10f092b5a96cc328
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #13
Branch: 8.0
commit 77704f63db4161833b7072c42cbf9869a2f20e80
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Feb 09 11:23:20 2023
Refinements to value-is-dead analysis
Bug:
Fixes:
Change-Id: I8007b13e2a4e0c32dffc181a827867ff4ab0373e
M src/main/java/com/android/tools/r8/ir/code/ValueIsDeadAnalysis.java
M src/main/java/com/android/tools/r8/ir/optimize/DeadCodeRemover.java
ap...@google.com <ap...@google.com> #14
Branch: 8.0
commit 33930d7b7ff37a746a304bb0230b34123b1e0e6f
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Feb 09 11:22:50 2023
Fix repeated analysis of values in dead code removal
Bug:
Change-Id: I9deebf700e936ad81a8fb25d067acc04637d980d
M src/main/java/com/android/tools/r8/ir/code/ArrayPut.java
M src/main/java/com/android/tools/r8/ir/code/ValueIsDeadAnalysis.java
M src/main/java/com/android/tools/r8/ir/optimize/DeadCodeRemover.java
M src/main/java/com/android/tools/r8/utils/MapUtils.java
ap...@google.com <ap...@google.com> #15
Branch: 8.0
commit 923cf259db1b2f35578a486960afcd28369c520f
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Feb 09 11:22:16 2023
Rewrite value-is-dead analysis to a worklist algorithm
Bug:
Change-Id: I699f43eba8774083a4b5f2aa2edf7c5d80df4c8e
M src/main/java/com/android/tools/r8/ir/code/ValueIsDeadAnalysis.java
ap...@google.com <ap...@google.com> #16
Branch: 8.0
commit 736dd75501862e23764d265887a99ef8d8af0c9d
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Feb 09 11:21:02 2023
Refactor value-is-dead analysis to separate analysis class
Bug:
Change-Id: I8b881203ebe21395f48c8eeb6434faa03f7f9d46
M src/main/java/com/android/tools/r8/ir/code/BasicBlock.java
M src/main/java/com/android/tools/r8/ir/code/Value.java
A src/main/java/com/android/tools/r8/ir/code/ValueIsDeadAnalysis.java
M src/main/java/com/android/tools/r8/ir/optimize/DeadCodeRemover.java
ch...@google.com <ch...@google.com> #17
This should now be fixed in R8 versions 4.0.53 and 8.0.29 - and next week in 8.1.19-dev.
On my machine the build time for compiling the reproduction with R8 is down from ~190s to ~3s.
bv...@gmail.com <bv...@gmail.com> #18
I just tested 4.0.53: on the sample project it also runs in ~3s in my machine. The larger project now finishes within a few minutes, and that previously took almost an hour, wow. Thanks!
Any idea when this fix will become available in the AGP? Next release of Android Studio, I assume?
ch...@google.com <ch...@google.com> #19
Thanks for the confirmation. This will hopefully make it into Flamingo (AGP 8.0).
Description
We're using Renderscript in one of our projects and noticed that our build times for a minified release build went up by a factor of 3 after upgrading the Android Gradle Plugin from 7.3.1 to 7.4.0: from 17 minutes to 53 minutes.
For each Renderscript file, two files are generated: a
ScriptC_$name
file which contains bridging functions, and a$nameBitCode
file which contains a few huge byte arrays that are compiled into GPU code on the user's phone. R8 takes a very long time to process this last file.I made a sample project here:https://github.com/bvschaik/r8-renderscript-minify-issue here .
This project contains a copy of the BitCode class that's generated by Renderscript
Using AGP 7.4.0 (uses R8 4.0.48), running assembleRelease on this project takes almost 4 minutes, with 3m40s taken up by the
minifyReleaseWithR8
task.Downgrading AGP to 7.3.1 (uses R8 3.3.83), the
minifyReleaseWithR8
"only" takes 1m10s, which is still quite long for processing some static byte arrays.For now we're forcing R8 to the last available 3.3 version to get back to acceptable build times.
What could cause this increase in build times?
Why is R8 spending so much time on relatively simple code?
What can we do to tell R8 "don't change anything in this file"? I tried various -keep rules but it didn't make a difference.