Robert Wright argues that racism isn't natural--at least, not the way we think it is. We are almost certainly hard coded to be xenophobic, which is why hunter gatherers often have such extraordinary homicide rates. But we are not hard-coded to attach that xenophobia to skin color, hair type, etc. That's not actually very surprising, since most of our ancestors never saw anyone of a noticeably different race. Hence the shock when they encountered people who looked very different.
That still leaves us with a seemingly intractable fear and dislike of people who are very different, of course. One of my favorite Northern Irish jokes involves George Bernard Shaw giving a speech in Belfast. At the end of the speech, an old man straggles to his feet to ask a question.
"Can you tell me, sir, are you Catholic or are you Protestant?"
"I am an atheist!" thunders Shaw. The old man looks puzzled.
"What sort of religion is atheist?"
"My dear sir," says Shaw, "an atheist is no sort of religion at all. It means that I do not believe in God."
"I think I understand," says the old man. He ponders this for a moment. "But is it the Catholic God, or the Protestant God, that you don't believe in?"
So while it's nice to know that we don't automatically code for race--and that a more diverse peer group weakens racial coding--that doesn't necessarily mean that we'll move to a more utopian society. It may just mean that we seize on some other difference and code that instead.