Skip to content

test_benchmark_model_simulates_end_to_end fails with NaN in dead regime V at age 51 #9

@hmgaudecker

Description

@hmgaudecker

Summary

tests/test_benchmark.py::test_benchmark_model_simulates_end_to_end (marked @pytest.mark.long_running, so deselected from default pixi run -e tests-cpu tests) fails on main with:

lcm.exceptions.InvalidValueFunctionError: Value function at age 51 in regime 'dead': all values are NaN.

This is independent of the runtime-consumption-points work in PR #8 — the dead regime has no consumption action, and the same failure reproduces with both the static-points and runtime-points versions of the consumption grid.

Provenance

  • The test was originally masked by a different failure: AttributeError: 'PiecewiseLinSpacedGrid' object has no attribute 'start' in get_benchmark_initial_conditions (introduced when AIME became piecewise; the .start/.stop reads no longer work). PR Anchor consumption grid lower bound to consumption_floor parameter #8 incidentally fixes that by switching to to_jax().min()/.max().
  • With that fixed, the next failure is the NaN-in-V described above.

Suggested next step

Re-run with debug logging to identify whether the NaN enters via utility.dead → preferences.bequest, utility_scale_factor, or somewhere else:

model.solve(params=params, log_level="debug", log_path="./debug/")

The benchmark coefficient_rra for type_1 is 0.999077, which sits just outside jnp.isclose(gamma, 1.0)'s default tolerance (~1e-5). Both branches of the where in bequest/utility_scale_factor are evaluated under JAX, and the log-branch hits log(0) if assets_shifted ever lands on a zero — worth inspecting first.

Reproducer

pixi run -e tests-cpu tests aca-model/tests/test_benchmark.py -m long_running

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions