Can't believe after so many years, SharePoint's API doc is still so poor. EnsureUser actually can resolve four types of user name 1. Email Address 2. Logon name (domain\\username) 3. Just user name without the domain part 4. user title which is like "first last".
Also it is case insensitive.