You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for the great code! I've been using Inti.jl as part of a package to simulate cytoskeletal dynamics (with fluid flows), and have found the code mostly very easy to work with. One thing that I try to do to speed up startup is to cache the precomputed singular integral operators (and their factorizations) associated with large objects to file, and in certain cases I started getting strange (i.e. clearly incorrect) results. After tracing things back, the root cause appears to be that mesh generation is not necessarily deterministic. I've attached a minimal working example. Really, it's the creation of the "Domain" that is not deterministic --- given a fixed Domain, the resultant mesh (and associated quadrature etc) are all generated deterministically, but generation of a Domain from geometric information produces non-deterministic behavior.
using Inti
functiontest(Domain=nothing)
Domain =if Domain ===nothing
Inti.GeometricEntity("ellipsoid") |> Inti.Domain
else
Domain
end
Boundary = Inti.boundary(Domain)
msh = Inti.meshgen(Boundary; meshsize=0.1)
display(msh.nodes[1])
end# not deterministicfor i in1:5test()
end# deterministic
Domain = Inti.GeometricEntity("ellipsoid") |> Inti.Domain
for i in1:5test(Domain)
end# what changes?for i in1:5
Domain = Inti.GeometricEntity("ellipsoid") |> Inti.Domain
display(Domain.keys.dict.slots)
display(Domain.keys.dict.keys.ptr)
end
Thanks for the bug report and the MWE. The issue stems from the fact that Dicts and Sets in Julia are not deterministic themselves: there is no guarantee connection between the insertion order and the iteration order AFAIK. And Sets are used in Inti to store entities in a Domain right now.
For your example, while the meshes were correct and always the same, I understand that you may want/expect the mesh structure to be invariant. I am gonna push a fix soon 👍
Hi @dbstein, I forgot to ping you earlier. I tried to address the issue you mentioned, but I’m not entirely sure it fully resolves it (the issue was auto-closed since it was linked to the PR I merged 😅). I hope that you can cache the pre-computation of the singular corrections now! Let me know if something still does not work and I can re-open this issue.
Yes, I saw, and thanks for the quick work! I'm deep in the midst of sorting out another (unrelated) bug --- I'll test your fix as soon as I sort that and let you know if everything is resolved.
Activity
maltezfaria commentedon Jan 22, 2026
Thanks for the bug report and the MWE. The issue stems from the fact that
Dicts andSets in Julia are not deterministic themselves: there is no guarantee connection between the insertion order and the iteration order AFAIK. AndSets are used inIntito store entities in aDomainright now.For your example, while the meshes were correct and always the same, I understand that you may want/expect the mesh structure to be invariant. I am gonna push a fix soon 👍
replace all uses of `Set` and `Dict` by their ordered equivalent
maltezfaria commentedon Jan 26, 2026
Hi @dbstein, I forgot to ping you earlier. I tried to address the issue you mentioned, but I’m not entirely sure it fully resolves it (the issue was auto-closed since it was linked to the PR I merged 😅). I hope that you can cache the pre-computation of the singular corrections now! Let me know if something still does not work and I can re-open this issue.
maltezfaria commentedon Jan 26, 2026
And there is a new tagged version with the fix, so you can run
pkg> updateto fetch it.dbstein commentedon Jan 26, 2026
Yes, I saw, and thanks for the quick work! I'm deep in the midst of sorting out another (unrelated) bug --- I'll test your fix as soon as I sort that and let you know if everything is resolved.
dbstein commentedon Feb 12, 2026
Took a while to get back and check on this, but I can confirm that this fixes the issue I was having. Thanks!