Repository navigation
Conversation
Reviewer's GuideData structuresDefine the optimizer’s result shape, supported levels, and bounded literal eligibility that the optimization passes depend on.
APIExpose the optimizer and its pass-count result as a public Python API.
Add optimization options to compiler, run, and CLI entry points, resolving configuration and applying optimization to generated code.
ImplementationImplement bounded AST rewrites, preserve source when optimization is disabled or no pass applies, and validate optimized output.
ConfigurationDocument the default-Python-compatibility invariant and the requirement for explicit, tested opt-ins.
Advertise the experimental optimization option and its configuration form to users.
DocumentationExplain optimization levels, invocation, pass behavior, and limitations.
TestsCover optimizer behavior and safety, pass counts, API/config/CLI integration, include handling, and default Python compatibility.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
First optimizer foundation: conservative literal folding, constant conditional-expression simplification, immutable literal membership, pass reports, opt-in -O0 through -O3 config/API/CLI integration, and differential tests. O2/O3 currently share the same passes; no performance claims or automatic unsafe transformations. Later PRs add native runtime specialization. No release or merge.
Summary by Sourcery
Introduce an experimental, opt-in AST optimization backend while preserving unoptimized compilation as the default.
New Features:
Enhancements:
Documentation:
Tests: