Compare commits

...
Author SHA1 Message Date
Ludovic MarieandClaude Opus 5.5 840284a77a Main's python tests pass again: the perf_bench table test gives full conditions
#4407's test wrote reports with only render_distance, and #? (reject incomparable
benchmark reports, 320778a3d) now refuses to compare runs whose scenario, seed,
simulation distance, window, vsync or offscreen are missing. The test now gives
the same full conditions to all three reports.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 19:19:41 +01:00
+4 -1
View File
@@ -135,6 +135,9 @@ class PerfBenchStatsTests(unittest.TestCase):
root = Path(tmp)
reports = root / "benchmarks" / "perf"
reports.mkdir(parents=True)
# The conditions `table` requires to match before it compares runs.
conditions = {"render_distance": 8, "scenario": "default", "seed": 1, "simulation_distance": 8,
"window": [1280, 720], "vsync": False, "offscreen": True}
for label, metrics in (
("missing", {}),
("zero", {"chunks.village.load_ms": {"mean": 0}}),
@@ -142,7 +145,7 @@ class PerfBenchStatsTests(unittest.TestCase):
"chunks.forest.load_ms": {"mean": 3000}}),
):
(reports / f"{label}-rd8.json").write_text(
json.dumps({"conditions": {"render_distance": 8}, "metrics": metrics}), encoding="utf-8")
json.dumps({"conditions": conditions, "metrics": metrics}), encoding="utf-8")
output = io.StringIO()
with mock.patch.object(pb, "ROOT", root), contextlib.redirect_stdout(output):
pb.table(["missing", "zero", "measured"])