text
stringlengths
0
4.86k
@pytest.mark.parametrize("seed", [1, 2, 3])
def test_reusable_cli_generalizes_to_private_randomized_histories(seed: int) -> None:
output, instance, history, center, scale, threshold = run_hidden(seed)
assert {path.name for path in output.iterdir()} == ARTIFACTS
mask, _, _, _ = expected_decomposition(history, instance)
events = read_csv(output / "collision_events.csv", EVENT_COLUMNS)
assert len(events) == int(np.sum(mask)) == 7 + seed
assert all(float(row["raw_jump_msun"]) > threshold for row in events)
tree = read_json(output / "merger_tree.json")
assert tree["event_count"] == 7 + seed
assert tree["maximum_event_mass_closure_msun"] < 1e-8
expected_ladder, total_collision_mass = expected_runaway(history, mask, center)
ladder = read_csv(output / "runaway_growth.csv", RUNAWAY_COLUMNS)
assert len(ladder) == len(expected_ladder) == 7 + seed
for row, expected in zip(ladder, expected_ladder, strict=True):
assert row["event_id"] == expected["event_id"]
assert math.isclose(float(row["companion_mass_msun"]), float(expected["companion_mass_msun"]), rel_tol=1e-10, abs_tol=1e-9)
assert math.isclose(float(row["cumulative_collision_mass_msun"]), float(expected["cumulative_collision_mass_msun"]), rel_tol=1e-9, abs_tol=1e-9)
assert math.isclose(float(row["growth_timescale_myr"]), float(expected["growth_timescale_myr"]), rel_tol=1e-9)
assert math.isclose(float(ladder[-1]["collision_mass_fraction"]), 1.0, abs_tol=1e-12)
hidden_diagnostics = read_json(output / "diagnostics.json")
> assert hidden_diagnostics["runaway"]["event_count"] == 7 + seed
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E KeyError: 'event_count'
/verifier/test_outputs.py:803: KeyError
==================================== PASSES ====================================
=========================== short test summary info ============================
PASSED ../verifier/test_outputs.py::test_source_is_general_and_does_not_contain_public_signatures
PASSED ../verifier/test_outputs.py::test_hidden_execution_masks_sensitive_roots_fds_secrets_and_shared_tmp
PASSED ../verifier/test_outputs.py::test_primary_provenance_and_frozen_hashes
PASSED ../verifier/test_outputs.py::test_publication_is_complete_hash_bound_and_exact
PASSED ../verifier/test_outputs.py::test_malformed_hash_fails_without_partial_publication
FAILED ../verifier/test_outputs.py::test_public_canonicalization_and_collision_catalog
FAILED ../verifier/test_outputs.py::test_public_merger_tree_is_a_closed_central_spine
FAILED ../verifier/test_outputs.py::test_public_growth_budget_closes_every_interval
FAILED ../verifier/test_outputs.py::test_public_runaway_growth_ladder_is_closed_and_spine_coupled
FAILED ../verifier/test_outputs.py::test_public_remnant_scenarios_match_independent_analytic_solution
FAILED ../verifier/test_outputs.py::test_report_contains_auditable_physical_interpretation
FAILED ../verifier/test_outputs.py::test_reusable_cli_generalizes_to_private_randomized_histories[1]
FAILED ../verifier/test_outputs.py::test_reusable_cli_generalizes_to_private_randomized_histories[2]
FAILED ../verifier/test_outputs.py::test_reusable_cli_generalizes_to_private_randomized_histories[3]
========================= 9 failed, 5 passed in 2.11s ==========================
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-8.4.1, pluggy-1.6.0 -- /usr/local/bin/python3
rootdir: /verifier
collecting ... collected 14 items
../verifier/test_outputs.py::test_source_is_general_and_does_not_contain_public_signatures PASSED [ 7%]
../verifier/test_outputs.py::test_hidden_execution_masks_sensitive_roots_fds_secrets_and_shared_tmp PASSED [ 14%]
../verifier/test_outputs.py::test_primary_provenance_and_frozen_hashes PASSED [ 21%]
../verifier/test_outputs.py::test_publication_is_complete_hash_bound_and_exact PASSED [ 28%]
../verifier/test_outputs.py::test_public_canonicalization_and_collision_catalog FAILED [ 35%]
../verifier/test_outputs.py::test_public_merger_tree_is_a_closed_central_spine PASSED [ 42%]
../verifier/test_outputs.py::test_public_growth_budget_closes_every_interval FAILED [ 50%]
../verifier/test_outputs.py::test_public_runaway_growth_ladder_is_closed_and_spine_coupled FAILED [ 57%]
../verifier/test_outputs.py::test_public_remnant_scenarios_match_independent_analytic_solution PASSED [ 64%]
../verifier/test_outputs.py::test_report_contains_auditable_physical_interpretation PASSED [ 71%]
../verifier/test_outputs.py::test_reusable_cli_generalizes_to_private_randomized_histories[1] FAILED [ 78%]
../verifier/test_outputs.py::test_reusable_cli_generalizes_to_private_randomized_histories[2] FAILED [ 85%]
../verifier/test_outputs.py::test_reusable_cli_generalizes_to_private_randomized_histories[3] FAILED [ 92%]
../verifier/test_outputs.py::test_malformed_hash_fails_without_partial_publication PASSED [100%]
=================================== FAILURES ===================================
______________ test_public_canonicalization_and_collision_catalog ______________
def test_public_canonicalization_and_collision_catalog() -> None:
instance = read_json(PUBLIC_INSTANCE)
history, counts = canonical_history(PUBLIC_HISTORY)
mask, center, scale, threshold = expected_decomposition(history, instance)
rows = read_csv(OUTPUT / "collision_events.csv", EVENT_COLUMNS)
indices = np.flatnonzero(mask) + 1
> assert len(rows) == len(indices) >= 100
E AssertionError: assert 185 == 187
E + where 185 = len([{'companion_mass_msun': '15.4319315296', 'event_id': 'event_0001', 'post_mass_msun': '19.0295874814', 'pre_mass_msun': '3.5976559518', ...}, {'companion_mass_msun': '18.2544032014', 'event_id': 'event_0002', 'post_mass_msun': '38.5847513503', 'pre_mass_msun': '20.3303481489', ...}, {'compan...
E + and 187 = len(array([ 904, 1047, 1084, 1173, 1287, 1300, 1324, 1346, 1347, 1381, 1404,\n 1407, 1408, 1421, 1427, 1434, 1437, 1443, 1445, 1449, 1453, 1456,\n 1458, 1464, 1467, 1469, 1471, 1472, 1478, 1490, 1496, 1501, 1503,\n 1506, 1510, 1517, 1530, 1532, 1533, 1541, 1543, 1551, 1552, 156...
/verifier/test_outputs.py:688: AssertionError
_______________ test_public_growth_budget_closes_every_interval ________________
def test_public_growth_budget_closes_every_interval() -> None:
history, _ = canonical_history(PUBLIC_HISTORY)
rows = read_csv(OUTPUT / "growth_budget.csv", GROWTH_COLUMNS)
assert [int(row["bin_index"]) for row in rows] == list(range(len(rows)))
smooth = sum(float(row["smooth_delta_msun"]) for row in rows)
collision = sum(float(row["collision_delta_msun"]) for row in rows)
total = sum(float(row["total_delta_msun"]) for row in rows)
assert math.isclose(total, float(history[-1, 1] - history[0, 1]), abs_tol=1e-7)
assert math.isclose(smooth + collision, total, abs_tol=1e-7)
diagnostics = read_json(OUTPUT / "diagnostics.json")
> assert abs(diagnostics["growth_budget"]["growth_closure_residual_msun"]) < 1e-7
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E KeyError: 'growth_closure_residual_msun'
/verifier/test_outputs.py:728: KeyError
________ test_public_runaway_growth_ladder_is_closed_and_spine_coupled _________
def test_public_runaway_growth_ladder_is_closed_and_spine_coupled() -> None:
instance = read_json(PUBLIC_INSTANCE)