what if you have a multi-threaded backend to the compiler that happens to lay down data in different orders?
Let's assume there is a latent bug in the compiler that gets triggered if file four is the first one. Good luck debugging that.
Most compilers give no guarantees in which order they lay out the data. I love deterministic processes as much as everyone. But randomized approaches have their advantages too. And if a compiler has reasons to randomize output e.g. for speed than it’s a trade off to consider.
grabs lock
writes to file
writes to index
releases lock
That's not a race condition. The output order doesn't matter, but it is nondeterministic.