-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CTG tests are not reproducible #566
Comments
But I don't know how to handle random, according to the following code, it seems intentional, or it is necessary because we need to choose one from various solutions riscv-arch-test/riscv-ctg/riscv_ctg/cross_comb.py Lines 223 to 225 in cd94912
However, I think we can set the random seed as a parameter, which ensures reproducibility while also allowing for some randomness |
While I wish it were reproducible, what is important is really the
coverage.
The only reason tests are recreated is to add specific cover points,
Test generation should not be adding tests that don't add new coverpoints,
so as
CTG runs, it must be keeping track of how much coverage has already been
found.
If we specify just new coverpoints, AND add the capability of pointing to
existing cover points
from a previous run, then new tests that match only existing coverpoints
could be dropped,
only tests matching new coverpoints will be added, and existing tests
won't remain unchanged.
That would make reviewing new tests much simpler.
I don't think that's an option that CTG has, though internally it must do
something like that when creating tests, so shouldn't be hard to add.
(I can say this because I know I'm incapable of making that change....:-
…On Mon, Nov 25, 2024 at 7:17 PM MingZhu Yan ***@***.***> wrote:
But I don't know how to handle random, according to the following code, it
seems intentional ( I haven't looked closely at why to do this way)
https://github.com/riscv-non-isa/riscv-arch-test/blob/cd94912fed2aab75d7d5f115b441da0813fdce8d/riscv-ctg/riscv_ctg/cross_comb.py#L223-L225
—
Reply to this email directly, view it on GitHub
<#566 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJVNH4AH2ITBER3VM5L2CPR3JAVCNFSM6AAAAABSF6BSO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJZGU3DIMZVGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I roughly understand what you mean; ctg only generates new test cases for points that have not yet been covered. I will give it a try
|
If you are generating tests for a specific extension, you can add a filter, |
After some testing, I found that the tests ctg (without
-r
option) generated each time is different. This is completely different from what I expected. I also had another person try it, and the results were also different.I think Tim have already found this issue a few month ago: riscv-software-src/riscv-ctg#115
I'm trying to fix this, but simply appending a line
random.seed(10)
after allimport random
statements does not solve the problem. I will check it again.Update: The reason is the use of
set
in the code, and I am replacing them withordered_set
if you don't know what
-r
option does:-r, --randomize Randomize Outputs.
riscv-arch-test/riscv-ctg/riscv_ctg/generator.py
Lines 493 to 496 in cd94912
I haven't tested the behavior of
MinConflictsSolver
, which will use random insideOriginally posted by @trdthg in #565 (comment)
Update: In summary, two steps are needed to solve the problem here
The text was updated successfully, but these errors were encountered: