feat(benchmark): add --progress logging for engine solves

Long whole-job solves ran silently, so there was no way to tell a slow
engine from a hung one until the timeout fired. --progress hands each
solve a JobProgressLog that prints [job/engine] lines for start, finish
(or failure/timeout), every plate commit, and candidate evaluations
throttled to one line per 2 s so parallel runs stay readable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
aj
2026-09-25 14:03:10 -04:00
co-authored by Claude Opus 5.5
parent 695ccc0a3b
commit 23dd99fa2f
7 changed files with 193 additions and 7 deletions
@@ -296,6 +296,40 @@ public sealed class BenchmarkRunnerTests : IDisposable
Assert.True(File.Exists(Path.Combine(output, "job-Engine0.json")));
}
[Fact]
public void Run_WithProgressLog_ForwardsEngineProgress()
{
var writer = new StringWriter();
var engines = new List<NestingEngineInfo>
{
new("Reporter", "test double", () => new ReportingEngine()),
};
BenchmarkRunner.Run(LoadJob(), engines, maxParallelism: 1, progressLog: writer);
var log = writer.ToString();
Assert.Contains("[job/Reporter] started", log);
Assert.Contains("[job/Reporter] evaluating plate 1 on stock", log);
Assert.Contains("[job/Reporter] finished in", log);
}
private sealed class ReportingEngine : INestingEngine
{
public NestJobResult Solve(
NestJob job,
IProgress<NestJobProgress>? progress = null,
CancellationToken token = default
)
{
progress?.Report(
new NestJobProgress(NestJobStage.EvaluatingCandidate, job.Plates[0].Id, 0, 0, 0)
);
return new NestJobResultBuilder(job, progress).Build(
NestJobStopReason.NoPlacementFound
);
}
}
private sealed class ConcurrencyProbe
{
private int _current;