Implement and validate the derivative-first ("red path") Jacobian aggregation to improve scaling

Implement and empirically validate the derivative-first Jacobian aggregation approach for the marginal price algorithm, verifying that it achieves the predicted O(N) complexity with respect to the number of curves and removes the observed O(N·K^2) dependence on the number of tokens seen in the current implementation.

Background

The authors show mathematically (via a commutative diagram) that aggregating Jacobians per-curve before summation (the "red path") should avoid computing many zero entries and yield better asymptotic complexity than summing function values first and then differentiating (the "blue path").

They have not yet implemented the red-path approach to confirm the predicted performance gains in practice, citing the need for careful changes to their research system.

References

We have not at this stage been able to prove this by implementing the red path algorithm, for the reasons discussed above at the beginning of section \ref{sec:interlude}.

Marginal Price Optimization (2502.08258 - Loesch et al., 12 Feb 2025) in Section 6.3, Mathematical interlude