Developer
Ruslan Latypov
latypov@meta.com
Performance
YoY:+1060%Key patterns and highlights from this developer's activity.
Breakdown of growth, maintenance, and fixes effort over time.
Bugs introduced vs. fixed over time.
Reclassifies engineering effort based on bug attribution. Commits that introduced bugs are retrospectively counted as poor investments.
Investment Quality reclassifies engineering effort based on bug attribution data. Commits identified as buggy origins (those that introduced bugs later fixed by someone) have their grow and maintenance time moved into the Wasted Time category. Their waste (fix commits) remains counted as productive. All other commits retain their standard classification: grow is productive, maintenance is maintenance, and waste (fixes) is productive.
The standard model classifies commits as Growth, Maintenance, or Fixes. Investment Quality adds a quality lens: a commit that introduced a bug is retrospectively counted as a poor investment — the engineering time spent on it was wasted because it ultimately required additional fix work. Fix commits (Fixes in the standard model) are reframed as productive, because fixing bugs is valuable work.
Currently computed client-side from commit and bug attribution data. Ideal server-side endpoint:
POST /v1/organizations/{orgId}/investment-quality
Content-Type: application/json
Request:
{
"startTime": "2025-01-01T00:00:00Z",
"endTime": "2025-12-31T23:59:59Z",
"bucketSize": "BUCKET_SIZE_MONTH",
"groupBy": ["repository_id" | "deliverer_email"]
}
Response:
{
"productivePct": 74,
"maintenancePct": 18,
"wastedPct": 8,
"buckets": [
{
"bucketStart": "2025-01-01T00:00:00Z",
"productive": 4.2,
"maintenance": 1.8,
"wasted": 0.6
}
]
}Latest analyzed commits from this developer.
| Hash | Message | Date | Files |
|---|
Commit activity distribution by hour and day of week. Shows when this developer is most active.
Developers who frequently work on the same files and symbols. Higher score means stronger code collaboration.
| Effort |
|---|
| 85a6ba38 | This commit **removes the `should_kosabi_jvm_abi_gen_use_k2` flag** from the build system, simplifying Kotlin compilation configuration. It **automates the use of the K2 `kosabi jvm-abi-gen` plugin** by making `KotlinDaemon` automatically select it whenever a target's language version supports K2. This **refactoring** impacts Starlark rule declarations for `android_library` and `kotlin_library`, where the flag is removed, and updates `KotlinCStepsBuilder.java` to eliminate K1-forcing logic for source-only ABI. The decision to use K2 kosabi is now derived directly from `languageVersion.getSupportsK2()`, streamlining the build process by removing a legacy configuration option and ensuring modern ABI generation is used by default. | Mar 26 | 6 | maint |
| d6575031 | This commit introduces a new mechanism for **per-class dependency file tracking** within the **Kosabi** compiler plugin. It adds a `KosabiClassUsageCollector` that performs a **FIR tree walk** after Kosabi analysis to identify classpath class usage. This **new capability** directly addresses limitations with the existing `DependencyTracker` plugin extensions, which were incompatible with Kosabi's isolated project environment and its skipped checker phase. By analyzing declaration-level types and expression-level references, this approach accurately captures dependencies, **improving the correctness and efficiency** of incremental builds for Kosabi-generated ABI. The `K2JvmAbiFirAnalysisHandlerExtension.kt` file integrates this collector into the analysis pipeline. | Mar 22 | 2 | grow |
| e7fa6d80 | This commit **enables K2 Kosabi JVM ABI generation by default** for all Kotlin targets by setting the `should_kosabi_jvm_abi_gen_use_k2` flag to `True` within the **Kotlin build system's** `kotlin_library` rule and `kotlincd_jar_creator` functions. This **feature enablement** significantly impacts the **ABI generation process**, ensuring that new Kotlin targets leverage the K2 compiler for ABI creation. Concurrently, it introduces **critical stability improvements and bug fixes** to the K2 JVM ABI generation logic. These improvements include stripping unresolvable supertypes and adding a `SafeParcelizeIrExtensionWrapper` to prevent crashes, thereby providing a more robust and reliable default experience for the **K2 JVM ABI generator**. | Mar 18 | 3 | waste |
| b8d7b933 | This commit introduces a **performance optimization** by adding a `skip_classpath_removal_rebuild` attribute to **`kotlin_library` and `android_library` rules**. This new **configuration capability** allows **Buck's Kotlin compilation pipeline** to bypass the forced full rebuild that previously occurred when classpath entries were removed, a mechanism introduced to mitigate an upstream Kotlin incremental compiler bug. By setting this flag, projects can opt out of the `ClasspathChangesFactory`'s classpath removal detection, trading potential correctness issues for significant build speed improvements, particularly for large applications like WhatsApp Android. This provides a crucial **workaround** until the underlying compiler issue is resolved. | Mar 14 | 12 | maint |
| 2a2f265b | This commit introduces a **new capability** to enhance **build performance analytics** by adding **lexer-based token counting** for Kotlin and Java source files during compilation. It integrates this functionality directly into the **Kotlin compilation process** within Buck, specifically updating the **`kotlincd_actions` telemetry system** to include `num_kotlin_tokens` and `num_java_tokens` fields. A new utility, `SourceTokenCounter`, is added to perform this counting, and the `KotlinCDLoggerAnalytics` infrastructure is updated to log these new metrics. This enables more accurate **build speed normalization** (tokens/second) in Scuba, facilitating the identification of abnormally slow targets and cross-app comparisons with negligible performance impact. | Mar 3 | 8 | maint |
| fe6b94b5 | This commit **fixes a critical bug** in the **K2 Kosabi ABI generation** process that caused `javac` to fail with "class file not found" errors. Previously, **private nested classes** were entirely stripped from the ABI jar and Kotlin Metadata, despite references remaining in the bytecode. The fix modifies the `removeNonPublicApi` and `isPrivateFirDeclaration` logic within `K2JvmAbiFirAnalysisHandlerExtension.kt` to **retain these private nested classes as stubs**, mirroring K1 Kosabi's behavior. This ensures **ABI compatibility** and prevents downstream compilation failures when consuming K2-generated ABI jars. | Feb 25 | 1 | waste |
| a59ae9b4 | This commit **fixes a critical bug** in the **Kotlin JVM ABI generation compiler plugin** by replacing a faulty heuristic for **file facade detection** with the compiler's reliable `isFileClass` property. Previously, the heuristic in `K2JvmAbiFirAnalysisHandlerExtension.kt` could incorrectly classify regular classes as file facades, causing their Class protobufs to be misinterpreted as Package protobufs. This misinterpretation led to corrupt entries where field 5 (`TypeParameter`) was read as `TypeAlias`, resulting in **crashes** with the error "No expandedType in ProtoBuf.TypeAlias". The change ensures accurate ABI generation and prevents these runtime failures by correctly distinguishing between class and package protobufs. | Feb 25 | 1 | waste |
| ceb82d10 | This commit **fixes a bug** in the **Kotlin ABI generation** logic, specifically within `prelude/kotlin/kotlincd_jar_creator.bzl`. Previously, the build would incorrectly fail if the K2 plugin was not supplied, even when `source_only_abi` was intentionally disabled and the plugin was not needed. The check in `_encode_kotlin_extra_params` is now refined to **only trigger a failure when a source-only ABI build explicitly requires the K2 plugin**, preventing unnecessary build interruptions. Additionally, the repeated comparison for `source_only_abi` mode is extracted into a new `is_source_only_abi` variable for improved readability and maintainability. This **refactoring** enhances the robustness and flexibility of the **Kotlin build system**. | Feb 17 | 1 | waste |
| d964efe1 | This commit **enables** the generation of **used-classes depfiles** for **K2 source-only ABI** builds, removing precautionary guards that previously disabled this functionality. It modifies the `kotlincd_jar_creator.bzl` Starlark rule and the `KotlincStep.java` class to ensure the **dep-tracker plugin** registers and writes depfiles consistently. This is a **feature enablement** and **maintenance** task, as the guards are now obsolete given the plugin's independent operation from K1/K2. The change improves **incremental build performance** and accuracy for Kotlin projects by leveraging detailed dependency information during K2 ABI generation. | Feb 17 | 2 | grow |
| 7c9b24d9 | This commit **fixes a bug** in the **K2 Kosabi missing type collector** within the **K2 JVM ABI generation process** by correctly handling `FirTypeAlias` declarations. Previously, the collector failed to detect missing types referenced through type aliases, leading to incomplete ABI jars and `No expandedType in ProtoBuf.TypeAlias` errors in downstream targets. The change introduces logic in `K2JvmAbiFirAnalysisHandlerExtension` to traverse the expanded type of `FirTypeAlias` declarations, both from source and dependencies, ensuring that all transitive dependencies are properly identified. This **enhances the robustness of ABI generation** by preventing silent omissions of required types and ensuring correct stub generation. | Feb 17 | 1 | waste |
| 766d6031 | This commit delivers **two crucial bug fixes** for **K2 Kosabi ABI generation**, enhancing compatibility and preventing downstream compilation errors. It now **strips `@Throws` annotations** from `RuntimeInvisibleAnnotations` during bytecode post-processing, resolving issues where Safe Kotlin would incorrectly complain about exceptions. Furthermore, it enables **IR-level stripping of `SOURCE`-retention annotations** by calling `stripSourceRetentionAnnotations()` within `K2JvmAbiFirAnalysisHandlerExtension.kt`, which prevents `javac` from failing with "Cannot find annotation method" when compiling against ABI jars with `-Werror`. This ensures that only `BINARY`/`CLASS` retention annotations, essential for processors, are preserved, aligning K2's ABI output with expected behavior and avoiding build breaks. | Feb 16 | 1 | waste |
| a0607f04 | This commit delivers a **bug fix** for **K2 Kosabi ABI generation**, resolving an issue where private interface methods were erroneously included in Kotlin `Metadata` annotations, leading to KSP2/DI processor failures. The previous attempt to strip these declarations was ineffective due to cached FIR scopes. The new solution **post-processes the bytecode** of generated `.class` files, employing ASM and `kotlinx-metadata-jvm` to filter out private functions, properties, and constructors from the `Metadata` `d1`/`d2` arrays. This robust approach, implemented through a new `BytecodeTransformer` interface, ensures accurate ABI generation and **fixes KSP2/DI processor failures** related to incorrect method signatures. | Feb 16 | 2 | grow |
| 328ba893 | This commit **fixes a bug** in the **K2 JVM ABI generation** process within the **Kosabi compiler plugin**. Previously, the `removeNonPublicApi` function in `K2JvmAbiFirAnalysisHandlerExtension.kt` was erroneously stripping the mandatory backing field of **Kotlin `JvmInline value class`** instances, which is required by the `JvmInlineClassLowering` phase. The **bug fix** introduces a check for `inlineClassRepresentation?.underlyingPropertyName` to explicitly preserve any `IrField` or `IrProperty` matching this name. This ensures that **Kotlin `JvmInline value class` compilation** proceeds correctly by maintaining essential internal fields, preventing compilation failures or incorrect ABI generation when using the Kosabi plugin. | Feb 16 | 1 | waste |
| 43cc4c7c | This commit introduces a **bug fix** to the **Kotlin metadata serialization** process, specifically within the `K2JvmAbiFirAnalysisHandlerExtension`. It addresses an issue where private declarations, such as interface methods with default implementations, were incorrectly included in the `Metadata` annotation's `d1`/`d2` arrays, despite being correctly stripped from bytecode. By adding `stripPrivateDeclarationsFromFirMetadataSources()`, this change ensures that private methods, properties, and constructors are removed from `FirMetadataSource` before the **JVM backend** serializes Kotlin metadata. This prevents failures in **KSP2/DI processors** that rely on accurate metadata, resolving errors caused by unexpected private declarations. | Feb 16 | 1 | waste |
| 6c9b2d36 | This commit **fixes a critical bug** in the **K2 JVM ABI generation plugin** by correcting a type mismatch within the `removeNonPublicApi` function in `K2JvmAbiFirAnalysisHandlerExtension.kt`. Previously, **private and local API members** were not properly stripped from the generated ABI due to an incorrect comparison between `DescriptorVisibility?` and `Visibility` types. This **bug fix** ensures that the ABI accurately reflects only public declarations, improving **ABI correctness and reducing its size**. Additionally, test expectations for **internal classes** in the source-only ABI are updated to align with K1 behavior, supporting inline functions and incremental compilation. | Feb 16 | 1 | waste |
| 0faeb435 | This commit provides a **bug fix** for the **K2 Kosabi plugin** by **stripping private supertypes from FIR metadata sources** before `Metadata` annotations are generated. Previously, while private interfaces were correctly removed from IR and bytecode via `removeNonPublicApi()`, their references persisted in FIR-generated metadata, leading to "cannot access supertype" errors during downstream compilation. The new `stripPrivateSupertypesFromFirFirMetadataSources()` function in `K2JvmAbiFirAnalysisHandlerExtension.kt` now uses actual FIR visibility to accurately identify and remove these private supertype references, distinguishing them from valid dependencies. This **prevents downstream compilation failures** and ensures that necessary interface methods are correctly copied and serialized in the class's metadata, improving the robustness of ABI generation. | Feb 16 | 2 | waste |
| 9c329fc5 | This commit **fixes a critical bug** in the **K2 Kosabi compiler plugin** that caused incorrect stripping of internal supertypes from **FIR metadata** during ABI generation. Previously, `implements` clauses for interfaces from internal classes were erroneously removed, leading to **broken default parameter resolution** in Kotlin. By stopping this stripping and refining the logic in `K2JvmAbiFirAnalysisHandlerExtension.kt` to only remove private classes, the commit ensures that necessary type information is preserved in the ABI. This resolves failures like "no value passed for parameter" when invoking methods with default arguments, restoring correct behavior for **Kotlin's default parameter resolution** and aligning with K1's ABI generation. | Feb 16 | 1 | waste |
| 825c53df | This commit **fixes a bug** in the **K2 ABI generator** that caused **duplicate method generation** for **public enums implementing private interfaces**. Previously, the generator would incorrectly create synthetic methods for interface overrides within enum entries, leading to compilation errors. The fix enhances the `getCallableNamesForClass` function in `K2JvmAbiFirAnalysisHandlerExtension.kt` to correctly identify methods already declared in **enum entry anonymous objects**, preventing redundant ABI entries. This ensures accurate **ABI generation** for Kotlin code patterns involving enums and private interface implementations. | Feb 16 | 1 | waste |
| d16f0c25 | This commit implements a **critical performance bug fix** within the **K2 JVM ABI generator**'s `K2JvmAbiFirAnalysisHandlerExtension.kt` file, specifically targeting the `hasErrorExpressionRecursive` function. A double recursion issue previously caused **exponential time complexity** when traversing deeply nested FIR trees, leading to severe **build hangs** that could exceed 42 minutes for targets with complex `when` expressions. The **bug fix** resolves this by removing a redundant `acceptChildren` call and adding an early exit condition, thereby **preventing build timeouts** and significantly improving the efficiency of error expression checking within the **Kotlin compiler plugins**. This ensures more reliable and faster compilation for projects leveraging K2 JVM ABI generation. | Feb 6 | 1 | waste |
| 55c18379 | This commit delivers a **bug fix** for **K2 Kosabi**'s stub generation mechanism, specifically addressing an issue with **Java static fields**. Previously, the system incorrectly generated stubs for Java static fields, such as `Build.VERSION_CODES.R`, because its logic in `K2JvmAbiFirAnalysisHandlerExtension.kt` only accounted for `FirPropertySymbol` and `FirEnumEntrySymbol`, missing the `FirCallableSymbol` subclass that Java static fields represent. The fix extends the stub generation to correctly identify and handle any `FirCallableSymbol` with a matching name, ensuring accurate ABI generation for **Java interoperability**. This change improves the reliability of ABI stubs for Android SDK constants, Java methods, and other callable members. | Feb 6 | 1 | waste |
This commit **removes the `should_kosabi_jvm_abi_gen_use_k2` flag** from the build system, simplifying Kotlin compilation configuration. It **automates the use of the K2 `kosabi jvm-abi-gen` plugin** by making `KotlinDaemon` automatically select it whenever a target's language version supports K2. This **refactoring** impacts Starlark rule declarations for `android_library` and `kotlin_library`, where the flag is removed, and updates `KotlinCStepsBuilder.java` to eliminate K1-forcing logic for source-only ABI. The decision to use K2 kosabi is now derived directly from `languageVersion.getSupportsK2()`, streamlining the build process by removing a legacy configuration option and ensuring modern ABI generation is used by default.
This commit introduces a new mechanism for **per-class dependency file tracking** within the **Kosabi** compiler plugin. It adds a `KosabiClassUsageCollector` that performs a **FIR tree walk** after Kosabi analysis to identify classpath class usage. This **new capability** directly addresses limitations with the existing `DependencyTracker` plugin extensions, which were incompatible with Kosabi's isolated project environment and its skipped checker phase. By analyzing declaration-level types and expression-level references, this approach accurately captures dependencies, **improving the correctness and efficiency** of incremental builds for Kosabi-generated ABI. The `K2JvmAbiFirAnalysisHandlerExtension.kt` file integrates this collector into the analysis pipeline.
This commit **enables K2 Kosabi JVM ABI generation by default** for all Kotlin targets by setting the `should_kosabi_jvm_abi_gen_use_k2` flag to `True` within the **Kotlin build system's** `kotlin_library` rule and `kotlincd_jar_creator` functions. This **feature enablement** significantly impacts the **ABI generation process**, ensuring that new Kotlin targets leverage the K2 compiler for ABI creation. Concurrently, it introduces **critical stability improvements and bug fixes** to the K2 JVM ABI generation logic. These improvements include stripping unresolvable supertypes and adding a `SafeParcelizeIrExtensionWrapper` to prevent crashes, thereby providing a more robust and reliable default experience for the **K2 JVM ABI generator**.
This commit introduces a **performance optimization** by adding a `skip_classpath_removal_rebuild` attribute to **`kotlin_library` and `android_library` rules**. This new **configuration capability** allows **Buck's Kotlin compilation pipeline** to bypass the forced full rebuild that previously occurred when classpath entries were removed, a mechanism introduced to mitigate an upstream Kotlin incremental compiler bug. By setting this flag, projects can opt out of the `ClasspathChangesFactory`'s classpath removal detection, trading potential correctness issues for significant build speed improvements, particularly for large applications like WhatsApp Android. This provides a crucial **workaround** until the underlying compiler issue is resolved.
This commit introduces a **new capability** to enhance **build performance analytics** by adding **lexer-based token counting** for Kotlin and Java source files during compilation. It integrates this functionality directly into the **Kotlin compilation process** within Buck, specifically updating the **`kotlincd_actions` telemetry system** to include `num_kotlin_tokens` and `num_java_tokens` fields. A new utility, `SourceTokenCounter`, is added to perform this counting, and the `KotlinCDLoggerAnalytics` infrastructure is updated to log these new metrics. This enables more accurate **build speed normalization** (tokens/second) in Scuba, facilitating the identification of abnormally slow targets and cross-app comparisons with negligible performance impact.
This commit **fixes a critical bug** in the **K2 Kosabi ABI generation** process that caused `javac` to fail with "class file not found" errors. Previously, **private nested classes** were entirely stripped from the ABI jar and Kotlin Metadata, despite references remaining in the bytecode. The fix modifies the `removeNonPublicApi` and `isPrivateFirDeclaration` logic within `K2JvmAbiFirAnalysisHandlerExtension.kt` to **retain these private nested classes as stubs**, mirroring K1 Kosabi's behavior. This ensures **ABI compatibility** and prevents downstream compilation failures when consuming K2-generated ABI jars.
This commit **fixes a critical bug** in the **Kotlin JVM ABI generation compiler plugin** by replacing a faulty heuristic for **file facade detection** with the compiler's reliable `isFileClass` property. Previously, the heuristic in `K2JvmAbiFirAnalysisHandlerExtension.kt` could incorrectly classify regular classes as file facades, causing their Class protobufs to be misinterpreted as Package protobufs. This misinterpretation led to corrupt entries where field 5 (`TypeParameter`) was read as `TypeAlias`, resulting in **crashes** with the error "No expandedType in ProtoBuf.TypeAlias". The change ensures accurate ABI generation and prevents these runtime failures by correctly distinguishing between class and package protobufs.
This commit **fixes a bug** in the **Kotlin ABI generation** logic, specifically within `prelude/kotlin/kotlincd_jar_creator.bzl`. Previously, the build would incorrectly fail if the K2 plugin was not supplied, even when `source_only_abi` was intentionally disabled and the plugin was not needed. The check in `_encode_kotlin_extra_params` is now refined to **only trigger a failure when a source-only ABI build explicitly requires the K2 plugin**, preventing unnecessary build interruptions. Additionally, the repeated comparison for `source_only_abi` mode is extracted into a new `is_source_only_abi` variable for improved readability and maintainability. This **refactoring** enhances the robustness and flexibility of the **Kotlin build system**.
This commit **enables** the generation of **used-classes depfiles** for **K2 source-only ABI** builds, removing precautionary guards that previously disabled this functionality. It modifies the `kotlincd_jar_creator.bzl` Starlark rule and the `KotlincStep.java` class to ensure the **dep-tracker plugin** registers and writes depfiles consistently. This is a **feature enablement** and **maintenance** task, as the guards are now obsolete given the plugin's independent operation from K1/K2. The change improves **incremental build performance** and accuracy for Kotlin projects by leveraging detailed dependency information during K2 ABI generation.
This commit **fixes a bug** in the **K2 Kosabi missing type collector** within the **K2 JVM ABI generation process** by correctly handling `FirTypeAlias` declarations. Previously, the collector failed to detect missing types referenced through type aliases, leading to incomplete ABI jars and `No expandedType in ProtoBuf.TypeAlias` errors in downstream targets. The change introduces logic in `K2JvmAbiFirAnalysisHandlerExtension` to traverse the expanded type of `FirTypeAlias` declarations, both from source and dependencies, ensuring that all transitive dependencies are properly identified. This **enhances the robustness of ABI generation** by preventing silent omissions of required types and ensuring correct stub generation.
This commit delivers **two crucial bug fixes** for **K2 Kosabi ABI generation**, enhancing compatibility and preventing downstream compilation errors. It now **strips `@Throws` annotations** from `RuntimeInvisibleAnnotations` during bytecode post-processing, resolving issues where Safe Kotlin would incorrectly complain about exceptions. Furthermore, it enables **IR-level stripping of `SOURCE`-retention annotations** by calling `stripSourceRetentionAnnotations()` within `K2JvmAbiFirAnalysisHandlerExtension.kt`, which prevents `javac` from failing with "Cannot find annotation method" when compiling against ABI jars with `-Werror`. This ensures that only `BINARY`/`CLASS` retention annotations, essential for processors, are preserved, aligning K2's ABI output with expected behavior and avoiding build breaks.
This commit delivers a **bug fix** for **K2 Kosabi ABI generation**, resolving an issue where private interface methods were erroneously included in Kotlin `Metadata` annotations, leading to KSP2/DI processor failures. The previous attempt to strip these declarations was ineffective due to cached FIR scopes. The new solution **post-processes the bytecode** of generated `.class` files, employing ASM and `kotlinx-metadata-jvm` to filter out private functions, properties, and constructors from the `Metadata` `d1`/`d2` arrays. This robust approach, implemented through a new `BytecodeTransformer` interface, ensures accurate ABI generation and **fixes KSP2/DI processor failures** related to incorrect method signatures.
This commit **fixes a bug** in the **K2 JVM ABI generation** process within the **Kosabi compiler plugin**. Previously, the `removeNonPublicApi` function in `K2JvmAbiFirAnalysisHandlerExtension.kt` was erroneously stripping the mandatory backing field of **Kotlin `JvmInline value class`** instances, which is required by the `JvmInlineClassLowering` phase. The **bug fix** introduces a check for `inlineClassRepresentation?.underlyingPropertyName` to explicitly preserve any `IrField` or `IrProperty` matching this name. This ensures that **Kotlin `JvmInline value class` compilation** proceeds correctly by maintaining essential internal fields, preventing compilation failures or incorrect ABI generation when using the Kosabi plugin.
This commit introduces a **bug fix** to the **Kotlin metadata serialization** process, specifically within the `K2JvmAbiFirAnalysisHandlerExtension`. It addresses an issue where private declarations, such as interface methods with default implementations, were incorrectly included in the `Metadata` annotation's `d1`/`d2` arrays, despite being correctly stripped from bytecode. By adding `stripPrivateDeclarationsFromFirMetadataSources()`, this change ensures that private methods, properties, and constructors are removed from `FirMetadataSource` before the **JVM backend** serializes Kotlin metadata. This prevents failures in **KSP2/DI processors** that rely on accurate metadata, resolving errors caused by unexpected private declarations.
This commit **fixes a critical bug** in the **K2 JVM ABI generation plugin** by correcting a type mismatch within the `removeNonPublicApi` function in `K2JvmAbiFirAnalysisHandlerExtension.kt`. Previously, **private and local API members** were not properly stripped from the generated ABI due to an incorrect comparison between `DescriptorVisibility?` and `Visibility` types. This **bug fix** ensures that the ABI accurately reflects only public declarations, improving **ABI correctness and reducing its size**. Additionally, test expectations for **internal classes** in the source-only ABI are updated to align with K1 behavior, supporting inline functions and incremental compilation.
This commit provides a **bug fix** for the **K2 Kosabi plugin** by **stripping private supertypes from FIR metadata sources** before `Metadata` annotations are generated. Previously, while private interfaces were correctly removed from IR and bytecode via `removeNonPublicApi()`, their references persisted in FIR-generated metadata, leading to "cannot access supertype" errors during downstream compilation. The new `stripPrivateSupertypesFromFirFirMetadataSources()` function in `K2JvmAbiFirAnalysisHandlerExtension.kt` now uses actual FIR visibility to accurately identify and remove these private supertype references, distinguishing them from valid dependencies. This **prevents downstream compilation failures** and ensures that necessary interface methods are correctly copied and serialized in the class's metadata, improving the robustness of ABI generation.
This commit **fixes a critical bug** in the **K2 Kosabi compiler plugin** that caused incorrect stripping of internal supertypes from **FIR metadata** during ABI generation. Previously, `implements` clauses for interfaces from internal classes were erroneously removed, leading to **broken default parameter resolution** in Kotlin. By stopping this stripping and refining the logic in `K2JvmAbiFirAnalysisHandlerExtension.kt` to only remove private classes, the commit ensures that necessary type information is preserved in the ABI. This resolves failures like "no value passed for parameter" when invoking methods with default arguments, restoring correct behavior for **Kotlin's default parameter resolution** and aligning with K1's ABI generation.
This commit **fixes a bug** in the **K2 ABI generator** that caused **duplicate method generation** for **public enums implementing private interfaces**. Previously, the generator would incorrectly create synthetic methods for interface overrides within enum entries, leading to compilation errors. The fix enhances the `getCallableNamesForClass` function in `K2JvmAbiFirAnalysisHandlerExtension.kt` to correctly identify methods already declared in **enum entry anonymous objects**, preventing redundant ABI entries. This ensures accurate **ABI generation** for Kotlin code patterns involving enums and private interface implementations.
This commit implements a **critical performance bug fix** within the **K2 JVM ABI generator**'s `K2JvmAbiFirAnalysisHandlerExtension.kt` file, specifically targeting the `hasErrorExpressionRecursive` function. A double recursion issue previously caused **exponential time complexity** when traversing deeply nested FIR trees, leading to severe **build hangs** that could exceed 42 minutes for targets with complex `when` expressions. The **bug fix** resolves this by removing a redundant `acceptChildren` call and adding an early exit condition, thereby **preventing build timeouts** and significantly improving the efficiency of error expression checking within the **Kotlin compiler plugins**. This ensures more reliable and faster compilation for projects leveraging K2 JVM ABI generation.
This commit delivers a **bug fix** for **K2 Kosabi**'s stub generation mechanism, specifically addressing an issue with **Java static fields**. Previously, the system incorrectly generated stubs for Java static fields, such as `Build.VERSION_CODES.R`, because its logic in `K2JvmAbiFirAnalysisHandlerExtension.kt` only accounted for `FirPropertySymbol` and `FirEnumEntrySymbol`, missing the `FirCallableSymbol` subclass that Java static fields represent. The fix extends the stub generation to correctly identify and handle any `FirCallableSymbol` with a matching name, ensuring accurate ABI generation for **Java interoperability**. This change improves the reliability of ABI stubs for Android SDK constants, Java methods, and other callable members.