Damus
Fabio Manganiello profile picture
Fabio Manganiello
@Fabio Manganiello
πfs is the most efficient (when it comes to data storage) filesystem that you’ll ever find.

In fact, it compresses information so much that any file, no matter its size, will occupy the same amount of disk space. Even if it’s many GBs in size.

It achieves such a feat by using the digits of π (yes, the mathematical constant) to store your files.

If your reaction is “huh? how can I store my files inside of an irrational number?”, you’re not the only one.

One of the most interesting conjectures about π (first proposed in 2001) is that its binary representation is normal.

Or, in other words, its binary representation will contain any possible subset of finite bit strings.

Your illegal MP4 rip of Titanic? Yup, it’s just a finite string of binary digits hidden somewhere in π.

As long as you know the index inside of π of the substring that represents the content of your file and its length, you can use the BPP formula to extract the actual file content from the trascendental digits of π.

The only requirement to run the filesystem is to have a simple metadata directory which, for each file, contains its name, its length and its index inside of π.

> DATA="$HOME/pifs/data"
> META="$HOME/pifs/meta"
> mkdir -p "$DATA" "$META"
> πfs -o mdd="$META" "$DATA"
> echo "This is a test" > "$DATA/test.txt"
> cat "$DATA/test.txt"
This is a test
> ls -lh "$META"
total 4.0K
-rw-r--r-- 1 fabio fabio 30 Jun 11 16:41 test.txt

NOTE: DON’T USE IN PRODUCTION

I intentionally said that πfs is the most efficient filesystem when it comes to data storage.

This is an interesting application of a mathematical conjecture when it comes to extreme data compression, but it’s still mostly a mathematical gimmick and proof-of-concept.

The price you don’t pay on the data storage side is paid on the CPU and memory side.

The bigger the file, the more expensive it is for the algorithm to find a sequence of digits in π that matches its content. And the more memory it takes to store intermediate results.

It can work fine for small text files, but it can become embarrassingly slow as the file size increases (it took an hour to copy a 23 KB PNG image).

Using the Spigot algorithm could probably enhance things though, as it allows to extract a generic set of digits from a trascendental number by minimizing the knowledge required about the previous digits.
1
SpaceLifeForm · 3w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqkqtz67nqte53u3n95lgqrezrunnccfp4wfr52fuyf2he3ayaj5tq8xvkpw it is funny. Where is the e version?