@@ -196,6 +196,34 @@ def test_sample_pack_configs_spreads_across_full_grid_deterministically():
196196 assert {cfg .risk_penalty for cfg in sampled_a } == {0.2 , 0.5 }
197197
198198
199+ def test_sample_pack_configs_keeps_randomized_order ():
200+ args = argparse .Namespace (
201+ risk_penalties = "0.2,0.5" ,
202+ cvar_weights = "0.0" ,
203+ entry_gap_bps_grid = "25,50,75" ,
204+ entry_alpha_grid = "0.5" ,
205+ exit_alpha_grid = "0.8" ,
206+ edge_threshold_grid = "0.003,0.006" ,
207+ edge_to_full_size_grid = "0.02" ,
208+ min_close_ret_grid = "0.0" ,
209+ close_edge_weight_grid = "0.0" ,
210+ min_upside_downside_ratio_grid = "0.0" ,
211+ max_positions_grid = "5,8" ,
212+ max_pending_entries_grid = "12" ,
213+ entry_ttl_hours_grid = "3" ,
214+ max_hold_hours_grid = "24" ,
215+ max_leverage_grid = "1.0" ,
216+ entry_selection_modes = "edge_rank" ,
217+ entry_allocator_modes = "concentrated" ,
218+ entry_allocator_edge_power_grid = "2.0" ,
219+ )
220+ configs = iter_pack_configs (args )
221+ sampled = sample_pack_configs (configs , limit = 10 , seed = 20260427 )
222+ sampled_indices = [configs .index (cfg ) for cfg in sampled ]
223+
224+ assert sampled_indices != sorted (sampled_indices )
225+
226+
199227def test_filter_liquid_frames_keeps_top_dollar_volume_symbols ():
200228 ts = pd .date_range ("2026-03-01T00:00:00Z" , periods = 4 , freq = "h" )
201229 frames = {
0 commit comments