Conversation
Contributor
|
@stroxler has exported this pull request. If you are a Meta employee, you can view the originating Diff in D120593117. |
This comment has been minimized.
This comment has been minimized.
Summary: Implicit jaxtyping dimensions were created from shape-string uses during solving, so identity depended on solve order and was not scoped to the function that introduced the name. When `static_jaxtyping` is present, resolve shape names to the source-anchored variables recorded by the binder. Function finalization binds variables declared by that exact definition, in declaration order. Undeclared names and scalar/variadic mismatches are errors; without a declaration, jaxtyping retains its ordinary gradual `Annotated` meaning. Validate the resulting function parameters in the same transition: declaration names may not collide with written parameters, and a declared parameter may not follow a defaulted one. Differential Revision: D120593109
Summary: Jaxtyping annotations now resolve the source-anchored variables recorded by their declarations, leaving the mutable solve-time quantified cache unused. Remove the cache, its synthetic identity constructors, and the field threaded through `AnswersSolver`. This is a behavior-preserving cleanup after the resolution change. Differential Revision: D120709371
Summary: The flag existed because jaxtyping support had no other switch: the syntax was interpreted wherever it appeared, so the only way to not have it was to turn it off for a whole project or sub-config. `static_jaxtyping` is a finer switch in the same place the annotations are, and it is now the only way shape checking is reached, which leaves the flag with nothing to decide. A project with the flag set and no declarations behaved exactly as one without it. Removing it takes out the option, its accessor and default, the `bool` threaded through the solver context and the state steps, the test-environment toggle, and the schema entry. The documentation loses the option's section and the two pages that told readers to set it. Differential Revision: D120593110
Summary: A nested `static_jaxtyping` declaration should add local dimensions without hiding dimensions declared by an enclosing function. Expose enclosing declaration scopes as an innermost-first iterator and resolve each dimension through it. The implementation does not allocate or thread a scope vector through parsing helpers; lookup occurs only when a shape name needs resolution. Only dimensions declared directly on a function contribute new callable type parameters. Differential Revision: D120593111
Summary: Class attributes and methods need to share symbolic dimensions, which jaxtyping annotations cannot express on their own. Allow `static_jaxtyping` on classes and add every declared dimension to the class generic parameters. Build each quantified variable once at binding time and resolve it through an owner-aware scope table. Full class-statement ranges make declarations visible in their own headers while preventing capture across nested-class boundaries. At runtime, use the shared legacy `_F` TypeVar so the decorator parses on Python 3.10. Decorated classes erase trailing shape arguments while preserving ordinary generic subscriptions and the origin of inherited subscriptions. Differential Revision: D120593112
Summary: The jaxtyping corpus grew as individual syntax cases were added, leaving related behavior spread across several small files. Group successful lowering cases in `test_desugaring.py` and declaration failures in `test_declaration_errors.py`. This is a test-only reorganization with fewer files and no change to expected checker behavior. Differential Revision: D120593113
Summary: Pull Request resolved: #4985 Document `static_jaxtyping` as the explicit opt-in for experimental jaxtyping shape checking, including function and class scope, composition, supported syntax, and gradual behavior outside a declaration. The reference describes the generic `IntTuple`-bounded integration only; the removed legacy `ShapedArray` bridge is not presented as supported. Differential Revision: D120593117
meta-codesync
Bot
force-pushed
the
export-D120593117
branch
from
September 19, 2026 05:50
9cfe171 to
f37beab
Compare
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
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:
Document
static_jaxtypingas the explicit opt-in for experimental jaxtyping shape checking, including function and class scope, composition, supported syntax, and gradual behavior outside a declaration.The reference describes the generic
IntTuple-bounded integration only; the removed legacyShapedArraybridge is not presented as supported.Differential Revision: D120593117