Skip to content

P2.7 Dissipative forces: backend test scaffold (migration deferred to Pspecial)#897

Closed
jobovy wants to merge 1 commit into
feat/backendsfrom
feat/P2.7-dissipative
Closed

P2.7 Dissipative forces: backend test scaffold (migration deferred to Pspecial)#897
jobovy wants to merge 1 commit into
feat/backendsfrom
feat/P2.7-dissipative

Conversation

@jobovy

@jobovy jobovy commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Part of the P2.x series (→ #892). Dissipative / velocity-dependent forces (f=f(x,v)).

Outcome (conservative, by design): zero compute methods migrated — every force path in ChandrasekharDynamicalFrictionForce and FDMDynamicalFrictionForce irreducibly uses scipy.special.erf/sici + a scipy.interpolate sigmar spline + a mutable input-hash cache + data-dependent branching, all out of scope until the Pspecial backend router. No source files changed → numpy path byte-identical by construction.
Deliverable: tests/test_backend_dissipative.py — 6 passed, 2 strict-xfail. Establishes the v=[vR,vT,vz] calling convention + _cached_force*{...} factoring + below-minr-zero branch, pins the numpy values as a regression guard, and documents (xfail) that jax.grad currently raises TracerArrayConversionError (auto-flips to PASS once Pspecial + a cache/branching refactor land).
Follow-up: after Pspecial provides backend erf/sici and a backend-friendly sigmar, refactor the cache (gate on xp is numpy) + branches (xp.where), then migrate _calc_force + add real parity/grad tests. (This is also "route 2" — the C-STM dissipative Jacobian — on the variational side.)

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.92%. Comparing base (141ebfe) to head (e0d6567).

Additional details and impacted files
@@              Coverage Diff               @@
##           feat/backends     #897   +/-   ##
==============================================
  Coverage          99.92%   99.92%           
==============================================
  Files                228      228           
  Lines              34213    34213           
  Branches             712      723   +11     
==============================================
  Hits               34186    34186           
  Misses                27       27           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

DissipativeForce / planarDissipativeForce / ChandrasekharDynamicalFrictionForce
/ FDMDynamicalFrictionForce. Establishes the velocity-dependent-force convention
(forces take v=[vR,vT,vz]). No compute methods migrated: every force compute
path routes through scipy.special.erf/sici, a scipy.interpolate sigmar spline, a
mutable input-hash cache, and data-dependent branching -- all deferred to the
later scipy.special (Pspecial) router. Adds tests/test_backend_dissipative.py
pinning the numpy path + velocity convention and documenting the deferred jax/
torch differentiability via strict xfail.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jobovy jobovy force-pushed the feat/P2.7-dissipative branch from 2ca9833 to e0d6567 Compare June 5, 2026 16:54
@jobovy jobovy marked this pull request as ready for review June 6, 2026 01:08
@jobovy

jobovy commented Jun 8, 2026

Copy link
Copy Markdown
Owner Author

Closing per review: the dissipative-forces test scaffold on its own isn't worth merging. The real DissipativeForce/ChandrasekharDynamicalFriction/FDMDynamicalFriction namespace-swap (P2.7) will be done as a proper migration after Pspecial lands (some of these depend on special functions), and the tests will go in with that work. Superseded by the upcoming post-Pspecial dissipative migration.

@jobovy jobovy closed this Jun 8, 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