The Temporal Entropy Source

Oct 6,  2022

Written by Theodore H. Smith, developer of the open source Temporal library which we use as secondary source of entropy for random location generation.

I created a library called TemporalLib, that generates random numbers. It generates numbers using the CPU's "time" instruction, and a lot of post-processing on the numbers.

"Time" is a useful physical source of randomness. Using time is similar to using a camera to collect randomness, except this will run on a camera-less server even. Which is convenient for developers.

On Intel processors, the time instruction is called RDTSC, meaning "read time-stamp counter", which is an extremely high-precision counter, running at basically the CPU's clock frequency. (The ARM equivalent is mrs x0, PMCCNTR_EL0).

So on a 4GHZ computer, RTDSC will be running at 4GHZ. However, this "time" is physical time, not the same as the CPU's instruction count, so running code like "x = x + 1", may read as having taken 1 or 2 or even 0 cycles, depending on... god knows what is happening inside the CPU.

I believe my library "quantum", because everything affects time! Let's say you had to get a bus. Your bus could be delayed by invisible aliens blocking the wheel's movement... or by a miniature black-hole anomaly... or even by casper the friendly ghost. ANYTHING affects time. But in a CPU, the quantum fluctuation of heat and voltages, dominates timings.

Let's say your consciousness (or an alien's) wants to send a signal, via the CPU. Any aliens that want to send us a message, don't need to disrupt voltages and risk causing errors like 2+2=5. They just need to delay events. This physical neutrality... makes it easier for mind-machine interaction.

My TemporalLib is a whole another way of operating your computer's CPU. Imagine tapping on your computer to make drum beats, and then recording the noise. That is what "TemporalLib" is like. Your CPU still runs code, but we look at HOW LONG the code takes to run, in great detail. Which isn't how your code normally works. It becomes more like a musical instrument. Kind of like using an encyclopedia as a drum.

...

TemporalLib is more than an engine. It is almost a laboratory.

We have a lot of "extra features", but that is how TemporalLib contains the original spirit of the project. TemporalLib has about 40 different approaches for creating randomness, and chooses the best one. Each approach is scored with five different "entropy quality tests". It also creates a batch of cool looking multi-colored pictures to visualise the output! Randonautica probably doesn't NEED to show you pictures, but they were used while testing and creating TemporalLib.

TemporalLib has a lot of extra features for developers, like performing entropy-quality tests and visualisation, on externally generated input. Some of the randonaut devs contacted me and said they really enjoyed how easy and powerful it was at testing their other RNGs, such as the Camera RNG.

TemporalLib does a lot of data-cleaning. First pre-processing. If all numbers are divisible by by X, we divide them all by X. For example, if we get the numbers 14, 7, 21, 35 in random orders, we can turn it into 2, 1, 3, 5. This loses us no data and just clarifies things.

We also take two or more data-buffers, and xor-combine them into one buffer. This halves the data produced, but also creates far higher quality output. We also do a "Von Neuman" operation, which debiases the true/false values, but again it results in a loss of data. This is OK because TemporalLib generates a huge amount of data. Simply put: 01-->0, 10-->1, and 00 and 11 are discarded. So Von Neuman will shrink the data by 4x, but it does a very good job of making sure that true/false values count for 50% each.

We also have an optional "retro-active causality" mode, which simply hashes the input, although we hash it in a special way that hopefully increases the amount of "chances" that your (or something's) consciousness has to affect the output.

TemporalLib was written specifically for the needs of Randonautica's devs. In fact, it can be used for anything needing random-numbers, especially intention-sensitive numbers. But the original impetus was "make something that they need".

I believe this approach can used for more purposes someday! Hopefully it could be used to create an artificial intelligence that can "feel your emotions". At least... someday. That is the hope. If anyone wants to support this goal please let me know.

Thats it for describing my TemporalLib. Thanks for reading the article and have a great day!