Skip to content

Add debug shrinking log - #88

Merged
c-cube merged 2 commits into
masterfrom
add_shrink_debug
Nov 26, 2019
Merged

Add debug shrinking log#88
c-cube merged 2 commits into
masterfrom
add_shrink_debug

Conversation

@Gbury

Copy link
Copy Markdown
Collaborator

Should fix#71

cc @gasche , sorry for the delay.

Comment threadMakefile

example-runner:
@dune exec example/QCheck_runner_test.exe
@dune exec example/QCheck_runner_test.exe -- --debug-shrink=log.tmp

@c-cubec-cubeNov 23, 2019

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is more a topic for discussion, not a review, but here Sys.getenv might also be quite convenient compared to passing parameters on the CLI (which needs to be negociated with each runner, including alcotest).
never mind, the whole PR is for the base runner.

Comment threadsrc/runner/QCheck_base_runner.mli Outdated

(** {2 Event handlers} *)

type counter = {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be a type counter = private {… to prevent mutation of the fields?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a good idea, yes.

@c-cubec-cube left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, let's see if @gasche likes it :)

@jmid

jmid commented Nov 23, 2019

Copy link
Copy Markdown
Collaborator

Should fix #71

First of all: Nice work! 👍🏻
I've recently spent some time debugging a non-trivial shrinker. For that I found logging each successful shrink attempt to a separate file (shrink01, shrink02, ...) and using the 2-column output of diff -y worked very well to visualize and understand the gradual shrinking process.

@c-cube
c-cube merged commit 82b3b78 into masterNov 26, 2019
@gasche

Copy link
Copy Markdown
Contributor

I just helped a student work on a shrinker for Inferno, and we benefited enormously of the new logging feature. Thanks!

@jmidjmid mentioned this pull request Aug 17, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What's the workflow to observe/debug shrinking choices? (with proposals inside)

4 participants

@Gbury@jmid@gasche@c-cube