<commit_before>use Random;

config const n = 100, trials = 100, useRndSeed = true;

proc main {
  var A: [1..n] real;
  var initSeed = if useRndSeed then SeedGenerator.currentTime else 31415;
  var diffCnt: int;

  fillRandom(A, initSeed);
  for i in 1..trials {
    var seed = if useRndSeed then SeedGenerator.currentTime else 31415;
    var B: [1..n] real;
    fillRandom(B, seed);

    if !(&& reduce (A == B)) then
      diffCnt += 1;
    A <=> B;
  }<commit_msg>Update testRandomSeed.chpl to make sure it gets a new seed every time [trivial, not reviewed]<commit_after>use Random;

config const n = 100, trials = 100, useRndSeed = true;

proc getNextSeed(oldSeed) {
  var newSeed = SeedGenerator.currentTime;
  while newSeed == oldSeed {
    newSeed = SeedGenerator.currentTime;
  }
  return newSeed;
}

proc main {
  var A: [1..n] real;
  var initSeed = if useRndSeed then SeedGenerator.currentTime else 31415;
  var diffCnt: int;

  fillRandom(A, initSeed);
  for i in 1..trials {
    if !useRndSeed then initSeed += 2;
    var seed = if useRndSeed then getNextSeed(initSeed) else initSeed;
    var B: [1..n] real;
    fillRandom(B, seed);

    if !(&& reduce (A == B)) then
      diffCnt += 1;
    A = B;
    initSeed = seed;
  }
{'fraction_non_alphanumeric': 0.11479385610347616, 'fraction_numerical': 0.02910266774454325, 'mean_word_length': 3.1266666666666665, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6610218', 'n_tokens_mistral': 499, 'n_tokens_neox': 458, 'n_words': 145}