MEKAWIRE
ExpertarXiv

Specification-Aware Sparse Differentiation: Planning under Signal Temporal Logic with Sparsemax Robustness

Sai Sandeep Damera, Ryan Matheu, John S. Baras, Calin Belta
From the abstract

Gradient-based optimal control under a Signal Temporal Logic (STL) specification involves solving a nonlinear program whose constraints are smoothed robustness functions of the trajectory, and automatic differentiation without knowledge of sparsity computes the Jacobian and the Hessian that its solver needs in full. This often renders the problem computationally intractable.

From the abstract. Our summary is in progress.

Full paper

Specification-Aware Sparse Differentiation: Planning under Signal Temporal Logic with Sparsemax Robustness

Sai Sandeep Damera, Ryan Matheu, John S. Baras, Calin Belta

Published under CC BY 4.0. Reproduced with attribution; original at arXiv:2611.29346 (PDF).

Abstract

Gradient-based optimal control under a Signal Temporal Logic (STL) specification involves solving a nonlinear program whose constraints are smoothed robustness functions of the trajectory, and automatic differentiation without knowledge of sparsity computes the Jacobian and the Hessian that its solver needs in full. This often renders the problem computationally intractable. The dynamics and the specification prescribe a sparsity pattern through the STL syntax, the windows of the temporal operators and the variables that the predicates read. Standard tools such as CasADi recover this pattern by structural detection. In this work, we propose a method to prescribe such a pattern directly from the task specification. We show that our method allows us to exploit SparseMax, a recently proposed smooth robustness operator that is certifiably sparse and sound. Its derivative is exactly zero at every operand at or below a data-dependent threshold, which structural detection cannot see. We derive the patterns that expose this trajectory-dependent sparsity to sparse automatic differentiation, with a margin test for their reuse and Hessians confined to the variables of each constraint’s support. We demonstrate the method on a dual-arm coordination task in which two arms share a hand-off zone divided into cells and one until constraint per scheduled visit keeps the other arm out of a cell until the visitor has left it. The two scenes are a zone of five cells and a circle of 64 cells, with single solves and closed-loop re-planning on a rigid-body simulation. Our exact-Hessian interior-point solves are up to 27 times faster than those with the sound log-sum-exp robustness in CasADi and IPOPT.

1 Introduction

Consider two arms that pass through a shared hand-off zone. The zone is divided into cells, only one arm may occupy a cell at a time, and each arm visits the cells on a schedule and must reach waypoints on time. A Signal Temporal Logic (STL) specification combines predicates on the state, such as an arm being outside a cell, with Boolean and temporal operators, and its robustness is positive when a trajectory satisfies it. Ours is a conjunction whose operands, the conjuncts, are one until per scheduled visit, which keeps the other arm out of the cell until the visitor has left it within a time window, and one eventually per waypoint. A receding-horizon controller enforces it by solving, at every control period, a nonlinear program over the next T time steps subject to the dynamics and to a smoothed robustness of every conjunct at or above a margin. An interior-point solver needs the constraint Jacobian at every update and, for exact second-order steps, the Hessian of the Lagrangian. Automatic differentiation without knowledge of sparsity computes both in full. At 400 time steps that is 11,222 reverse and 16,800 Hessian-vector products at every update.

Figure 1: Overview: the dual-arm task with one until constraint, the prescribed sparsity pattern, its restriction to the sparsemax supports at the iterate, and the test for its reuse.

Most entries of these two matrices are zero, for reasons known before any derivative is evaluated. A defect constraint of the dynamics reads two consecutive time steps, and a conjunct reads the time steps inside the windows of its temporal operators and, at each of them, only the coordinates on which its predicates depend. The specification and the dynamics therefore prescribe a sparsity pattern, and a coloring of it lets sparse automatic differentiation recover every entry from a few compressed products (Curtis et al., 1974; Gebremedhin et al., 2005; Gebremedhin et al., 2007). CasADi detects this structure from the program itself. It propagates dependencies through the expression graph of the program, colors the detected pattern and hands sparse derivatives to the solver (Andersson et al., 2019; Wächter and Biegler, 2006), which is one reason it is the tool of choice for such problems.

How sparse the derivatives are inside this pattern depends on the smoothing. The log-sum-exp robustness (Pant et al., 2017; Gilpin et al., 2021) can be positive on a violating trajectory in its common form, and its sound variant (Sound-LSE) (Mehdipour et al., 2025; Damera et al., 2026), our baseline, gives every operand of every extremum a positive weight. Sparsemax robustness (Damera et al., 2026) is a lower bound of the exact robustness that gives a derivative of exactly zero to every operand at or below a data-dependent threshold. We show what the set of operands with a nonzero weight, the support, gives computationally. First, structural detection, which propagates dependencies through the operations of a program as CasADi does, returns the same pattern for sparsemax as for log-sum-exp (Proposition 2). Second, a method that evaluates the constraints once, reads the supports and restricts the prescribed pattern to them obtains a smaller pattern at that trajectory, with a margin that states when it remains valid at the next one (Sections 3 and 1).

The gain is largest at second order. The Hessian pattern of a log-sum-exp conjunct is dense over every variable in its windows, while that of a sparsemax conjunct is confined to the variables of its support (Section 4). On the task above at 400 time steps the Hessian of the Lagrangian takes 1,204 Hessian-vector products with the prescribed pattern and 63 with the supports, and on a circle of 64 cells the constraint Jacobian takes 102 products against 13. With exact Hessians on the supports’ structure, a solve from the previous period’s solution at 200 time steps takes 3 updates of the iterate and 0.22 s, 18 times shorter than log-sum-exp in CasADi with IPOPT, whose exact-Hessian solve takes the same 3 updates. Re-planning every 0.5 s after one arm is held up, our controller completes each control period over a horizon of 2 s within 0.40 s, inside the control period.

We contribute (i) the sparsity pattern of the constraint Jacobian that the dynamics and an STL specification prescribe, with the proof that every gradient lies inside it (Section 3); (ii) Proposition 2 on what structural detection returns for sparsemax and for log-sum-exp, with a radius within which the pattern of the current supports, and a cached coloring, stay valid; (iii) the sparse exact Hessian, supported on the square of the active pattern of each constraint (Section 4); and (iv) a comparison with dense differentiation and with log-sum-exp in CasADi and IPOPT on a dual-arm task, in products, solve times and the control period of a re-planning loop (Section 5).

Related work. STL robustness reduces Boolean and temporal operators to nested extrema over predicate values (Maler and Nickovic, 2004; Donzé and Maler, 2010), and smooth measures replace these extrema so that gradient-based solvers can enforce a specification (Pant et al., 2017; Leung et al., 2023; Kapoor et al., 2025). A sound measure pairs under-approximations of both extrema (Gilpin et al., 2021), and average-based measures form a further family (Mehdipour et al., 2019; Uzun et al., 2024), among them the generalized-mean robustness (GMR) (Mehdipour et al., 2025). An exact reformulation of the extrema removes the smoothing error by adding variables and constraints (Han et al., 2025). Sparsemax robustness (Damera et al., 2026), on which we build, bounds the exact robustness from below and confines the gradient of each extremum to a data-dependent support. We derive the sparsity of its first and second derivatives from that support and use it in receding-horizon control, where STL specifications have been enforced (Raman et al., 2014; Sadraddini and Belta, 2015) and the cost of the derivatives recurs every control period.

Sparse automatic differentiation recovers a Jacobian or a Hessian from one product per color of a known sparsity pattern (Curtis et al., 1974; Gebremedhin et al., 2005; Gebremedhin et al., 2007). Structural detection of the pattern, as in CasADi, propagates dependencies through the operations and returns a pattern that is valid at every input (Andersson et al., 2019; Hill and Dalle, 2025). Local detection also evaluates the operations and returns the pattern at one input (Hill and Dalle, 2025). Our patterns are read from the supports in the forward evaluation of the constraints, without tracing the program, and they carry a margin that states at which other inputs they remain valid, together with the structure of the Hessian and its assembly in closed form. Appendix A extends this survey.

2 Preliminaries

2.1 Sampled STL robustness and sparsemax lower extrema

Let x_{t+1}=f_{h}(x_{t},u_{t}) be a discrete-time robot model with sampling period h>0, state x_{t}\in\mathbb{R}^{n_{x}} and control u_{t}\in\mathbb{R}^{n_{u}}, over a horizon of T time steps. An STL specification in negation normal form is built from the grammar

\phi::=\mu\mid\neg\mu\mid\phi\wedge\psi\mid\phi\vee\psi\mid\mathbf{G}_{I}\phi\mid\mathbf{F}_{I}\phi\mid\phi\,\mathbf{U}_{I}\,\psi,
(1)

where a predicate \mu holds when g_{\mu}(x_{t})\geq 0, with \rho^{\mu}_{t}=g_{\mu}(x_{t}) and \rho^{\neg\mu}_{t}=-g_{\mu}(x_{t}), and I=\{a,\ldots,b\} with integers 0\leq a\leq b is a window of sample offsets. The robustness at sample t (Maler and Nickovic, 2004; Donzé and Maler, 2010) is defined recursively as the minimum over the operands for \wedge and over the window for \mathbf{G}_{I}, the maximum for \vee and \mathbf{F}_{I}, and for the until

\rho^{\phi\,\mathbf{U}_{I}\,\psi}_{t}=\max_{j\in I}\,\min\Bigl\{\rho^{\psi}_{t+j},\ \min_{0\leq i\leq j}\rho^{\phi}_{t+i}\Bigr\},
(2)

with a closed prefix (Sadraddini and Belta, 2015), and the sampled trajectory satisfies \phi when \rho^{\phi}_{0}\geq 0. Unrolling Equation 2 over the samples gives a finite acyclic evaluation graph of minima and maxima over predicate values, where a node v has m_{v} children \mathrm{ch}(v) (Appendix B).

In our earlier work (Damera et al., 2026), we proposed the SparseMax operator and proved its soundness and sparsity by construction. In this work, we exploit the sparsity that arises from allocating the gradient signal on the support to boost the computational performance of optimal control under STL specifications. For z\in\mathbb{R}^{m} and \gamma>0, the quadratically regularized maximum M_{\gamma}(z)=\max_{p\in\mathcal{S}_{m}}\bigl(p^{\top}z-\tfrac{\gamma}{2}\|p\|_{2}^{2}\bigr) over the simplex \mathcal{S}_{m} has the gradient p_{\gamma}(z)=\Pi_{\mathcal{S}_{m}}(z/\gamma), the sparsemax projection (Martins and Astudillo, 2016). The projection and the lower extrema are

\displaystyle p_{\gamma,i}(z) \\ \displaystyle=\frac{(z_{i}-\theta)_{+}}{\gamma},\qquad\sum_{i=1}^{m}(z_{i}-\theta)_{+}=\gamma, \\ \displaystyle Q^{+}_{\gamma}(z) \\ \displaystyle=M_{\gamma}(z)+\frac{\gamma}{2m},\qquad Q^{-}_{\gamma}(z)=-M_{\gamma}(-z)-\frac{\gamma}{2}.
(3) (4)

By Equation 3, every entry at or below the threshold \theta receives a derivative of exactly zero. Both operators of Equation 4 are continuously differentiable and nondecreasing in every entry, with gradients p_{\gamma}(z) and p_{\gamma}(-z) in the simplex, and each lies below its exact extremum by at most the band b_{m}(\gamma)=\tfrac{\gamma}{2}(1-1/m) (Mensch and Blondel, 2018, Lemma 1). We require f_{h} and each g_{\mu} to be continuously differentiable, twice where second derivatives are used.

Replace the extremum at every internal node v of the evaluation graph by the operator of Equation 4 with m_{v} entries and parameter \gamma_{v}, and write y_{v} or \widetilde{\rho}_{v} for the smoothed value of the node. The smoothed value lies below the exact one by at most a budget that is known before optimization (Theorem 2, from that paper), so a smoothed robustness of at least a margin \delta\geq 0 implies an exact sampled robustness of at least \delta. By the chain rule \nabla y_{v}=\sum_{c\in\mathrm{ch}(v)}\alpha_{v,c}\nabla y_{c}, with the edge weights

\alpha_{v}=p_{\gamma_{v}}(s_{v}z_{v}),\qquad s_{v}=+1\text{ at a maximum node},\quad s_{v}=-1\text{ at a minimum node},
(5)

where z_{v} collects the children’s values. The support S_{v}=\{c\in\mathrm{ch}(v):\alpha_{v,c}>0\} of v holds the children whose signed values lie strictly beyond the threshold and changes only where a signed child value crosses it. Under Sound-LSE (Appendix B) every weight is positive and S_{v}=\mathrm{ch}(v).

2.2 Nonlinear program and its derivatives

We keep the states as decision variables (Bock and Plitt, 1984), w=(x_{1},\ldots,x_{T},u_{0},\ldots,u_{T-1})\in\mathbb{R}^{n} with n=T(n_{x}+n_{u}), and impose the defects d_{t}(w)=x_{t+1}-f_{h}(x_{t},u_{t}) as equality constraints. The specification enters through a finite set \mathcal{R} of rows, one for every conjunct at every time at which the controller imposes it. Each row r is the root node v_{r} of a conjunct of the evaluation graph at a time t_{r}, and its smoothed value \widetilde{\rho}_{r}(w) reads states only. Every temporal operator inside a row is smoothed over its whole window. The constraint vector and the problem are

