[Git][cmucl/cmucl][master] Restore ability to compile in mt19937 rng.

Raymond Toy rtoy at common-lisp.net
Sun Jan 28 05:59:35 UTC 2018


Raymond Toy pushed to branch master at cmucl / cmucl


Commits:
380759e3 by Raymond Toy at 2018-01-27T21:59:25-08:00
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.

- - - - -


3 changed files:

- src/tools/worldbuild.lisp
- src/tools/worldload.lisp
- tests/rng.lisp


Changes:

=====================================
src/tools/worldbuild.lisp
=====================================
--- a/src/tools/worldbuild.lisp
+++ b/src/tools/worldbuild.lisp
@@ -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"


=====================================
src/tools/worldload.lisp
=====================================
--- a/src/tools/worldload.lisp
+++ b/src/tools/worldload.lisp
@@ -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")


=====================================
tests/rng.lisp
=====================================
--- a/tests/rng.lisp
+++ b/tests/rng.lisp
@@ -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*)))))
+



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/380759e3d91a1d6517a2025452df594a47e25a68

---
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/380759e3d91a1d6517a2025452df594a47e25a68
You're receiving this email because of your account on gitlab.common-lisp.net.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20180128/e35dba0f/attachment-0001.html>


More information about the cmucl-cvs mailing list