Repository navigation
partition schemas and model stubs - #871
Open
stobrien89 wants to merge 1 commit into
Open
stobrien89 wants to merge 1 commit into
stobrien89 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Generated-output compatibility and lint failures remain, alongside schema-planning and partition-weighting issues that undermine scalability.
4 open issues
What changed in this PR
This PR extends the native standalone types generator with private schema and model-stub partitions, reducing memory use and static analysis time while retaining stable facade modules.
Changes:
- Adds configurable partition targets, defaulting to 250 items.
- Balances schema partitions by estimated source size and keeps recursive components together.
- Adds partitioning tests and documents output layout, compatibility, and benchmark results.
| File | Description |
|---|---|
| packages/smithy-python/tests/unit/test_schemas.py | Tests thresholds, lazy loading, recursion, and size balancing. |
| packages/smithy-python/tests/unit/test_models.py | Tests partitioned stubs, public models, and strict Pyright. |
| packages/smithy-python/tests/unit/test_generation.py | Tests partition defaults and positive-value validation. |
| packages/smithy-python/src/smithy_python/schemas.py | Adds weighted schema partitions and a lazy facade. |
| packages/smithy-python/src/smithy_python/models.py | Adds private stub partitions and public re-exports. |
| packages/smithy-python/src/smithy_python/generation.py | Defines and validates partition settings. |
| designs/codegen/types.md | Updates settings and large-model design guidance. |
| designs/codegen/partitioning.md | Documents partitioning behavior and performance measurements. |
| designs/codegen/index.md | Links the partitioning design. |
Review effort: Balanced
stobrien89
force-pushed
the
native-codegen-partitioning
branch
from
October 25, 2026 23:44
818584f to
91cc4c3
Compare
stobrien89
marked this pull request as ready for review
October 26, 2026 00:32
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.

Issue #, if available:
#797
Description
Partitions large standalone types packages to reduce generation memory and static analysis time.
Stacked on #866 and intended to be reviewed against
native-types-cli-integration.Changes
schemas.pyandmodels.pyifacades.EC2 benchmark
Measured on x86 with 4,065 selected shapes, five runs, and one warmup.
Validation
Compatibility
Public model imports, lazy model construction, schema identity, serde behavior, and typing remain unchanged. Partition files live under
_private.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.