c(w)=\bigl(d_{0},\ldots,d_{T-1},(\widetilde{\rho}_{r})_{r\in\mathcal{R}}\bigr),\qquad\min_{w}\ E(w)\quad\text{s.t.}\quad d_{t}(w)=0,\ \ \widetilde{\rho}_{r}(w)\geq\delta,
(6)

with a margin \delta\geq 0, the initial state x_{0} given by the measured state, bounds on the states and the controls, and a quadratic cost E. An interior-point solver needs the constraint Jacobian J(w)=Dc(w) at every update and, for exact second-order steps, the Hessian of the Lagrangian

\mathcal{L}(w,\lambda,\mu)=\sigma E(w)+\sum_{t=0}^{T-1}\lambda_{t}^{\top}d_{t}(w)+\sum_{r\in\mathcal{R}}\mu_{r}\widetilde{\rho}_{r}(w),
(7)

with an objective factor \sigma and multipliers \lambda_{t} and \mu_{r}.

At every update the solver computes its step from a linear system in the Hessian of \mathcal{L} and J, whose sparsity structure it fixes when a solve starts. With the exact Hessian the step is a Newton step, and a solve from the previous control period’s solution ends in a few updates, while a quasi-Newton approximation from successive gradients needs no second derivative and more updates. A solve thus takes the number of updates times the cost of one J, one Hessian and one factorization. Automatic differentiation returns products, u^{\top}J, Jv or a Hessian-vector product, and a coloring of a known sparsity pattern lets rows or columns share a product, so the pattern sets their number.

3 Sparsity Patterns of the Constraint Jacobian

3.1 Static and active patterns

Let v denote an occurrence in the syntax tree of the specification in negation normal form. Its evaluation at sample t is a node (v,t) whose children \mathcal{C}(v,t) are the nodes of its operands at the samples that its window reads. An until v_{L}\,\mathbf{U}_{I}\,v_{R} instead has as children one witness node (v,t,j) per j\in I, whose children are (v_{R},t+j) and (v_{L},t+i) for 0\leq i\leq j (Equation 14 in Appendix C). Conjunctions, always operators and the witness nodes of an until are minimum nodes, and disjunctions, eventually operators and the outer node of an until are maximum nodes. For each predicate \mu we declare a set A_{\mu}\subseteq\{1,\ldots,n_{x}\} of state coordinates such that \partial_{j}g_{\mu}(x)=0 for every j\notin A_{\mu} on an open domain. A leaf \ell of \mu or \neg\mu at sample t then reads the columns \mathcal{D}_{\ell}=\{(t,j):j\in A_{\mu}\} of w, where (t,j) names coordinate j of x_{t}. A leaf at a given state, the measured x_{0} or a recorded past sample, reads no column, so \mathcal{D}_{\ell}=\emptyset. Let S_{v,t}(w) be the support of node (v,t) under the edge weights of Equation 5, and let \mathcal{A}_{\ell}(w)=\mathcal{D}_{\ell} at the leaves. The static and the active sets of an internal node are

\displaystyle\mathcal{D}_{v,t} \\ \displaystyle=\bigcup_{c\in\mathcal{C}(v,t)}\mathcal{D}_{c}, \\ \displaystyle\mathcal{A}_{v,t}(w) \\ \displaystyle=\bigcup_{c\in S_{v,t}(w)}\mathcal{A}_{c}(w).
(8) (9)
Proposition 1 (Containment of the gradient support).

For differentiable predicates with the declared coordinate sets and a fixed evaluation graph, \operatorname{supp}\nabla_{w}y_{v,t}(w)\subseteq\mathcal{A}_{v,t}(w)\subseteq\mathcal{D}_{v,t}.

The proof is an induction over the graph with the chain rule (Appendix C). For a row r at node v_{r} and time t_{r}, the indicators P^{\mathrm{stat}}_{r} of \mathcal{D}_{r}=\mathcal{D}_{v_{r},t_{r}} and P^{\mathrm{act}}_{r}(w) of \mathcal{A}_{v_{r},t_{r}}(w) are the pattern rows supplied to sparse differentiation. Stacked below the defect pattern they give the static pattern of J, which we call the prescribed pattern, and its active pattern at w, the supports’ pattern.

3.2 Structural detection and reuse of the active pattern

A structural detector such as CasADi’s marks an entry of the Jacobian wherever an output is connected to an input in the expression graph (Andersson et al., 2019). It reads the operations of a program and not the values that flow through them. Call a leaf \ell of a row at node (v,t) attainable on a set \mathcal{W} of decision vectors if some w\in\mathcal{W} has a path from (v,t) to \ell in the evaluation graph along which every edge weight of Equation 5 is positive.

Proposition 2 (Static pattern and union of the active patterns).

Fix the evaluation graph of a row at node (v,t), the coordinate sets A_{\mu} and a set \mathcal{W} of decision vectors.

  1. With log-sum-exp nodes, whose edge weights are the softmax weights of the node, \mathcal{A}_{v,t}(w)=\mathcal{D}_{v,t} for every w in exact arithmetic.
  2. With sparsemax nodes, \bigcup_{w\in\mathcal{W}}\mathcal{A}_{v,t}(w) is the union of \mathcal{D}_{\ell} over the leaves \ell attainable on \mathcal{W}. For a leaf to be attainable it suffices that some w\in\mathcal{W} and some path from (v,t) to the leaf satisfy the following condition. At every node u of the path other than the leaf, with m_{u} children and parameter \gamma_{u}, the signed value of the child of u on the path exceeds the largest signed child value of u minus \gamma_{u}/m_{u}. If every leaf of the row is attainable, the union is \mathcal{D}_{v,t}.
  3. Consider a procedure that assigns to the result of every scalar operation of a program the union of the sets assigned to its arguments. Suppose the program computes each leaf \ell from exactly the coordinates in \mathcal{D}_{\ell}, and the value of every internal node from the values of all of its children and from constants only. Then the procedure assigns \mathcal{D}_{v,t} to the row, with log-sum-exp nodes and with sparsemax nodes alike. If the program reads further values, the set it assigns contains \mathcal{D}_{v,t}.

Item 1 holds because every softmax weight is positive. For item 2, unfolding Equation 9 to the leaves gives the first claim, and the condition places every child on the path above the threshold of its node, which is at most the largest signed child value minus \gamma_{u}/m_{u}. Item 3 holds because a union over the arguments of every operation reproduces the recursion of Equation 8 whatever the values (details in Appendix C). By item 3, a detector that propagates the union of the operands’ sets through scalar operations, as CasADi does, returns the static pattern of the Jacobian for sparsemax as it does for log-sum-exp, so exchanging one smoothing for the other inside such a tool does not change that pattern. The zeros of sparsemax depend on the point. A method uses them by reading the supports in one evaluation of the row and building P^{\mathrm{act}}(w), and it reuses that pattern at the next point once a test confirms that it still holds there. Strict gaps \eta_{v} between the signed child values and the threshold at every node of a row, with Lipschitz bounds L_{v} of the node inputs in w, give the radius \min_{v:L_{v}>0}\eta_{v}/(2L_{v}) in the infinity norm within which every support of the row, and with it the active pattern and a cached coloring, is preserved (Lemmas 1 and 21). Without such bounds a runtime test of the cached supports at the new node inputs decides it (Section C.3).

4 Sparsity of the Lagrangian Hessian

We derive the pattern of the Hessian of an STL row in the states and its assembly, starting from the Hessian of one smoothed node on a fixed support (Mensch and Blondel, 2018, Appendix B.1).

A support region \mathcal{R}_{\mathcal{S}} is an open set of trajectories on which every node keeps one support \mathcal{S}_{v} with strict inequalities, every signed child value of S_{v} strictly beyond the threshold and every other one strictly short of it. The statements of this section hold on one such region. Write J_{v} for the Jacobian of the child values \zeta_{v}=z_{v} of node v in the variables, let k_{v}=|S_{v}|, and let P_{v} be the sum over the paths from the row to v of the products of their edge weights. On \mathcal{R}_{\mathcal{S}} a sparsemax node v is a quadratic polynomial of its children whose Hessian H_{v}=\tfrac{s_{v}}{\gamma_{v}}\bigl(\operatorname{Diag}(\mathbf{1}_{S_{v}})-\mathbf{1}_{S_{v}}\mathbf{1}_{S_{v}}^{\top}/k_{v}\bigr) is zero outside S_{v}\times S_{v}, while the Hessian of a log-sum-exp node is nonzero on all of its children when it has two or more. The Hessian of a row is the sum over the nodes of P_{v}\,J_{v}^{\top}H_{v}J_{v} plus the sum over the leaves of P_{\ell}\,\nabla^{2}z_{\ell}, with z_{\ell} the signed predicate value of leaf \ell (Appendix D).

Theorem 1 (Sparsity of a constraint Hessian).

Let L_{A}=\{\ell:P_{\ell}>0\}, the leaves joined to the row through supports only. On \mathcal{R}_{\mathcal{S}} the Hessian of a sparsemax row in the leaf values is supported on L_{A}\times L_{A}, and its Hessian in the states is supported on \mathcal{A}_{r}\times\mathcal{A}_{r}, where \mathcal{A}_{r}=\bigcup_{\ell\in L_{A}}\mathcal{D}_{\ell} is the active Jacobian row of Equation 9. The predicate term is block diagonal in time, one block of side |A_{\mu}| per active leaf. For a log-sum-exp row every weight is positive, L_{A} is every leaf in the windows, \mathcal{A}_{r}=\mathcal{D}_{r}, and the Hessian is supported on the window clique \mathcal{D}_{r}\times\mathcal{D}_{r}.

In the sum above a term with P_{v}=0 vanishes, and for P_{v}>0 the matrix H_{v} keeps only the rows of J_{v} of the children in S_{v}, whose derivatives reach the leaves of L_{A} alone. Appendix D has the details, the jump of the Hessian where a support changes (Theorem 3) and the behavior of Newton’s method near a solution on such a surface (Theorem 4). In the Hessian of the Lagrangian in Equation 7 the cost couples each control with itself and with its successor and adds a diagonal on the tracked joint positions, each defect term is one dense block on (x_{t},u_{t}) of side n_{x}+n_{u}, on u_{0} alone for t=0, and each row adds \mathcal{A}_{r}\times\mathcal{A}_{r} for sparsemax at the current point, or \mathcal{D}_{r}\times\mathcal{D}_{r} for the static declaration and for log-sum-exp. A star or acyclic coloring needs at least as many colors as the largest clique of the pattern, so the windows of the temporal operators set the bound on the static and log-sum-exp patterns and the supports set it on the active one. The Hessian is assembled by star coloring (Gebremedhin et al., 2007) or in closed form from Equation 23.

5 Numerical Experiments

5.1 Experimental setup

Comparators. Every table and figure compares three ways of obtaining the constraint Jacobian and the Hessian of the Lagrangian of the same program. Dense automatic differentiation computes every entry, with \min\{m,n\} products for an m\times n Jacobian and n Hessian-vector products. Sound-LSE in CasADi with IPOPT is the smooth baseline in its documented form (Andersson et al., 2019; Wächter and Biegler, 2006). CasADi detects the static pattern (Proposition 2) and colors it, and IPOPT runs with its quasi-Newton approximation of the Hessian (L-BFGS) or with CasADi’s exact Hessian. On both scenes below CasADi detects the prescribed Jacobian pattern entry for entry, for the sparsemax program as well (Section E.1), so the supports are what our method adds over this baseline. SparseMax with our patterns, colored and differentiated in JAX (Bradbury et al., 2018) with asdex (Hill and Dalle, 2026), uses the supports’ pattern and the exact Hessian of Section 4 with the same IPOPT. The smoothings are matched at equal worst-case error per node (Equation 12), and products are counted after a greedy coloring (Gebremedhin et al., 2007).

Task. The plant is a dual-arm manipulator with seven joints per arm, planned on a double integrator in joint space with 14 joint positions, velocities and accelerations per time step, sampled at 0.02 s and bounded. The arms share a hand-off zone divided into cells, balls of radius 0.03 m that only one arm may occupy at a time, so that one arm can follow the other through the zone at a short time gap. The predicate \mathrm{out}_{a,z} states that the 17 distal collision spheres of arm a are outside cell z, and g_{a,p} that the hand of arm a is within 0.05 m of waypoint p. Both read joint positions only. A schedule assigns every visit i of a cell z to one arm v, with o the other arm, and every waypoint p to an arm a with a deadline d_{p}, and the specification has one conjunct per visit and one per waypoint,

\mathrm{out}_{o,z}\,\mathbf{U}_{[0,W_{i}-1]}\,\mathrm{out}_{v,z}\qquad\text{and}\qquad\mathbf{F}_{[0,d_{p}]}\,g_{a,p}.
(10)

The until conjunct keeps the other arm out of the cell until the visitor has left it, within W_{i} samples. It enters the program of a control period once its whole window lies inside the horizon (Section E.3). Every conjunct is one constraint, its smoothed robustness at or above a margin of 0.02, and the cost penalizes the deviation from a reference motion, the accelerations and their increments.

Scenes. On the five-cell zone the arms cross five cells once per loop of 3.2 s, half a loop apart, and W_{i} is the scheduled stay plus 30 samples, 49 to 86 samples in all. A horizon of 100, 200 and 400 time steps holds 6, 13 and 23 until conjuncts with long windows. On the 64-cell circle (Figure 7) each arm passes 64 cells on a circle once per turn of 3 s, half a turn behind the other, with W_{i}=100. A horizon then holds 28, 121 and 298 until conjuncts with overlapping windows. In the hold-up scenario the five-cell zone is timed so that one arm enters a cell 11 to 15 samples after the other has left it. The leading arm is held up by 12 to 20 samples and its schedule moves with it, so the other arm arrives early and the controller has to keep it out of each cell until the leader has left (Figure 2).

Protocol. Every time of the tables and of Figure 2, except the embedded computer’s, comes from one workstation, one job at a time on 12 cores, in double precision. A derivative time is the median of up to 30 evaluations after compilation and a repeated solve or closed-loop time the median of its runs (Sections E.3 and 4). Both sides solve the same program up to the smoothing, with the same cost, bounds and IPOPT options, from the solution of the previous control period shifted by one sample or cold from the reference motion. Our solver declares the structure of the supports, tests at every accepted iterate, before its Hessian is evaluated, whether the supports leave it and, if they do, rebuilds on their union and continues from that iterate, all within its reported time. On both sides the reported time of a single solve is that of the solve, with the program of the control period built, and ours compiled, beforehand. In the loops our program is compiled once per horizon, and we report the whole control period against the baseline’s solve alone.

5.2 Results

We demonstrate a model predictive controller that re-plans the joint motion of both arms through the hand-off zone. In the hold-up scenario it starts where the right arm is held up, applies the first 0.5 s of accelerations of each plan to the double integrator and solves again from the shifted plan. Re-planning every 0.5 s over a horizon of 2 s, our whole control period takes 0.11 to 0.40 s in the ten periods after the first solve and lies inside the control period in every one of them. The baseline’s solve alone takes 0.46 to 1.35 s. Over a horizon of 4 s the medians are 0.36 s against 6.0 s (Table 6). In closed loop on a rigid-body simulation of the two arms with their joint drives, re-planning from the simulated state for 10.5 s, every control period after the first takes 0.09 to 0.47 s in six runs against 0.49 to 1.45 s for the baseline’s solve alone (Figure 2a). All 33 until constraints and all 21 reach constraints hold in exact semantics on the executed motion, the until constraints with a smallest robustness of 0.28 against -0.41 on the motion that ignores the hold-up, and the arms stay at least 38 mm apart (Section E.3). At 200 time steps the first solve after the hold-up repairs a plan that violates 6 to 7 until conjuncts, ours 2.5 to 4.4 times sooner than the baseline’s (Table 3) and at a cost 1.7 to 6.6 per cent lower. The bottom row of Figure 2 shows the closed-loop motion at one hand-off of cell 3.

Figure 2: (a) Time of every control period of the closed loop on the rigid-body simulation after a hold-up, our whole control period against the baseline’s solve alone (medians of six runs; dashed: the control period). (b), (c) Time of one Hessian of the Lagrangian on the five-cell zone and of one constraint Jacobian on the 64-cell circle (medians of up to 30 evaluations). Bottom: the closed-loop motion on the rigid-body simulation, where the right hand (blue path) leaves cell 3 before the left hand (orange path) enters it.

Table 1 gives single solves, with the GMR as the baseline’s second smoothing (Section E.4), and its row after a hold-up is the median solve of the ten periods that follow it. From the previous control period’s solution the exact Hessian on the supports’ structure brings the solve to 3 updates, where IPOPT’s quasi-Newton approximation needs 67 to 144. CasADi’s exact Hessian gives the baseline the same 3 updates at a higher cost each, so our solve is 6.4 to 27 times shorter than the baseline’s shorter one. The supports’ structure accounts for a factor of 3.9 to 7.0 of this gain, since the same solver takes that much longer with the prescribed structure declared (Table 3). From the reference motion the gain is 1.5 to 8.9, and on the 64-cell circle it is 8.6 from the previous solution with the prescribed structure declared (Section E.3). The last column repeats the factor on the CPU of a Jetson AGX Orin, where our solves reproduce to rounding (Section E.5).

Table 1: Single solves on the five-cell zone, as updates of the iterate and seconds, with Sound-LSE and GMR in CasADi and IPOPT. The factor divides the shorter Sound-LSE time by ours (star: the baseline’s solve ended with an error; dash: not run or ended without a solution).
  • Previous solution
    T
    100
    Sound-LSE Quasi-Newton
    67, 0.79
    Sound-LSE Exact Hessian
    3, 1.19
    GMR Quasi-Newton
    75, 0.95
    SparseMax Ours
    3, 0.12
    Factor Workstation
    6.4
    Factor Orin
    4.6
  • No data
    T
    200
    Sound-LSE Quasi-Newton
    144, 5.53
    Sound-LSE Exact Hessian
    3, 4.13
    GMR Quasi-Newton
    135, 5.16
    SparseMax Ours
    3, 0.22
    Factor Workstation
    18.4
    Factor Orin
    14.8
  • No data
    T
    400
    Sound-LSE Quasi-Newton
    142, 10.81
    Sound-LSE Exact Hessian
    3, 11.27
    GMR Quasi-Newton
    175, 14.48
    SparseMax Ours
    3, 0.40
    Factor Workstation
    26.8
    Factor Orin
    22.5∗
  • After a 16-sample hold-up
    T
    200
    Sound-LSE Quasi-Newton
    112 to 170, 4.09
    Sound-LSE Exact Hessian
    –
    GMR Quasi-Newton
    –
    SparseMax Ours
    3 to 7, 0.22
    Factor Workstation
    18.7
    Factor Orin
    13.9

The derivatives account for these differences. Figure 3 shows what the supports remove from the prescribed pattern, and Table 2 counts it in derivative products. On the five-cell zone the prescribed Hessian pattern is a staircase of blocks spanned by the until windows, and the supports leave a narrow band. The Hessian-vector products fall from 1,204, the 14 joints times the longest window of 86 samples, to 63, a factor of 19. The Jacobian gains most where many until windows overlap. On the 64-cell circle its products fall from 102 to 13 at 400 time steps, against 130 with CasADi’s own coloring, and on the five-cell zone from 8 to 4.

Figure 3: Sparsity patterns of the specification’s constraints at one control period. Top: the constraint Jacobian on the 64-cell circle with 200 time steps. Bottom: the Hessian of the Lagrangian on the five-cell zone with 400 time steps, on the joint positions, with its Hessian-vector products.

In time, one Hessian of the Lagrangian on the five-cell zone, assembled in closed form on the supports (Section 4), takes 72 and 160 times less time than CasADi’s exact Hessian at 100 and 200 time steps (Figure 2b). On one thread, as CasADi’s default evaluation runs, it takes 33 and 73 times less (Table 5). Our Jacobian is 1.9 to 4.7 times shorter than CasADi’s with either smoothing on the 64-cell circle and 1.5 to 1.9 times shorter on the five-cell zone at 200 and 400 time steps (Table 2).

6 Conclusion

Structural detection, as in CasADi, returns the prescribed pattern for sparsemax as for log-sum-exp. The supports lower the Hessian-vector products by a factor of 19 on the five-cell zone and the Jacobian products by a factor of 7.8 on the 64-cell circle. With exact Hessians on the supports’ structure a solve from the previous period’s solution takes 3 updates and is 6.4 to 27 times shorter than log-sum-exp in CasADi with IPOPT. Re-planning every 0.5 s over 2 s after a hold-up, our whole control period takes at most 0.40 s against up to 1.35 s for the baseline’s solve alone, and every constraint of the specification holds in closed loop on a rigid-body simulation of the arms.

acknowledgments-disclosure-of-funding.

The authors acknowledge the use of Claude LLMs for code development, visualizations, and manuscript review.

References

  1. Amestoy et al. (2001) Patrick R Amestoy, Iain S Duff, Jean-Yves L’Excellent, and Jacko Koster. A fully asynchronous multifrontal solver using distributed dynamic scheduling. SIAM Journal on Matrix Analysis and Applications, 23(1):15–41, 2001.
  2. Amestoy et al. (2019) Patrick R Amestoy, Alfredo Buttari, Jean-Yves L’Excellent, and Theo Mary. Performance and scalability of the block low-rank multifrontal factorization on multicore architectures. ACM Transactions on Mathematical Software (TOMS), 45(1):1–26, 2019.
  3. Andersson et al. (2019) Joel AE Andersson, Joris Gillis, Greg Horn, James B Rawlings, and Moritz Diehl. CasADi: a software framework for nonlinear optimization and optimal control. Mathematical Programming Computation, 11(1):1–36, 2019.
  4. Bock and Plitt (1984) Hans Georg Bock and Karl-Josef Plitt. A multiple shooting algorithm for direct solution of optimal control problems. IFAC Proceedings Volumes, 17(2):1603–1608, 1984.
  5. Bradbury et al. (2018) James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
  6. Curtis et al. (1974) Alan R Curtis, Michael JD Powell, and John K Reid. On the estimation of sparse Jacobian matrices. IMA Journal of Applied Mathematics, 13(1):117–119, 1974.
  7. Damera et al. (2026) Sai Sandeep Damera, Ryan Matheu, John S Baras, and Calin Belta. SparseMax-dSTL: Sound robustness with horizon-independent gradient allocation for temporal logic trajectory optimization. arXiv preprint arXiv:2610.23837, 2026.
  8. Donzé and Maler (2010) Alexandre Donzé and Oded Maler. Robust satisfaction of temporal logic over real-valued signals. In International conference on formal modeling and analysis of timed systems, pages 92–106. Springer, 2010.
  9. Gebremedhin et al. (2007) Assefaw H Gebremedhin, Arijit Tarafdar, Fredrik Manne, and Alex Pothen. New acyclic and star coloring algorithms with application to computing Hessians. SIAM Journal on Scientific Computing, 29(3):1042–1072, 2007.
  10. Gebremedhin et al. (2005) Assefaw Hadish Gebremedhin, Fredrik Manne, and Alex Pothen. What color is your Jacobian? graph coloring for computing derivatives. SIAM Review, 47(4):629–705, 2005.
  11. Gilpin et al. (2021) Yann Gilpin, Vince Kurtz, and Hai Lin. A smooth robustness measure of signal temporal logic for symbolic control. IEEE Control Systems Letters, 5(1):241–246, 2021. 10.1109/LCSYS.2020.3001875.
  12. Han et al. (2025) Shaohang Han, Joris Verhagen, and Jana Tumova. Exact smooth reformulations for trajectory optimization under signal temporal logic specifications, 2025. URL https://arxiv.org/abs/2511.07375.
  13. Hill and Dalle (2025) Adrian Hill and Guillaume Dalle. Sparser, better, faster, stronger: Sparsity detection for efficient automatic differentiation. arXiv preprint arXiv:2501.17737, 2025.
  14. Hill and Dalle (2026) Adrian Hill and Guillaume Dalle. asdex: Automatic sparse differentiation in JAX. arXiv preprint arXiv:2610.12336, 2026.
  15. Kapoor et al. (2025) Parv Kapoor, Kazuki Mizuta, Eunsuk Kang, and Karen Leung. STLCG++: A masking approach for differentiable signal temporal logic specification. IEEE Robotics and Automation Letters, 2025.
  16. Kojima and Shindo (1986) Masakazu Kojima and Susumu Shindo. Extension of newton and quasi-newton methods to systems of pcˆ 1 equations. Journal of the Operations Research Society of Japan, 29(4):352–375, 1986.
  17. Leung et al. (2023) Karen Leung, Nikos Aréchiga, and Marco Pavone. Backpropagation through signal temporal logic specifications: Infusing logical structure into gradient-based methods. The International Journal of Robotics Research, 42(6):356–370, 2023.
  18. Maler and Nickovic (2004) Oded Maler and Dejan Nickovic. Monitoring temporal properties of continuous signals. In International symposium on formal techniques in real-time and fault-tolerant systems, pages 152–166. Springer, 2004.
  19. Martins and Astudillo (2016) Andre Martins and Ramon Astudillo. From softmax to sparsemax: A sparse model of attention and multi-label classification. In International conference on machine learning, pages 1614–1623. PMLR, 2016.
  20. Mehdipour et al. (2019) Noushin Mehdipour, Cristian-Ioan Vasile, and Calin Belta. Arithmetic-geometric mean robustness for control from signal temporal logic specifications. In 2019 American Control Conference (ACC), pages 1690–1695. IEEE, 2019. 10.23919/ACC.2019.8814487.
  21. Mehdipour et al. (2025) Noushin Mehdipour, Cristian-Ioan Vasile, and Calin Belta. Generalized mean robustness for signal temporal logic. IEEE Transactions on Automatic Control, 70(3):1949–1956, 2025. 10.1109/TAC.2024.3482104.
  22. Mensch and Blondel (2018) Arthur Mensch and Mathieu Blondel. Differentiable dynamic programming for structured prediction and attention. In International Conference on Machine Learning, pages 3462–3471. PMLR, 2018.
  23. Pant et al. (2017) Yash Vardhan Pant, Houssam Abbas, and Rahul Mangharam. Smooth operator: Control using the smooth robustness of temporal logic. In 2017 IEEE Conference on Control Technology and Applications (CCTA), pages 1235–1240. IEEE, 2017.
  24. Raman et al. (2014) Vasumathi Raman, Alexandre Donzé, Mehdi Maasoumy, Richard M Murray, Alberto Sangiovanni-Vincentelli, and Sanjit A Seshia. Model predictive control with signal temporal logic specifications. In 53rd IEEE Conference on Decision and Control, pages 81–87. IEEE, 2014.
  25. Sadraddini and Belta (2015) Sadra Sadraddini and Calin Belta. Robust temporal logic model predictive control. In 2015 53rd Annual Allerton Conference on Communication, Control, and Computing (Allerton), pages 772–779. IEEE, 2015. 10.1109/ALLERTON.2015.7447084.
  26. Todorov et al. (2012) Emanuel Todorov, Tom Erez, and Yuval Tassa. MuJoCo: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 5026–5033. IEEE, 2012. 10.1109/IROS.2012.6386109.
  27. Uzun et al. (2024) Samet Uzun, Purnanand Elango, Pierre-Loic Garoche, and Behcet Acikmese. Optimization with temporal and logical specifications via generalized mean-based smooth robustness measures. arXiv preprint arXiv:2405.10996, 2024.
  28. Wächter (2002) Andreas Wächter. An interior point algorithm for large-scale nonlinear optimization with applications in process engineering. PhD thesis, Carnegie Mellon University, 2002.
  29. Wächter and Biegler (2006) Andreas Wächter and Lorenz T Biegler. On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming. Mathematical Programming, 106(1):25–57, 2006.
  30. Welikala et al. (2023) Shirantha Welikala, Hai Lin, and Panos J. Antsaklis. Smooth robustness measures for symbolic control via signal temporal logic. arXiv preprint arXiv:2305.09116, 2023.

