AMReX-Astro / AMReX-Astro/Microphysics

util/hybrj: invalid xtol currently hard-aborts instead of returning solver status

Open
#1,961 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-code-audit
Dominant language
C++
Stars
43
Forks
46
Avg merge
2d 18h
Merged PRs (30d)
15

Description

Summary

For invalid xtol (xtol < 0), hybrj calls amrex::Error, which aborts execution. This differs from MINPACK-style status reporting and makes the solver harder to integrate in robust workflows.

Affected code

  • util/hybrj/hybrj.H: input validation path for xtol

Why this is a problem

A hard abort bypasses normal solver error handling and can terminate larger applications unexpectedly.

Expected behavior

The solver should return a non-success info code (e.g., improper input) and exit cleanly without process termination.

Suggested fix

  • Replace hard abort with status-based return (info = 0 / dedicated bad-input code).
  • Keep behavior consistent with other termination paths that set info and return.

Acceptance criteria

  • Invalid xtol does not abort process.
  • Caller can observe and handle the returned status code.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start in util/hybrj/hybrj.H at the input validation path for xtol and compare it with other termination paths that set info and return. Verify that invalid xtol no longer aborts the process and that the caller receives a non-success status code.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.