Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Randomised tests are not reproducible #115

Open
Timmmm opened this issue Jun 7, 2024 · 1 comment
Open

Randomised tests are not reproducible #115

Timmmm opened this issue Jun 7, 2024 · 1 comment

Comments

@Timmmm
Copy link

Timmmm commented Jun 7, 2024

With the -r / --randomize flag, riscv-ctg uses python-constraint's MinConflictsSolver. This is not reproducible. It seems like this was noticed at least:

A obvious down-side of using random solvers is the fact that the same test cannot be reproduced again. However, the typical intent of users of CTG would be to generates tests satisfying the cover-points defined in the CGF. Since that is guaranteed by CTG, the reproducibility issue can be set aside.

I guess this was really set aside because unfortunately MinConflictsSolver uses global random and doesn't let you provide a seed. This can be easily worked around by seeding the global random before solving, or by copying & fixing MinConflictsSolver. But I think I will just fix it in that project.

I also noticed some other uses of the global random in riscv-ctg which should not be there: several uses of random.choice in cross_comb.py.

@Timmmm
Copy link
Author

Timmmm commented Jun 7, 2024

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant