Skip to content

Conversation

@ThomasTNO
Copy link
Collaborator

Description

In #3421 a bug was introduced making the minimizer incompatible with itself. This should fix it.

@tokatoka, I found it challenging to follow the suggested change in #3421, suggestions are welcome.

pub struct CorpusPowerTestcaseScore {}
   | ----------------------------------- doesn't satisfy `_: TestcasePenalty ...

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments

@tokatoka
Copy link
Member

I separated previous TestcaseScore into two because there are two patterns of its semantics
1st is when the testcase with higher score is better.
2nd is when the testcase with lower score is better.

1st type of score is named into TestcaseScore, 2nd type of score is named into TestcasePenalty.
and previously this corpus minimizer was used with LenTimeMulTestcaseScore in which lower score is better

The error means that CorpusPowerTestcaseScore should not be used with this minimizer.

The code has this comment

            // Additionally, each seed has a weight associated with them; the higher, the more z3
            // doesn't want to violate the assertion. Thus, inputs which have higher weights will be
            // less likely to appear in the final corpus -- provided all their coverage points are
            // hit by at least one other input.
            opt.assert_soft(&!seed, *weight, None);

So we actually want to punish testcases by having a high score. so TestcasePenalty is the right one.

@ThomasTNO
Copy link
Collaborator Author

So it should be TP instead of TS for generic?

@tokatoka
Copy link
Member

yes you are right. it should be TP

Copy link
Collaborator Author

@ThomasTNO ThomasTNO left a comment

Choose a reason for hiding this comment

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

Pipeline failure is unrelated to code change

@tokatoka tokatoka merged commit c4752fd into AFLplusplus:main Sep 23, 2025
108 of 110 checks passed
Sign up for free to 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.

2 participants