Summary
The 1D and 2D drift-diffusion solvers stop on the potential-step criterion alone. current_rel_change is measured and recorded, but there is no established acceptance criterion for it.
The current wording is appropriately narrow (potential-step-converged), but the CLI still exits 0 and writes a completed artifact. A caller therefore has no machine verdict for whether the current iteration has settled; exit 4 is reached only when the potential step fails.
This is already acknowledged in AGENTS.md and pinned by test_pn1d_grid_robustness.py, but it has no GitHub issue tracking the missing criterion.
Reproduction
Public main at 5100ab0:
tarhan --format json run solve \
semiconductor.pn.drift-diffusion.1d.steady \
--bias 0.1 --output /tmp/tarhan-low
tarhan --format json run solve \
semiconductor.pn.drift-diffusion.1d.steady \
--bias 0.4 --output /tmp/tarhan-high
Both commands exit 0 after three Gummel iterations and report potential-step-converged:
| bias |
psi_step |
current_rel_change |
| 0.1 V |
1.2079e-13 |
3.4901e-04 |
| 0.4 V |
1.2914e-10 |
2.7995e-09 |
The 0.1 V artifact records the distinction honestly:
{
"solver_status": "potential-step-converged",
"current_convergence": "measured:3.490e-04"
}
Code path
models/pn1d.py: the loop breaks when psi_step < gummel_tol; current_rel_change is diagnostic only.
models/pn2d.py: the same stopping structure is used.
cli.py: the diagnostic is copied into metrics/provenance, while the successful run remains exit 0.
What this issue does not claim
This is not evidence that either reported current is wrong. In particular, 0.1 V is one of the current-validation points in the capability record. The demonstrated problem is narrower: the solver contract has no current-based acceptance verdict, so potential convergence and current convergence cannot be distinguished by exit status.
Definition of done
- Establish a defensible current-convergence metric and threshold for 1D and 2D, including the difficult cases already documented:
- equilibrium, where net current is a cancellation and a relative change may be undefined;
- a first/single pass, where there is no previous current;
- platform-dependent floating-point variation.
- Decide how that verdict affects
solver_status and EXIT_NO_CONVERGENCE without relabelling the existing phase/potential criterion.
- Add negative-control tests showing the criterion rejects a sequence that is still materially changing and accepts a genuinely settled sequence.
- Keep the existing measured diagnostic in artifacts so the decision remains auditable.
Until a threshold is established, retaining the current honest potential-step-converged wording is preferable to inventing one from the two measurements above.
Summary
The 1D and 2D drift-diffusion solvers stop on the potential-step criterion alone.
current_rel_changeis measured and recorded, but there is no established acceptance criterion for it.The current wording is appropriately narrow (
potential-step-converged), but the CLI still exits 0 and writes a completed artifact. A caller therefore has no machine verdict for whether the current iteration has settled; exit 4 is reached only when the potential step fails.This is already acknowledged in
AGENTS.mdand pinned bytest_pn1d_grid_robustness.py, but it has no GitHub issue tracking the missing criterion.Reproduction
Public
mainat5100ab0:Both commands exit 0 after three Gummel iterations and report
potential-step-converged:psi_stepcurrent_rel_change1.2079e-133.4901e-041.2914e-102.7995e-09The 0.1 V artifact records the distinction honestly:
{ "solver_status": "potential-step-converged", "current_convergence": "measured:3.490e-04" }Code path
models/pn1d.py: the loop breaks whenpsi_step < gummel_tol;current_rel_changeis diagnostic only.models/pn2d.py: the same stopping structure is used.cli.py: the diagnostic is copied into metrics/provenance, while the successful run remains exit 0.What this issue does not claim
This is not evidence that either reported current is wrong. In particular, 0.1 V is one of the current-validation points in the capability record. The demonstrated problem is narrower: the solver contract has no current-based acceptance verdict, so potential convergence and current convergence cannot be distinguished by exit status.
Definition of done
solver_statusandEXIT_NO_CONVERGENCEwithout relabelling the existing phase/potential criterion.Until a threshold is established, retaining the current honest
potential-step-convergedwording is preferable to inventing one from the two measurements above.