Conversation
A worker event is also logged showing the shrinking operation and the sequence length before and after each successful step.
|
Hi, Thanks for starting this PR! I think we should follow @aviggiano advise, let's avoid adding the last operation, as it looks overkill. |
|
@gustavo-grieco Thanks for the feedback! Will remove last operation from the status line. That will also simplify the diff a lot. Just brainstorming
|
|
If the output is small and unintrusive, this can be enable by default. It will be only be triggered when using the text mode and when an invariant is failing. |
@gustavo-grieco done in 44f65d6 + 6188d78. The latest version always displays shrinking info in the status line. The "very-verbose" step logs are still hidden by the |
lib/Echidna/Types/Campaign.hs
Outdated
| , runningThreads :: [ThreadId] | ||
| -- ^ Extra threads currently being run, | ||
| -- aside from the main worker thread | ||
| , lastShrinkP :: Maybe Int |
There was a problem hiding this comment.
Do you really need this field? Can you calculate it each time from the reproducer size?
There was a problem hiding this comment.
@gustavo-grieco Good catch! The diff is much more shrinked now 😄 (5c8b253)
There was a problem hiding this comment.
It looks very good!, let me test this and we can merge it next week.
|
@aviggiano @rappie can you provide some testing for this PR? |
|
Hey, I think I found a bug
I updated shrinking-mwe with 2 invariants so that this is clearer I guess the behavior of >1 shrinking was not specified, so we should think about what should happen on the first bullet |
|
Good catch, thanks a lot @aviggiano for the testing ! |
|
@aviggiano Thanks for the testing and for sharing the logs! The decision to implement shrinking data display this way was that status line only includes aggregated data at this point. However, did not count for the second bullet. I think a solution to this would be per-worker display: This would show each worker's progress individually:
|
|
@BowTiedRadone I think your fix looks reasonable, so feel free to go ahead and we will review it as soon as you pushed it. |
2be9dbf to
971ef81
Compare
|
@gustavo-grieco 971ef81 seems to get the job done. Used @aviggiano's updates in shrinking-mwe to test it and looks good. |
|
This seems to be working great for me. I've stress tested it a little bit: No issues or crashes. Great work! 🙌 Question: Would it make sense to remove fully shrunk sequences? In the end my output looks like this, which adds a lot of unnecessary bulk: |
|
@rappie Thanks for testing the PR! Your proposed approach sounds good. Just double checking before pushing your proposed suggestion. Are we okay with the following? [2025-10-07 18:30:24.70] [status] tests: 1/2, fuzzing: 423146/1000000, values: [], cov: 513, corpus: 6, shrinking: W2:4592/5000(23), gas/s: 365760896
# W2 reaches max shrinking steps, shrinking status becomes `N/A` again:
[2025-10-07 18:30:27.71] [status] tests: 1/2, fuzzing: 513683/1000000, values: [], cov: 513, corpus: 6, shrinking: N/A, gas/s: 684749936
...
# Second invariant is falsified, only the worker that shrinks the reproducer will be included in the status line (since the previous one finished shrinking):
[2025-10-07 18:30:41.06] Saved reproducer to echidna/reproducers-unshrunk/3298828898765790914.txt
[2025-10-07 18:30:42.98] [status] tests: 2/2, fuzzing: 817862/1000000, values: [], cov: 513, corpus: 6, shrinking: W0:545/5000(43), gas/s: 297850634
[2025-10-07 18:30:45.99] [status] tests: 2/2, fuzzing: 817862/1000000, values: [], cov: 513, corpus: 6, shrinking: W0:1076/5000(43), gas/s: 0 |
|
Looks good to me. Slightly more minimalistic alternative (mild preference): only show shrinking if there's shrinking taking place |
|
Same, minimalistic is preferred |
|
@rappie @aviggiano Done in 6c4c26c. |
|
Works great. Thanks 🙂 |
|
LGTM! |
|
Merged, thanks to everyone in the community for the code and testing! |
* Add cli option to include shrinking status in status lines A worker event is also logged showing the shrinking operation and the sequence length before and after each successful step. * Add `logShrinking` flag to `default.yaml` * Remove last shrinking op from status line * Always display shrinking info in status line * Comment cleanup * Remove shrinking step log and `logShrinking` flag * Compute status line reproducer length on demand * Log per-worker shrinking status * Display shrinking status when shrinking and active shrinking workers data
This PR adds shrinking info in the "detached mode" as requested in #1270. This feature displays real-time shrinking progress in the status line as:
W{id}:N/M (P)whereNis the current step,Mis the limit,Pis the current reproducer length, andidis the corresponding worker id.Sample status line:
To see shrinking progress, run: