Skip to content

Non-determinism in examples, traced back to initial implicit residual in ImplicitEquationJacobian #2228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
charleskawczynski opened this issue Mar 11, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@charleskawczynski
Copy link
Member

Found (by luck) in #2225. I've since initialized the data to zeros, to help improve CI determinism, but if after

    ∂Yₜ∂Y = FieldMatrix(...)

we do

    fill!(parent(∂Yₜ∂Y[ᶜρ_name, ᶠ𝕄_name]), NaN)
    fill!(parent(∂Yₜ∂Y[ᶜ𝔼_name, ᶠ𝕄_name]), NaN)
    fill!(parent(∂Yₜ∂Y[ᶠ𝕄_name, ᶜρ_name]), NaN)
    fill!(parent(∂Yₜ∂Y[ᶠ𝕄_name, ᶜ𝔼_name]), NaN)
    fill!(parent(∂Yₜ∂Y[ᶠ𝕄_name, ᶠ𝕄_name]), NaN)

then the solution is (sometimes) driven to NaNs. This appears to be a bug because the solution should not depend on the initial state of the residual--it should be (properly) computed before it is used.

Here are two builds where I've observed this (I also observed this locally):

However, I just tried ∂Yₜ∂Y with NaNs, and the solution was NaN-free, so this seems to be non-deterministic.

Running on the CPU, with Julia 1.10, here is a "reproducer": ENV["TEST_NAME"] = "sphere/held_suarez_rhoe"; using Revise; include("examples/hybrid/driver.jl")

cc @dennisYatunin

@charleskawczynski charleskawczynski added the bug Something isn't working label Mar 11, 2025
@charleskawczynski
Copy link
Member Author

Actually, I'm not 100% confident that the issue with this initialization, I used the DebugOnly module and ran with a NaN-callback, and this is where I did find NaNs, but I don't know if that's how it got into the solution. I'm going to leave this issue open for now, since it's still a bit odd. Let's see how the latest push in #2225 goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant