Skip to content

feat: add calendar date utilities - #1047

Open
cdc-as81 wants to merge 1 commit into
mainfrom
cdc-as81-1040-ixa-calendar
Open

feat: add calendar date utilities#1047
cdc-as81 wants to merge 1 commit into
mainfrom
cdc-as81-1040-ixa-calendar

Conversation

@cdc-as81

Copy link
Copy Markdown
Collaborator

Summary

  • Add a day-based Calendar mapping simulation time 0.0 to a Gregorian date.
  • Add ContextCalendarExt helpers for date conversion and date-based scheduling.
  • Re-export Chrono date types and calendar operations through Ixa's root and prelude.
  • Support ISO date serialization without timezone or clock dependencies.

Behavior

  • One simulation-time unit represents one calendar day.
  • Fractional times map to their containing day using floor semantics.
  • Negative simulation times map to dates before the epoch.
  • Missing configuration, duplicate configuration, non-finite times, and date-range
    overflow produce explicit errors.
  • Existing timeline and scheduling behavior remains unchanged.

@cdc-as81 cdc-as81 linked an issue Aug 17, 2026 that may be closed by this pull request
@github-actions

Copy link
Copy Markdown

Benchmark Results

Hyperfine

Command Mean [ms] Min [ms] Max [ms] Relative
large_sir::baseline 3.3 ± 0.0 3.2 3.4 1.00
large_sir::baseline_households 3.4 ± 0.1 3.3 3.6 1.03 ± 0.02
large_sir::entities 8.0 ± 0.6 7.5 10.6 2.43 ± 0.18
large_sir::households 7.4 ± 0.2 7.1 8.0 2.24 ± 0.06

Criterion

Regressions (slower)
Group Bench Param Change CI Lower CI Upper
large_dataset bench_filter_unindexed_entity 24.727% 20.015% 29.640%
large_dataset bench_match_entity 16.067% 15.789% 16.371%
counts multi_property_indexed_entities 8.919% 7.717% 10.154%
large_dataset bench_filter_indexed_entity 8.244% 6.291% 10.222%
sample_entity sample_entity_single_property_indexed 1000 6.046% 4.384% 7.807%
sampling sampling_single_unindexed_entities 4.549% 4.473% 4.626%
examples example-births-deaths 4.538% 3.724% 5.338%
sample_entity sample_entity_single_property_indexed 10000 4.131% 1.617% 7.446%
sampling sampling_multiple_unindexed_entities 3.675% 3.562% 3.765%
sample_entity sample_entity_multi_property_indexed 1000 3.168% 2.651% 3.610%
sample_entity sample_entity_multi_property_indexed 10000 3.142% 2.627% 3.616%
algorithm_benches algorithm_sampling_single_rand_reservoir 2.985% 2.604% 3.319%
examples example-basic-infection 2.902% 1.494% 4.111%
sampling sampling_single_unindexed_concrete_plus_derived_entities 2.877% 2.518% 3.237%
sample_entity sample_entity_multi_property_indexed 100000 2.849% 2.300% 3.356%
large_dataset bench_query_population_indexed_property_entities 2.195% 1.335% 2.942%
indexing query_people_multiple_individually_indexed_properties_entities 2.166% 1.802% 2.524%
sampling count_and_sampling_single_unindexed_concrete_plus_derived_entiti 1.260% 1.157% 1.362%
Improvements (faster)
Group Bench Param Change CI Lower CI Upper
sample_entity sample_entity_single_property_unindexed 10000 -22.909% -23.370% -22.563%
sample_entity sample_entity_single_property_unindexed 1000 -21.096% -21.828% -20.345%
large_dataset bench_query_population_property_entities -13.769% -16.889% -11.290%
large_dataset bench_query_population_multi_indexed_entities -13.399% -14.799% -11.835%
indexing query_people_single_indexed_property_entities -11.434% -11.857% -10.994%
indexing query_people_count_indexed_multi-property_entities -10.014% -11.231% -8.773%
counts single_property_indexed_entities -6.179% -7.220% -5.059%
indexing query_people_count_multiple_individually_indexed_properties_enti -5.795% -6.145% -5.471%
indexing with_query_results_multiple_individually_indexed_properties_enti -4.789% -5.319% -4.244%
indexing query_people_count_single_indexed_property_entities -4.128% -4.751% -3.457%
indexing with_query_results_indexed_multi-property_entities -4.067% -4.578% -3.417%
counts multi_property_unindexed_entities -2.030% -2.542% -1.572%
Unchanged / inconclusive (CI crosses 0%)
Group Bench Param Change CI Lower CI Upper
large_dataset bench_query_population_multi_unindexed_entities 1.605% 0.994% 2.290%
sample_entity sample_entity_whole_population 1000 -1.335% -2.038% -0.553%
indexing with_query_results_single_indexed_property_entities -1.310% -1.960% -0.587%
counts index_after_adding_entities -1.190% -1.903% -0.651%
sampling count_and_sampling_single_known_length_entities -1.116% -1.564% -0.727%
sampling sampling_multiple_known_length_entities -1.040% -1.702% -0.375%
indexing query_people_indexed_multi-property_entities 1.029% 0.439% 1.637%
large_dataset bench_query_population_derived_property_entities 0.955% -0.045% 1.904%
sample_entity sample_entity_single_property_indexed 100000 0.947% -1.214% 3.029%
sampling sampling_single_l_reservoir_entities -0.785% -1.330% -0.340%
counts reindex_after_adding_more_entities -0.705% -1.229% -0.105%
sampling sampling_single_known_length_entities -0.681% -1.265% -0.210%
algorithm_benches algorithm_sampling_single_l_reservoir -0.616% -0.898% -0.360%
sample_entity sample_entity_whole_population 100000 0.605% -0.243% 1.392%
counts single_property_unindexed_entities 0.547% -0.097% 1.340%
sample_entity sample_entity_whole_population 10000 -0.435% -1.091% 0.248%
sample_entity sample_entity_single_property_unindexed 100000 0.310% 0.021% 0.589%
algorithm_benches algorithm_sampling_multiple_known_length -0.304% -0.618% 0.017%
algorithm_benches algorithm_sampling_single_known_length -0.256% -3.129% 2.778%
algorithm_benches algorithm_sampling_multiple_l_reservoir -0.239% -0.715% 0.266%
counts concrete_plus_derived_unindexed_entities -0.168% -0.812% 0.343%
sampling sampling_multiple_l_reservoir_entities -0.064% -0.202% 0.052%
Not Compared (no baseline yet)
Group Bench Reason
(none)

github-actions Bot added a commit that referenced this pull request Aug 17, 2026
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.

Investigate adding date utility to ixa

2 participants