guya - you say "If you are a non-resident alien, the tax treaty is not a relevant question as there is no US tax on your share of any gains at all." Since I share some US registered Mutual Funds with my spouse, I imagined there would be US Capital Gains tax on that, but I've come to the same conclusion, though I can't actually find it written anywhere.
The situation of an NRA is very little discussed on this site, but I suspect that a lot of people are NRAs, being owners of US property (real estate), retirement savings or simply sharers of family investments like me. I only discovered this year that as an NRA I have to fill in the Schedules NEC and OI that go with the 1040nr, and that I do not get any of the exclusions or personal exemption. Will I have to fill in these schedules every year - nowhere does it say that if you did it last year, there is no need to repeat all that guff about not being a tax cheat all over again. On the other hand, my capital gains in the US seem to be US tax-free, including capital gains dividends as specifically stated on the 1040nr instructions.
I would add as a general comment, that althought the US tax system is an absolute pain in the proverbial, if you read the instructions carefully and completely, a lot of things become clear. For example, what forms you have to follow, as asked by a poster a few post above me, becomes clear if you just do what it says. Like - 'if you are a this and are married to a that, then do not enter your amount here, but fill in form XXXX and enter the result on line 47 of the worksheet hidden on the page 87 of form 1091nr instructions, then enter the result on line 1029h of Form 902 and line 66 of 1040nr. Take away the number you first thought of and send in the money.'