diff --git a/src/doc_md/CHANGELOG.long.md b/src/doc_md/CHANGELOG.long.md index 4f401b1f..bba8a19d 100644 --- a/src/doc_md/CHANGELOG.long.md +++ b/src/doc_md/CHANGELOG.long.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -1097 merges; 186 releases +1098 merges; 186 releases @@ -18,6 +18,21 @@ Published tags: +  + +  + +## [Untagged] - 10/25/2023 10:58:24 AM + +Commit [e1ef14c5268547a18010d378267f7196e186a08c](https://github.com/StoneCypher/jssm/commit/e1ef14c5268547a18010d378267f7196e186a08c) + +Author: `John Haugeland ` + + * silence most build warnings + + + +     diff --git a/src/doc_md/CHANGELOG.md b/src/doc_md/CHANGELOG.md index d8865054..65bdd687 100644 --- a/src/doc_md/CHANGELOG.md +++ b/src/doc_md/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -1097 merges; 186 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md) +1098 merges; 186 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md) @@ -18,6 +18,21 @@ Published tags: +  + +  + +## [Untagged] - 10/25/2023 10:58:24 AM + +Commit [e1ef14c5268547a18010d378267f7196e186a08c](https://github.com/StoneCypher/jssm/commit/e1ef14c5268547a18010d378267f7196e186a08c) + +Author: `John Haugeland ` + + * silence most build warnings + + + +     @@ -174,21 +189,4 @@ updated-dependencies: - dependency-name: xml2js dependency-type: direct:development ... - * Signed-off-by: dependabot[bot] - - - - -  - -  - - - -## [5.88.4] - 2/7/2023 3:52:11 PM - -Commit [ef4285a2699696409cfd36f3ed5b63f67f568f34](https://github.com/StoneCypher/jssm/commit/ef4285a2699696409cfd36f3ed5b63f67f568f34) - -Author: `John Haugeland ` - - * cleanup and bumps \ No newline at end of file + * Signed-off-by: dependabot[bot] \ No newline at end of file diff --git a/src/ts/jssm_util.ts b/src/ts/jssm_util.ts index 20b6d909..de463966 100644 --- a/src/ts/jssm_util.ts +++ b/src/ts/jssm_util.ts @@ -199,25 +199,36 @@ const named_hook_name = (from: string, to: string, action: string): string => /******* * - * Creates a Mulberry32 random generator. Used by the randomness test suite. + * Creates a SplitMix32 random generator. Used by the randomness test suite. * - * Sourced from `bryc` at StackOverflow: https://stackoverflow.com/a/47593316/763127 + * Sourced from `bryc`: https://github.com/bryc/code/blob/master/jshash/PRNGs.md#splitmix32 + * + * Replaces the Mulberry generator, which was found to have problems * */ -const make_mulberry_rand = (a?: number | undefined) => +function gen_splitmix32(a? : number | undefined) { - () => { + if (a === undefined) { + a = new Date().getTime(); + } - if (a === undefined) { a = new Date().getTime(); } + return function() { - let t = a += 0x6D2B79F5; - t = Math.imul(t ^ t >>> 15, t | 1); - t ^= t + Math.imul(t ^ t >>> 7, t | 61); + a |= 0; + a = a + 0x9e3779b9 | 0; - return ((t ^ t >>> 14) >>> 0) / 4294967296; + var t = a ^ a >>> 16; + t = Math.imul(t, 0x21f0aaad); - }; + t = t ^ t >>> 15; + t = Math.imul(t, 0x735a2d97); + + return ((t = t ^ t >>> 15) >>> 0) / 4294967296; + + } + +} @@ -306,6 +317,7 @@ function find_repeated(arr: T[]): [T, number][] { export { + seq, unique, find_repeated, arr_uniq_p, @@ -313,6 +325,7 @@ export { weighted_rand_select, weighted_sample_select, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, - make_mulberry_rand + gen_splitmix32 + }; diff --git a/src/ts/tests/util.spec.ts b/src/ts/tests/util.spec.ts index f1d1612f..2866b925 100644 --- a/src/ts/tests/util.spec.ts +++ b/src/ts/tests/util.spec.ts @@ -3,7 +3,7 @@ import { seq, unique, find_repeated, - make_mulberry_rand, + gen_splitmix32, name_bind_prop_and_state } from '../jssm_util'; @@ -82,7 +82,7 @@ describe('seq', () => { -describe('make_mulberry_rand', () => { +describe('gen_splitmix32', () => { @@ -90,7 +90,7 @@ describe('make_mulberry_rand', () => { test(`Seed ${n} - Generates 500 numbers [0,1)`, () => { - const rnd = make_mulberry_rand(n); + const rnd = gen_splitmix32(n); let fail = false; seq(500).forEach(_ => { @@ -111,13 +111,13 @@ describe('make_mulberry_rand', () => { - const rnd = (n) => Math.floor(make_mulberry_rand( new Date().getTime()+n )() * Number.MAX_SAFE_INTEGER ); + const rnd = (n) => Math.floor(gen_splitmix32( new Date().getTime()+n )() * Number.MAX_SAFE_INTEGER ); [ rnd(0), rnd(1), rnd(2), rnd(3), rnd(4) ].map( n => test(`Seed ${n} - Generates 500 numbers [0,1)`, () => { - const rnd = make_mulberry_rand(n); + const rnd = gen_splitmix32(n); let fail = false; seq(500).forEach(_ => { @@ -140,7 +140,7 @@ describe('make_mulberry_rand', () => { test(`Seed undefined - Generates 500 numbers [0,1)`, () => { - const rnd = make_mulberry_rand(); + const rnd = gen_splitmix32(); let fail = false; seq(500).forEach(_ => { diff --git a/src/ts/version.ts b/src/ts/version.ts index d072df94..471e0c90 100644 --- a/src/ts/version.ts +++ b/src/ts/version.ts @@ -1,5 +1,5 @@ -const version : string = "5.89.3", - build_time : number = 1698256594220; +const version : string = "5.89.4", + build_time : number = 1698257988350; export { version, build_time };