STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_hybrid_seed_reproducible Namespace Reference

Functions

 _rosenbrock (x)
 _run (seed, budget=600)
 test_same_seed_same_search ()
 test_different_seed_different_search ()
 test_unseeded_still_runs ()

Detailed Description

``layer1_random_seed`` must actually pin the hybrid search.

Measured before this test existed: three Layer 1 runs of configs/ethalox_6500N.yaml, all
with ``layer1_random_seed: 37``, returned three different injectors (included angle 89 / 87 /
83 deg, O/F 1.5023 / 1.5106 / 1.5144). The seed reached the 16-trial warm start and nothing
after it: ``run_hybrid_optimization`` built its own ``np.random.default_rng()`` with no seed
and called ``run_cma_core`` without ``seed=`` in Stage A, every block and every refresh, so
CMA seeded itself from the clock. The legacy CMA path passes ``_cma_restart_seed``; the hybrid
path -- the one every shipped config selects -- did not.

The objective here is deliberately a plain function, not the engine: what is under test is
that the SEARCH is a deterministic function of its seed, and nothing else.

Function Documentation

◆ _rosenbrock()

test_hybrid_seed_reproducible._rosenbrock ( x)
protected

Definition at line 26 of file test_hybrid_seed_reproducible.py.

Referenced by _run().

◆ _run()

test_hybrid_seed_reproducible._run ( seed,
budget = 600 )
protected
Run the search and return what it *did*: every point it evaluated, in order.

The first version of this test compared the final best point of two seeds, and that
is a coin flip: at a 600-evaluation budget the search often never improves on the
start at all -- seed 7 returns the start point on every machine tried, seed 8 finds
something marginally better here and nothing at all on the CI runner -- so "the two
seeds landed in different places" passed or failed on luck. Whether the seed reaches
the sampler is visible in the *sequence of candidates*, which differs between seeds
on the very first iteration and is identical between equal seeds, whatever the
search then makes of them.

Definition at line 30 of file test_hybrid_seed_reproducible.py.

References _rosenbrock().

Referenced by test_different_seed_different_search(), test_same_seed_same_search(), and test_unseeded_still_runs().

◆ test_different_seed_different_search()

test_hybrid_seed_reproducible.test_different_seed_different_search ( )

Definition at line 71 of file test_hybrid_seed_reproducible.py.

References _run(), and min.

◆ test_same_seed_same_search()

test_hybrid_seed_reproducible.test_same_seed_same_search ( )

Definition at line 61 of file test_hybrid_seed_reproducible.py.

References _run().

◆ test_unseeded_still_runs()

test_hybrid_seed_reproducible.test_unseeded_still_runs ( )

Definition at line 83 of file test_hybrid_seed_reproducible.py.

References _run().