Appendix A Extended Related Work

STL robustness reduces Boolean and temporal operators to nested extrema over predicate values (Maler and Nickovic, 2004; Donzé and Maler, 2010), and differentiable computation graphs expose it to gradient-based methods (Leung et al., 2023; Kapoor et al., 2025). The log-sum-exp robustness replaces each extremum by a soft one (Pant et al., 2017). The softmax-mean measure pairs a log-sum-exp minimum with a softmax-weighted mean as the maximum, both under-approximations, so a positive value implies satisfaction for every parameter value (Gilpin et al., 2021). A comparison of four smooth measures composes per-node error bounds through the specification and allows different parameters at different levels of it (Welikala et al., 2023). Average-based measures form a further family (Mehdipour et al., 2019; Mehdipour et al., 2025; Uzun et al., 2024). The sparsemax lower extrema of our earlier paper (Damera et al., 2026) are built from the quadratically regularized maximum (Mensch and Blondel, 2018), whose gradient is the Euclidean projection onto the simplex (Martins and Astudillo, 2016). That paper proves that the resulting robustness is a lower bound of the exact one with an error known before optimization, and that its weight on violating samples a gap beyond the others is bounded below independently of the horizon. This paper builds on both results and shows what their supports give for the cost of the derivatives of a constrained planner.

An exact reformulation of the extrema avoids the approximation error of a smooth measure (Han et al., 2025). A constraint on a minimum becomes one constraint per operand, and a constraint on a maximum becomes a constraint on a convex combination of the operands whose weights are decision variables. Applied at every nested extremum with auxiliary variables, the two rules give a smooth nonlinear program whose feasible trajectories are those of the original constraint. The number of added variables and constraints grows linearly with the size of the tree of nested extrema. We keep each constraint as one smoothed robustness function of the trajectory, which adds no decision variable and carries the error bound of that paper. We derive the sparsity patterns of its derivatives from the specification and its supports.

Sparse automatic differentiation recovers a Jacobian or a Hessian from one product per color of a known sparsity pattern (Curtis et al., 1974; Gebremedhin et al., 2005; Gebremedhin et al., 2007). The pattern is declared by the user or detected from the program (Hill and Dalle, 2025; Hill and Dalle, 2026). Structural detection, also called global, propagates dependencies through the operations and returns a pattern that is valid at every input, while local detection also evaluates the operations at one input and returns the pattern at that input (Hill and Dalle, 2025). A local pattern can be reused at another input when it contains the pattern there, and the margin of Section 3.2 supplies such a test for the supports’ pattern, which we read from the forward evaluation of the constraints without tracing the program. CasADi detects the pattern of a Jacobian by propagating dependencies through its expression graph and treats a Hessian as the Jacobian of a gradient with symmetry exploited (Andersson et al., 2019; Wächter and Biegler, 2006). We therefore count it as the established baseline with a sparse pattern and not as a dense one. Direct multiple shooting enters the dynamics through local defect constraints (Bock and Plitt, 1984), and STL specifications have been enforced in receding-horizon control (Sadraddini and Belta, 2015; Raman et al., 2014).

Appendix B STL Semantics and the Smoothed Operators

The model has a fixed initial state x_{0}. The controls U=(u_{0},\ldots,u_{T-1}) lie in a box \mathcal{U} of actuator bounds and generate the sampled trajectory X=(x_{0},\ldots,x_{T}) over the horizon H=Th. For the grammar of Equation 1, the robustness at sample t is defined recursively from the predicate values by

\displaystyle\rho^{\phi\wedge\psi}_{t} \\ \displaystyle=\min\{\rho^{\phi}_{t},\rho^{\psi}_{t}\},\qquad\rho^{\phi\vee\psi}_{t}=\max\{\rho^{\phi}_{t},\rho^{\psi}_{t}\}, \\ \displaystyle\rho^{\mathbf{G}_{I}\phi}_{t} \\ \displaystyle=\min_{j\in I}\rho^{\phi}_{t+j},\qquad\rho^{\mathbf{F}_{I}\phi}_{t}=\max_{j\in I}\rho^{\phi}_{t+j}, \\ \displaystyle\rho^{\phi\,\mathbf{U}_{I}\,\psi}_{t} \\ \displaystyle=\max_{j\in I}\,\min\Bigl\{\rho^{\psi}_{t+j},\ \min_{0\leq i\leq j}\rho^{\phi}_{t+i}\Bigr\}.

Negation normal form pushes every negation to a predicate through De Morgan’s laws, the duality of always with eventually and, for a negated until, the identity \neg(\phi\,\mathbf{U}_{I}\,\psi)\equiv\bigwedge_{j\in I}\bigl(\mathbf{F}_{\{j\}}\neg\psi\vee\mathbf{F}_{\{0,\ldots,j\}}\neg\phi\bigr), which holds in the sampled exact semantics. The conversion is made in exact semantics before any smoothing, because the negation of a lower bound of a robustness is an upper bound of the negated robustness.

Unrolling the recursion of Equation 11 over the samples gives a finite acyclic evaluation graph whose leaves are predicate values and whose internal nodes are minima and maxima. A node is evaluated only where every sample its window reads exists, so every window keeps its full number of children and the horizon of a specification is at most H. We write \mathrm{ch}(v) for the children of a node v and m_{v} for their number. An until node at sample t is a maximum over its witnesses j\in I, and the child of witness j is a minimum over the j+2 values \rho^{\psi}_{t+j},\rho^{\phi}_{t},\ldots,\rho^{\phi}_{t+j}. Its inner minima therefore differ in their numbers of children, which an implementation handles with masked windows.

Each node is evaluated as one operator over all of its children, because the smoothed operators are not associative. At a node whose k extreme children lie a gap \Delta beyond its N other children, the sparsemax weight on the k children is at least \min\{1,k\Delta/\gamma\} for every N. At equal worst-case error the weight of the sound log-sum-exp on them tends to zero as N grows when the other children lie within that error of them (Damera et al., 2026).

We write \rho_{v} for the exact value of a node and \widetilde{\rho}_{v} for its smoothed value. The budget of a node is B_{v}=b_{m_{v}}(\gamma_{v})+\max_{u\in\mathrm{ch}(v)}B_{u}, with B_{v}=0 at an exact predicate leaf.

Theorem 2 (Lower bound, Damera et al., 2026).

On a finite acyclic evaluation graph of minima and maxima with exact leaves, every node satisfies 0\leq\rho_{v}-\widetilde{\rho}_{v}\leq B_{v}, and at the root B_{v} is the largest sum of node bands along a root-to-leaf path.

Our baseline (Sound-LSE) is the sound log-sum-exp. Its maximum L_{\beta}(z)=\beta^{-1}\log\sum_{i}e^{\beta z_{i}}-\log m/\beta lies below the maximum by at most \log m/\beta (Mehdipour et al., 2025; Damera et al., 2026), as does the log-sum-exp minimum -\beta^{-1}\log\sum_{i}e^{-\beta z_{i}} below the minimum (Gilpin et al., 2021). Its gradient is the softmax of \beta z, which is positive at every entry, so every child of a log-sum-exp node is in its support. The two families are compared at equal worst-case error \varepsilon per node with m\geq 2 children,

\beta=\frac{\log m}{\varepsilon},\qquad\gamma=\frac{2\varepsilon}{1-1/m}.
(12)

Multiple shooting places every predicate leaf at sample t on the variable x_{t} alone, so the gradient of a row touches only the states its windows read. Under single shooting a late predicate depends on every earlier control, and the adjoint of even a sparse forcing propagates through every earlier step of the dynamics. A solver point that meets the constraints of Equation 6 has rows of at least \delta on its own states, which by Theorem 2 gives exact rows of at least \delta on those states.

The defect d_{0} has no block in the given x_{0}. In the rows of the defect d_{t} with t\geq 1 the only nonzero blocks are

\left[\frac{\partial d_{t}}{\partial x_{t}}\ \ \frac{\partial d_{t}}{\partial x_{t+1}}\ \ \frac{\partial d_{t}}{\partial u_{t}}\right]=\bigl[-D_{x}f_{h}\ \ I\ \ -D_{u}f_{h}\bigr].
(13)

Without using any internal structure of the dynamics, two palettes of n_{x} colors alternating over even and odd samples and n_{u} further colors for the controls give a valid column coloring of the defect rows. It has 2n_{x}+n_{u} colors, a number independent of the horizon.

Appendix C Jacobian Patterns: Proofs, a Worked Example and Reuse

The children of the node (v,t) of an occurrence v in the syntax tree at sample t are

\mathcal{C}(v,t)=\begin{cases}\{(v_{L},t),(v_{R},t)\},&v\text{ is }\wedge\text{ or }\vee,\\
\{(v_{C},t+j):j\in I\},&v\text{ is }\mathbf{F}_{I}\text{ or }\mathbf{G}_{I},\\
\{(v,t,j):j\in I\},&v\text{ is }v_{L}\,\mathbf{U}_{I}\,v_{R},\\
\{(v_{R},t+j)\}\cup\{(v_{L},t+i):0\leq i\leq j\},&\text{the witness node }(v,t,j)\text{ of an until},\end{cases}
(14)

where v_{L}, v_{R} and v_{C} are the left, right and only children of v in the syntax tree.

Proof of Proposition 1 At a leaf the claim is the coordinate declaration. At an internal node the chain rule gives \nabla_{w}y_{v,t}=\sum_{c\in\mathcal{C}(v,t)}\alpha_{v,t,c}\nabla_{w}y_{c}, and edges of weight zero contribute nothing. By induction every surviving child gradient lies in the union of Equation 9, which is a subset of the union of Equation 8. \jmlrQED

Proof of Proposition 2 Every log-sum-exp weight is positive, so every support is the whole child set and Equation 9 is Equation 8, which gives item 1. For item 2, unfold Equation 9 down to the leaves. The set \mathcal{A}_{v,t}(w) is the union of \mathcal{D}_{\ell} over the leaves reached from (v,t) through support children only, and these are the leaves joined to (v,t) by a path of positive weights at w. The union over \mathcal{W} is the first claim. For the sufficient condition, let z\in\mathbb{R}^{m} hold the signed child values of a node, \theta its threshold and k\geq 1 the size of its support. In Equation 3 exactly k terms are positive and each is at most z_{\max}-\theta, so \gamma\leq k(z_{\max}-\theta) and \theta\leq z_{\max}-\gamma/k\leq z_{\max}-\gamma/m. A child whose signed value exceeds z_{\max}-\gamma/m therefore lies above the threshold and has a positive weight, and under the condition this holds at every edge of the path. Unfolding Equation 8 in the same way shows that \mathcal{D}_{v,t} is the union of \mathcal{D}_{\ell} over all leaves of the row, which gives the last claim. For item 3, the result of a scalar operation receives the union of the sets of its arguments. The value of a node is computed from the values of all of its children and from constants, so it receives the union of the sets of its children, which is the recursion of Equation 8 from the leaf sets \mathcal{D}_{\ell}. A further value that the program reads can only add to a set. Every program that evaluates a sparsemax node correctly for all child values reads every child, because by Equation 3 each child enters the support, and with it the value, for some child values. \jmlrQED

The condition of item 2 of Proposition 2 holds at any w at which every node on the path has the largest signed smoothed value among the children of its parent, ties included.

C.1 Worked example

Figure 4: The worked example of Section C.1: (a) the syntax tree of Equation 15 and (b) its four leaf evaluations at t=1, all in the static graph. Solid edges carry a positive weight at the trajectory of Equation 17, dashed edges a weight of zero, and arrows point from parents to children.

Negation normal form turns the specification on the left of

\neg\bigl(\mathbf{G}_{[1,2]}\neg\mu\vee\mathbf{F}_{[0,1]}\nu\bigr)\equiv\varphi,\qquad\varphi=\mathbf{F}_{[1,2]}\mu\wedge\mathbf{G}_{[0,1]}\neg\nu
(15)

into \varphi. We evaluate \varphi at t=1 with states x_{t}=(a_{t},b_{t},c_{t}) and the affine predicates g_{\mu}(x_{t})=a_{t}+b_{t} and g_{\nu}(x_{t})=b_{t}+c_{t}. The temporal nodes read the leaf pairs (g_{\mu}(x_{2}),g_{\mu}(x_{3})) and (-g_{\nu}(x_{1}),-g_{\nu}(x_{2})), and Figure 4 shows the graph. With \gamma=1 at every node, the three internal values are

y_{F}=Q_{1}^{+}\bigl(g_{\mu}(x_{2}),g_{\mu}(x_{3})\bigr),\qquad y_{G}=Q_{1}^{-}\bigl(-g_{\nu}(x_{1}),-g_{\nu}(x_{2})\bigr),\qquad y_{\varphi}=Q_{1}^{-}(y_{F},y_{G}).
(16)

At the states

x_{1}=(0,-1,0),\qquad x_{2}=(1,1,-4),\qquad x_{3}=(1/2,0,0)
(17)

the leaf scores are (2,1/2,1,3). The gaps inside the two temporal nodes, 3/2 and 2, exceed \gamma, and at the root the projection of (-7/4,-1) has the threshold -15/8, so both branches of the root stay active,

\alpha_{F}=(1,0),\ \ y_{F}=7/4,\qquad\alpha_{G}=(1,0),\ \ y_{G}=1,\qquad\alpha_{\varphi}=(1/8,7/8),\ \ y_{\varphi}=63/64.
(18)

The exact robustness is 1, consistent with the lower value 63/64.

Restrict the columns to \bar{w}=(a_{1},b_{1},c_{1},a_{2},b_{2},c_{2},a_{3},b_{3},c_{3}), outside which every column of the Jacobian is zero, and stack the intermediate outputs (y_{F},y_{G},y_{\varphi}) to display the construction. The static and active patterns are

P^{\mathrm{stat}}=\begin{bmatrix}0&0&0&1&1&0&1&1&0\\
0&1&1&0&1&1&0&0&0\\
0&1&1&1&1&1&1&1&0\end{bmatrix},\qquad P^{\mathrm{act}}=\begin{bmatrix}0&0&0&1&1&0&0&0&0\\
0&1&1&0&0&0&0&0&0\\
0&1&1&1&1&0&0&0&0\end{bmatrix}.
(19)

The static root row has seven columns and the active root row four, because the edges to g_{\mu}(x_{3}) and -g_{\nu}(x_{2}) have weight zero. Their removal drops a_{3}, b_{3} and c_{2} but keeps b_{2}, which the other predicate reads at sample 2. Pruning one occurrence of a predicate must therefore never erase a column that another active path uses. The chain rule gives the Jacobian \bar{J}=\partial(y_{F},y_{G},y_{\varphi})/\partial\bar{w},

\bar{J}=\begin{bmatrix}0&0&0&1&1&0&0&0&0\\
0&-1&-1&0&0&0&0&0&0\\
0&-\frac{7}{8}&-\frac{7}{8}&\frac{1}{8}&\frac{1}{8}&0&0&0&0\end{bmatrix}.
(20)

At this trajectory the exact root selects only the always branch, whereas the smoothed root keeps both, so the active pattern describes the derivative of the smoothed robustness.

C.2 Recovery from compressed products

Proposition 3 (Recovery from compressed products).

Suppose P contains the support of J. Assign column colors \kappa(j)\in\{1,\ldots,q\} so that no two columns that share a marked row receive the same color, set V_{j,a}=\mathbf{1}\{\kappa(j)=a\} and compute Y=JV. Then J_{ij}=Y_{i,\kappa(j)} wherever P_{ij}=1, and every other entry of J is zero.

Proof The entry Y_{i,\kappa(j)} sums J_{i\ell} over the columns \ell of color \kappa(j). Validity of the pattern removes the unmarked columns, and the coloring condition leaves only \ell=j. \jmlrQED

By Proposition 3, q directional derivatives reconstruct J, and the transposed argument with row colors uses q vector-Jacobian products. In the active pattern of Equation 19 the first two rows have disjoint columns and can share one reverse product. With the output seeds R=\bigl[\begin{smallmatrix}1&1&0\\ 0&0&1\end{smallmatrix}\bigr] and B=R\bar{J}, the first compressed row is \bar{J}_{F}+\bar{J}_{G}, its columns a_{2},b_{2} recover \bar{J}_{F} and its columns b_{1},c_{1} recover \bar{J}_{G}, and the second compressed row is the root row. In the static pattern the first two rows overlap at b_{2} and cannot share a product. An omitted nonzero corrupts another recovered entry through a color collision, so the reuse of a pattern at another point requires the test of Section C.3.

C.3 Reuse of an active pattern

A change of the child values can bring into the support a child that the current support discards. A strict gap between each child value and the threshold bounds how far the values may move before that happens.

Lemma 0 (Stability of the support).

Let a node have signed child values z, threshold \theta, support S=\{i:z_{i}>\theta\} and margin \eta=\min_{i}|z_{i}-\theta|>0. For a fixed \gamma and a fixed number of children, every perturbation with \|\delta z\|_{\infty}<\eta/2 preserves S.

Proof of Lemma 1 The threshold candidate that keeps the old support is \theta^{\prime}=\theta+|S|^{-1}\sum_{i\in S}\delta z_{i}, whose displacement is at most \|\delta z\|_{\infty}. Each child value minus threshold therefore changes by less than \eta and keeps its strict sign. The candidate satisfies the normalization in Equation 3 on S, so the uniqueness of the projection makes it the new threshold. \jmlrQED

The test covers every node of a row, because the inputs of its descendants change too. Assume strict margins \eta_{v}>0 at every node, and suppose that every node input map obeys \|z_{v}(w+\delta w)-z_{v}(w)\|_{\infty}\leq L_{v}\|\delta w\|_{\infty} on a stated neighbourhood. Applying Lemma 1 at every node keeps all supports for

\|\delta w\|_{\infty}<\min_{v:L_{v}>0}\frac{\eta_{v}}{2L_{v}},
(21)

as long as the step stays in the neighbourhood. The bounds L_{v} follow from Lipschitz bounds of the leaves and the nonexpansiveness of the lower extrema in the infinity norm.

In the worked example the margins are \eta_{F}=1/2, \eta_{G}=1 and \eta_{\varphi}=1/8, each affine leaf is 2-Lipschitz in the infinity norm, and the lower extrema keep that bound for every node input, so \|\delta\bar{w}\|_{\infty}<1/32 keeps the active pattern of Equation 19.

Where no Lipschitz bounds are available, the runtime check evaluates every node input, computes the thresholds that the cached supports imply and tests every active and inactive inequality. A failed test triggers a new support detection and pattern construction before any compressed product.

We checked these constructions on random specifications with every operator, until included. No entry of a dense Jacobian lay outside the static pattern, nor outside the active pattern where the supports were strict, and recovery through every coloring matched dense differentiation to rounding in double and single precision. Of 1120 random perturbations larger than the reuse radius, 321 changed a support, and the runtime check rejected every one of them. Forcing the cached coloring at those 321 points gave a wrong Jacobian at 154 of them in double precision, with relative errors up to 0.72.

Appendix D Hessian: Proofs, Support Changes and Newton’s Method

Lemma 0 (Hessian of a sparsemax node).

On \mathcal{R}_{\mathcal{S}} the sparsemax node v is a quadratic polynomial of its children with Hessian

H_{v}=\frac{s_{v}}{\gamma_{v}}\Bigl(\operatorname{Diag}(\mathbf{1}_{S_{v}})-\frac{\mathbf{1}_{S_{v}}\mathbf{1}_{S_{v}}^{\top}}{k_{v}}\Bigr),
(22)

which is zero outside S_{v}\times S_{v} and zero when k_{v}=1. A log-sum-exp node at equal error has H_{v}=s_{v}\beta_{v}(\operatorname{Diag}\pi-\pi\pi^{\top}) with \pi the softmax of \pm\beta_{v}\zeta_{v}, which is nonzero on all of its children for m_{v}\geq 2.

Proposition 4 (Hessian of a constraint).

On \mathcal{R}_{\mathcal{S}} the Hessian of a row r is

\nabla^{2}\widetilde{\rho}_{r}=\sum_{v}P_{v}\,J_{v}^{\top}H_{v}J_{v}+\sum_{\ell}P_{\ell}\,\nabla^{2}z_{\ell},
(23)

where the second sum runs over the leaves and z_{\ell} is the signed predicate value of leaf \ell.

We use the published Hessian of one smoothed node on a fixed support. For the quadratically regularized maximum it is (\operatorname{Diag}(s)-ss^{\top}/\|s\|_{1})/\gamma with s the indicator of the support (Mensch and Blondel, 2018, Appendix B.1), the Jacobian of sparsemax has the same bracket (Martins and Astudillo, 2016, Eq. 12), and Hessian-vector products through a graph of nested smoothed maxima cost as much as its gradient (Mensch and Blondel, 2018, Section 3.4).

Star coloring recovers the entries directly from the compressed products (Gebremedhin et al., 2007). Each compressed product is one forward-over-reverse pass through the Lagrangian, whose cost grows linearly with T. The closed-form assembly instead evaluates Equation 23 from the supports and from the gradients and Hessians of the active leaves alone. On the five-cell zone at 100 to 400 time steps, one Hessian of the Lagrangian by star coloring takes 12 to 15 times less time for sparsemax on the supports’ pattern than for log-sum-exp on the prescribed pattern, both in our implementation. The closed-form assembly on the supports is a further 130 to 175 times shorter.

Proof of Proposition 4 Every map is twice differentiable on \mathcal{R}_{\mathcal{S}}. At the row, \nabla^{2}y_{r}=J_{r}^{\top}H_{r}J_{r}+\sum_{c}\alpha_{r,c}\nabla^{2}y_{c}. Applying the same identity at every node in topological order multiplies the term of node v by the sum over the paths to v of the products of the edge weights, which is P_{v}, and a leaf contributes P_{\ell}\nabla^{2}z_{\ell}. A node reached by several paths collects each path once. \jmlrQED

Proof of Theorem 1 In the sum of Proposition 4, terms with P_{v}=0 vanish. For P_{v}>0, Lemma 2 keeps only the rows of J_{v} that belong to children c\in S_{v}, each of which has P_{c}\geq P_{v}\alpha_{v,c}>0. The derivative \partial y_{c}/\partial z_{\ell} is a sum over support paths from c to \ell, so it vanishes unless \ell\in L_{A}. The state form follows from z_{\ell}=\pm g_{\mu}(x_{t}), whose gradient lies in \mathcal{D}_{\ell}. \jmlrQED

For an always over the whole horizon on |A_{\mu}| coordinates, the log-sum-exp block has side |A_{\mu}|T, while the sparsemax block has side |A_{\mu}| times the number of samples in the support.

Let the evaluation graph below the row be a tree with |L_{A}|\geq 2, and let v be the first node with k_{v}\geq 2 reached from the row. In the leaf values, two leaves a,b\in L_{A} below different children e\neq e^{\prime} of v receive the entry -s_{v}P_{v}\,\partial_{z_{a}}\zeta_{e}\,\partial_{z_{b}}\zeta_{e^{\prime}}/(\gamma_{v}k_{v}) and no other term, which is nonzero on all of \mathcal{R}_{\mathcal{S}} because its factors are products of positive weights. Every other entry of L_{A}\times L_{A} collects terms of several nodes whose signs can differ, and it vanishes only on a closed set of leaf values of measure zero.

Theorem 3 (Hessian jump at a support change).

Let X^{\ast} lie on the common boundary of two support regions that differ at one node v, with \mathcal{S}^{\prime}_{v}=\mathcal{S}_{v}\cup\{j\} and k=|\mathcal{S}_{v}|. The row is continuously differentiable at X^{\ast}, the one-sided Hessians H_{\mathcal{S}} and H_{\mathcal{S}^{\prime}} exist as the limits of the Hessian from inside each region, and

H_{\mathcal{S}^{\prime}}-H_{\mathcal{S}}=\frac{s_{v}P_{v}}{\gamma_{v}\,k(k+1)}\,qq^{\top},\qquad q=k\,\nabla\zeta_{v,j}-\sum_{i\in\mathcal{S}_{v}}\nabla\zeta_{v,i},
(24)

a jump of rank at most one along the normal of the switching surface.

