feat: RBS size reduction#3382
Merged
Merged
Conversation
jterapin
reviewed
May 14, 2026
Contributor
jterapin
left a comment
There was a problem hiding this comment.
Looking great so far. I'm curious to see the overall size reduction. Could you calculate the before vs after for all of our service gems? I think this will be great to highlight once this gets to prod.
As for the CodeQL failure, will this failure persist after this merge? If so, we should find a way to suppress (if not useful) or find a fix for it.
jterapin
approved these changes
May 18, 2026
Contributor
jterapin
left a comment
There was a problem hiding this comment.
Looks great. I would recommend that you run rake sdk:build to see the codegenerated outputs are exactly you expected.
jterapin
approved these changes
May 19, 2026
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.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Changes & Impact
aws-sdk-<service>/sig/folder in generated service gems by factoring out repeatedly used nested input struct definitions intosig/params.rbsas typealiases that get reused insig/client.rbs.sig/types.rbscannot be reused because that would make methods no longer accept hash literals.aws-sdk-quicksight. Itssig/folder at the time of this PR (aws-sdk-quicksight v1.179.0) was 35.5MB, but after this refactor it's reduced to 0.925MB, which is a reduction of about 97.3%. With other big services like EC2 and S3, reduction is much less due to those services primarily using flat input shape structure. EC2 gets about 5% reduction to itssig/(3.34MB => 3.17MB) and S3 gets about 1.5% reduction to itssig/(445KB => 439KB)....in RubyMine.InputTypeAliasCollectorwalks through shapes, caching names of shapes within operation input shapes that appear more than once & would end up taking more than 5 lines in rendered RBS if it were to be generated fully without typealias. It then returns topologically sorted shapes so that leaf shapes (shapes without dependencies) can get rendered first in RBS, allowing latter shapes to simply refer to leaf shapes in their own definitions.params.rbsto look at child typealias definitions anyways & couple extra type alises don't hurt, so additional complexity isn't worth it.