arXiv:2611.09589cs.DSNov 2026

Manuscript Offprint

arXiv:2611.09589

Dual-Number Associative Arrays for One-Pass Provenance and Sensitivity

Timothy Habashy, Hayden Jananthan, Jeremy Kepner

Timothy Habashy, Hayden Jananthan, Jeremy Kepner

MIT

Abstract—Associative arrays and GraphBLAS express sparse computations as matrix operations over a chosen semiring, but the result normally contains only the ordinary value. We define a dual-number extension Dk(S)=S⋉SkD_k(S) = S \ltimes S^k that carries this value together with kk independent auxiliary channels in the same computation. We prove that the construction is a split square-zero extension of any commutative semiring. Over min-plus, the auxiliary value is the weight of the shortest walk constrained to use the corresponding edge, excluding the weight of that edge. This gives an exact shortest-path membership test for that edge, although ties return the union of the edges on all optimal paths. We implement the min-plus construction using sparse python-graphblas operations, with a fixpoint test that checks the value and auxiliary components together. We validate the implementation across 18,692 checks, including 2,825 tied target pairs. On random graphs with 100,000 vertices and 32 seed edges, the dual method is 3.39×3.39\times faster than the sequential algorithm but 1.50×1.50\times slower than a min-plus-specific batched method. This difference is largely explained by the dual method requiring 1.55×1.55\times as many sweeps. Thus, the main contribution is a general algebraic approach with competitive sparse performance, rather than information that specialized min-plus algorithms cannot already compute.

I. INTRODUCTION

Associative arrays represent spreadsheets, databases, matrices, and graphs as sparse key-labeled arrays whose operations are determined by a chosen value algebra [1]. GraphBLAS applies the same idea to graph algorithms: the sparse matrix structure stays fixed, while addition and multiplication are replaced by semiring operations suited to the problem [2], [3]. This provides a compact and reusable language for sparse computation. However, the result usually does not record which inputs contributed to it or how auxiliary information moved through the computation.

Semiring provenance approaches this problem by annotating inputs and propagating those annotations through a computation [4], [5]. Extensions cover aggregate queries [6], linear algebra operators [7], and graph queries [8]. Matrix query languages have also been connected to positive relational algebra over semiring-annotated relations [9]. In ordinary arithmetic, dual numbers carry a value and its first-order information through one forward computation [10], [11]. Expectation

semirings similarly carry auxiliary statistics alongside the ordinary value [12] and have been studied algebraically as semiring trivial extensions [13]. Newtonian program analysis provides a related differential calculus for semiring polynomials in fixed-point systems [14]. This leads to the question studied here: can the dual-number product rule be extended to any commutative semiring, and when does the auxiliary component have a useful interpretation?

This paper makes four contributions: (1) define Dk(S)=S⋉SkD_k(S) = S \ltimes S^k as a flat split square-zero extension; (2) interpret its auxiliary components over min-plus; (3) implement a sparse GraphBLAS recurrence with joint convergence and prove termination without reachable negative-weight cycles; and (4) compare sequential and batched min-plus baselines. The batched method recovers the same information at full convergence, but it depends on a min-plus-specific factorization. The dual construction instead uses the same rule for each semiring and works for hop-bounded (restricted to paths containing ≤N\leq N edges, where NN is fixed) computations.