feat: desugar lambdas in aot-bytecode, an opt-in step for starts without a JDK AOT cache #527
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 323 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.346
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #527"
general
weight: 0.35
alvarosanchez
What.
desugarLambdas(true), a second opt-in step ofClassPathTransform, turns eachLambdaMetafactory.metafactorysite into a call to a class generated next to its host. Sites of one host with the same interface, method and captures share a class, as in micronaut-projects/micronaut-build#957.Why. Without a JDK AOT cache, every start spins a hidden class per lambda it reaches, mostly in dependencies (#521).
How. Runner's desugarer (alvarosanchez/micronaut-runner@6363090) on an open class path, where uncertain names stay. A site also stays when its interface's initializer could reach it first, as core's
ConversionContextdoes. Plugins calldesugarLambdas(true); Runner (#250) addsforeignPackages(Set.of("io.micronaut.runner")).Tests. 121 unit tests, which fail to compile on 3406ef4 and catch 45 mutations; "Class path corpus" also starts an app under
-Xverify:all(with-cp).Results (Apple M4 Pro, 12 CPUs, 48 GB; JDK 25; Micronaut 5.1.5; Docker's Linux VM). Readiness unless RSS, % [95% CI], 3 sessions × 20 pairs (cached: 12 caches), timed at 1e51b2b, which rewrote 2 more sites per app; data-security held out.
| | hello-netty | benchmark-large | data-security |
|---|---|---|---|
| Fat JAR, no cache | −8.2 [−8.7, −7.5] | −7.6 [−8.3, −7.3] | −7.5 [−7.9, −6.7] |
| Docker layout, 2 CPUs | −8.9 [−9.9, −8.1] | −7.3 [−8.3, −6.9] | −5.3 [−5.8, −4.8] |
| Fat JAR, AOT cache | +0.8 [+0.2, +1.4] | +0.7 [+0.2, +1.2] | −1.3 [−1.5, −1.1] |
| RSS, Docker layout, 2 CPUs | −2.2 [−2.7, −1.7] | −3.6 [−3.8, −3.3] | −6.3 [−6.6, −5.8] |
JDK 27 agrees without a cache. One class per site (3de85df): −5.7, −5.9, −4.7; cached +1.7, +1.3.
Criteria of #521
-Xverify:all; no class verifies worse: met.STORED+6.7 to +7.1% (Runner per site: +9.8%).Open questions
1. Shared classes follow #957, not reviewed yet.
2. No
closedClassPath: open mode rewrites Runner's sites here, but for the initializer rule's 2 per app; the 2 extrashadowedOrUncertainare reactor-core's multi-release base copy.3. Cached: +0.7–0.8% on JDK 25 with 5.1.5; not significant on JDK 27, nor with micronaut-projects/micronaut-core#13650 and #957's modules. Acceptable?
4. Docs: a section of
classPathTransform.adoc.Fixes #521
🤖 Generated with Claude Code