Proof Freezing every support at \mathcal{S} gives a function that is twice differentiable near X^{\ast} and equals the row on \mathcal{R}_{\mathcal{S}}. At X^{\ast} the weight of j is zero on both sides, so the weights, the path weights and the child gradients of the two frozen functions agree, and in Equation 23 only H_{v} differs. A direct computation gives H(\mathcal{S}_{v}\cup\{j\})-H(\mathcal{S}_{v})=\tfrac{s_{v}}{\gamma_{v}}uu^{\top} with u=(k\,e_{j}-\mathbf{1}_{\mathcal{S}_{v}})/\sqrt{k(k+1)}, and J_{v}^{\top}uu^{\top}J_{v}=qq^{\top}/(k(k+1)). \jmlrQED

Simultaneous switches at different nodes add their terms, and a switch at a node with P_{v}=0 changes nothing.

D.1 Local convergence of Newton’s method at a support change

A solution can lie on the boundary between support regions, where the Hessian of a row has two or more one-sided values. Newton’s method does not need the Hessian to exist there. At each point the gradient of every row coincides with one of finitely many continuously differentiable maps, one per choice of supports, and a Newton step with the Hessian of the current point’s own supports is a Newton step on one of these maps. Every map that can be chosen near the solution vanishes at the solution, and where the Jacobian of each of them is nonsingular there, each such step contracts toward it.

Write Equation 6 with nonnegative slack variables for the rows and the bounds. The variables \xi\in\mathbb{R}^{N} then collect w and the slacks, the constraints are equalities G(\xi)=0, and \xi_{i}\geq 0 for i in an index set \mathcal{B}. For a barrier parameter \omega>0 an interior-point method minimizes E(\xi)-\omega\sum_{i\in\mathcal{B}}\ln\xi_{i} subject to G(\xi)=0. Let \lambda be the multipliers of G and \chi_{\mathcal{B}}=(\chi_{i})_{i\in\mathcal{B}} those of the bounds, and let \chi\in\mathbb{R}^{N} extend \chi_{\mathcal{B}} by zeros. The optimality conditions of this barrier problem are the primal-dual equations

F_{\omega}(\xi,\lambda,\chi_{\mathcal{B}})=\begin{pmatrix}\nabla E(\xi)+DG(\xi)^{\top}\lambda-\chi\\
G(\xi)\\
(\xi_{i}\chi_{i}-\omega)_{i\in\mathcal{B}}\end{pmatrix}=0,\qquad\xi_{\mathcal{B}}>0,\ \ \chi_{\mathcal{B}}>0.
(25)

We write \Xi=(\xi,\lambda,\chi_{\mathcal{B}}).

For a set S of k entries of z\in\mathbb{R}^{m} let \theta_{S}(z)=(\sum_{i\in S}z_{i}-\gamma)/k and q_{S}(z)=\theta_{S}(z)+\tfrac{1}{2\gamma}\sum_{i\in S}(z_{i}-\theta_{S}(z))^{2}, a quadratic polynomial of the entries in S. By the definition of M_{\gamma} in Section 2.1 and by Equation 3, M_{\gamma}(z)=q_{S}(z) wherever the support of z is S. An assignment \mathcal{S} gives every internal node v of every row a nonempty set \mathcal{S}_{v} of its children. The frozen row \widetilde{\rho}^{\mathcal{S}}_{r} evaluates every node by Equation 4 with q_{\mathcal{S}_{v}} in place of M_{\gamma_{v}}, and G^{\mathcal{S}} and F^{\mathcal{S}}_{\omega} are G and F_{\omega} with every row frozen at \mathcal{S}. We call \mathcal{S} active at \xi when G^{\mathcal{S}}(\xi)=G(\xi) and DG^{\mathcal{S}}(\xi)=DG(\xi).

Lemma 0 (Constraints with fixed supports).

Let the predicates and the model f_{h} be twice continuously differentiable. There are finitely many assignments, every F^{\mathcal{S}}_{\omega} is continuously differentiable, and the assignment \mathcal{S}(\xi) of the supports at \xi is active at \xi for every \xi. An assignment that is not active at \bar{\xi} is not active at any point near \bar{\xi}.

Proof A frozen row composes quadratic polynomials with twice continuously differentiable predicates, and the defects are twice continuously differentiable with the model, so G^{\mathcal{S}} is twice and F^{\mathcal{S}}_{\omega} once continuously differentiable. At a point whose support at a node is S, the operator of that node equals its frozen form. The identity \sum_{i\in S}(z_{i}-\theta_{S}(z))=\gamma gives \partial q_{S}/\partial z_{i}=(z_{i}-\theta_{S}(z))/\gamma for i\in S and zero otherwise, which are the edge weights of Equation 5 when S is the support. Induction from the leaves shows that every row and its frozen row have the same value and the same gradient at the point’s own supports. The argument covers a point at which a child value equals the threshold, because the support is defined by a strict inequality. The last statement holds because G, DG, G^{\mathcal{S}} and DG^{\mathcal{S}} are continuous. \jmlrQED

The Jacobian DF^{\mathcal{S}}_{\omega} holds the Hessian of the frozen Lagrangian, W^{\mathcal{S}}(\xi,\lambda)=\nabla^{2}E(\xi)+\sum_{j}\lambda_{j}\nabla^{2}G^{\mathcal{S}}_{j}(\xi), in its first block. At \mathcal{S}=\mathcal{S}(\xi) and a point \xi at which no child value equals its node’s threshold, this block is the Hessian that automatic differentiation returns at \xi in exact arithmetic. Newton’s method for a system of piecewise continuously differentiable equations, with the Jacobian of a piece that contains the current point, converges quadratically from every start near a solution if the Jacobians of the pieces that contain the solution are nonsingular there and Lipschitz continuous near it (Kojima and Shindo, 1986). Theorem 4 applies this argument to the barrier equations, whose pieces are the equations with fixed supports, and adds the superlinear rate for Jacobians that are only continuous and the positivity of the slacks and the multipliers.

Theorem 4 (Local convergence of Newton’s method).

Let the predicates and the model f_{h} be twice continuously differentiable, and let \bar{\Xi}=(\bar{\xi},\bar{\lambda},\bar{\chi}_{\mathcal{B}}) solve Equation 25. Let \mathcal{N}(\bar{\xi}) be the set of assignments \mathcal{S} for which every neighbourhood of \bar{\xi} holds a point \xi with \mathcal{S}(\xi)=\mathcal{S}, and suppose that DF^{\mathcal{S}}_{\omega}(\bar{\Xi}) is nonsingular for every \mathcal{S}\in\mathcal{N}(\bar{\xi}). Then there is a ball U around \bar{\Xi} such that for every \Xi\in U the step with the supports of the current point,

\Xi^{+}=\Xi-DF^{\mathcal{S}(\xi)}_{\omega}(\Xi)^{-1}F_{\omega}(\Xi),
(26)

is defined, lies in U, keeps \xi^{+}_{\mathcal{B}} and \chi^{+}_{\mathcal{B}} positive and satisfies \|\Xi^{+}-\bar{\Xi}\|\leq\tfrac{1}{2}\|\Xi-\bar{\Xi}\|, with \|\Xi^{+}-\bar{\Xi}\|/\|\Xi-\bar{\Xi}\|\to 0 as \Xi\to\bar{\Xi}. The iteration that uses the Hessian of each point’s own supports therefore converges to \bar{\Xi} superlinearly from every start in U, for any number of children at their thresholds at \bar{\xi} and however often the iterates change support. The convergence is quadratic when the predicates and the model are three times continuously differentiable.

Proof There are finitely many assignments, so there is a ball U_{0} around \bar{\Xi} on which the supports \mathcal{S}(\xi) of every point belong to \mathcal{N}(\bar{\xi}). Every member of \mathcal{N}(\bar{\xi}) is active at \bar{\xi}. By Lemma 3 it is active at points that converge to \bar{\xi}, and an assignment that is not active at \bar{\xi} is not active near it. The Jacobians of the members are continuous and nonsingular at \bar{\Xi}, so U_{0} can be chosen such that \|DF^{\mathcal{S}}_{\omega}(\Xi)^{-1}\|\leq M on it for every \mathcal{S}\in\mathcal{N}(\bar{\xi}). Take \Xi\in U_{0} and \mathcal{S}=\mathcal{S}(\xi). Then F_{\omega}(\Xi)=F^{\mathcal{S}}_{\omega}(\Xi) because \mathcal{S} is active at \xi, and F^{\mathcal{S}}_{\omega}(\bar{\Xi})=F_{\omega}(\bar{\Xi})=0 because \mathcal{S} is active at \bar{\xi}. The step Equation 26 therefore satisfies

\Xi^{+}-\bar{\Xi}=DF^{\mathcal{S}}_{\omega}(\Xi)^{-1}\int_{0}^{1}\Bigl[DF^{\mathcal{S}}_{\omega}(\Xi)-DF^{\mathcal{S}}_{\omega}\bigl(\bar{\Xi}+t(\Xi-\bar{\Xi})\bigr)\Bigr]dt\,(\Xi-\bar{\Xi}).
(27)

The norm of the bracket in Equation 27 is at most the modulus of continuity of the finitely many Jacobians on U_{0}, evaluated at \|\Xi-\bar{\Xi}\|, which tends to zero with its argument. Shrinking the ball until M times this modulus is at most \tfrac{1}{2}, and until its radius is below every \bar{\xi}_{i} and \bar{\chi}_{i} with i\in\mathcal{B}, gives U. With three times continuously differentiable predicates and model the Jacobians are Lipschitz continuous on U_{0}, and the modulus is at most a constant times \|\Xi-\bar{\Xi}\|. \jmlrQED

Let \Sigma be the diagonal matrix with the entries \bar{\chi}_{i}/\bar{\xi}_{i} for i\in\mathcal{B} and zeros elsewhere. The nonsingularity holds when DG(\bar{\xi}) has full row rank and, for every assignment in \mathcal{N}(\bar{\xi}), the matrix W^{\mathcal{S}}(\bar{\xi},\bar{\lambda})+\Sigma is positive definite on the null space of DG(\bar{\xi}). When \bar{\xi} lies in a support region, \mathcal{N}(\bar{\xi}) holds the supports of \bar{\xi} alone, and this is the usual second-order condition of the barrier problem. On the common boundary of two support regions that differ by one child at one node, as in Theorem 3, it asks the condition of each one-sided Hessian and of none of their convex combinations.

Theorem 4 is local. Before the iterates reach its ball, the global convergence analysis of the line-search filter method for one barrier problem uses no second derivative of the objective or of the constraints (Wächter, 2002). Its assumptions on the problem functions are values and first derivatives that are bounded and Lipschitz continuous on a set that holds the iterates. The sparsemax rows meet them on a bounded set with twice continuously differentiable predicates and model, because the projection onto the simplex is nonexpansive. Our solver declares at each restart the union of the old structure and the new active pattern (Section D.2), so a solve restarts finitely often.

D.2 Hessian structure declared to the solver

IPOPT takes the structure of the Hessian at the start of a solve, and three declarations of it are possible. The static declaration of window cliques contains every active pattern and never needs a restart, but its size costs factorization time and the conversion of every declared entry at every call. An active declaration is small, and when a support leaves it the solve restarts from the current iterate on the union of the two structures, with the barrier parameter it had reached. A declaration of the supports’ structure widened by a chosen number of samples in time, guarded by the runtime check of Section 3.2, lies between the two. Our implementation builds it when that distance is positive.

Appendix E Additional Experimental Details

E.1 Sparsity patterns detected by CasADi

On a small instance with bounded windows, CasADi detects exactly the 138 prescribed entries of a Jacobian with 800 entries for both smoothings, although 103 to 115 of them are numerically zero for sparsemax at five test points. The instance has 40 time steps with two state coordinates each and ten constraints with always, eventually and until operators over windows of 4 to 8 samples. In CasADi the sparsemax threshold is found by bisection and then computed exactly on the support, and the values of both programs agree with our operators within 1.3\times 10^{-15} at the five test points. CasADi colors the detected Jacobian with 18 forward or 4 reverse products and the detected Hessian pattern with 22 star colors, for both smoothings. On an instance of six always constraints that each read every column, CasADi detects all 480 entries for both smoothings, while the supports’ pattern at two test points has 52 and 44 entries.

On the programs of Section 5.2 we compared the pattern that CasADi detects with the prescribed pattern entry by entry, at the control periods at which we time the derivatives. On the five-cell zone at 100, 200 and 400 time steps the two Jacobian patterns are equal, with 14,385, 31,199 and 60,221 entries. The detected Hessian pattern is the prescribed one together with 0, 84 and 686 diagonal entries of joint positions, which the tracking term of the cost contributes and which our prescribed pattern of the constraints does not hold. On the 64-cell circle the Jacobian patterns are equal, with 44,639, 184,639 and 452,039 entries, and so are the Hessian patterns. CasADi’s own coloring of the detected Jacobian takes 7, 9 and 9 reverse products on the five-cell zone and 32, 98 and 130 on the 64-cell circle, where the greedy coloring of asdex takes 6, 8 and 8 and 31, 97 and 102. In 28 comparisons on six variants of the task at the same horizons, the Jacobian pattern detected for the sparsemax program had exactly the entries of the one detected for log-sum-exp, and both equalled the prescribed pattern. CasADi obtains the pattern of the Hessian from the expression of the gradient, without building the Hessian. Figure 5 shows the values behind this pattern at one control period on the 64-cell circle (top). CasADi detects the 34,881 prescribed entries of the specification’s rows for log-sum-exp and for the GMR alike. Under log-sum-exp none of them is exactly zero, and 13,177 exceed 10^{-12} of the largest. Under the power mean robustness of order (0,1), whose conjunction is the power mean of all operands when all are positive and of the negative parts otherwise, with the disjunction dual to it (Mehdipour et al., 2025), 11,795 are exactly zero. Under sparsemax the 2,072 nonzero entries are the supports’ pattern, and the other 32,809 are exactly zero. The Hessian of the specification’s part on the five-cell zone, with every multiplier equal to one, behaves alike (bottom). Of its 608,496 prescribed upper entries, log-sum-exp has none exactly zero and 100,357 above 10^{-12} of the largest, the GMR has 355,530 exactly zero, and sparsemax has 8,771 nonzero, the supports’ pattern.

