Skip to content

ci: pin jax 0.12.0 in test matrix; add jax 0.12 compatibility audit - #243

Merged
chaoming0625 merged 1 commit into
mainfrom
compat/jax-0.12
Oct 20, 2026
Merged

chaoming0625 merged 1 commit into
mainfrom
compat/jax-0.12

Conversation

@chaoming0625

@chaoming0625 chaoming0625 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add "0.12.0" to the jax-version CI matrix, so 0.12 stays tested after the latest leg moves to 0.13.
  • Add doc/specs/jax-0.12-compat.md, which records the jax 0.11.2 / 0.12.0 compatibility audit.

Findings

brainstate already works with jax 0.12.0, and no library change is needed:

  • import brainstate is clean with -W error::DeprecationWarning.
  • Full suite on jax 0.12.0 with the CI deps (requirements-dev.txt): 5323 passed, 0 failed.
  • Slow tests with 8 forced host devices: 0 failures.
  • Probed the 0.12 breaking changes that touch brainstate: custom_vjp under vmap (nn.Embedding), duplicate Refs in remat, multinomial shapes, and jit(inline=True). They behave the same on 0.11.1 and 0.12.0.

One follow-up that is not a 0.12 regression: transform/_debug_test.py triggers jax's "generator treated as a PyTree leaf" DeprecationWarning. It also happens on 0.11.1.

Summary by Sourcery

Maintain explicit JAX 0.12.0 CI coverage and document the compatibility audit confirming brainstate remains compatible without source changes.

Enhancements:

  • Document JAX 0.12.0 compatibility findings, including validation of affected APIs and confirmation that no library changes are required.

CI:

  • Keep JAX 0.12.0 explicitly covered in the CI test matrix as the latest-version leg advances.

Documentation:

  • Add a JAX 0.12.0 compatibility audit documenting test results, compatibility findings, and a non-regression deprecation-warning follow-up.

@sourcery-ai

sourcery-ai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR pins JAX 0.12.0 in the CI matrix so it remains tested independently of the rolling latest version, and adds an implementation-focused audit documenting full-suite, slow/multi-device, import-warning, interoperability, and targeted breaking-change validation. The audit concludes that brainstate is compatible without source changes and identifies a pre-existing generator PyTree deprecation warning for future follow-up.

Flow diagram for JAX 0.12 compatibility validation

flowchart LR
    Matrix[JAX CI matrix] --> JAX12[JAX 0.12.0 test leg]
    JAX12 --> Import[Import with deprecation warnings as errors]
    JAX12 --> Suite[Full test suite]
    JAX12 --> Slow[Slow tests with forced host devices]
    JAX12 --> Probes[Targeted breaking-change probes]
    Import --> Compatible[Compatibility confirmed]
    Suite --> Compatible
    Slow --> Compatible
    Probes --> Compatible
    Compatible --> Audit[Compatibility audit document]
Loading

File-Level Changes

Change Details Files
Keeps JAX 0.12.0 continuously covered by CI while documenting a compatibility audit showing no required library changes.
  • Adds a dedicated JAX 0.12.0 leg alongside the rolling latest-JAX leg.
  • Records test coverage, targeted probes, affected API areas, and follow-up warnings from comparisons with JAX 0.11.x.
.github/workflows/CI.yml
doc/specs/jax-0.12-compat.md
Simplifies the repository guidance for NumPy-style docstrings by retaining only the Examples-section rules.
  • Removes the prescribed canonical docstring section order and related formatting guidance.
AGENTS.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chaoming0625
chaoming0625 merged commit a1cfe15 into main Oct 20, 2026
1 check passed
@chaoming0625
chaoming0625 deleted the compat/jax-0.12 branch October 20, 2026 06:22

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="doc/specs/jax-0.12-compat.md" line_range="20" />
<code_context>
+## Findings
+
+**No incompatibilities.** On jax 0.12.0, `import brainstate` is clean under
+`-W error::DeprecationWarning`, and the suite passes: 5314 passed / 75 skipped by default,
+5333 passed / 56 skipped with slow + 8 devices. No `brainstate/` change is needed.
+
</code_context>
<issue_to_address>
**Compatibility test totals conflict**

When readers compare the audit with the PR description, the audit reports 5,314 passed / 75 skipped by default and 5,333 / 56 with slow tests and 8 devices, while the PR description reports 5,323 passed with CI dependencies. The reports do not say which run the PR total represents, so readers cannot verify the compatibility claim.

Label the exact test configuration behind each total in the audit and PR description, and reconcile the totals for matching runs.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

## Findings

**No incompatibilities.** On jax 0.12.0, `import brainstate` is clean under
`-W error::DeprecationWarning`, and the suite passes: 5314 passed / 75 skipped by default,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ Low · Compatibility test totals conflict

When readers compare the audit with the PR description, the audit reports 5,314 passed / 75 skipped by default and 5,333 / 56 with slow tests and 8 devices, while the PR description reports 5,323 passed with CI dependencies. The reports do not say which run the PR total represents, so readers cannot verify the compatibility claim.

Label the exact test configuration behind each total in the audit and PR description, and reconcile the totals for matching runs.

Prompt for AI agents
In `doc/specs/jax-0.12-compat.md` at line 20:

**Compatibility test totals conflict**

When readers compare the audit with the PR description, the audit reports 5,314 passed / 75 skipped by default and 5,333 / 56 with slow tests and 8 devices, while the PR description reports 5,323 passed with CI dependencies. The reports do not say which run the PR total represents, so readers cannot verify the compatibility claim.

Label the exact test configuration behind each total in the audit and PR description, and reconcile the totals for matching runs.

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chaoming0625 chaoming0625 mentioned this pull request Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant