Skip to content

🇬🇧 English · 🇪🇸 Español

Structural solver validation status

Updated November 2026 (release 6.6.0) with scoped rows for the distributional LP–HANK household bridge (puremacro.models.hank_distributional_bridge), dynamic trade reallocation household incidence (puremacro.trade.reallocation_incidence), and the offline-first macro freshness monitor (puremacro.macro_monitor), alongside existing 6.5.0 rows for financed fiscal HANK closures (puremacro.models.hank_fiscal), the empirical-structural workbench (puremacro.workbench), auditable batch trade and sovereign SMM fail-closed guards, and CCE Mean Group local projections (puremacro.lp.cce), together with refreshed validation and example ledger counts. Earlier updates added the returning puremacro.trade modules in October 2026 (consistent accounting only, synthetic and OECD fixtures, the bundled OECD ICIO 2019 table), and on 23 September 2026 added a row for stacked Newton-Krylov and rows revised by the post-4.3.0 audit fixes. The 20 September 2026 update followed the independent counterexamples of an internal critical evaluation and of its live Dynare follow-up. Feature availability, numerical convergence, and independent replication are separate claims. Passing a residual check does not validate an economic model.

Surface Supported calculation and acceptance contract Evidence and remaining limits
DSGE order three Risk slopes include state timing, Hessian chain terms and third-derivative variance contractions. Parsed models use symbolic derivatives; callable-model fallback has finite-difference accuracy. Five models executed in live Dynare 7.0 at orders two and three, including correlated shocks, nonlinear states and an RBC model. All unfolded tensors, risk corrections, covariance and common-innovation simulations/moments agree (maximum tensor error 1.15e-13; path error 2.70e-13). Mixed-derivative assembly now preserves each index permutation. This is a bounded benchmark, not general parity. MATLAB completed exports but crashed on shutdown; see tools/reference_validation/README.md. Exact pruned moments (after 4.3.0): the state-space identity reproduces the pruned simulator to 2e-15; means and covariances equal Dynare 8's pruned moments on six models (2e-13) and a closed form (3e-15). Dynare's order-3 autocorrelations omit a correlation term; a closed form and Dynare's own 4e6-period simulations agree with puremacro (tests/test_dsge_order3_moments.py).
Dynare parity dashboard Orders one and two compare steady states and all requested tensors (ghx, ghu, ghxx, ghxu, ghuu, ghs2), aligned by labels. Supplied oo_.mean/var/autocorr are compared with the moments of the object solved at the compared order: at order 2, the risk-corrected mean and first-order second moments, which is the convention of stoch_simul(order=2) without pruning. M_.Sigma_e is compared with the covariance the object declares. Autocorrelation rows of zero-variance variables that are NaN on both sides count as matching and are listed in details["moments_excluded"]. Missing, nonfinite (one-sided), malformed or empty input, including Dynare's initial oo_.dr = [] and record-array loadmat output, is unavailable. The live Dynare 7 fixtures were exported with nomoments, so order-2 moment parity is tested against the stoch_simul formulas applied to Dynare's own decision rules (agreement 3.6e-15 mean, 7.0e-14 var, 1.8e-14 autocorr on rbc), not against Dynare-reported moments. A reference from stoch_simul(order=2, pruning) reports pruned second moments: compare it with pruning=True, which uses the exact pruned moments (Dynare 8's pruned means, covariances and autocorrelations reproduced to 7e-14 on the five live models and on a closed-form model). Self-generated serialization fixtures are internal tests, not external Dynare oracles. The parity CLI cannot consume references and exits with an explanatory error; use the Python API.
Markov-switching DSGE Coupled-equation residuals are recomputed at the returned matrices. Convergence is diff <= tol (absolute), or every residual entry within tol or within rtol (64 eps) of the magnitudes of its own cancelling terms (componentwise backward error; the smallest certifying rtol is reported as relative_residual). Failed solutions have unavailable shock impacts, stability radii and ergodic moments. A real-root failure must not return finite equilibrium covariance or a stability certificate. Finite moments also require stability after convergence. Tested cases: uniform rescaling by up to 1e9; one equation rescaled by 1e6 and 1e9 on three models (the O(1) equations still meet tol and T stays within 1e-9 of the unscaled solution); variable units spanning 1e14; O(1) models (including a user-tightened tol) bit-identical to the absolute gate.
Stacked-time Newton-Krylov solve_stacked_newton_krylov accepts a path only when the stacked residual satisfies |F|_inf <= tol * s (s the steady-block scale) and the next Newton step is below 1e-10 * max(1, |Y|_inf); step_tol=None drops the step test (with jacobian_scale=1.0 the test is then |F|_inf <= tol). The Newton move is bounded in path units (0.75 * max(1, |Y|_inf)) and accepted by a 24-trial Armijo line search. A direction returned at the Krylov cap is recorded (status and recomputed true linear residual) and line-searched like any other; it is not an error by itself. Failed line searches, iteration limits, errors or nonfinite values inside a linear solve, a residual at a noise floor that meets the tolerance while the step test cannot, and a steady-state stacked matrix that cannot be factored raise StackedNewtonError with the last state attached and the cause in converged_by. Block-Thomas pivots with a LAPACK condition estimate below n * eps, or a factorization whose one-vector backward error exceeds 1e-10, fall back to SuperLU (recorded in the preconditioner name). When both inputs are StackedNewtonResult objects, compare_horizons requires converged inputs, identical boundaries and the same exogenous path held beyond the short horizon; arrays, DataFrames and PerfectForesightResult inputs are compared as given. Dense-solve oracles to 1e-12 (constant and per-date blocks, with and without time blocks), exact-inverse identity in one Krylov cycle, parity with solve_perfect_foresight on Ramsey and a 20-sector growth transition to 1e-8 (observed 7e-11 and 3.5e-11), equation-scaling invariance (1e-9) and variable-scaling invariance (units 1e-3 to 1e4, 1e-9 relative, same Newton counts), rounding-level and ill-conditioned pivot regressions (rank-deficient B = U V, stacked condition numbers 616 and 941; B = [[1, 1], [1, 1 + 1e-12]]), and the failure contract including errors inside the Krylov solve and a 1e-12 residual noise floor. Evidence covers analytic DSGE-size fixtures only. Memory is O(T n^2) (about 3.2 GB at n_vars = 1000, T = 200); systems with thousands of unknowns per date need a structured elimination, and none ships. Block structure alone does not establish speed or memory at scale, and the linear identities do not by themselves guarantee numerical accuracy or nonlinear convergence. No large-scale transition is solved here; MCP and the surprise mode of solve_perfect_foresight are unavailable. See usage and evidence.
VFI projections Euler collocation, FEM, Smolyak and spline flags require finite final residuals within the requested tolerance. Optimizer termination alone is insufficient. A fitting-node residual does not establish off-grid accuracy, feasibility, complementarity or global optimality. Adverse domains can return useful approximations with converged=False. Bellman variants have their own iteration criteria.
Collocation auxiliary values Policy and value use one CRRA curvature (sigma, alias gamma) and the model's productivity in the Euler, Coleman, Bellman and policy-evaluation blocks. User return_fn/euler_residual_fn parameters are passed through uninterpreted. Tested cases: the deterministic log-growth closed form under every spelling; the Bellman identity under CRRA(2) and CRRA(3); Euler/Bellman policy agreement (1.1e-6) at sigma = 2; the IFT gamma sensitivity against the sigma column and an FD re-solve. Boundary clamping limits interpretation outside the chosen domain. Since 4.5.0 puremacro.vfi.splines and puremacro.vfi.smolyak follow the same sigma-then-gamma rule; solve_smolyak(method="bellman") covers only log utility with full depreciation and raises otherwise.
Deep Macro Detached-target Euler time iteration. The current-state forward cache is restored before the weight update. A complete training-step gradient is checked by finite differences. Training success is calibration/seed dependent; even the default deterministic ten-country trajectory can fail the held-out Euler criterion. A small training loss alone is not convergence.
VFI sensitivities IFT linear solves using central-difference residual Jacobians: semi-analytic derivatives for representative-agent projections and the specialized continuous Aiyagari EGM equilibrium. The latter couples household, normalized tangent stationary-distribution and capital-market equations. Accuracy depends on differencing steps, grids, binding constraints and conditioning. tests/test_vfi/test_analytic_gradients.py checks distribution-derivative mass conservation and beta sensitivities of capital and the interest rate against independently re-solved equilibria (relative tolerance 1e-4) at one calibration with three productivity states. This does not establish every parameter derivative, calibration or arbitrary heterogeneous-agent model. See scope.
Trade equilibrium solve_trade_equilibrium uses the consistent accounting only: homogeneous factor costs, producer/purchaser values, output-revenue taxes, actual final-expenditure tax shares, fixed baseline foreign saving (in numeraire units by default, or as a share of world factor income with foreign_saving_units="world_income") and the first producer price as numeraire. Newton, sparse LU, Newton-Krylov, Broyden and Keller stop only when the solved residuals and the audited physical equations (the omitted goods equation and the realized foreign balances) meet tol; finite-difference steps scale with each unknown (h_j = eps * max(|x_j|, s_j)), so resolution does not depend on the currency unit. SciPy hybrid/LM use their own stopping rule and are audited afterwards. Dimensions are read from the table; the fiscal-recycling and capacity branches need an explicit country (and sector). Independent scalar two-country solution, a conserving OECD 3-region aggregation with budget/GDP identities and currency scaling, the frozen OECD 3x3 fixture and seeded synthetic tables of several sizes (tests/test_trade_consistent_accounting.py, tests/test_trade_solver_audit_fixes.py). With nonzero foreign saving the default closure depends on the country order; "world_income" removes the dependence. Full-size native GE is not verified. NumPy only (backend other than "numpy" raises NotImplementedError); Leontief/CES intermediates and lump-sum rebates; other fiscal recycling raises NotImplementedError. See equations and scope.
Tariff receipts All duties use exporter prices and the complete bilateral schedule, are paid once by buyers and rebated once to importing households. Metadata exposes domestic-tax receipts and producer/purchaser ledgers. OECD production-column TLS is modeled as an output tax; the data do not identify a full product/VAT schedule.
Keller PAC Complete starting/target intermediate and final-demand schedules; dense full-system continuation; residual-based final acceptance. A scalar tau_target (any 0-d real input) also applies to final-demand imports unless scalar_applies_to_final_demand=False, and the choice is recorded in metadata["scalar_tariff_convention"]. condensed=True is explicitly unavailable. Newton/PAC agreement for a small tariff experiment. No traversal of an economic fold has been demonstrated: the fold monitor is a diagnostic. metadata["fold_points"] holds merged events (consecutive tau_lambda <= 0 detections form one event with first_step, last_step, n_detections and a kind: lambda_reversal, factor_price_boundary or no_lambda_reversal), and metadata["fold_detections"] keeps the raw count. The Leontief Hawkins-Simon gate also applies for sigma > 0, where CES unit costs are at most the Leontief cost, so it can reject solvable CES schedules. See tariff continuation.
Caliendo–Parro The identity shortcut requires tariffs, iceberg costs and deficit closure to be individually unchanged. Countries and sectors are resolved by their codes, whatever their order. Offsetting tariff/iceberg changes must retain revenue. No new live replication of the authors' published quantitative results was performed.
Tariff games Explicit metric="hicksian_ev" uses consistent accounting, one fixed zero-tariff baseline, consumption-normalized gains/regret and fixed actions in payoff matrices. Full-interval grid/refinement and final simultaneous deviations determine numerical convergence. Audited Newton → hybrid → continuation recovery preserves the model and tolerance; failed deviations raise without a payoff. A Leontief schedule whose Collatz–Wielandt lower bound is at least one is refused before any attempt (PolicyEquilibriumError.viability); other screening outcomes are recorded in metadata["policy_viability"]. Independent scalar CES equilibrium and primal expenditure reference on a tariff grid, plus false-convergence/recovery tests. The benchmark reaches its tariff ceiling; neither interior optima nor global Nash uniqueness are established. See usage, evidence and limits.
Hicksian consumption welfare compute_hicksian_welfare evaluates expenditure-function EV/CV from consistent-accounting equilibria, with explicit consumption categories and purchaser prices. A separate endpoint Shapley attribution uses prices, factor income and fiscal transfers. Independent origin-level expenditure minimization, all six attribution orderings, duality checks, currency scaling and the OECD aggregation. Investment is excluded; native OECD C includes government consumption. This is conditional consumption welfare, not lifetime utility or a causal efficiency decomposition. See derivation and evidence.
Bundled OECD ICIO table load_icio_data() returns the OECD ICIO 2023-edition 2019 table aggregated to the 19 G20 countries plus ROW and the 20 ISIC Rev.4 sections (C, I, Cx final uses), built byte for byte by tools/build_icio_isic.py from the MD5-checked public release; value added is split 2/3 labour, 1/3 capital. Three internal gallery cases: world totals against the native release, column balance with positive value added on producing columns, and the base equilibrium at the calibration point. The 2/3-1/3 split is an assumption; four negative final-use cells were netted and three empty household-employer cells carry phantom output (recorded in the build record). Results computed from it credit the OECD. See section 7 and puremacro/trade/_datafiles/SOURCES.md.
MRIO adapters Missing source files fail by default. Generated data require explicit opt-in. Calibrations retain source, year, units, generation seed or file hash, conversion assumptions, and adjustment summaries. The FIGARO, EXIOBASE, WIOD and Eora harmonized loaders deliver C/I/Cx with the foreign-balance closure on gross fixed capital formation (I); their Cx is signed inventories and valuables (EXIOBASE: plus its export column), not residents' purchases abroad, as recorded in metadata["final_use_mapping"] and metadata["final_use_semantics"]. A conserving 3-region × 3-sector aggregation of the OECD 2023 release passes baseline, accounting and tariff counterfactual checks. The FIGARO/EXIOBASE/WIOD/Eora harmonized loaders are verified on synthetic fixtures only; parity with native archives is unverified (the native FIGARO and EXIOBASE files are read by puremacro.trade.mrio). Labor/capital shares of 2/3 and 1/3 remain assumptions.
MRIO productivity Strongly connected blocks, power iteration shifted by a small positive diagonal (shift=1e-3), Collatz–Wielandt bounds, and inverse-iteration refinement with a positive resolvent vector for unresolved blocks of up to 1024 rows. An interval crossing the viability threshold is unresolved, not a certificate. check_hawkins_simon_viability reads tariff schedules exactly as solve_trade_equilibrium does and returns a four-field ViabilityResult; solve_policy_equilibrium refuses a Leontief schedule whose lower bound is at least one before any solver attempt. Periodic, reducible and near-critical matrices and large synthetic tables across their viability threshold match dense eigenvalues (tests/test_trade_ingestion_audit_fixes.py, thresholds self-generated on seeded synthetic tables). The scalar spectral estimate alone is not a productivity certificate. No wall-time bound is guaranteed.
Native MRIO tables (puremacro.trade.mrio) Label-driven readers for OECD ICIO 2023 (read_oecd_native, a known-corrupted digest refused, unknown editions warned), Eurostat FIGARO 2026 (read_figaro_native, bounded rounding repairs recorded) and EXIOBASE 3.8.2 (read_exiobase_native, CSR; archive members, or an extracted directory passed with archive=, checked against the archive size and CRC-32 entries); registered digests are bound to their year. regularize_table accepts a table only when the identity guard, the residual-tax gates and the fob world-balance gate pass, and returns every gate value with the offending cells; under strict=False a failed table is marked regularized=False and aggregation and the calibration bridge warn. aggregate_mrio is exact P M P^T with conservation and a 1e-8 identity gate; to_calibration_matrix builds labour and capital rows that calibrate_trade_model accepts. Hand-derived fixtures in the official FIGARO and EXIOBASE layouts, a tiny OECD SML-layout file, every regularization gate in strict and reporting mode, conservation, composition and region aggregation, and calibration of the aggregated OECD fixture. active_mask means positive reported output, not an economic feasibility certificate; FIGARO keeps territorial consumption without a validated residence bridge; the EXIOBASE 2019 release is a nowcast. No equilibrium is solved on FIGARO or EXIOBASE; other editions and years, and GTAP (licensed data, GPL-3 parser), are outside the validation. See native tables.
Condensed one-factor Leontief tariff model puremacro.trade.condensed.solve_condensed eliminates prices and outputs exactly (two LU factorizations), solves the 2N system (log w, Y/Y0) to max|r| <= 1e-12 with the dropped Walras residual <= 1e-10, gates existence with a Collatz-Wielandt bound rho(B_tau) < 1 - 1e-3 (inconclusive bounds raise, never claim nonexistence; multipliers below one are refused), and with certify=True (default) accepts a state only after an independent ten-block raw-flow certificate at 1e-10, phantom cells entering with their true output ratio. certify=False results are diagnostic and never passed. Measures are numeraire-free by construction; separate_baseline_tariffs stacks increments on observed duties. Benchmark reproduction at 1e-14, certificates on a synthetic 3x4 table, the OECD 3x3 fixture and synthetic 5x4 and 20x6 tables, certificate fault injection, EV-split additivity 1e-12, numeraire invariance 1e-9, inventory-duty neutrality under the factor closure, unit homogeneity, exact effective rate, and continuation/arclength/multistart/fallback behaviours. No global uniqueness, universal fold threshold or global Newton guarantee is asserted; the thresholds are floating-point criteria, not interval enclosures. The fold monitor is exercised by a synthetic determinant sign change and by an existence boundary on the synthetic 3x4 economy, not by an economic turning point. One composite factor, Leontief technology and static EV that includes investment in absorption: results are not comparable one-to-one with solve_trade_equilibrium. See usage, equations and limits.
Nested CES block Newton solve_ces_block_newton and continue_tariff_homotopy solve the consistent-accounting equations with a benchmark-normalized three-tier nested CES technology (plus the K/L nest) using the exact Jacobian: two M x M LU factorizations and a (3N+1) macro Schur complement, damped Newton with an admissibility filter. One acceptance test, shared with the postprocessing audit: the scaled imposed residual is at most tol, every level row (including the omitted goods equation and the realized foreign balances) is at most tol * max(scale), and an independent flow certificate is at most 1e-8. Every homotopy stage passes the same tests, and failures raise CESNewtonError with the history, the stages and the last accepted result. Complex-step exact-inverse oracle at non-equilibrium points, central differences of the consistent-accounting residual at flat technology, row-by-row residual parity (1e-12), Leontief and flat-CES limits against the finite-difference solvers, benchmark reproduction, Euler/Shephard identities, ledgers within 1e-10 times the largest benchmark scale, an acceptance sweep, certificate sensitivity, homogeneity, currency scaling, an independent dense root and a self-generated OECD golden. The elimination is a conditional local identity, not a convergence or global-equilibrium theorem; CES elasticities are stylized. A direct Newton at origin elasticity 4 on a random 20x12 table needs the homotopy, and unit origin elasticity on the OECD 3x3 fixture is a near-singular point where the block Newton fails; those cases raise and are documented. Hicksian welfare is available only at flat technology. See derivation and evidence.
Household preferences and welfare puremacro.trade.household evaluates fixed-basket, Cobb-Douglas, Stone-Geary and CES sector-composite demand from an exact benchmark-normalized expenditure function; compute_household_welfare returns EV = e(p0,u1) - e(p0,u0) and CV = e(p1,u1) - e(p1,u0), positive for gains, with percentages on the base household budget. calibrate_household imposes Engel adding-up by an audited repair and requires 0 < lambda <= 1/max(eta); fit_supernumerary_share is a bounded regional WLS projection with reported residuals. Bridges re-audit results exactly as compute_hicksian_welfare (an optional tau_fd is resolved and cross-checked against the recorded schedule). Domain violations raise instead of clipping. Behavioral and duality tests on an analytic fixture, analytic Slutsky matrices against central differences (5e-8), primal SLSQP expenditure minimization (1e-6), general-base and reversed welfare identities, currency scaling, the relation to the flexible module's demand, Hicksian-welfare reproduction with fixed baskets (1e-10, categories 0 and 2, square and non-square tables) and an independent final-demand flow certificate (1e-12). The calibration is a disclosed transfer, not microdata estimation; the supernumerary share is not identified by input-output data (None defaults to 0.5 and the assumption is recorded); bridged EV/CV inherit the equilibrium's numeraire and foreign-saving conventions; flexible-model results are not bridged. See household preferences.
Parameter continuation and multistart continue_parameter/sigma_path follow one model parameter (the intermediate elasticity) at fixed complete tariff schedules with adaptive natural-parameter steps (halve on failure, grow after stages of at most fast_iterations iterations, stop at min_step keeping the last audited state); try_starts tries named starts at one exact target. A stage is accepted only if it carries consistent accounting, lump-sum transfers and exactly the requested sigma and schedules, passes the consistent-accounting re-evaluation of all equations with every reported field equal to the recomputed equilibrium to 1e-8, has an audited residual at most tol, and, unless allow_fallback=True, was solved by Newton from the warm start. Unresolved paths raise ParameterContinuationFailure with the last audited state; unresolved multistarts return no state. Synthetic 3x3 table: path endpoint versus direct solve, resume from a partial path, every trial a warm-started Newton solve, and the step-law rules (growth, cap, halving) pinned by mutants. The OECD 3-region fixture path agrees with the direct solve to 1e-6 relative. The audit is the model's own evaluator, not an independent oracle; local stability is not assessed; an equilibrium found from an alternative start is not established as belonging to a given branch, and neither convergence nor failed searches prove uniqueness or nonexistence. See usage, evidence and limits.
Reduced local stability (experimental) reduced_stability classifies a converged equilibrium under one explicit relative-factor-price adjustment law with producer prices, goods and fiscal budgets clearing at each factor-price vector; the reduced Jacobian is the Schur complement of a finite-difference Jacobian of the physical residuals, balances are re-denominated in world factor income, and the result carries the sign band, rank threshold, rank, homogeneity, Walras and independent re-solve errors. Under the consistent accounting homogeneity and the Walras identity are exact, so their failure raises an error. Closure- and partition-dependent classification; evidence, not verdict. Closed-form reduced Jacobian of a two-country Cobb-Douglas toy, independent fast-block re-solve, homogeneity and value-weighted Walras identity, reference invariance of the spectrum, adjustment speeds, degenerate naive partition detected at several unit scales, Euler tatonnement sign check, and runs on the OECD 3x3 fixture and synthetic tables. A local stability result is conditional on the specified adjustment process; it is not a uniqueness theorem and not stability under every process. See derivation and evidence.
Flexible trade GE (solve_flexible_trade_equilibrium) Nested CES technology, capacity barriers, Stone-Geary subsistence, Armington final-demand sourcing and Atkeson-Burstein markups on the consistent accounting, solved on a condensed [log r; log w; T] system with the same acceptance audit; at the default configuration every block equals the consistent-accounting residual. Capacity barriers need an explicit country and sector; fiscal recycling names its country and then raises NotImplementedError (lump-sum rebates only). Default-configuration parity with solve_trade_equilibrium, benchmark reproduction, markup and capacity identities, and runs on synthetic tables of several sizes. Welfare from welfare_decomposition is a proxy (the subsistence demand has no expenditure function); Armington and markup elasticities are inputs, not estimates.
Dynamic MRIO with sector capital puremacro.trade.dynamic: exactly stationary recalibration with a reported ledger, per-date exact elimination to N + 2C unknowns, analytic JVPs, a 17-entry independent certificate at max(1e-8, tol) on every accepted date, exact 2C condensed steady states, matrix-free stacked Newton transitions, and horizon acceptance requiring a 20-date window at 1e-5, welfare at 1e-4 pp and a terminal check (state_gap at 1e-4, status verified; opt-in discounted_wealth at 1e-6, status verified_window_and_welfare). Horizon comparisons require the same economy, boundaries and announced policy. Policy fingerprints are derived from the rate tables. Analytic two-country fixture: independent scalar accounts, JVPs vs central differences, condensation vs full solve, solve_perfect_foresight at 40 dates as an independent oracle, iterative backends vs sparse LU to 1e-10 on a seeded sparse table, and a verified 160/320 horizon ladder; synthetic 5x4 steady states and (slow) a determinate 12x5 table with a certified 40-date transition. A single input-output table does not identify capital stocks, depreciation, adjustment costs or intertemporal preferences; interior investment only; fixed sourcing, inelastic labour, financial autarky and government consumption in the household basket. See trade_dynamic.md.
Dynamic MRIO determinacy puremacro.trade.dynamic.stability_report counts stable generalized eigenvalues against predetermined capital stocks; solve_dynamic_transition refuses indeterminate steady states (DynamicDeterminacyError) unless require_determinacy=False, and the report refuses nonstationary points. The analytic two-country fixture (4/4) and the synthetic 12x5 table (60/60) are determinate; the gate raises a structured error on an indeterminate fixture. Large tables can be indeterminate under this closure, so dynamic welfare numbers need the report first.
GPU and MLX trade solvers (puremacro.trade.gpu) solve_trade_equilibrium_gpu, solve_trade_equilibrium_mlx and solve_homotopy_continuation solve the consistent-accounting model (Cobb-Douglas intermediates, lump-sum rebates) on its condensed [log w; T] or [log r; log w; T] system with batched Jacobians in float64 wherever the device allows; a float32 device is used for the coarse phase only when requested explicitly. Results are post-processed and audited exactly like a NumPy solve. Parity with the NumPy solver on an 8-country, 5-sector synthetic table and a homotopy to a large tariff (tests/test_gpu_acceleration.py), skipped when no accelerator is importable; CUDA paths were not executed. No speedup is claimed on small problems. See hardware backends.
Financed fiscal HANK closures (puremacro.models.hank_fiscal) solve_hank_fiscal and compare_fiscal_closures solve one-asset HANK fiscal transitions with explicit government financing (closure="balanced_budget" holding \(B_t = B_{\text{ss}}\) via \(T_t = r_t B_{\text{ss}} + G_t\), or closure="debt_rule" with \(B_t = (1 + r_t)B_{t-1} + G_t - T_t\) and \(T_t = T_{\text{ss}} + \phi_B (B_{t-1} - B_{\text{ss}}) + \phi_G dG_t\)) under tax_type="proportional" or "lump_sum", attaching SolverDiagnosticRecord (solver_diagnostics). Nonlinear Broyden + Armijo solves are accepted only when goods_market_residual (max_t |Y_t - C_t - G_t|), gov_budget_residual, and asset_market_residual (max_t |A_t - B_t|) are below tol, household_budget_residual < 1e-8, and euler_kkt_max <= 0.01. Enforces Leeper stability bounds \(r_{\text{ss}} < \phi_B < 2 + r_{\text{ss}}\) (ValueError by default, or converged=False and regime="non_stationary_explosive" when allow_unstable_rule=True) and flags upper-tail asset truncation (top_grid_mass > 1e-6 or overshoot) via SupportStatus(is_supported=False, regime="boundary_asset_truncation"). Internal tests (tests/test_hank_fiscal_closure.py) verify discrete-time Walras's Law (goods market clears when asset and government budgets clear strictly inside [0, a_max]), lump-sum vs proportional tax incidence, debt-rule crowding out, non-stationary Leeper rule rejection, and boundary truncation flagging (e.g., coarse a_max=30.0 vs default a_max=100.0). Stylized single-asset two-income-state model with fixed labour (N_ss) and stylized Phillips/Taylor blocks; uncalibrated and not independently replicated against published fiscal HANK papers; legacy solve_nonlinear_transition(..., shock_var="G") remains unfinanced. See structural models.
Empirical-structural workbench (puremacro.workbench) run_empirical_structural_workbench composes preflight_panel, LP + lp_sensitivity_grid, compare_irfs, optional lp_moment_targets / score_irf_against_targets, prior_posterior_comparison, and SolverDiagnosticRecord (ConvergenceStatus, AccuracyStatus, SupportStatus, VALID_OVERALL_STATUSES = ("PASS", "CONVERGED_INACCURATE", "UNSUPPORTED_REGIME", "FAILED"), determine_overall_status) into EmpiricalStructuralDossier with Pyodide-safe top-level imports. strict_preflight=True halts on error findings; overall_status separates "PREFLIGHT_FAILED", solver status, "PASS_WITH_WARNINGS", and "PASS"; _prepare_lp_grid_context isolates "ts", "panel", and "did" (lp_did) estimator conventions and rejects mixed grids. Propagates supplied or attached solver diagnostics and preflight flags rather than re-solving model equations or verifying residual physics itself (make_solver_diagnostic_record defaults is_accurate=True and is_supported=True unless real solver audits are supplied). lp_moment_targets covers single time series only (panel inputs score against the marginal LPResult with weight_mode_used="diagonal" and chi2_pvalue=NaN). Sensitivity-grid CIs are unadjusted for multiple specification testing, and compare_irfs reports descriptive path distances rather than Hausman tests. See workbench and scorecards.
Auditable batch trade & sovereign SMM guards (puremacro.trade.scenarios, puremacro.sovereign.smm) CompositeTariffScenario is registered on TariffScenario, and run_scenario_batch / summarize_scenario_batch fail closed on non-converged equilibria: failed baselines or scenarios skip prev_x warm-start carryover and Geary-Khamis PPP calculation, emit RuntimeWarning, set affected real_gdp_growth_pct, welfare cells (welfare_status="failed"), and summary aggregates (mean_ev_pct_consumption, min_ev_pct_consumption, total_ev, mean_real_gdp_growth_pct, mean_cpi_inflation_pct) to NaN, and make compare_robust reject failed or nonfinite cells. In puremacro.sovereign.smm, _stationary_access_exclusion_dist tracks the exact (access/excluded, b, y) Markov chain matching _fiscal_paths.simulate_paths, adds boundary_choice_share_pct, auto-selects "dense" policy_search for sigma_eps > 0 or rule.deficit_limit, and fails closed (ValueError/RuntimeError) on non-converged inner solves, non-converged stationary iteration, unnormalized choice probabilities, zero repayment/access mass, degenerate corr_pb_y, or nonfinite arrays/paths. Batch trade convergence guards are verified on synthetic 3x2 tables (tests/test_trade_batch_convergence_guard.py) within static consistent-accounting Dekle-Eaton-Kortum assumptions. Sovereign exclusion-Markov and fail-closed contracts are verified against closed-form 3x2 chains and 21x5 Monte Carlo equilibria (tests/test_sovereign/test_smm_exclusion_and_errors.py); default SMM calibration grids (n_b=51, n_y=9) trade discretization convergence for speed and require discrete policy_index. Neither set of guards establishes empirical validity of calibrated parameters.
CCE Mean Group LP (puremacro.lp.cce) cce_panel_lp(..., estimator="mean_group") and cce_mg_panel_lp estimate unit-by-unit time-series local projections augmented with horizon-specific cross-sectional averages of the outcome difference and controls, average unit slopes into Mean Group coefficients, and compute Pesaran (2006, eq. 56) nonparametric cross-unit standard errors (cov_type="pesaran_mg"), reporting n_entities_used and excluded_entities_by_horizon. Enforces duplicate, nonfinite, and chronology guards (allow_index_gaps=False by default), excludes rank-deficient or short units (min_obs, defaulting to max(10, k_regs + 2)), and raises when fewer than _MIN_MG_ENTITIES = 3 usable entities remain at any horizon. Verified on stationary and I(1) correlated-loading synthetic DGPs and against hand-computed Pesaran eq. (56) standard errors (tests/test_lp/test_cce_mean_group.py). Panels with time gaps fail closed unless allow_index_gaps=True; relies on large-\(T\) within-unit rank and large-\(N\) (\(N \ge 3\)) cross-unit asymptotic inference with no small-\(N\) finite-sample correction; not benchmarked against external econometric software. See local projections.
HANK distributional bridge (puremacro.models.hank_distributional_bridge) bridge_hank_distributional bridges distributional/quantile LPs (puremacro.lp.distributional) and one-asset HANK solvers (puremacro.models.hank_fiscal, puremacro.models.hank_sequence_space) across cohort, cross-section, and fixed-bin tracking with fail-closed population-weighted conservation audits (< 1e-10), inequality-gradient metrics, bilingual EN/ES exports, and SolverDiagnosticRecord propagation. Covered by unit and conformance tests (tests/test_conformance/test_65_models_conformance.py); inherits single-asset two-income-state HANK simplifications and stylized Phillips/Taylor blocks, and depends on residual/conservation gates rather than independent published empirical benchmarks. See HANK distributional bridge.
Dynamic trade reallocation incidence (puremacro.trade.reallocation_incidence) evaluate_transition_household_incidence and calibrate_reallocation_from_icio couple two-country, two-sector dynamic trade reallocation transitions (puremacro.trade.reallocation) with OECD ICIO aggregation and benchmark-normalized household demand (fixed_baskets, cobb_douglas, stone_geary, ces), aggregating bilateral tariff schedules inside (country, sector) partitions by baseline expenditure weights and failing closed when consumption category "C" is absent while reporting period/discounted Hicksian EV/CV, Konus cost-of-living indices, CEV, and budget-weighted inequality spreads. Covered by unit and conformance tests (tests/test_conformance/test_65_models_conformance.py); restricted to two-country, two-sector reallocation dynamics and conditional static-preference welfare without general equilibrium validation on external real-world tariff transitions. See dynamic trade reallocation incidence.
Offline-first macro monitor (puremacro.macro_monitor) run_macro_monitor and MacroMonitorConfig compose connector freshness audits, preflight_panel, rolling AR(1) 1-step nowcasts, bounded lp_sensitivity_grid transmission checks, and bilingual EN/ES bundle exports (monitor.md, monitor.html, monitor.json, CSVs, and SHA-256 manifest.json) with RFC 8259 JSON serialization (allow_nan=False). Covered by unit and conformance tests (tests/test_conformance/test_65_models_conformance.py) on offline/cached fixtures; reports descriptive monitoring diagnostics, rolling AR(1) baselines, and specification bounds rather than causal identification or live network guarantees. See macro freshness monitor.

The 116-case validation gallery (16 subsystems, all passing) contains 63 internal, 31 analytical, 15 package, five SciPy and two published-reference cases, three of them on the bundled trade table (world totals, column balance and the base equilibrium); see the validation gallery. Separately, the examples gallery ledger (docs/examples_gallery.json, generated 2026-11-05) tracks 95 recorded example checks (86 passing, 8 skipped, and 1 documented failure on romer_romer_2010_replication); newer examples added through 6.6.0 remain covered by unit tests until that JSON ledger is re-rendered. It has multiple tolerance classes. Most trade evidence lives in the trade tests listed above, not in the gallery. The gallery does not certify every feature, every backend or every deployment.

Puremacro ships no compiled extension of its own. NumPy/SciPy and other base packages include compiled components; the mandatory dependencies also include pandas, Matplotlib and requests. Pyodide importability, realistic browser execution, GPU agreement and bitwise reproducibility require different tests.