Skip to content

chore: Make rand usage deterministic and disable default features#905

Merged
k88hudson-cfa merged 1 commit into
mainfrom
cdc-as81-remove-getrandom-dependency
May 18, 2026
Merged

chore: Make rand usage deterministic and disable default features#905
k88hudson-cfa merged 1 commit into
mainfrom
cdc-as81-remove-getrandom-dependency

Conversation

@cdc-as81
Copy link
Copy Markdown
Collaborator

Summary

  • Disable rand default features and explicitly enable only std, small_rng, and std_rng
  • Replace remaining thread_rng usage with seeded RNGs in tests and benchmarks
  • Use a deterministic default seed for benchmark population generation
  • Remove the direct wasm getrandom dependency entry from the main crate manifest

@github-actions
Copy link
Copy Markdown

Benchmark Results

Hyperfine

Command Mean [ms] Min [ms] Max [ms] Relative
large_sir::baseline 2.8 ± 0.1 2.7 3.1 1.00
large_sir::entities 6.7 ± 0.1 6.5 7.2 2.35 ± 0.07

Criterion

Regressions (slower)
Group Bench Param Change CI Lower CI Upper
indexing query_people_count_single_indexed_property_entities 84.375% 77.263% 91.346%
counts multi_property_indexed_entities 37.309% 35.662% 39.071%
sample_entity sample_entity_single_property_indexed 1000 20.316% 17.880% 22.738%
sample_entity sample_entity_single_property_indexed 10000 15.480% 13.964% 16.867%
sample_entity sample_entity_single_property_indexed 100000 14.165% 12.798% 15.679%
indexing with_query_results_multiple_individually_indexed_properties_enti 12.199% 11.445% 12.927%
large_dataset bench_query_population_derived_property_entities 6.336% 5.857% 6.795%
indexing query_people_multiple_individually_indexed_properties_entities 3.270% 2.945% 3.657%
counts single_property_indexed_entities 2.923% 2.545% 3.313%
examples example-births-deaths 2.872% 2.434% 3.206%
counts reindex_after_adding_more_entities 2.516% 1.542% 3.520%
sampling sampling_multiple_l_reservoir_entities 2.449% 2.193% 2.723%
indexing query_people_count_multiple_individually_indexed_properties_enti 1.931% 1.741% 2.109%
sampling sampling_multiple_known_length_entities 1.470% 1.095% 1.859%
Improvements (faster)
Group Bench Param Change CI Lower CI Upper
algorithm_benches algorithm_sampling_single_known_length -43.386% -44.710% -42.184%
algorithm_benches algorithm_sampling_single_l_reservoir -39.386% -39.686% -39.155%
algorithm_benches algorithm_sampling_multiple_l_reservoir -22.770% -23.171% -22.232%
counts multi_property_unindexed_entities -17.220% -17.551% -16.915%
counts single_property_unindexed_entities -9.123% -11.027% -7.135%
algorithm_benches algorithm_sampling_multiple_known_length -8.432% -9.111% -7.802%
counts concrete_plus_derived_unindexed_entities -7.682% -9.815% -5.573%
large_dataset bench_query_population_multi_indexed_entities -5.762% -6.109% -5.312%
sampling count_and_sampling_single_known_length_entities -4.076% -4.465% -3.497%
large_dataset bench_match_entity -4.029% -4.430% -3.687%
algorithm_benches algorithm_sampling_single_rand_reservoir -2.381% -2.727% -2.058%
sampling sampling_single_known_length_entities -1.624% -2.190% -1.157%
Unchanged / inconclusive (CI crosses 0%)
Group Bench Param Change CI Lower CI Upper
sample_entity sample_entity_multi_property_indexed 10000 3.728% 0.921% 6.996%
sample_entity sample_entity_multi_property_indexed 1000 -2.413% -5.258% 0.743%
sample_entity sample_entity_multi_property_indexed 100000 1.725% -0.381% 4.155%
large_dataset bench_query_population_multi_unindexed_entities -1.654% -2.838% -0.595%
sample_entity sample_entity_single_property_unindexed 100000 -1.436% -2.226% -0.752%
indexing with_query_results_single_indexed_property_entities 1.224% 0.635% 1.873%
large_dataset bench_filter_indexed_entity -1.189% -8.918% 7.084%
sampling sampling_single_unindexed_concrete_plus_derived_entities -1.072% -1.445% -0.696%
indexing with_query_results_indexed_multi-property_entities -0.698% -1.724% 0.095%
sampling count_and_sampling_single_unindexed_concrete_plus_derived_entiti 0.649% 0.391% 0.889%
indexing query_people_indexed_multi-property_entities 0.542% 0.269% 0.831%
sample_entity sample_entity_single_property_unindexed 1000 -0.514% -0.896% -0.194%
sample_entity sample_entity_single_property_unindexed 10000 0.485% 0.047% 1.103%
indexing query_people_count_indexed_multi-property_entities 0.443% 0.016% 0.801%
large_dataset bench_query_population_indexed_property_entities -0.436% -0.937% -0.045%
sampling sampling_single_unindexed_entities -0.422% -0.494% -0.352%
large_dataset bench_query_population_property_entities -0.373% -0.970% 0.212%
indexing query_people_single_indexed_property_entities 0.355% 0.029% 0.824%
sampling sampling_single_l_reservoir_entities -0.353% -1.475% 0.801%
examples example-basic-infection -0.337% -0.914% 0.150%
counts index_after_adding_entities -0.298% -0.545% -0.031%
large_dataset bench_filter_unindexed_entity 0.264% -3.834% 3.882%
sample_entity sample_entity_whole_population 1000 0.195% -0.133% 0.555%
sample_entity sample_entity_whole_population 10000 0.150% -0.429% 0.577%
sample_entity sample_entity_whole_population 100000 0.137% -0.147% 0.455%
sampling sampling_multiple_unindexed_entities 0.053% -0.229% 0.328%
Not Compared (no baseline yet)
Group Bench Reason
(none)

github-actions Bot added a commit that referenced this pull request May 18, 2026
Copy link
Copy Markdown
Collaborator

@k88hudson-cfa k88hudson-cfa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@k88hudson-cfa k88hudson-cfa merged commit 450527c into main May 18, 2026
22 checks passed
@k88hudson-cfa k88hudson-cfa deleted the cdc-as81-remove-getrandom-dependency branch May 18, 2026 22:19
@cdc-as81 cdc-as81 linked an issue May 19, 2026 that may be closed by this pull request
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.

Remove getrandom dependency

3 participants