You’re looking for forward mode AD. The default with Enzyme is to do reverse mode (which propagates derivatives from outputs to inputs, hence when dd remains zeros). Forward mode will do as you desire (propagate derivatives from inputs to outputs).
Thank you! I have one more question, does this do the right thing and compute the derivative at almost the cost of 2 applications of foo or does it scale like the dimensions of the input (size of c)?