Close shifted oracle frontier boundaries
This commit is contained in:
@@ -9,7 +9,12 @@ ORACLE_GAP = Path(__file__).resolve().parents[1] / "scripts/oracle_gap"
|
||||
sys.path.insert(0, str(ORACLE_GAP))
|
||||
|
||||
from analyze import score_trial, summarize_trials # noqa: E402
|
||||
from run_frontier import AMENDMENT, UP_EXTENSIONS, resume_compatible # noqa: E402
|
||||
from run_frontier import ( # noqa: E402
|
||||
AMENDMENT,
|
||||
UP_EXTENSIONS,
|
||||
boundary_closure_needs,
|
||||
resume_compatible,
|
||||
)
|
||||
|
||||
|
||||
def _request(
|
||||
@@ -175,7 +180,7 @@ def test_a_og_1_extends_only_mutable_resume_fields() -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_a_og_3_requires_the_amended_grid_to_stay_fixed() -> None:
|
||||
def test_a_og_4_requires_the_amended_grid_to_stay_fixed() -> None:
|
||||
old = {
|
||||
"analyzer_sha256": "analyzer",
|
||||
"p5_client_sha256": "p5",
|
||||
@@ -190,9 +195,21 @@ def test_a_og_3_requires_the_amended_grid_to_stay_fixed() -> None:
|
||||
"up_extensions": {"P01": [38.0], "P06": [2.1, 2.2, 2.3, 2.4]},
|
||||
}
|
||||
|
||||
assert AMENDMENT == "A-OG-3"
|
||||
assert AMENDMENT == "A-OG-4"
|
||||
assert resume_compatible(old, {**old, "controller_sha256": "new"})
|
||||
assert not resume_compatible(
|
||||
old,
|
||||
{**old, "up_extensions": {"P01": [38.0], "P06": [2.1, 2.2, 2.3, 2.5]}},
|
||||
)
|
||||
|
||||
|
||||
def test_boundary_closure_follows_a_majority_shift() -> None:
|
||||
rows = []
|
||||
rows.append(_frontier_row("P06", "C00", 2.3, True))
|
||||
rows.extend(_frontier_row("P06", "C00", 2.4, value) for value in (True, False, False))
|
||||
rows.extend(_frontier_row("P06", "C00", 2.5, False) for _ in range(3))
|
||||
|
||||
assert boundary_closure_needs(rows) == [2.3]
|
||||
|
||||
rows.extend(_frontier_row("P06", "C00", 2.3, True) for _ in range(2))
|
||||
assert boundary_closure_needs(rows) == []
|
||||
|
||||
Reference in New Issue
Block a user