Skip to content

Tardis shell convergence criteria is wrong #3769

Done

Description

@jvshields

I think this line is wrong

return fraction_converged > self.threshold

Our config ymls have a reasonable field for this in convergence_strategy.fraction that is probably intended to set what fraction of cells you want to be converged before accepting that iteration.

Instead, tardis just checks against threshold again, which is what you set to specify what the convergence criterion for each shell should be.

This basically means, if you say you want your shells to be converged to 5% or better, then you're ALSO only asking 5% of the shells to converge. Which has to be wrong.

Activity

  1. anshuman83-40 commented on Oct 9, 2026

    @anshuman83-40

    I'd like to work on this. The fix looks like reading convergence_strategy.fraction in ConvergenceSolver and comparing fraction_converged against it instead of threshold. Since this changes when runs are considered converged, it will likely shift the regression data. Is it OK to go ahead with that behavior change?

  2. shabanali53216-gif commented on Oct 12, 2026

    @shabanali53216-gif

    Hi I'd like to help investigate this issue. I'll trace how convergence_strategy.fraction is passed into ConvergenceSolver and check the existing tests before proposing a fix. I'll also look into the expected regression-test changes to make sure the updated convergence behaviour is covered.

  3. anshuman83-40 commented on Oct 12, 2026

    @anshuman83-40

    I'll step back from this one, feel free to take it. For whoever picks it up: convergence_strategy.fraction isn't read anywhere in the code any more; release-2023.01.11 compared against it in Simulation._get_convergence_status.

  4. bhabishnu commented on Oct 25, 2026

    @bhabishnu

    I traced this back to the older convergence logic: the converged-shell fraction used to be compared against convergence_strategy.fraction, while the current code compares it against self.threshold.

    The existing test only covers all/none converged, so it misses the partially converged case.

    One question: should exactly fraction count as converged? The old code used >, while the config description sounds closer to >=.

  5. andrewfullard commented on Nov 24, 2026

    @andrewfullard
    Contributor

    Fixed by #3833

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions