Here, computing gradients is an end in itself, not a means to the end of minimizing some function.
I have a vector x whose elements must always sum to 1.  I want to know how much f(x) changes for valid infinitesimal changes in x.  That is, how much does f vary over small changes in the regime where x sums to 1.
Using .backward() and traditional gradients naively would consider infinitesimal changes along the coordinate axes in the superspace of x. x+delta may not be a valid vector anymore, so this strategy cannot be used for my purpose.
So:

How can I measure the gradient taken only in valid directions?