Skip to content

Stabilize Sybil doctests against JAX scalar repr drift#671

Draft
nstarman with Copilot wants to merge 6 commits into
versions/v1.11.xfrom
copilot/fix-unxt-python-3-13-job
Draft

Stabilize Sybil doctests against JAX scalar repr drift#671
nstarman with Copilot wants to merge 6 commits into
versions/v1.11.xfrom
copilot/fix-unxt-python-3-13-job

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

The failing unxt Python 3.13 on macos-latest job was caused by brittle doctest expectations, not a quantity-operation regression. JAX scalar Array(...) reprs vary by environment (weak_type=True, optional trailing dtype metadata), and Sybil was treating those formatting differences as failures.

  • Root cause

    • Doctests in Python docstrings and docs assumed a single exact scalar JAX repr.
    • On the failing runner, valid outputs differed only in optional repr metadata.
  • Doctest normalization

    • Added a custom Sybil/doctest output checker in conftest.py.
    • Normalizes JAX scalar repr noise before comparison:
      • strips optional weak_type=True
      • normalizes doctest placeholders like dtype=float32, ... so they still match when no extra metadata is present
  • Scope

    • Keeps runtime quantity behavior unchanged.
    • Applies only to doctest evaluation, so existing examples remain readable while becoming portable across JAX/Python/platform combinations.
  • Coverage

    • Added focused unit tests for the checker:
      • accepts repr-only variation
      • rejects substantive output changes

Example of the normalized mismatch this addresses:

# expected in doctest
Quantity(Array(2., dtype=float32), unit='m')

# actual on some runners
Quantity(Array(2., dtype=float32, weak_type=True), unit='m')

Copilot AI changed the title [WIP] Fix failing GitHub Actions job for Python 3.13 on macOS Stabilize Sybil doctests against JAX scalar repr drift Jun 29, 2026
Copilot AI requested a review from nstarman June 29, 2026 08:40
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.

2 participants