Skip to content

Conversation

@VEZY
Copy link
Member

@VEZY VEZY commented Feb 6, 2026

This pull request introduces major improvements to PlantSimEngine’s architecture, documentation, and core interfaces to support upcoming features like multi-rate simulation, scoped model instances, and advanced scheduling policies.

Documentation enhancements:

  • Added a detailed internal summary (AI_PACKAGE_SUMMARY.md) explaining PlantSimEngine’s architecture, data structures, dependency graph, multiscale mapping, MTG integration, execution flow, and known pain points.
  • Updated planned features documentation to reference the new multi-rate and scoped simulation draft.

Core scaffolding for multi-rate and scoped simulation:

  • Added new includes in src/PlantSimEngine.jl for multi-rate scaffolding (time/multirate.jl) and model specification (mtg/ModelSpec.jl). [1] [2]
  • Expanded exports to include new types and interfaces for scope, clock, model/output keys, scheduling policies, temporal state, model specification, input bindings, and output routing.

GraphSimulation struct extension:

  • Extended the GraphSimulation struct to include model_specs and temporal_state fields, enabling support for normalized model usage specifications and multi-rate temporal storage.

These changes collectively prepare PlantSimEngine for more flexible and robust simulation workflows, including multi-rate execution and scoped modeling.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Benchmark Results (Julia v1.10)

Time benchmarks
main 46d4b24... main / 46d4b24...
bench_linux/PBP 14.5 ± 2 ms 14.5 ± 2.1 ms 1 ± 0.2
bench_linux/PBP_multiple_timesteps_MT 0.233 ± 0.0051 s 0.265 ± 0.014 s 0.88 ± 0.05
bench_linux/PBP_multiple_timesteps_ST 0.243 ± 0.0059 s 0.242 ± 0.0036 s 1.01 ± 0.029
bench_linux/PSE 4.64 ± 0.39 s 4.51 ± 0.37 s 1.03 ± 0.12
bench_linux/XPalm_convert_outputs 0.758 ± 0.01 s 0.788 ± 0.01 s 0.962 ± 0.018
bench_linux/XPalm_run 0.0178 ± 0.0094 h 0.0175 ± 0.0096 h 1.02 ± 0.77
bench_linux/XPalm_setup 16.9 ± 2.6 ms 16.8 ± 2.5 ms 1.01 ± 0.21
bench_linux/PSE_multirate_status_tracked_run 3.87 ± 0.096 s
bench_linux/PSE_multirate_output_request_run 7.24 s
time_to_load 2 ± 0.033 s 2.09 ± 0.19 s 0.956 ± 0.089
Memory benchmarks
main 46d4b24... main / 46d4b24...
bench_linux/PBP 0.0913 M allocs: 6.16 MB 0.0916 M allocs: 6.23 MB 0.989
bench_linux/PBP_multiple_timesteps_MT 3.46 M allocs: 0.714 GB 3.46 M allocs: 0.714 GB 1
bench_linux/PBP_multiple_timesteps_ST 3.32 M allocs: 0.217 GB 3.32 M allocs: 0.217 GB 1
bench_linux/PSE 0.0496 G allocs: 2.31 GB 0.0497 G allocs: 2.38 GB 0.972
bench_linux/XPalm_convert_outputs 6.59 M allocs: 0.436 GB 6.59 M allocs: 0.436 GB 1
bench_linux/XPalm_run 0.571 G allocs: 28.9 GB 0.576 G allocs: 30.3 GB 0.953
bench_linux/XPalm_setup 0.168 M allocs: 9.16 MB 0.168 M allocs: 9.16 MB 1
bench_linux/PSE_multirate_status_tracked_run 0.0591 G allocs: 1.66 GB
bench_linux/PSE_multirate_output_request_run 0.0867 G allocs: 3.16 GB
time_to_load 0.153 k allocs: 14.5 kB 0.153 k allocs: 14.5 kB 1

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Benchmark Results (Julia v1)

Time benchmarks
main 689ae3a... main / 689ae3a...
bench_linux/PBP 12.5 ± 1.2 ms 16 ± 1.4 ms 0.783 ± 0.1
bench_linux/PBP_multiple_timesteps_MT 0.369 ± 0.0058 s 0.363 ± 0.02 s 1.02 ± 0.059
bench_linux/PBP_multiple_timesteps_ST 0.244 ± 0.023 s 0.172 ± 0.023 s 1.42 ± 0.23
bench_linux/PSE 4.84 ± 0.15 s 5.34 ± 0.66 s 0.907 ± 0.12
bench_linux/XPalm_convert_outputs 0.878 ± 0.1 s 0.93 ± 0.72 s 0.944 ± 0.74
bench_linux/XPalm_run 0.0208 ± 0.0083 h 0.0176 ± 0.0047 h 1.19 ± 0.57
bench_linux/XPalm_setup 15.3 ± 2 ms 15.9 ± 2.1 ms 0.959 ± 0.18
bench_linux/PSE_multirate_status_tracked_run 4.4 ± 0.67 s
bench_linux/PSE_multirate_output_request_run 7 s
time_to_load 3.37 ± 0.061 s 3.53 ± 0.04 s 0.955 ± 0.02
Memory benchmarks
main 689ae3a... main / 689ae3a...
bench_linux/PBP 0.0911 M allocs: 5.48 MB 0.0911 M allocs: 5.48 MB 1
bench_linux/PBP_multiple_timesteps_MT 3.97 M allocs: 0.746 GB 2.08 M allocs: 0.651 GB 1.15
bench_linux/PBP_multiple_timesteps_ST 3.5 M allocs: 0.239 GB 1.64 M allocs: 0.146 GB 1.64
bench_linux/PSE 0.0497 G allocs: 2.3 GB 0.0499 G allocs: 2.38 GB 0.97
bench_linux/XPalm_convert_outputs 6.62 M allocs: 0.436 GB 6.62 M allocs: 0.436 GB 1
bench_linux/XPalm_run 0.572 G allocs: 28.9 GB 0.448 G allocs: 27.1 GB 1.07
bench_linux/XPalm_setup 0.165 M allocs: 8.87 MB 0.165 M allocs: 8.89 MB 0.997
bench_linux/PSE_multirate_status_tracked_run 0.0593 G allocs: 1.78 GB
bench_linux/PSE_multirate_output_request_run 0.0805 G allocs: 3.15 GB
time_to_load 0.149 k allocs: 11.1 kB 0.149 k allocs: 11.1 kB 1

@VEZY VEZY changed the title Implement multirate simulation scaffolding and update documentation Implement multirate simulations take 3 Feb 7, 2026
@VEZY VEZY changed the title Implement multirate simulations take 3 Implement multirate simulations - take 3 Feb 7, 2026
VEZY added 6 commits February 7, 2026 09:23
We now make a window as large as the largest consumer request (e.g. one consumer at 4h and one at 24 will produce a 24h window) instead of the full history.
multirate with classic status tracking (Dict) vs multirate with online export requests (Vector{OutputRequest})
VEZY added 17 commits February 7, 2026 14:34
filter tests for when `ModelSpec` exists (not in Main)
…urly meteo) + make a uniform interface with policies
…dow) or calendar (possibly using values future to the current step)
Add regular output print in multirate tutorial
Add test with all defaults for models running at different rates (testing inference of multirate traits)
Update PlantMeteo compat
Fix issues with versions (force using this PlantSimEngine)
This avoids to manually install XPalm and PlantSimEngine
@VEZY
Copy link
Member Author

VEZY commented Feb 11, 2026

Important: revert XPalm to main in the benchmark's Project before merging

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