I am struggling with the same thing. Historically UCSF has been better, but it seems that recently Stanford has gained a lot of ground and maybe in four years when we are finishing up Stanford will be the premier program in the bay area...
Yea after thinking about it for awhile i think im going with Stanford.. it is still clear that UCSF is an amazing program and at this point its just splitting hairs, but I also feel that Stanford has constantly tried to improve its educational curriculum for the better, that online start program, the short 15 minute daily lectures on key topics for the ITE, the case mix there is now as good if not better then UCSF (too much neuro not enough cardiac), ICU is a true mixed med/surgical - closed, co-directed with medicine run mostly by anesthesia, facilities are amazing (unfortunately only as a ca-3 will i get to see the new hospital), no crna's mean that I will work hard also - which is actually something I'm looking for in a program (might turn off some) as long as there is solid education as well. There are also all ACGME in-house fellowships at Stanford while UCSF has really slim pickings except for CCM some of which aren't accredited (weird) and at Stanford it seems most of the in-house residents get first dibs at. UCSF is kind of broke right now while Stanford has $$ so perhaps resources might be a little better at Stanford.
Something for other people to think about though is can you live in the burbs... i met some people who do live in SF but it can be quite a long commute to do daily (40-50min down 280 or 101) also the housing stipend is better at UCSF but salary is a tad lower - im not sure how that all evens out. A lot of the SF groups are dominated by UCSF grads while the southbay groups are Stanford grads - I'm not 100% sure what that means but it is something to think about if you want to live in SF afterwards.