I found the commit message's description of reference resolution hard to understand. I think I understand it well enough now to ACK the design. Would be nice to work some of your explanations into the commit message, but we don't have time for that. So I'm merely fixing your QGA vs. QSD typo.
We might want to put an improved description into the code. Not today. Thanks!