Repository navigation
Conversation
…itten Every simulation state value starts as NaN. With state kept over the union of each key's columns, a component that no model writes stays NaN for the whole run. Initial-condition updates passed such a value to IOM's set_ic_quantity!, which failed with an AssertionError that printed the whole component and named neither the state key nor the cause. The emulator feedforward update copied it into the model without any check. A shared _check_state_value raises IS.InvalidValue naming the component, the state key, and the two causes: a decision not yet made for the time being read, or no model writing that component, usually from different device filters. Every initial-condition update reads through it, and it replaces the five copies of the finite-value check in the parameter updates. The emulator feedforward update now checks too.
m-bossart
marked this pull request as ready for review
October 16, 2026 22:16
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Simulation state now covers the union of each key's columns across models (3a1dabe).
A component that no model writes stays
NaNfor the whole run.When a model read that value, the failure was unclear:
@assert isfiniteinset_ic_quantity!, which prints the whole component and names neither the state key nor the cause.On the previous code, the same setup failed at build with a message about device filters.
Changes
_check_state_value(src/simulation/simulation_state.jl) raisesIS.InvalidValuenaming the component, the state key, and both causes: a decision not yet made for the time being read, or no model writing that component, usually from different device filters._get_state_value, which applies the check.update_container_parameter_values.jlcall the shared check.VariableValueAttributes,EmulationModel) now checks too.ParameterKeyonce per call and uses it for its state reads and the check.The check runs only on values a model actually reads.
Unwritten cells for components nobody reads are expected under union columns and are not flagged.
Testing
test/test_simulation_state_union_columns.jl: an emulator whose UC formulation filters out Alta leaves Alta'sOnVariablestate unwritten, and UC's initial conditions read it at step 2. The test checks that the simulation log names Alta,OnVariable__ThermalStandard, and device filters. It fails without the change.mainand POMmain: 29,715 pass, 2 fail.The 2 failures are the hot-start coverage check at
test/test_market_bid_cost.jl:388, which fails the same way onpsy6. POM now reads time limits in minutes, and that test's multi-start scenarios no longer produce a hot start. That fix is a separate test-data change.🤖 Generated with Claude Code