Commit 380759e3 authored by Raymond Toy's avatar Raymond Toy

Restore ability to compile in mt19937 rng.

- src/tools/worldbuild.lisp
    - only compile rand-xoroshiro if :random-xoroshiro is a feature
- src/tools/worldload.lisp
    - only load rand-xoroshiro if :random-xoroshiro is a feature
- tests/rng.lisp
    - Add a quick test that the state vector of the *random-state* has
      the correct type.
parent 99eb4311
Pipeline #276 passed with stage
in 9 minutes and 56 seconds
......@@ -127,7 +127,6 @@
'("target:code/rand-xoroshiro"))
(t
'("target:code/rand")))
"target:code/rand-xoroshiro"
"target:code/alieneval"
"target:code/c-call"
"target:code/sap"
......
......@@ -102,7 +102,6 @@
(maybe-byte-load "code:rand-xoroshiro")
#-(or random-mt19937 random-xoroshiro)
(maybe-byte-load "code:rand")
(maybe-byte-load "code:rand-xoroshiro")
(maybe-byte-load "target:pcl/walk")
(maybe-byte-load "code:fwrappers")
(maybe-byte-load "code:ntrace")
......
......@@ -20,6 +20,13 @@
(defvar *test-state*)
(define-test rng.state
(let ((s (kernel::random-state-state *random-state*)))
#+random-xoroshiro
(assert-true (typep s '(simple-array double-float (2))))
#+random-mt19937
(assert-true (typep s '(simple-array (unsigned-byte 32) (627))))))
#+random-xoroshiro
(define-test rng.initial-state
(setf *test-state*
......@@ -56,6 +63,7 @@
(assert-equal value (64-bit-value *test-state*))
(assert-equal state (multiple-value-list (64-bit-rng-state *test-state*))))))
#+random-xoroshiro
(define-test rng.jump
(setf *test-state*
(kernel::make-random-object :state (kernel::init-random-state #x12345678)
......@@ -68,3 +76,4 @@
(kernel:random-state-jump *test-state*)
(assert-equal result (multiple-value-list
(64-bit-rng-state *test-state*)))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment