Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

NSE EOS Jacobians use cubic derivatives when linear interpolation is selected

Open
#2,074 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@zingale is already working on this.

Since Oct 5, 2026.

  • #2110 by @zingale — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
backend

Research direction

Start in nse_tabular/nse_table.H at the affected ranges 429-440, 496-539, and 549-592, then trace the callers in nse_tabular/nse_eos.H. Reproduce the reported derivatives at the supplied T, rho, and Ye with linear interpolation, and verify finite-difference checks in both linear and cubic modes away from cell boundaries.

Written by the indexing model from the issue text.

Description

ai-code-audit nse

Reviewed commit: 3ac0bda4f00da3eed0446beadfc1cd5c51b99a40

Suggested priority: Medium

Affected code: nse_tabular/nse_table.H:429-440, nse_tabular/nse_table.H:496-539, nse_tabular/nse_table.H:549-592; callers in nse_tabular/nse_eos.H.

Description

nse_interp() honors network.nse_table_interp_linear, but nse_interp_dT() and nse_interp_drho() always differentiate the cubic interpolant. The EOS inversion routines therefore use derivatives of a different composition function from the one used to evaluate their residuals.

Reproduction

Set linear interpolation and use T=5.18e9 K, rho=1.23e9 g/cm^3, Ye=0.472. Compare the returned abar derivatives to centered finite differences of nse_interp() with relative perturbation 1e-5:

Derivative Reported Finite difference
dabar/dT -1.072562604210832e-9 -1.097834698172967e-9
dabar/drho 3.987522835638749e-10 4.095838820409504e-10

The discrepancies are approximately 2.3% and 2.6%. With cubic interpolation selected, the same check agrees closely.

Expected behavior / suggested fix

Differentiate the selected interpolant, or explicitly select matching value/derivative routines within the inversions. Add finite-difference checks in both modes, away from cell boundaries.

Impact and validation: An inconsistent Newton Jacobian can impair convergence. The derivative mismatch is reproduced; a linear-mode inversion failure is not claimed. See reproduction-output.txt

reproduction-output.txt

.

Dominant language
C++
Stars
44
Forks
47
Avg merge
3d 7h
Merged PRs (30d)
10

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AMReX-Astro/Microphysics

All issues in AMReX-Astro/Microphysics

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.