Logic Backdoors - Fast Inverse Square Function

Post Reply
User avatar
 sailboats 
Suneater
Posts: 15
Joined: Tue Dec 20, 2022 11:04 pm
Contact:

One of the limiting factors in modern technology is compute power. Supercomputers can process complex calculations very quickly. It all comes down to how fast a machine can perform an operation. Everything a computer does breaks down into math. Your computer's processor interprets any command you execute as a series of math problems. Faster processors can handle more calculations per second than slower ones, and they're also better at handling really tough calculations.

As I continue, be advised I'm speaking only about traditional compute. Quantum compute is covered here: viewtopic.php?t=10.

Because computational power is a limit to computer processing, this means it's also a limit to our general reality -- especially as AI comes into the fold. Compute power is the great filter for true AGI.

But some funny things happen when you use efficiency backdoors -- the world opens up and the filter is removed. One such example comes from the videogame Quake III Arena, which is a first-person shooter game developed in 1999.

Fast Inverse Square Root
Light and reflection computation require an inverse square root function to determine the direction of various light vectors to produce a realistic 3d effect. The problem encountered by iD software developers in 1999 was the requirement to use an inverse square root function to produce 3d renderings, counterbalanced with the lag caused by running the algorithm that makes these 3d renderings work.

In short, the algorithm to calculate photon reflection is too slow to produce life-like 3d streaming media. The geniuses as iD stumbled upon an algorithm that takes advantage of a "hack" -- a way to eliminate the complexity of the compute function for inverse square roots. This is known in computer science as the "fast inverse square root" function which takes advantage of the way memory/compute handles floating point integers.

Image
This is the original source code. Notice the comments -- the developers themselves channeled a logical backdoor that they didn't understand.

At the time, the general method to compute the inverse square root was to calculate an approximation for 1/SQ^x, then revise that approximation via another method until it came within an acceptable error range of the actual result. Common software methods in the early 1990s drew approximations from a lookup table. The key of the fast inverse square root was to directly compute an approximation by utilizing the structure of floating-point numbers, proving faster than table lookups. The algorithm was approximately four times faster than computing the square root with another method and calculating the reciprocal via floating-point division.

These logic hacks require a good understanding of ASM (assembly) and bit-level memory manipulation, 2 skills which are largely obsolete due to low-code/no-code/no-compile languages that are so popular today.

But the true wizards, the scryers -- we have this all at our fingertips. The "fast inverse square root" function was not deduced logically, but mystically. What else lies beneath the surface? What other filters can we remove?
Unfortunately, the clock is ticking, the hours are going by. The past increases, the future recedes. Possibilities decreasing, regrets mounting.
Post Reply