I'd stay with my son. Couple of reasons: First, being a spiritual person, I would trust that my father (in the immediacy of his passing) would understand my choice and not have a final moment of regret that I wasn't there. I'd trust that at the end of his mortal life, he was not alone. Second, my son would be losing his grandfather, and in some respects, such a loss can be harder on a child than for us as adults losing that parent. I wouldn't want my son to be nervously entering surgery while also dealing with his own anguish over grandpa's death.
Interesting discussions - thanks for all the thoughts.
In the end I stayed with my son. My father was under heavy sedation and it had become pretty clear for a couple weeks before that that he was very unlikely to ever leave the hospital. My brother, who went through the whole thing with me, fully agreed with my decision to, as he said, "take care of the living". I had plenty of time to come to terms and get in what time I could with my dad.
Still, getting the call in the waiting room just before my child get into surgery that he had passed made for a horrible day (and, as a corollary, the math worked out that I would have likely missed my dad by 15-30 minutes or so, not that that makes any difference when the choice was before me) . The day was really only buoyed by the feeling of being able to be there after the surgery and help him get set to go home.
As a side note my son had his second knee surgery today, as an MRI made it look like he borked up his repaired ACL pretty good. Turns out the surgeon didn't do anything to the ACL as it was stable, though slightly damaged (it will heal by itself) and did a bit of nip and tuck with his meniscus. Really about as good an outcome for that as humanly possible.
Take care all.