qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Jun Sun <jsun@junsun.net>, qemu-devel@nongnu.org
Subject: Re: [PATCH risu] use time() as random seed and introduce --randseed option
Date: Thu, 18 May 2023 14:09:02 +0100	[thread overview]
Message-ID: <87wn15lrab.fsf@linaro.org> (raw)
In-Reply-To: <CAFEAcA-wT3OUZzkVA8riMRDWE4M_f3yZD2HLHSTksLUVM+kH3Q@mail.gmail.com>


Peter Maydell <peter.maydell@linaro.org> writes:

> On Fri, 5 May 2023 at 01:23, Jun Sun <jsun@junsun.net> wrote:
>>
>> Agree on the usefulness of generating the same test. That is the
>> reason behind adding --randseed option. Once a seed is set, it
>> always generates the same sequence of instructions.
>>
>> Basically with this patch,
>>
>> by default you will generate random instruction sequences for most testing cases
>> you can provide a random seed option in the commandline to generate a deterministic instruction sequence
>>
>> Without this patch,
>>
>> we always get one fixed sequence (ie. random seed == 0 case)
>> Otherwise we would have to manually modify code to generate random
>> instruction sequences or generate a different fixed sequence.
>>
>> Hope this clarifies things a little bit.
>
> Mmm; it comes down to: should we default to 'time' and
> require the user to specify --randseed 0 to get the old
> behaviour; or do we retain the current behaviour as the
> default and let the user pass an option if they want a
> non-reproducibly random output.
>
> Alex, what do you reckon? You probably have been using
> risugen more actively than me recently. I guess I vaguely
> lean to "default to randomize(time)".

I'm easy either way as long as we as long as we print out the seed so we
can deterministically regenerate if we want to.

>
> Also, should we make risugen print the random seed to stdout
> so you can repro it even if you didn't pass --randseed initially?
>
> Now that the random-seed-setting is 6 lines instead of 1,
> this should definitely be abstracted out to a function
> in the common code and not repeated in each per-arch file.
>
> thanks
> -- PMM


-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2023-05-18 13:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 16:23 [PATCH risu] use time() as random seed and introduce --randseed option Jun Sun
2023-05-03 17:03 ` Alex Bennée
2023-05-05  0:22   ` Jun Sun
2023-05-09 12:53     ` Peter Maydell
2023-05-18 13:09       ` Alex Bennée [this message]
2023-06-06 16:36         ` Jun Sun
2023-06-06 16:58           ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wn15lrab.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=jsun@junsun.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).