Repository navigation
perf: generate only used Platform API operations - #644
Merged
Merged
Conversation
|
Member
Author
|
@greptileai The P1 packaging finding is fixed: the crate include list now contains |
alongubkin
force-pushed
the
alon/alien-861-filter-platform-rust-client
branch
from
September 17, 2026 23:27
e08c465 to
87286d1
Compare
alongubkin
enabled auto-merge (squash)
September 17, 2026 23:57
alongubkin
force-pushed
the
alon/alien-861-filter-platform-rust-client
branch
from
September 18, 2026 00:04
87286d1 to
848a198
Compare
alongubkin
added a commit
that referenced
this pull request
Sep 18, 2026
## Summary - give exact repeated anonymous object schemas deterministic component identity before filtered Platform Rust generation - reuse unique existing components and fail on generated-name or content-hash collisions - preserve the two anonymous schema families whose path-derived Rust types are imported by handwritten Alien consumers - tighten the filtered generated-source regression ceiling from 600,000 to 240,000 lines - leave the default full 229-operation SDK unchanged ## Evidence The filtered generated client shrinks: | Metric | Before | After | Change | | --- | ---: | ---: | ---: | | Rust lines | 534,989 | 195,463 | -63.5% | | Bytes | 22,198,092 | 7,342,952 | -66.9% | | Structs | 2,003 | 1,125 | -43.8% | | Enums | 1,372 | 518 | -62.2% | | Impl blocks | 14,187 | 7,524 | -47.0% | In an empty-target stacked `cargo check -p alien-cli --timings`: - full CLI: 1m55s (previous stacked runs: 1m57.74s and 2m21.89s) - Platform rustc unit: 12.9s (previous: 28.6-29.8s) - Platform generator run: 1.9s (previous: 4.7-5.2s) - warm filter edit through final CLI: 8.42s Azure and native `aws-lc-sys` now dominate the cold critical path, so the deterministic source and unit reductions are stronger attribution than the smaller wall-time change. ## Validation - `cargo test -p alien-platform-api --no-default-features --features rustls` - `cargo test -p alien-platform-api` - `cargo check -p alien-cli` - empty-target `cargo check -p alien-cli --timings` - `git diff --check` The first consumer check identified 13 imports of path-derived generated types. The generator now protects exactly the two corresponding schema families and fails if either pointer disappears; the complete CLI compiles without call-site changes. Depends on #644. Linear: ALIEN-866
alongubkin
added a commit
that referenced
this pull request
Oct 5, 2026
## Problem #644 made the Rust Platform API client generate only the operations Alien calls. It kept the full client behind the default `full-api` feature. But `cargo build` or `cargo test` at the workspace root (and CI's `cargo test --workspace` / `cargo nextest run --workspace`) selects `alien-platform-api` as a package, so its default features apply. Feature unification then gives every consumer the full unfiltered client. In a cold CI test build: | `alien-platform-api` part | Now | Filtered | |---|---|---| | lib | 156 s | 26 s | | lib unit-test target | 147 s | 22 s | | build script | 31 s | < 5 s | ## Change - **`default = ["rustls"]`:** `full-api` is opt-in. SDK users who want every operation add `features = ["full-api"]`. **Release note:** this changes the crate's default features. - **docs.rs metadata enables `full-api`,** so the published docs still show the complete SDK. - **New `Platform SDK full-api tests` step.** It runs `cargo test -p alien-platform-api --features full-api`, so `tests/command_registry_unavailable.rs` (`#![cfg(feature = "full-api")]`) keeps running. - In `ci-fast.yml`, it runs when `client-sdks/platform/rust/**`, `Cargo.toml` or `Cargo.lock` change, or on manual runs. - In `ci-fork.yml`, it runs on every fork PR. ## Measured Cold `cargo test --workspace --features alien-manager/openapi,alien-bindings/platform-sdk --no-run` on `depot-ubuntu-24.04-arm-8`, CI settings, 3 runs each: | | Wall | CPU (user) | |---|---|---| | main | 388, 398, 407 s | ~1,790 s | | this change | **301, 317, 318 s** | ~1,523 s | That's about −22% on the build part of the `Rust crates` job, and the same for any workspace-root build locally. All test targets compile with the filtered client. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
full-apifeatureImpact
cargo check -p alien-cli --timings: 7m13s baseline -> 2m34s observedThe timing runs used empty Cargo target directories on the same machine but were recorded under different system load and filesystem-cache conditions. The generated-source reduction is deterministic; timing ratios are observed rather than a perfectly controlled attribution.
Validation
cargo check -p alien-clicargo test -p alien-platform-api --no-default-features --features rustlscargo test -p alien-platform-apiLinear: ALIEN-861