Skip to content

Split the model factories into a domain spec and a thin create_model - #26

Draft
hmgaudecker wants to merge 2 commits into
feat/model-horizonfrom
feat/model-spec
Draft

hmgaudecker wants to merge 2 commits into
feat/model-horizonfrom
feat/model-spec

Conversation

@hmgaudecker

Copy link
Copy Markdown
Member

What changes

  • build_model_spec(...) returns the model's domain as keyword arguments for lcm.Model:
    • regimes, ages and regime ids;
    • description and derived categoricals;
    • the default entry initial_nodes;
    • edges and the broadcast functions, constraints, states and transitions.
  • One builder covers both models: policy=None builds the baseline, and a PolicyVariant applies its ACA overlay. The ACA factory module is removed.
  • The spec builder takes pia_aime_grid instead of fixed_params. pia_aime_grid is the only parameter that grid construction reads. build_grids, build_all_regimes and build_model_slots take it the same way.
  • create_model(spec=..., fixed_params=..., **model_options) forwards every other lcm.Model option unchanged. An option the spec also holds, such as initial_nodes, overrides the spec's value. create_model does not trim or rewrite the params.
  • aca-model no longer supplies an execution-config default. Without execution_config, pylcm's "device" budget applies. That budget needs a preallocated allocator pool, which every Marvin batch job already has through the workspace slurm_env.
  • create_benchmark_model(*, pref_type_grid, grid_config, final_age, **model_options) builds through the same spec.
  • Tests:
    • the spec holds exactly the domain keys;
    • a missing execution config is not filled in;
    • an explicit config, an arbitrary option (durable_identity) and an initial_nodes override all reach Model unchanged.
  • The README is updated.

https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW

hmgaudecker and others added 2 commits October 23, 2026 11:42
`build_model_spec` returns the domain keyword arguments of `lcm.Model`
for the baseline (`policy=None`) or an ACA policy, including the entry
initial nodes and derived categoricals, and reads only `pia_aime_grid`
from the parameters. `create_model(spec=, fixed_params=, **model_options)`
forwards generic options unchanged; without `execution_config` pylcm's
device default applies. The ACA factory module is gone and the benchmark
forwards `**model_options`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant