Skip to content

Test approx_df cubic2 inside shard_map - #210

Merged
f0uriest merged 4 commits into
f0uriest:mainfrom
nstarman:test/shard-map-derivs
Nov 24, 2026
Merged

f0uriest merged 4 commits into
f0uriest:mainfrom
nstarman:test/shard-map-derivs

Conversation

@nstarman

@nstarman nstarman commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Adds a regression test that runs approx_df(..., "cubic2") inside jax.shard_map, with the values passed in as a shard_map input and the knots closed over, for each bc_type (not-a-knot, natural, clamped, periodic). It checks the result against the plain vmap. The test is skipped on jax older than 0.6.1, which has no jax.shard_map.

With jax 0.8 through 0.11 (the newest v0.3.15 allows), interpax v0.3.15 raised ValueError: Vector and operator structures do not match here. The lineax solve compares the operator's structure with the right-hand side's, sharding included, and from jax 0.8 the right-hand side carries the manual mesh sharding inside shard_map. The tridiagonal solve in v0.3.16 fixed it, and this test keeps it fixed on jax >= 0.8. On older jax the old code passed too, so there the test can't catch that regression. A one-device mesh is enough to trigger it, so the test runs on CPU CI.

🤖 Generated with Claude Code

Values mapped over a shard_map axis with unmapped knots used to fail in the
lineax solve ("Vector and operator structures do not match"). The tridiagonal
solve from v0.3.16 handles it; this pins that for every bc_type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.35%. Comparing base (a2f7fd1) to head (df8ba73).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #210   +/-   ##
=======================================
  Coverage   98.35%   98.35%           
=======================================
  Files           8        8           
  Lines        1699     1699           
=======================================
  Hits         1671     1671           
  Misses         28       28           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

nstarman and others added 2 commits November 22, 2026 22:14
jax.shard_map arrived in jax 0.6.1, below which the test raised
AttributeError. Also say what triggers the old failure: f entering
shard_map as an input while x is closed over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The old lineax failure only shows with jax >= 0.8, where the right-hand side
carries the manual mesh sharding. Pass axis=0 by keyword and say why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@f0uriest
f0uriest merged commit 98a3fee into f0uriest:main Nov 24, 2026
10 checks passed
@nstarman
nstarman deleted the test/shard-map-derivs branch November 24, 2026 13:21
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