I'm guessing perfect "AI" will simulate every possibility with the current input sources and to find the best solution. Perhaps similar as our life by the universe being a deterministic system and having slightly small edits compared to other universes functioning with keeping track of one another. What we call "mistakes or failures" are just a summation of events to witness a certain outcome. All the outcomes of all the other universes with maybe our own, hold one sacred outcome. Maybe you're experiencing it now or not.