fix(strategy): print a summary for --compare --quiet instead of nothing#228
Merged
Conversation
runner.compare() only prints when verbose (i.e. not --quiet), and main() discarded its return value and returned before the quiet-summary block -- so `strategy --compare --quiet` produced no output at all. Capture compare()'s result and, under --quiet, print a one-line exact/smart/speedup/rel_err summary (mirroring the run path's --quiet line). Add a CPU test that stubs runner.compare so it needs no GPU.
zeokin
approved these changes
Jul 14, 2026
zeokin
left a comment
Owner
There was a problem hiding this comment.
--compare --quiet now prints a one-line summary instead of nothing; no double-print.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR kind
Summary
strategy --compare --quietproduced no output at all.runner.compare()only prints its report whenverbose(i.e. not--quiet), andmain()discardedcompare()'s return value andreturn 0'd before the--quietsummary block that the normal run path has:So a scripted
--compare --quietrun silently computed both engines and printed nothing.Fix
Capture
compare()'s returned dict and, under--quiet, print a one-line summary (exact/smart seconds, speedup, rel_err) — mirroring the run path's--quietline. Non-quiet behaviour is unchanged (compare() still prints its full report; no double output).Touches only
strategy/cli.pyand a new test — no protected paths.Validation
The test stubs
runner.comparevia monkeypatch, so it runs on CPU with no GPU/torch — it exercises the flag handling and summary formatting (and asserts non-quiet mode does not double-print).Checklist
Co-authored-byfooters for coding agents such as Cursor, Codex, Claude, Copilot, or similar tools.featPR — no scorecard required.