Production Network Risk
Real input-output economics, in the tradition of Acemoglu, Carvalho, Ozdaglar & Tahbaz-Salehi’s “The Network Origins of Aggregate Fluctuations”: the OECD’s real Inter-Country Input-Output tables, USA domestic block, 45 real industries, year 2020, chosen because 2020 is the year specific sectors took the sharpest real demand shock in decades, giving the shock-propagation exercise below a genuine event to model.
The Leontief inverse: total requirements, not just direct
Section titled “The Leontief inverse: total requirements, not just direct”L = (I-A)⁻¹: how much total output sector $i$ must produce to deliver one extra
dollar of final demand for sector $j$ (direct effects plus every indirect round):
MATRIX A = [[0.1, 0.2, 0.0], [0.3, 0.1, 0.1], [0.0, 0.2, 0.2]]MATRIX I3 = [[1,0,0],[0,1,0],[0,0,1]]LET IminusA = I3 - ALET L = INVERSE IminusAOn the real 45×45 matrix: INVERSE matched an independent numpy computation to
8.9e-08 max difference. Output multipliers (column sums of L) computed as a real
matrix multiplication, not a .sum() shortcut:
MATRIX ones_row = [[1, 1, 1]]LET mult_mat = MATMUL ones_row LLET multipliers = FLATTEN mult_matThree notions of “systemic importance”: they disagree
Section titled “Three notions of “systemic importance”: they disagree”GDP-weighted Katz-Bonacich influence (v = Lᵀw), eigenvector centrality on the
symmetrized network (EIGEN on (A + Aᵀ)/2, after confirming EIGENVALUES
correctly refuses the real, non-symmetric A directly), and output multiplier all
rank the real 45 sectors differently: Spearman correlation between multiplier and
influence is only 0.208. Sectors like food manufacturing have high per-dollar
multipliers, but the highest systemically influential sectors (wholesale trade,
finance, real estate) matter mostly for their sheer size and connectivity. This is a
real, non-cherry-picked finding matching current network-economics literature.
A real, dated shock: air transport’s 2020 collapse
Section titled “A real, dated shock: air transport’s 2020 collapse”A real -$52B final-demand shock to air transport, propagated two independent ways
(SOLVE directly, and MATMUL against the already-computed L), agreeing to within
numerical precision:
LET total_effect = SOLVE IminusA shockLET total_effect_2 = FLATTEN (MATMUL L shock_col)The result is a 3.79x amplification: the aggregate output response across the
whole economy (-$95.8B) is nearly 4x the direct effect alone (-$25.3B). The 2020
COVID-driven US input-output matrix genuinely is not full rank (RANK(A) = 44, not
45). Confirmed against numpy exactly, this is a real economic fact about linear
dependence among 2020 input structures, not a data error.
Three real engine findings from this one notebook
Section titled “Three real engine findings from this one notebook”- Fixed:
SimdBackend’s scalar broadcast (matrix * 0.5) failed above the 1024-element SIMD threshold with a bare"Shape mismatch". Real 45×45 economic data (2,025 elements) was the first notebook input large enough to ever hit this path. Fixed with 4 new regression tests. - Flagged: a qualified column inside a window function’s
ORDER BY(RANK() OVER (ORDER BY t.col DESC)) fails to parse; a bareORDER BY colworks. - Flagged: an un-aliased qualified
SELECTcolumn (SELECT t.col FROM t, noAS) returns correct data but names the output column__cmp_0instead ofcol.

