That only makes the dynamic even more exaggerated when you travel from a reasonably clean, streetcar-suburb neighborhood like West Portal or the Outer Richmond to the city core and are abruptly surrounded by a mass of bodies failed by society.
I would urge you to travel to Asia if you think so. Mumbai would be a fine place to start.
SF is not "racing ahead" to a dystopian future; its merely becoming a regular city where very rich and very poor cohabit. This egalitarianism is merely a passing phenomenon, which lasted for ~50 years, and is now shrunk to Western/Northern Europe and a few other small countries.
This author's article points out the unique aspect: you can see the expensive restaurants and the homeless inches away from one another. that's what makes it not just unjust but so aesthetically absurd as to be dystopian.