diff --git a/python/scripts/nvbench_compare.py b/python/scripts/nvbench_compare.py index e75f158..adb9a10 100644 --- a/python/scripts/nvbench_compare.py +++ b/python/scripts/nvbench_compare.py @@ -865,9 +865,6 @@ def resolve_binary_filename(json_dir, binary_filename): if os.path.exists(parent_relative_filename): return parent_relative_filename - if os.path.exists(binary_filename): - return binary_filename - return json_relative_filename @@ -1778,6 +1775,15 @@ def has_robust_estimate(summary): ) +def has_robust_interval(summary): + return ( + summary.minimum is not None + and summary.first_quartile is not None + and summary.median is not None + and summary.third_quartile is not None + ) + + def has_mean_estimate(summary): return summary.mean is not None and ( summary.stdev_relative is not None or summary.stdev is not None @@ -1791,7 +1797,12 @@ def select_relative_dispersion(relative_dispersion, absolute_dispersion, center) def compute_common_time_estimates(ref_timing, cmp_timing): - if has_robust_estimate(ref_timing) and has_robust_estimate(cmp_timing): + if ( + has_robust_estimate(ref_timing) + and has_robust_interval(ref_timing) + and has_robust_estimate(cmp_timing) + and has_robust_interval(cmp_timing) + ): return ( TimeEstimate( center=ref_timing.median, diff --git a/python/test/test_nvbench_compare.py b/python/test/test_nvbench_compare.py index 0743544..1269f46 100644 --- a/python/test/test_nvbench_compare.py +++ b/python/test/test_nvbench_compare.py @@ -658,6 +658,31 @@ def test_gpu_timing_data_warns_when_lazy_sample_read_fails(tmp_path, nvbench_com assert timing.samples is None +def test_bulk_file_resolution_does_not_fall_back_to_cwd( + monkeypatch, tmp_path, nvbench_compare +): + json_dir = tmp_path / "json" + cwd = tmp_path / "cwd" + json_dir.mkdir() + cwd.mkdir() + np.array([123.0], dtype="