Add experimental AST-based optimizer and optimize_ast entrypoint; parametrize tests #3
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.
Motivation
Description
delayed_image.experimental.astoptwith driver, rule registry, traversal helpers, and canonical-signature helpers (optimizer.py,rules.py,transformer.py,signature.py, plus package__init__.py).delayed_image.experimental.astopt.optimize()andoptimize_trace(), and addedDelayedOperation.optimize_ast()(and.pyistub) which forwards to the experimental optimizer; the existingoptimize()behavior is unchanged.tests/conftest.pywith fixtures to parametrize between the legacy and AST optimizer, added equivalence/idempotence tests intests/test_ast_optimize_equivalence.py, and updated several existing tests to run against both optimizer callables.CHANGELOG.md).Testing
python run_tests.py, which runspytestplus xdoctest); the run collected 184 items and produced a mixed result: 113 passed, 19 failed, 52 skipped, and 2 warnings.tests/test_ast_optimize_equivalence.py) passed in the test runs that exercised them, and the paramaterized tests exercised bothoptimize()andoptimize_ast()paths.NotImplementedErrorfromkwimage.warp_affinebecause theskimagebackend is not available in this environment, and xdoctest failures caused by blocked external demo image downloads); these are pre-existing environment-sensitive failures rather than regressions in the new optimizer integration.Codex Task