Skip to content

Commit

Permalink
Print resource counts when using -smoke
Browse files Browse the repository at this point in the history
  • Loading branch information
atomb committed Feb 9, 2024
1 parent fbf1aa2 commit 812d8d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Source/ExecutionEngine/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,11 @@ protected override bool ParseOption(string name, CommandLineParseState ps)
ps.CheckBooleanFlag("checkInfer", x => InstrumentWithAsserts = x) ||
ps.CheckBooleanFlag("restartProver", x => restartProverPerVc = x) ||
ps.CheckBooleanFlag("printInlined", x => printInlined = x) ||
ps.CheckBooleanFlag("smoke", x => SoundnessSmokeTest = x) ||
ps.CheckBooleanFlag("smoke", x =>
{
SoundnessSmokeTest = x;
Prune = false;
}) ||
ps.CheckBooleanFlag("vcsDumpSplits", x => VcsDumpSplits = x) ||
ps.CheckBooleanFlag("dbgRefuted", x => DebugRefuted = x) ||
ps.CheckBooleanFlag("reflectAdd", x => ReflectAdd = x) ||
Expand Down
8 changes: 6 additions & 2 deletions Source/VCGeneration/SmokeTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ async Task<bool> CheckUnreachable(TextWriter traceWriter, Block cur, List<Cmd> s
Contract.Assert(checker != null);

SolverOutcome outcome = SolverOutcome.Undetermined;
var resourceCount = 0;
try
{
VCExpr vc;
Expand Down Expand Up @@ -309,6 +310,7 @@ async Task<bool> CheckUnreachable(TextWriter traceWriter, Block cur, List<Cmd> s
Options.SmokeTimeout, Options.ResourceLimit, CancellationToken.None);

await checker.ProverTask;
resourceCount = checker.GetProverResourceCount();

lock (checker)
{
Expand All @@ -326,7 +328,9 @@ async Task<bool> CheckUnreachable(TextWriter traceWriter, Block cur, List<Cmd> s
TimeSpan elapsed = end - start;
if (Options.Trace)
{
traceWriter.WriteLine(" [{0} s] {1}", elapsed.TotalSeconds,
traceWriter.WriteLine(" [{0} s, resource count: {1}] {2}",
elapsed.TotalSeconds,
resourceCount,
outcome == SolverOutcome.Valid
? "OOPS"
: "OK" + (outcome == SolverOutcome.Invalid ? "" : " (" + outcome + ")"));
Expand Down Expand Up @@ -492,4 +496,4 @@ public override void OnProverWarning(string msg)
callback.OnWarning(options, msg);
}
}
}
}

0 comments on commit 812d8d8

Please sign in to comment.