My understanding was that clang isn’t deterministic by default but can be made deterministic with flags. I checked and this is still true but not for the reasons I thought. I assumed this was due to the way LLVM iterates over functions and basic blocks in a non-deterministic order (because of the way they are laid out in memory) and because some optimisations use heuristics. But it appears LLVM tries to make all optimisation passes deterministic. The remaining non-determinism comes from file paths and timestamps which can be worked around with the correct flags and some extra work to create reproducible builds.
Thank you very much for looking it up! I learned something new thanks to you.
So I guess in the end it is deterministic, because for a given set of inputs it always produces the same output, it’s just that file paths and timestamps must also be considered as input.
And if you don’t know what you’re doing, it’ll probably be a long time before you realize it, because the token generator really wants you to keep paying your subscription.
Honestly if you do know what you’re doing that’s still true. They’re really good at looking like good code which makes it not always obvious when it’s not, even to an experienced developer.
Or maybe more bluntly, they’re really good at volume, not necessarily quality.
You can’t compare a statistical token generator to a deterministic algorithmic program.
I could’ve sworn that I saw a headline recently that gcc isn’t deterministic. But maybe that was some really weird edge case or a bug.
I’m fairly certain that clang is non-deterministic and I strongly suspect that gcc is too.
I don’t think that’s true - or thst it is a bug. It would make reproducible builds impossible.
My understanding was that clang isn’t deterministic by default but can be made deterministic with flags. I checked and this is still true but not for the reasons I thought. I assumed this was due to the way LLVM iterates over functions and basic blocks in a non-deterministic order (because of the way they are laid out in memory) and because some optimisations use heuristics. But it appears LLVM tries to make all optimisation passes deterministic. The remaining non-determinism comes from file paths and timestamps which can be worked around with the correct flags and some extra work to create reproducible builds.
Thank you very much for looking it up! I learned something new thanks to you.
So I guess in the end it is deterministic, because for a given set of inputs it always produces the same output, it’s just that file paths and timestamps must also be considered as input.
Removed by mod
Removed by mod
And if you don’t know what you’re doing, it’ll probably be a long time before you realize it, because the token generator really wants you to keep paying your subscription.
Honestly if you do know what you’re doing that’s still true. They’re really good at looking like good code which makes it not always obvious when it’s not, even to an experienced developer.
Or maybe more bluntly, they’re really good at volume, not necessarily quality.
Removed by mod
Removed by mod