Figure 5: Entries of the specification’s constraints under Sound-LSE, GMR and SparseMax at one control period of the reference motion with 100 time steps. Top: the rows of the constraint Jacobian on the 64-cell circle. Bottom: the Hessian on the five-cell zone, on the joint positions. Grey: the prescribed pattern. Black: entries above 10^{-12} of the largest.

E.2 Product counts and derivative times

Table 2: Derivative products and time of one evaluation, in ms unless a unit is given. Each cell lists dense differentiation in JAX, Sound-LSE in CasADi and SparseMax with our patterns, and a time cell has the generalized-mean robustness (GMR) in CasADi as its third entry. The product counts are medians over control periods, and the middle one is a greedy coloring of the prescribed pattern, which CasADi’s own coloring exceeds by 1 to 28 (Section E.1). A dash marks a cell not run and a star one call.
  • T
    Constraint Jacobian
    Products
    Time
    Hessian of the Lagrangian
    Products
    Time
  • Five-cell zone
  • 100
    Constraint Jacobian
    2,806 / 7 / 4
    6.6 s / 2.6 / 2.7 / 2.7
    Hessian of the Lagrangian
    4,200 / 1,011.5 / 59.5
    26.6 s / 339 / 260 / 4.7
  • 200
    Constraint Jacobian
    5,612 / 8 / 4
    26.8 s / 5.8 / 5.8 / 3.7
    Hessian of the Lagrangian
    8,400 / 1,204 / 63
    109.6 s / 1,103 / – / 6.9
  • 400
    Constraint Jacobian
    11,222 / 8 / 4
    114.9 s / 12.1 / 9.9 / 6.5
    Hessian of the Lagrangian
    16,800 / 1,204 / 63
    476.4 s / – / – / 17.7
  • 64-cell circle
  • 100
    Constraint Jacobian
    2,823 / 25 / 9
    3.9 s / 19.7 / 19.7 / 5.1
    Hessian of the Lagrangian
    4,200 / 1,393 / 203
    22.1 s / – / – / 11.2
  • 200
    Constraint Jacobian
    5,713 / 95.5 / 13
    27.4 s / 103.3 / 88.7 / 21.7
    Hessian of the Lagrangian
    8,400 / 2,086 / 266
    169.6 s / – / – / 53.2
  • 400
    Constraint Jacobian
    11,493 / 102 / 13
    137.2 s / 248.2 / 225.3 / 116.3
    Hessian of the Lagrangian
    16,800 / 2,786 / 266
    817.4 s∗ / – / – / 172.8
Figure 6: Derivative products against the horizon at the control period of the derivative times, for the Hessian of the Lagrangian on the five-cell zone (left) and the constraint Jacobian on the 64-cell circle (right).

Figure 6 plots the products against the horizon, on the five-cell zone as medians over ten control periods along the reference motion and on the 64-cell circle at the control period at which we time the derivatives, with CasADi’s own coloring of the pattern it detects. The entries behave as the products do. On the five-cell zone at 200 time steps the Hessian has 35,284,200 upper entries, of which the prescribed pattern holds a median of 1.32 million and the supports’ pattern 17,801. On the 64-cell circle at 200 time steps the Jacobian has 48,073,200 entries, of which the prescribed pattern holds 184,639 and the supports’ pattern 27,762.

On the five-cell zone the prescribed count of the Hessian is the 14 joint positions of a time step times the 86 samples of the longest window, the largest number of variables that one until constraint reads, and it does not change between 200 and 400 time steps. The count with the supports is 63 at both horizons, so the support of no constraint covers more than 63 variables there.

On the 64-cell circle the prescribed count of the Jacobian is two more than the number of until windows that hold one time step, because every such constraint reads the joint positions of that time step and a row coloring gives each its own color. The supports’ count is set by the cells whose hand-offs lie within the width of one support, about 11 samples, where a hand-off is the sample at which the visitor’s rising distance to the cell meets the other arm’s falling one. More cells raise both counts, and the lower bounds of their ratio at 200 time steps are 8.2, 8.6 and 8.8 with 64, 96 and 128 cells. A longer window raises the prescribed count alone, to 138 against 13 with windows of 150 samples at 400 time steps.

E.3 Task, solver settings and additional solves

The until conjunct of Equation 10 is imposed one sample after the scheduled entry of the visitor. The reach conjunct is imposed at the passage of the previous waypoint, with the scheduled interval plus 10 samples as its deadline. The schedule is read from a reference motion on which neither arm rests and every conjunct holds in exact semantics with the margin of 0.02. A conjunct stays in the program until the recorded motion decides it, and the samples of its window that lie in the past enter as recorded values. The predicate \mathrm{out}_{a,z} is a minimum node over one smooth predicate per sphere, the sphere’s clearance to the cell divided by the cell’s radius, and g_{a,p} is normalized by its tolerance. Every node of a conjunct uses \gamma=0.02~\mathrm{m}/L with L the normalizing length of its predicates, 0.03 m for an until conjunct and 0.05 m for a reach conjunct, so that \gamma is 2/3 and 0.4, and the log-sum-exp parameter follows from Equation 12. The conjunct counts of Section 5.1 are those of the control period at which we time the derivatives, the one with the most until conjuncts at 100 time steps, and the product counts of Table 2 are medians over control periods. On both sides the reported solve is the second of its process, after a first one that includes the one-time compilation and setup.

Figure 7 shows the 64-cell circle in closed loop. Its cells are balls of radius 0.03 m whose centres lie 0.0157 m apart on a circle of radius 0.16 m.

Figure 7: The 64-cell circle in closed loop on the rigid-body simulation. Left: every cell as its outline and centre at 4.82 s. Right: the hand-off of one cell (thicker outline) from two viewpoints, where the right hand (blue path) leaves the cell before the left hand (orange path) enters it.

Every time except those of Section E.5 comes from one workstation with a 16-core AMD Ryzen 9 7950X and 131 GB of memory, with one job at a time pinned to 12 cores. Our derivative evaluations run on 12 threads and on one thread, and CasADi’s default evaluation of a function runs on one. Both sides call IPOPT 3.14.19 with the linear solver MUMPS (Amestoy et al., 2001; Amestoy et al., 2019) 5.8.2 on one thread through CasADi 3.8.1, with a tolerance of 10^{-6} on optimality and on the constraint violation and at most 1,000 updates of the iterate, or 3,000 in the hold-up scenario. The quasi-Newton approximation is limited-memory BFGS with a history of 10 updates. A solve from the previous control period’s solution uses IPOPT’s warm start, with its bound pushes and its initial barrier parameter at 10^{-6}, on both sides. The shifted start holds the last state at zero velocity, shifts the multipliers of the defects and of the bounds by one sample, and carries the multiplier of every conjunct that is still imposed. Our derivatives are computed in JAX 0.11.2 with asdex 0.6.0. A derivative time is the median of 30 evaluations after compilation, and of 3 to 5 evaluations for dense differentiation, whose steps ran under a time budget that left one evaluation for the starred cell of Table 2.

CasADi builds its exact Hessian of the log-sum-exp program on the five-cell zone in 349 s and 14 GiB at 100 time steps and in 1,345 s and 46 GiB at 200, and one evaluation of it takes 0.34 s and 1.10 s. At 400 time steps the solver with this Hessian takes 2,731 s and 88 GiB to build. The baseline’s program is written in CasADi’s scalar expressions.

Table 3 gives the solves of Section 5.2 with other declared structures, and the cold solves of the hold-up scenario. Its two baselines are log-sum-exp and the generalized-mean robustness (GMR) in CasADi with IPOPT’s quasi-Newton approximation, and with CasADi’s exact Hessian the log-sum-exp baseline takes 12 updates and 5.50 s from the reference motion at 100 time steps and 15 updates and 29.25 s at 200. Widening the declared structure by 2 or 5 samples in time lowers the number of structures built in a cold solve and raises the cost of every Hessian. The supports’ structure makes the solve from the previous period’s solution 3.9 to 7.0 times shorter than the prescribed structure declared once, at the same 3 updates.

Table 3: Further solves on the five-cell zone, as updates of the iterate and seconds, with the number of structures built in parentheses where it exceeds one. A hold-up is given in samples, a dash is a solve stopped at the update limit, and the times repeated in Table 4 are medians.
  • Previous period
    T
    100
    Sound-LSE
    67, 0.79
    GMR
    75, 0.95
    Supports
    3, 0.12
    Widened by 2
    3, 0.14
    Widened by 5
    3, 0.21
    Prescribed
    3, 0.48
  • No data
    T
    200
    Sound-LSE
    144, 5.53
    GMR
    135, 5.16
    Supports
    3, 0.22
    Widened by 2
    3, 0.37
    Widened by 5
    3, 0.48
    Prescribed
    3, 1.42
  • No data
    T
    400
    Sound-LSE
    142, 10.81
    GMR
    175, 14.48
    Supports
    3, 0.40
    Widened by 2
    3, 0.48
    Widened by 5
    3, 0.83
    Prescribed
    3, 2.81
  • Reference motion
    T
    100
    Sound-LSE
    96, 1.18
    GMR
    126, 1.60
    Supports
    14, 0.77 (7)
    Widened by 2
    13, 0.59 (3)
    Widened by 5
    13, 0.82 (3)
    Prescribed
    13, 1.95
  • No data
    T
    200
    Sound-LSE
    277, 11.36
    GMR
    228, 9.40
    Supports
    12, 1.27 (8)
    Widened by 2
    16, 1.42 (4)
    Widened by 5
    16, 2.36 (3)
    Prescribed
    13, 10.37
  • No data
    T
    400
    Sound-LSE
    187, 14.09
    GMR
    228, 18.14
    Supports
    12, 2.06 (7)
    Widened by 2
    12, 1.78 (3)
    Widened by 5
    13, 2.40 (2)
    Prescribed
    13, 21.49
  • Cold, hold-up 12
    T
    200
    Sound-LSE
    191, 7.02
    GMR
    –
    Supports
    22, 1.61 (9)
    Widened by 2
    18, 1.24 (4)
    Widened by 5
    17, 2.01 (3)
    Prescribed
    23, 20.95
  • Cold, hold-up 16
    T
    200
    Sound-LSE
    183, 5.37
    GMR
    –
    Supports
    18, 1.48 (11)
    Widened by 2
    21, 1.73 (7)
    Widened by 5
    20, 2.32 (4)
    Prescribed
    18, 12.30
  • Cold, hold-up 20
    T
    200
    Sound-LSE
    208, 6.55
    GMR
    –
    Supports
    26, 2.67 (21)
    Widened by 2
    28, 2.58 (9)
    Widened by 5
    22, 2.14 (5)
    Prescribed
    20, 11.55

Table 4 gives the spread of the times that we repeated, each run a new process alone on its cores. In Figure 2b and c the quartiles of the 30 evaluations lie within 5 per cent of the median, and for our Jacobian on the 64-cell circle at 200 time steps between 21.3 and 25.8 ms around a median of 21.7 ms.

Table 4: Spread of the repeated times in seconds, as the median with the smallest and the largest run. The solves are those of Tables 1 and 7, and the closed loop is that of Figure 2a at 100 time steps, with its slowest and its fastest control period. Every run takes the same updates.
  • Workstation
  • Solve, previous solution
    T
    100
    Runs
    4
    Sound-LSE, quasi-Newton
    0.79 (0.77 to 0.82)
    SparseMax, ours
    0.122 (0.120 to 0.124)
  • No data
    T
    200
    Runs
    4
    Sound-LSE, quasi-Newton
    5.53 (5.45 to 5.62)
    SparseMax, ours
    0.225 (0.223 to 0.231)
  • No data
    T
    400
    Runs
    4
    Sound-LSE, quasi-Newton
    10.81 (10.70 to 10.87)
    SparseMax, ours
    0.403 (0.395 to 0.413)
  • Solve, after a 16-sample hold-up
    T
    200
    Runs
    4
    Sound-LSE, quasi-Newton
    4.09 (4.01 to 4.11)
    SparseMax, ours
    0.218 (0.212 to 0.234)
  • Closed loop, slowest period
    T
    100
    Runs
    6
    Sound-LSE, quasi-Newton
    1.40 (1.33 to 1.42)
    SparseMax, ours
    0.461 (0.459 to 0.469)
  • Closed loop, fastest period
    T
    100
    Runs
    6
    Sound-LSE, quasi-Newton
    0.493 (0.490 to 0.504)
    SparseMax, ours
    0.092 (0.089 to 0.095)
  • Jetson AGX Orin
  • Solve, previous solution
    T
    100
    Runs
    4
    Sound-LSE, quasi-Newton
    2.38 (2.36 to 2.41)
    SparseMax, ours
    0.522 (0.515 to 0.543)
  • No data
    T
    200
    Runs
    4
    Sound-LSE, quasi-Newton
    13.68 (13.65 to 13.76)
    SparseMax, ours
    0.833 (0.801 to 0.859)
  • No data
    T
    400
    Runs
    4
    Sound-LSE, quasi-Newton
    28.49 (28.26 to 28.64)
    SparseMax, ours
    1.266 (1.231 to 1.350)
  • Solve, after a 16-sample hold-up
    T
    200
    Runs
    4
    Sound-LSE, quasi-Newton
    11.04 (10.95 to 11.10)
    SparseMax, ours
    0.796 (0.776 to 0.823)
