|
| 1 | +## Summary |
| 2 | +- Reworked first-order index cache to avoid `Union{Nothing,...}` and added cached identity-slice matrices for `expand` usage. |
| 3 | +- Switched `calculate_first_order_solution` to positional `π` wrappers (Real and Dual) and updated call sites to stop passing caches explicitly. |
| 4 | +- Added a runnable script for RBC baseline pruned third-order standard deviations and updated the standalone cache test to use the new initializer and positional wrapper. |
| 5 | +- Fixed pruned mean calculation to use state-only kron indices and added a runnable script for RBC baseline pruned second-order mean. |
| 6 | +- Fixed `get_steady_state` axis labels for models with calibration equations and added a runnable script to exercise calibration equations. |
| 7 | +- Added a moments cache for kron selectors, `I_plus_s_s`, and `eβ΄`/`eβΆ`, plus substate/dependency caches, and switched `moments.jl` to use cached values. |
| 8 | +- Extended model structure caching with steady-state selector matrices, full NSSS display names, and cached variable indices; updated steady-state and variable parsing code to use cached values. |
| 9 | +- Added a targeted cache validation script for steady-state expansion, custom steady state mapping, and cached variable indices. |
| 10 | +- Moved cache creation helpers into `src/options_and_caches.jl` (name display, computational constants, model structure, first-order indices, selector matrix, moments) and removed duplicate definitions from `src/MacroModelling.jl` and `src/moments.jl`. |
| 11 | +- Refactored cache usage to call ensure helpers once per high-level call and use `π.caches` in `src/moments.jl`, `src/perturbation.jl`, `src/get_functions.jl`, and filter paths; updated steady-state/model-structure callers to use cached selectors. |
| 12 | +- Fixed package load/precompile failures caused by include-order cycles (`timings` and `β³`) by introducing `src/timings.jl` and removing the `::β³` annotation from `initialize_caches!`. |
| 13 | +- Removed obsolete `T = π.timings` keywords from second/third-order solution call sites and fixed a typo (`βC` β `cache`) in `calculate_third_order_solution`. |
| 14 | +- Made `get_loglikelihood(..., algorithm = :pruned_third_order)` work by adding `get_computational_constants(::timings)` and fixing the inversion filterβs pruned third-order Jacobian construction (stateΒ² term needed an explicit volatility slot). |
| 15 | +- Added `cache::caches` overloads for `determine_efficient_order` and switched `src/moments.jl` call sites from `π.timings` to `π.caches`. |
| 16 | +- Replaced cacheβtimings wrapper overloads by making cache-carrying methods the concrete implementations for `determine_efficient_order`, `create_*_order_auxiliary_matrices`, `solve_quadratic_matrix_equation`, and `parse_*_input_to_index`/`parse_covariance_groups`. |
| 17 | +- Added a targeted `get_std` script test for pruned second/third order on RBC_CME models with/without calibration equations. |
| 18 | +- Fixed `calculate_first_order_solution` (Dual path) to use `cache.first_order_index_cache` fields (`nabla_zero_cols`, `nabla_e_start`) after cache refactor. |
| 19 | +- Added a targeted script test covering the three `run_rbc_*.jl` entrypoints. |
| 20 | +- Restored `apply_custom_name` and `normalize_superscript` helpers needed by `StatsPlotsExt` so `plot_model_estimates` works again. |
| 21 | +- Added a targeted script test for `plot_model_estimates` / `plot_model_estimates!`. |
| 22 | +- Fixed `name_display_cache` axis fields to be concrete (`Vector{Symbol}`) so `get_var_axis(::β³)` is type-stable and doesnβt trip DispatchDoctor. |
| 23 | +- Added a targeted script test for `get_var_axis` / `get_exo_axis` return types. |
| 24 | +- Added ChainRules `rrule` for `mat_mult_kron` to make Zygote gradients work (avoids mutation errors from `mul!` into views). |
| 25 | +- Fixed the `rrule` signature for `calculate_second_order_solution` to match current argument ordering so Zygote doesnβt trace into LAPACK solves. |
| 26 | +- Added a targeted script test for Zygote gradients of `get_loglikelihood` at `:third_order` and `:pruned_third_order`. |
| 27 | +- Moved second/third-order auxiliary matrices into `caches`, introduced a `workspaces` struct for higher-order scratch buffers, and removed `nothing`-based timings initialization (added `Empty_timings` + `is_empty_timings`). |
| 28 | +- Fixed `ensure_name_display_cache!` to initialize `calib_axis` correctly when curly-brace formatting is used. |
| 29 | +- Moved auxiliary indices into `caches`, added a dedicated `workspaces` field on `β³`, and updated higher-order solution calls to pass workspaces explicitly. |
| 30 | +- Updated `run_cache_steady_state_checks.jl` to only call mean/std for supported algorithms. |
| 31 | + |
| 32 | +## Tests |
| 33 | +- `TEST_SET=basic julia --project -e 'using Pkg; Pkg.test()'` failed: unsatisfiable requirements during Pkg resolve (DynamicPPL/Pigeons/Turing/JET constraints). |
| 34 | +- `julia --project -e 'using Test; include("test/test_standalone_function.jl")'` failed: `FiniteDifferences` not found in current environment. |
| 35 | +- `julia --project run_rbc_pruned_third_order_std.jl` succeeded (prints `get_std` output for `RBC_baseline`, algorithm `:pruned_third_order`). |
| 36 | +- Re-ran `julia --project run_rbc_pruned_second_order_mean.jl`: succeeded (prints `get_mean` output for `RBC_baseline`, algorithm `:pruned_second_order`). |
| 37 | +- Re-ran `julia --project run_rbc_pruned_third_order_std.jl`: succeeded (prints `get_std` output for `RBC_baseline`, algorithm `:pruned_third_order`). |
| 38 | +- Re-ran `julia --project run_rbc_pruned_third_order_std.jl`: succeeded (prints `get_std` output for `RBC_baseline`, algorithm `:pruned_third_order`). |
| 39 | +- `julia --project run_rbc_pruned_second_order_mean.jl` succeeded (prints `get_mean` output for `RBC_baseline`, algorithm `:pruned_second_order`). |
| 40 | +- `julia --project run_rbc_pruned_third_order_std.jl` succeeded (prints `get_std` output for `RBC_baseline`, algorithm `:pruned_third_order`). |
| 41 | +- `julia --project run_cache_steady_state_checks.jl` failed: `get_relevant_steady_states` not exported (used unqualified call). |
| 42 | +- `julia --project run_cache_steady_state_checks.jl` succeeded after qualifying `MacroModelling.get_relevant_steady_states`. |
| 43 | +- `julia --project run_rbc_calibration_equations_ss.jl` succeeded (prints calibration equations, calibrated parameter values, and steady state for `RBC_CME_calibration_equations`). |
| 44 | +- `julia --project -e 'using MacroModelling; include("models/RBC_baseline.jl"); MacroModelling.calculate_second_order_moments(RBC_baseline.parameter_values, RBC_baseline);'` failed: `calculate_hessian` method mismatch (hessian functions not initialized for second-order). |
| 45 | +- `julia --project -e 'using MacroModelling; include("models/RBC_baseline.jl"); solve!(RBC_baseline); MacroModelling.calculate_second_order_moments(RBC_baseline.parameter_values, RBC_baseline);'` failed: same `calculate_hessian` method mismatch. |
| 46 | +- `julia --project -e 'using MacroModelling; include("models/RBC_baseline.jl"); solve!(RBC_baseline; algorithm = :second_order); MacroModelling.calculate_second_order_moments(RBC_baseline.parameter_values, RBC_baseline);'` succeeded. |
| 47 | +- `julia --project run_rbc_pruned_second_order_mean.jl` succeeded (prints `get_mean` output for `RBC_baseline`, algorithm `:pruned_second_order`). |
| 48 | +- `julia --project run_rbc_pruned_second_order_mean.jl` succeeded (prints `get_mean` output for `RBC_baseline`, algorithm `:pruned_second_order`). |
| 49 | +- `julia --project run_rbc_pruned_third_order_std.jl` succeeded (prints `get_std` output for `RBC_baseline`, algorithm `:pruned_third_order`). |
| 50 | +- `julia --project run_cache_steady_state_checks.jl` succeeded (prints steady-state cache checks for `RBC_baseline` and `RBC_switch`). |
| 51 | +- `julia --project -e 'using MacroModelling; println(\"loaded\")'` succeeded. |
| 52 | +- `julia --project scripts/test_get_loglikelihood_pruned_third.jl` succeeded (prints finite pruned third-order loglikelihood). |
| 53 | +- `julia --project scripts/test_get_std_pruned_second_third.jl` succeeded (pruned second/third order `get_std` for RBC_CME models with/without calibration equations). |
| 54 | +- Re-ran `julia --project scripts/test_get_loglikelihood_pruned_third.jl`: succeeded. |
| 55 | +- Re-ran `julia --project scripts/test_get_std_pruned_second_third.jl`: succeeded after cache-propagation refactor. |
| 56 | +- `julia --project run_rbc_pruned_second_order_mean.jl` failed: `caches` has no field `nabla_zero_cols`. |
| 57 | +- `julia --project run_rbc_pruned_third_order_std.jl` failed: `caches` has no field `nabla_zero_cols`. |
| 58 | +- `julia --project run_rbc_pruned_second_order_mean.jl` succeeded after fixing Dual first-order cache indexing. |
| 59 | +- `julia --project run_rbc_pruned_third_order_std.jl` succeeded after fixing Dual first-order cache indexing. |
| 60 | +- `julia --project scripts/test_run_rbc_scripts.jl` succeeded (pruned second/third moments + calibration equations steady state). |
| 61 | +- `julia --project scripts/test_get_std_pruned_second_third.jl` succeeded. |
| 62 | +- `julia --project scripts/test_get_loglikelihood_pruned_third.jl` succeeded. |
| 63 | +- `julia --project -e 'using MacroModelling, StatsPlots; include(\"test/models/RBC_CME.jl\"); sim = simulate(m); plot_model_estimates(m, sim([:k], :,:simulate); show_plots=false, save_plots=false)'` succeeded after restoring plotting helpers. |
| 64 | +- `julia --project scripts/test_plot_model_estimates.jl` succeeded. |
| 65 | +- `julia --project scripts/test_get_var_axis.jl` succeeded. |
| 66 | +- `julia --project scripts/test_zygote_loglikelihood_third_pruned_third.jl` succeeded (Zygote gradients for `:third_order` and `:pruned_third_order`). |
| 67 | +- `julia --project run_cache_steady_state_checks.jl` succeeded. |
| 68 | +- `julia --project run_cache_steady_state_checks.jl` succeeded after updating the scriptβs mean/std algorithm list. |
| 69 | + |
| 70 | +## Remaining |
| 71 | +- Resolve test environment dependencies and rerun tests. |
0 commit comments