Recognize zero-sweep gravity benchmark controls
This commit is contained in:
@@ -120,7 +120,9 @@ def inspect_case_artifacts(folder):
|
|||||||
check('action_checks_present', len(action_rows) == 2 and
|
check('action_checks_present', len(action_rows) == 2 and
|
||||||
{row['role'] for row in action_rows} == {'baseline', 'candidate'})
|
{row['role'] for row in action_rows} == {'baseline', 'candidate'})
|
||||||
for row in action_rows:
|
for row in action_rows:
|
||||||
expected = by_role[row['role']]['variant'] == 'independent'
|
measured = by_role[row['role']]
|
||||||
|
expected = measured['variant'] == 'independent' or (
|
||||||
|
measured['variant'] == 'gravity-schur' and int(measured['schur_correction_sweeps']) == 0)
|
||||||
check(row['role'] + '_action_variant_matches', row['variant'] == by_role[row['role']]['variant'])
|
check(row['role'] + '_action_variant_matches', row['variant'] == by_role[row['role']]['variant'])
|
||||||
check(row['role'] + '_equivalence_requirement_recorded',
|
check(row['role'] + '_equivalence_requirement_recorded',
|
||||||
row['context_equivalence_required'] == ('1' if expected else '0'))
|
row['context_equivalence_required'] == ('1' if expected else '0'))
|
||||||
|
|||||||
@@ -206,6 +206,25 @@ class BenchmarkCheckerTests(unittest.TestCase):
|
|||||||
lambda data: data[0].update(context_equivalence_required=0))
|
lambda data: data[0].update(context_equivalence_required=0))
|
||||||
self.assert_no_claim(checker.inspect_case(self.folder))
|
self.assert_no_claim(checker.inspect_case(self.folder))
|
||||||
|
|
||||||
|
def test_zero_sweep_gravity_control_requires_default_equivalence(self):
|
||||||
|
for variant, sweeps, equivalent in (('gravity-schur', 0, True),
|
||||||
|
('gravity-schur', 1, False),
|
||||||
|
('stellar-ldu-gravity-schur', 0, False)):
|
||||||
|
with self.subTest(variant=variant, sweeps=sweeps):
|
||||||
|
self.make_case()
|
||||||
|
def summary(data):
|
||||||
|
data[0]['schur_correction_sweeps'] = 0
|
||||||
|
data[1].update(variant=variant, schur_correction_sweeps=sweeps)
|
||||||
|
self.alter_rows('preconditioner_summary.csv', summary)
|
||||||
|
self.alter_rows('preconditioner_actions.csv', lambda data:
|
||||||
|
data[1].update(variant=variant, context_equivalence_required=int(equivalent)))
|
||||||
|
result = checker.inspect_case(self.folder)
|
||||||
|
self.assertTrue(result['passed'], result)
|
||||||
|
if equivalent:
|
||||||
|
self.alter_rows('preconditioner_actions.csv', lambda data:
|
||||||
|
data[1].update(context_equivalence_required=0))
|
||||||
|
self.assert_no_claim(checker.inspect_case(self.folder))
|
||||||
|
|
||||||
def test_omitted_input_or_output_hash_cannot_support_speedup(self):
|
def test_omitted_input_or_output_hash_cannot_support_speedup(self):
|
||||||
for key, remove in [('input_state_hashes', str(self.snapshot)),
|
for key, remove in [('input_state_hashes', str(self.snapshot)),
|
||||||
('output_hashes', 'candidate_normalized_linear_defect.txt')]:
|
('output_hashes', 'candidate_normalized_linear_defect.txt')]:
|
||||||
|
|||||||
Reference in New Issue
Block a user