Table 5: Time of one evaluation of our derivatives in ms, on 12 threads and on one thread.
  • Five-cell zone
    T
    100
    Jacobian, 12 threads / one
    2.7 / 4.9
    Hessian, 12 threads / one
    4.7 / 10.4
  • No data
    T
    200
    Jacobian, 12 threads / one
    3.7 / 7.8
    Hessian, 12 threads / one
    6.9 / 15.1
  • No data
    T
    400
    Jacobian, 12 threads / one
    6.5 / 14.1
    Hessian, 12 threads / one
    17.7 / 39.4
  • 64-cell circle
    T
    100
    Jacobian, 12 threads / one
    5.1 / 6.4
    Hessian, 12 threads / one
    11.2 / 19.2
  • No data
    T
    200
    Jacobian, 12 threads / one
    21.7 / 28.3
    Hessian, 12 threads / one
    53.2 / 123.0
  • No data
    T
    400
    Jacobian, 12 threads / one
    116.3 / 132.2
    Hessian, 12 threads / one
    172.8 / 355.0

On the 64-cell circle at 200 time steps, from the previous control period’s solution, the baseline takes 144 updates and 31.39 s and our solve on the supports’ structure 3 updates and 5.67 s, of which 2.17 s declare the structure. With the prescribed structure it takes 3.66 s. Cold from the reference motion the baseline takes 284 updates and 59.33 s, our solve on the supports’ structure 18 updates, 15 structures and 37.08 s, and on the prescribed structure 28 updates and 80.68 s. With the linear solver on 12 threads on both sides, the solves on the five-cell zone at 200 time steps take 5.56 and 11.41 s for the baseline and 0.25 and 1.28 s for ours, close to the times on one thread.

The closed loop of Section 5.2 runs on a rigid-body simulation of the two arms in MuJoCo (Todorov et al., 2012), in which the joint drives track the plan between two solves. The controller starts at sample 100 of the motion delayed by a hold-up of 14 samples, re-plans every 25 samples over 100 time steps from the simulated joint positions and velocities and runs for 21 control periods, with the simulation waiting while it computes. The executed joint positions differ from the planned ones by at most 0.0040 rad. The collision spheres of the two arms stay at least 38 mm apart on the executed motion and overlap by 9 mm on the motion that ignores the hold-up, and the same constraints hold on the executed motion with either planner. On the 64-cell circle the same loop, with the declared structure widened by 2 samples, starts after a hold-up of 38 samples and runs for 13 control periods (Figure 7). All 225 until constraints and all 15 reach constraints decided during the run hold in exact semantics on the executed motion, the until constraints with a smallest robustness of 0.25 against -0.22 on the motion that ignores the hold-up. Every control period after the first is 1.7 to 3.1 times shorter than the baseline’s solve alone.

After a hold-up the factor grows with the horizon, as it does from the previous solution. The median solve of the ten control periods after it is 6.3, 19 and 31 times shorter than the baseline’s at 100, 200 and 400 time steps, and the first solve after it 1.7 to 4.4 times. A change of IPOPT’s tolerance on both sides keeps the gain. At 200 time steps from the previous solution our solve is 15 times shorter with a tolerance of 10^{-4} and 44 times with IPOPT’s default of 10^{-8}, where the baseline stops at IPOPT’s acceptable level after 231 updates.

Table 6 lists every re-planning loop that we timed on the planning model, over horizons of 2, 4 and 8 s with a new plan every 0.5 s and at every sample.

Table 6: Re-planning loops on the planning model after a hold-up: time per control period in s, as the median and range of the ten periods after the first solve. The column on construction adds the baseline’s construction of its program to its solve, and the factor divides its solve alone by our whole period.
  • 2 s
    New plan every
    0.5 s
    Ours, whole period
    0.16 (0.11 to 0.40)
    Baseline, solve alone
    0.68 (0.46 to 1.35)
    With construction
    4.15
    Factor
    4.3
  • 4 s
    New plan every
    0.5 s
    Ours, whole period
    0.36 (0.25 to 1.76)
    Baseline, solve alone
    5.99 (4.04 to 8.84)
    With construction
    14.64
    Factor
    16.6
  • 8 s
    New plan every
    0.5 s
    Ours, whole period
    0.55 (0.50 to 2.23)
    Baseline, solve alone
    14.06 (11.91 to 20.55)
    With construction
    29.87
    Factor
    25.3
  • 2 s
    New plan every
    0.02 s
    Ours, whole period
    0.14 (0.11 to 0.23)
    Baseline, solve alone
    0.98 (0.72 to 1.18)
    With construction
    6.41
    Factor
    7.0
  • 4 s
    New plan every
    0.02 s
    Ours, whole period
    0.24 (0.20 to 0.35)
    Baseline, solve alone
    4.18 (3.60 to 5.41)
    With construction
    13.06
    Factor
    17.6
  • 8 s
    New plan every
    0.02 s
    Ours, whole period
    0.47 (0.43 to 0.94)
    Baseline, solve alone
    13.18 (11.27 to 20.04)
    With construction
    30.78
    Factor
    28.0

E.4 Comparison with the generalized-mean robustness

The baseline’s second smoothing is the generalized-mean robustness (Mehdipour et al., 2025) in its power mean form of order (p,q)=(0,1), one of the three settings of its authors’ control example. The measure is built so that all subformulas and time points contribute to the score, which removes the locality and masking of the traditional robustness. It is sound in its authors’ sense for every order, which means that its sign is the sign of the exact robustness. Its conjunction is the power mean of exponent p of the operands when all of them are positive (Mehdipour et al., 2025, Eq. 12). Otherwise it is the negated power mean of exponent q of the magnitudes of their negative parts, taken over all operands, so a positive operand enters as zero. Its disjunction follows by De Morgan’s law, and the conjunction lies at or above the minimum. A constraint on the measure at the margin therefore certifies a positive exact robustness, but not in general the margin. Its authors note that with the limiting orders, as with the traditional robustness, the measure considers only the most critical time or subformula and is useful for monitoring or control in safety-critical applications (Mehdipour et al., 2025, p. 1954). The other orders set the level of contribution of all subformulas and times. Sparsemax lies between the two. Its derivative stays on the operands within a threshold of the extremum, which one parameter sets, and its value bounds the exact robustness from below, so a margin on it carries over to the exact robustness.

We place the measure in each constraint of our program, in CasADi with its detection and IPOPT, as we do with log-sum-exp. We evaluate its authors’ equations as printed, with the until nested as they define it (Mehdipour et al., 2025, Eq. 15) and without the smooth approximation of the positive and negative parts that they use to improve convergence. At our solutions of the solves started from the previous control period’s solution, the derivative of the specification’s constraints is then nonzero in 3,514 of the 4,627 Jacobian entries prescribed for them on the five-cell zone at 100 time steps. The counts are 8,491 of 11,641 at 200 time steps, 15,351 of 21,063 at 400 and 102,116 of 165,081 on the 64-cell circle at 200. The sparsemax supports hold 385, 679, 1,120 and 8,204 of the prescribed entries. We compared CasADi’s detected patterns on five programs, each at one control period (the five-cell zone at the three horizons, the 64-cell circle and the hold-up scenario at 200 time steps). On each it detects for this measure the pattern it detects for log-sum-exp, entry for entry, in the Jacobian and in the Hessian, so at these control periods its derivative products equal those of log-sum-exp (Table 2). CasADi’s detection thus returns the prescribed Jacobian pattern on these programs for a second smoothing whose derivative, evaluated as printed, has exact zeros. One Jacobian of this program takes CasADi 0.8 to 1.0 times its log-sum-exp time.

From the previous control period’s solution, where every conjunct holds, the baseline with this measure and IPOPT’s quasi-Newton approximation takes 75, 135 and 175 updates and 0.95, 5.16 and 14.48 s at 100, 200 and 400 time steps (Table 1). With log-sum-exp it takes 67, 144 and 142 updates. From the reference motion it takes 126, 228 and 228 updates, where log-sum-exp takes 96, 277 and 187 (Table 3). In the hold-up scenario the first solve starts from the plan made before the hold-up, on which the delayed leading arm leaves 6 to 7 conjuncts violated. From that start, at hold-ups of 12, 16 and 20 samples and 200 time steps, IPOPT with its quasi-Newton approximation stopped at its limit of 3,000 updates. The tables therefore give no hold-up solve for this measure. Because the measure is not smooth at the satisfaction boundaries, its authors state that algorithms for nonsmooth optimization can be used and name two further aids, a first solve with a smooth measure and smooth approximations of the positive and negative parts (Mehdipour et al., 2025, Section V). We applied none of these.

Its authors maximize the measure in the cost under a margin constraint (Mehdipour et al., 2025, Eq. 11), where we only constrain it. We also solved their formulation on our plant and specification at 100 time steps, with one constraint on the measure of the conjunction of all conjuncts, the weight of 100 of their control example and the margin of 0.02. IPOPT with the same quasi-Newton setting reached its limit of 1,000 updates from the reference motion and from the previous period’s last iterate, at iterates on which every conjunct holds in exact semantics. Their own solves of that formulation use BFGS and SLSQP.

E.5 Results on an embedded computer

We repeated the solves and the derivative times of Section 5.2 on the 12-core CPU of a Jetson AGX Orin, with the same programs, options and software versions and no GPU (Table 7). Our solves and the baseline’s solve with CasADi’s exact Hessian, 3 updates and 2.54 s at 100 time steps, reproduce the workstation’s solutions to rounding. The quasi-Newton baseline takes a different number of updates there and stops at points that differ from the workstation’s by up to 1.4\times 10^{-3} in the solution. At 400 time steps IPOPT ends it with an error in the step computation, at a feasible iterate that misses the optimality tolerance and whose objective differs from the workstation’s by 6\times 10^{-7}. On the device our solves are 4.6 to 22.5 times shorter than the baseline’s, and our Hessian on the five-cell zone at 100 time steps is 29 times shorter than CasADi’s (Table 7). On the five-cell zone over four fifths of our Jacobian’s time goes to the predicates and their derivatives, which every method has to evaluate, and on one thread the device’s cores run them 2.5 to 3.1 times slower than the workstation’s in our compiled code, against 1.7 to 2.1 times for CasADi’s evaluation.

Table 7: The comparison on the CPU of a Jetson AGX Orin: one solve as updates of the iterate and seconds, the baseline’s with the quasi-Newton approximation / CasADi’s exact Hessian, and one derivative evaluation in ms, ours on 12 threads / one thread. The solve’s factor divides the baseline’s shorter time by ours. The starred solve ended with an error. The quasi-Newton and our solve times are medians of four runs (Table 4).
  • Solve, previous solution
    T
    100
    Sound-LSE in CasADi
    74, 2.38 / 3, 2.54
    SparseMax, ours
    3, 0.52
    Factor
    4.6
  • No data
    T
    200
    Sound-LSE in CasADi
    137, 13.68 / 3, 12.35
    SparseMax, ours
    3, 0.83
    Factor
    14.8
  • No data
    T
    400
    Sound-LSE in CasADi
    126, 28.49∗
    SparseMax, ours
    3, 1.27
    Factor
    22.5
  • Solve, after a 16-sample hold-up
    T
    200
    Sound-LSE in CasADi
    101 to 161, 11.04
    SparseMax, ours
    3 to 7, 0.80
    Factor
    13.9
  • Hessian, five-cell zone
    T
    100
    Sound-LSE in CasADi
    630
    SparseMax, ours
    21.9 / 26.6
    Factor
    29
  • Jacobian, five-cell zone
    T
    100
    Sound-LSE in CasADi
    4.5
    SparseMax, ours
    12.3 / 14.0
    Factor
    0.36
  • No data
    T
    200
    Sound-LSE in CasADi
    12.1
    SparseMax, ours
    18.8 / 22.8
    Factor
    0.64
  • No data
    T
    400
    Sound-LSE in CasADi
    23.3
    SparseMax, ours
    27.5 / 39.0
    Factor
    0.85
  • Jacobian, 64-cell circle
    T
    100
    Sound-LSE in CasADi
    39.7
    SparseMax, ours
    23.5 / 21.7
    Factor
    1.7
  • No data
    T
    200
    Sound-LSE in CasADi
    206.6
    SparseMax, ours
    76.0 / 99.9
    Factor
    2.7
  • No data
    T
    400
    Sound-LSE in CasADi
    520.4
    SparseMax, ours
    156.3 / 256.6
    Factor
    3.3