FreeBASIC's PRNG #2

General FreeBASIC programming questions.
Post Reply
dafhi
Posts: 1641
Joined: Jun 04, 2005 9:51

Re: FreeBASIC's PRNG #2

Post by dafhi »

rho i'm assuming you're using FBC 64

i switched to it, compiled MT, dropped into D:\PR64, drag-dropped onto RNG_test, got "the application was unable to start correctly .. ..007b"

trying paul's suggestion next
dafhi
Posts: 1641
Joined: Jun 04, 2005 9:51

Re: FreeBASIC's PRNG #2

Post by dafhi »

wxFBE has no problems creating an exe in the source folder.

i'm thinking the problem lies in PractRand on my system due to my limited system space. It's not an issue to me because RNG testing is not high on my list atm.

I have some pre-install win environments which I can run fbc graphical projects with. perhaps i'll try with that in the next day or so
Last edited by dafhi on Sep 17, 2018 0:56, edited 1 time in total.
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: FreeBASIC's PRNG #2

Post by deltarho[1859] »

dafhi wrote:rho i'm assuming you're using FBC 64
No.

FOLLOW INSTRUCTIONS!

I wrote 'Execute MT.exe' - I did not write drag-drop onto RNG_test.
dafhi
Posts: 1641
Joined: Jun 04, 2005 9:51

Re: FreeBASIC's PRNG #2

Post by dafhi »

console. same error message :P

program does run, cpu usage is 25% (like always) but nothing happens.

If i hit ctrl-c it says
Aborting due to runtime error 9 ("interrupted" signal) in D:\Pr64\MT.bas::()
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: FreeBASIC's PRNG #2

Post by deltarho[1859] »

dafhi wrote:console. same error message :P
program does run, cpu usage is 25% (like always) but nothing happens.
That is a contradiction.

If you got "the application was unable to start correctly .. ..007b" then the program would not run.

25%? That is less than my i7 with hyperthreading.

Compile MT.bas with full gcc optimization (-O3). If the piping is slow PractRand will hang.
dafhi
Posts: 1641
Joined: Jun 04, 2005 9:51

Re: FreeBASIC's PRNG #2

Post by dafhi »

