Tesla shares surged toward a record high as optimism around AI and automation fueled the rally, despite warnings that valuation is outpacing fundamentals and sales growth is slowing.