AI stocks roared back to help lift two of the major averages to fresh records.