It is not clear to me that init was ever meant to be part of the public API. That said, I think documenting it might help people understand what it does.
My guess is that init was added to solve head off another correct issue early on.
The thread split messed things up, but I was responding to a comment which suggested Numpy wasn’t working as expected but using not using an equivalent bit of code for comparison (i.e. not using the in-place sum function).
But yes, I agree comparisons are only useful insofar as they can correct mistaken assumptions such as “there’s no way to do this safely”. Thankfully sum! at least provides a warning in its docstring, so thus I don’t think it’s the best representative for the broader topic on hand.
To the broader topic, I think what @mschauer touches on about bugs which can show up using only functionality from stdlibs (no “distributed SVD of a BlockedArray filled with Unitful Quaternions”) and the difficulties in getting them fixed is worth exploring. Using Did Julia community do something to improve its correctness? - #121 by mschauer as an example, one can see a number of barriers:
Designing proposed fixes often requires a back-and-forth from subject matter experts and/or those with the commit bit, but can often be left hanging if someone gets busy or moves on without a good way to revive them.
Even when a PR is made, the same can still happen.
There has been plenty of ink spilled on how to solve this, but just to list a couple ideas which resonated with me:
Defining a clear and consistent process for how bug, robustness and maybe docs fixes are triaged and reviewed. e.g. all bugfixes are put into a priority queue based on severity and age, and a certain amount of each triage meeting is set out to go over them.
Defining and adhering to a guideline for when PRs are complete so they can be landed. Whether that’s some combination of approval, green CI, the merge me label, etc, there should be some way to start this process and some sense of urgency to merge once a PR meets the criteria. I’m sure certain parts of Julialang/Julia will want to be excluded from this (the compiler comes to mind), but enabling it for stdlib bugfixes shouldn’t be that disruptive.
But ultimately, how something like this gets done is less important than declaring it will be done and seeing actions being taken towards that end. My impression from the previous discussion threads on robustness is that a number of ideas are thrown around but only the most incremental (if any) changes are implemented. Given that, it’s kind of hard to blame people for bringing the topic up again and again, since what can I or anyone else point at to say “look, it’s being worked on”?
I’m imagining a repo that does a lot of correctness tests independent from the implementations. Things like stats fitting, sampling from distributions, summing things matrix arithmetic, etc etc. Perhaps implementing some tests from NIST suites and such. Then it generates a report, clarifying what common mathematical operations work correctly and what ones don’t.
This test suite could be iterated on much quicker than the fixes, and could be used in the bug fixing process to help approve code.
One methodology might be to calculate various things in both Julia and R and compare them for example.
I appreciate your point that not all packages have the same level of correctness, but I don’t think it’s fair to imply that bugs only occur in obscure or unused packages. For example, the JuliaStats ecosystem, which is widely used and respected, has many correctness issues that affect me and other users. I often encounter problems with @inbounds, type conversions, and out-of-bounds in packages like Distributions.jl and StatsBase.jl. These issues often keep me from using Julia for serious statistical computing, even though I love Turing.jl and many other parts of the Julia ecosystem.
These problems aren’t always related to Julia offering a greater degree of composability either. I often find it easier to compose packages in Python and R than I do in Julia, because they have more standardized and documented interfaces for different tasks. For instance, if I want to use labelled arrays, autodiff, differential equations, or tensor algebra in Python, I know there is a widely adopted package for each one of these purposes (XArray, JAX, Equinox, and PyTensor), all of which have been tested for compatibility with PyMC. In Julia, there are many different implementations of these functionalities, which makes it hard to ensure compatibility and correctness.
This is all even before we start talking about the autodiff ecosystem, which is often a major barrier to making any serious progress in Julia. I appreciate the progress that Enzyme has made here over the past year, but I still have some concerns about whether its current problems are just growing pains, or if they just reflect the difficulty of trying to write autodiff in assembly. After being burned by several autodiff systems with major correctness bugs, there’s a real feeling in the community that we can’t fully trust anything until we’ve tested it in our own code.
Syntactic macros, performance, cleaner mathematical syntax, better abstractions (Distributions.jl has an amazing high-level design, despite all of its correctness issues), functional/procedural programming instead of OOP, not having to learn/work in C++…
There’s lots of great things about Julia! But unfortunately, a well-tested and thoroughly-debugged ecosystem isn’t one of them.
This is an unhelpful overgeneralization, IMO. In my six years with Julia I think I reported a couple of minor bugs in the standard library, and about the same number elsewhere…
Please at least try a fair read of my comments. I obviously am not implying bugs only occur in obscure or unused packages. I remain one of the biggest critics of JuliaStats for a multitude of reasons. My point is precisely that I know JuliaStats has these issues, but that doesn’t mean other ecosystems have these issues. People who are pointing to this correctness problem keep pointing to examples in JuliaStats. Yes, I agree JuliaStats has many issues, but “Julia” is not just “JuliaStats”. Equating the two is a huge huge huge generalization of the Julia community. So it’s funny that the example that you point out is exactly this same example.
The larger point of “has the community overall done something to address this (in a systemic manner)?” stands though - it’s cool if SciML or other subcommunities fix this “on their turf”, but there still isn’t any larger drive to prevent this systemically from occurring in the first place.
It’s always super frustrating to see these calls for “has the ecosystem at large addressed this?” be met with “well MY part of the ecosystem doesn’t have these problems!” - that’s not what was asked
It’s not just JuliaStats. Zygote is infamous for this. If what you really want is an example from SciML, QMC.jl was riddled with correctness issues before I essentially rewrote it from scratch last year.