chore: scope the jaxtyping lint ignores so F821 runs everywhere else - #3194
Merged
Conversation
F821 (undefined name) was disabled repo-wide for jaxtyping's shape strings, so ruff could not report a missing import anywhere in prime-rl — and style CI runs only ruff. Four modules actually use those annotations; the ignore now names them. The fifth file the rule fired on was not jaxtyping: rotary_emb annotated a config it never imported, so the name resolved to nothing. Imported. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mikasenghaas
marked this pull request as ready for review
August 4, 2026 22:42
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
samsja
approved these changes
Aug 4, 2026
samsja
reviewed
Aug 4, 2026
eligotts
added a commit
that referenced
this pull request
Aug 5, 2026
Main's standalone env servers (#3162) moved env workers out of the orchestrator process, so the orchestrator-side apply_run_asset_env no longer reaches them. The run image-asset env now rides the launcher's env-server spawn (the process that actually renders and offloads images); the orchestrator-side apply and spawn injection are deleted as dead plumbing. Standalone env servers set VF_RENDERER_IMAGE_OFFLOAD_DIR themselves. Also imports EncodedTensor in trainer/batch.py, surfaced by main's F821 scope fix (#3194). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
F821(undefined name) was disabled repo-wide:jaxtyping needs it —
Int[Tensor, "batch seq"]is a string annotation ruff reads as a forwardreference — but the ignore was global, so ruff could not report a missing import anywhere in
prime-rl, and
style.yamlruns only ruff. A missing import is then invisible to lint, invisibleto CI, and invisible to
pytestunless a test happens to execute that line: importing the modulesucceeds, because the
NameErroronly fires when the function is called.Four modules actually use jaxtyping annotations, so the ignore names them:
New jaxtyping usage outside these fails lint until it is added here, which is the point — the entry
should be deliberate.
The fifth file was a real bug
F821also fired ontrainer/models/layers/rotary_emb.py, and not for jaxtyping:Nothing imports that name, so the annotation refers to nothing —
typing.get_type_hints(_compute_default_rope_parameters)raisesNameErroronmain. Fixed byimporting it (
transformersis already a hard import in that module), and the hint now resolves.It is not in the ignore list.
Verification
ruff check src tests packages— clean.typing.get_type_hintson the rope helper resolves after the fix, raises before it.uv run pytest tests/unit— 485 passed. One pre-existing, unrelated failure on this box(
test_qwen3_vl_e2e, stale fixture, fix: token_id-formatted logprob tokens in the qwen3-vl fake engine #3161).Follow-up
This closes the cheap half. The other half is that prime-rl has no type checker in CI at all —
verifiers runs
Ty, and something equivalent here would catch the attribute-level version of this(reading a field that no longer exists), which
F821does not.🤖 Generated with Claude Code
Note
Low Risk
Lint configuration and a type-hint import fix; no runtime behavior change beyond correct annotation resolution.
Overview
Ruff
F722/F821are no longer ignored repo-wide. They stay suppressed only on the four trainer modules that use jaxtyping shape annotations, so missing imports and undefined names surface everywhere else in CI.rotary_emb.pyhad a realF821: the helper annotatedOptional["PreTrainedConfig"]without importing that name. The PR importsPretrainedConfigfromtransformersand uses it in the hint soget_type_hintsresolves correctly.Reviewed by Cursor Bugbot for commit 062e837. Bugbot is set up for automated code reviews on this repo. Configure here.