A furious rally in the AI trade this year helped Wall Street shake off the Middle East conflict and hit record levels.