RFR: 8346107: Generators: testing utility for random value generation

Emanuel Peter epeter at openjdk.org
Tue Jan 7 14:25:41 UTC 2025


On Tue, 7 Jan 2025 14:19:28 GMT, Theo Weidmann <tweidmann at openjdk.org> wrote:

>> Hmm. But what if I at some point get the "special" distribution from `Generators.ints`, but then want to draw from a range that has no elements? I kinda need that to not throw for the Templates.
>
> But what is it good for to draw from a range with no elements? What is supposed to happen then?

Well, it is more about this:
I want to be able to draw from restricted ranges in the Templates. But the distribution should be random. Maybe the solution is just to make sure that for `Generators.ints`, we always mix in uniform, but at a very low weight. That way, if all other sub-distribution of a mixed distribution fall away (empty), we at least still have the uniform distribution.
Because if the template wants a range, then we must sample something from that range.
Does that make sense?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22941#discussion_r1905529209


More information about the hotspot-compiler-dev mailing list