deltarho[1859] wrote:[
program does run, cpu usage is 25% (like always) but nothing happens.
That is a contradiction.
context.
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: FreeBASIC's PRNG #2

Post by deltarho[1859] »

Nothing followed my first quote so "That is a contradiction." refers to the two quotes.

In my last code I used '*SPtr = Rnd*2^32'. If your machine is not powerful enough then it may take a while to populate the string and PractRand will hang on that.

So, either pipe a smaller string or use a generator which does not require '*2^32'.
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FreeBASIC's PRNG #2

Post by dodicat »

My little algo has passed through the 256 GB gauntlet unscathed.

Code: Select all

Microsoft Windows [Version 10.0.17134.285]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\User\Desktop\bin\random\PractRand_0.94\PractRand_094\bin\msvc12_64bit>pipefile | rng_test stdin32 -multithreade
d
RNG_test using PractRand version 0.94
RNG = RNG_stdin32, seed = unknown
test set = core, folding = standard (32 bit)

rng=RNG_stdin32, seed=unknown
length= 128 megabytes (2^27 bytes), time= 2.2 seconds
  no anomalies in 154 test result(s)

rng=RNG_stdin32, seed=unknown
length= 256 megabytes (2^28 bytes), time= 4.7 seconds
  no anomalies in 165 test result(s)

rng=RNG_stdin32, seed=unknown
length= 512 megabytes (2^29 bytes), time= 8.7 seconds
  no anomalies in 178 test result(s)

rng=RNG_stdin32, seed=unknown
length= 1 gigabyte (2^30 bytes), time= 16.3 seconds
  no anomalies in 192 test result(s)

rng=RNG_stdin32, seed=unknown
length= 2 gigabytes (2^31 bytes), time= 30.1 seconds
  no anomalies in 204 test result(s)

rng=RNG_stdin32, seed=unknown
length= 4 gigabytes (2^32 bytes), time= 56.5 seconds
  no anomalies in 216 test result(s)

rng=RNG_stdin32, seed=unknown
length= 8 gigabytes (2^33 bytes), time= 111 seconds
  no anomalies in 229 test result(s)

rng=RNG_stdin32, seed=unknown
length= 16 gigabytes (2^34 bytes), time= 217 seconds
  no anomalies in 240 test result(s)

rng=RNG_stdin32, seed=unknown
length= 32 gigabytes (2^35 bytes), time= 481 seconds
  no anomalies in 251 test result(s)

rng=RNG_stdin32, seed=unknown
length= 64 gigabytes (2^36 bytes), time= 1146 seconds
  no anomalies in 263 test result(s)

rng=RNG_stdin32, seed=unknown
length= 128 gigabytes (2^37 bytes), time= 2521 seconds
  no anomalies in 273 test result(s)

rng=RNG_stdin32, seed=unknown
length= 256 gigabytes (2^38 bytes), time= 5217 seconds
  no anomalies in 284 test result(s)

   
The pipefile was compiled fb 64 bit with no optimisations.

So that's me done with this thread.
Good luck chuckle brothers.
dafhi
Posts: 1641
Joined: Jun 04, 2005 9:51

Re: FreeBASIC's PRNG #2

Post by dafhi »

i'll update your algo :-)
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBASIC's PRNG #2

Post by paul doe »

deltarho[1859] wrote:So, either pipe a smaller string or use a generator which does not require '*2^32'.
Can PractRand be used to test doubles? I can test the 64-bit version of MSWS to death and it doesn't fail (using ulongints), while using doubles fails immediately. Couldn't find any info on this. Or I'm supposed to test the 'raw' output, as opposed to a normalized one?
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: FreeBASIC's PRNG #2

Post by deltarho[1859] »

In PractRand's RNG_usage.txt is:
Every PractRand RNG that is not designated as "raw" includes support for all of the following methods:
One of which is
//uniform random floats
float randf(); //uniform random number in [0..1)
I have tried, after stdin (not stdin32), -float randf() and -randf() both of which come up with

Code: Select all

unrecognized parameter: -float
aborting
or

Code: Select all

unrecognized parameter: -randf()
aborting
Unfortunately, Chris Doty-Humphrey, the author of PractRand, is like many authors who write amazing software but give very little information on how to use it. I had a hell of a job finding out his name. I have seen one guy use '-tf 2' and '-te 1' switches but I cannot find them in any txt file of PractRand's doc folder. '-tf 2' uses more tests and '-tf 2 -te 1' uses even more tests.

Look at the tests being done testing FB #3.

Code: Select all

rng=RNG_stdin, seed=unknown
length= 128 megabytes (2^27 bytes), time= 3.3 seconds
  no anomalies in 1081 test result(s)
It may be worthwhile going through his source files to find these switches.

BTW, the issue with PractRand hanging with a slow string fill was with V0.92. V0.94 is faster and I suspect more robust. I could not test FB's stock generators with V0.92 using '*2^32'.
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: FreeBASIC's PRNG #2

Post by deltarho[1859] »

I am currently running PractRand using 'stdin32 -tf 2 -te 1' to test MsWs. IGB 'normally' takes about 11.4 seconds. With the additional switches, it took 30.2 seconds. The question is will I still be alive if it gets to 1TB. <laugh>

Added: I got a 'FAIL !!!!!!!' at 4GB.

I am now trying those switches on PCG32II.

PCG32II has just gone past 32GB with only one lowest ranking anomaly so far.

I have read many blogs about using PractRand but none of them mentioned the -tf and -te switches. I came across them in a comment by someone on another's blog but he did not explain what they did.
Last edited by deltarho[1859] on Sep 17, 2018 7:00, edited 1 time in total.
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: FreeBASIC's PRNG #2

Post by deltarho[1859] »

I have just found mention of -tf and -te, but only a mention, in the Discussion section of PractRand at SourceForge described as extended tests. There may be issues with these switches as they are knocking the stuffing out of some generators very early on. It is tempting to say give them a wide berth but PCG32II has just gone past 64GB. It took twice as long to do that compared with not using those switches. I wonder if Melissa O'Neill knows about them. Blimey, I am using half of my 8GB of RAM and occasionally maxing out on CPU usage. I have a CPU temp at 80°C with a high-performance liquid cooler on board. -tf -te is not for everybody. <smile>

I lost my nerve and pulled out. -tf -te are not for me either. <Phew!> CPU usage is back to 0%/1%.

Image
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: FreeBASIC's PRNG #2

Post by deltarho[1859] »

I had another bash with MsWs and got past 8GB this time but it took 103 seconds to do 1GB. These switches are 'flaky' and there is no mention of them in PractRand's version.txt going back to V0.80, the initial release. Perhaps they are experimental and only a few know about them. Yep, give them a wide berth.
Post Reply