Comment by gf000

13 hours ago

The hard part was never getting it correct on a local scope, that's mostly solved by a linter, or even C++'s RAII will get it right.

The hard part is doing it correctly on a global scope with non-trivial lifetimes, possibly influenced by multiple threads.

And in my experience LLMs are still hit or miss on these kind of problems, they can find problems from time to time, but they can't really reason well about more complex global state reliably. They will come up with "hypotheses" that 'oh sure this is the root cause of the issue' only to say something completely wrong (which you may notice or not, only to fail later)