改动 / #3205

#3205 [Benchmark] calibrate checks the output directory up front (#3187)

open · @ctr-137 · 0 评论 · 去 GitHub 看

BenchmarksSetup & installAMD / HIPNVIDIA / CUDAWindows

说明

## The problem

`strata engine calibrate --measure` checks the report path up front, but not the directory it should land in. That check only ran in `_write_new`, after the sweep, so a full measurement (8 engine starts, 177 measurements, ~19 minutes on the reporter's machine) ended with `report output directory does not exist` and no report for `--review-result` / `--apply-result` to consume.

## What it does

The parent-directory check now runs in `_measure_locked` next to the existing "report path already exists" check, so the refusal happens in a second instead of after the sweep. Same message, same exit code (5). `_write_new` keeps its check as the last word. Nothing is created: the tool still refuses rather than making a directory.

## Validation

Environment: `main` @ `f57c0adc` (the branch base), Windows 11, Python 3.14.7.

- New test `test_measure_refuses_a_missing_output_directory_before_the_sweep` in `tests/terminal/test_calibration.py`: one case for a missing directory, one for a parent that is a file. It uses a runner that fails if the sweep starts, so it only passes when the refusal comes first.
- That test fails on the unpatched tree with `calibration measurement failed (AssertionError); config unchanged` instead of the refusal, which is the sweep having run and only the write failing.
- `tests/terminal`: 701 tests with the change, 700 without, and the same 24 problems in both runs (7 failures, 17 errors) — the two lists are identical. Those are this machine's pre-existing Windows problems in the process and liveness tests plus loader errors, not the change. `pytest` is not installed here, so I ran `python -m unittest discover -s tests/terminal`.
- Not run: no CUDA, HIP or SYCL build, as this file is Python only. No GPU, no model files, no engine start, no measured numbers.

## Limits

- Only `strata engine calibrate --measure`. The issue also names `setup.py --calibrate`, which writes its own record and does not fail; I left it alone.
- No new behaviour and no default changed: the message, the exit code and the report writing are as they were, only earlier.

Fixes #3187

🤖 Generated with [Claude Code](https://claude.com/claude-code)

本站相关内容

相关页面的快捷入口。