The reason Ocean Beach has always remained exactly the same is that the city relocates thousands of tons of sand to south end of it every year.
But I don't know much about the Sunset or the Richmond so I guess you could speak better to that. I live near Twin Peaks.
Edit: elsewhere in the thread there’s a nice link to a map from the US coast survey, https://upload.wikimedia.org/wikipedia/commons/9/9d/1858_U.S...
I'm no civil engineer so this is totally out of my realm of knowledge.
Also, I guess I'm lucky to live on one of the highest points in the city.