πFS

450 pointsposted 5 hours ago
by helterskelter

113 Comments

jamwise

3 hours ago

Reminds me of when I tried to use the library of babel as a data compression tool. It led me down a fun rabbit hole and was my first introduction to information theory.

The conclusion being that you basically need the same amount of data to represent the address of your data as the data itself, so it's not really effective at compression, just a fun thought experiment.

The cool part of this in modern times is that LLMs are basically a form of lossy compression that actually achieves the gist of what these tools fail at. Although it is lossy, and requires a massive substrate. This is related to the idea of AI/LLMs being a form of language compression.

quirino

an hour ago

3Blue1Brown just released a viduo about this Intelligence-Compression connection.

https://youtu.be/l6DKRf-fAAM

jamwise

an hour ago

The idea was fresh in my mind because I watched this yesterday. Great video, the illustrations and intuition-building of the compressability of information was so good! I'm so grateful for 3Blue1Brown.

janalsncm

19 minutes ago

The level of compression is pretty impressive when you think about it. I wrote a comment a while back which is still true (although bytes should be bits, so in that sense it’s still wrong): https://news.ycombinator.com/item?id=39559969

Back of the envelope calculation for storing valid 4-grams (sequences of four words) is around 10 billion x 14 bits per word = 17 gb for all 10 billion. There are LLMs 100x smaller which can write coherent prose.

ainch

an hour ago

In some sense, science is the most extreme form of compression - Newtonian mechanics explains an incredible number of phenomena in a few lines of text.

emptyroads

2 hours ago

Reminds me of nsafs, the National Security Agency Filesystem ("free" because the government pays for it) - https://github.com/freedomtools/nsafs

dekhn

an hour ago

I once interviewed for a company and the interviewer was telling me how he (a vc) funded a project to generate large streams of random numbers; you would select an index at random, share that private key with somebody, and then the subsequent text could be used as a one-time-pad. NSA would be forced to buffer/save the entire stream, which could be generated at GB/sec, if they wanted to decrypt.

It didn't seem very practical.

helterskelter

39 minutes ago

I wonder if we could mess with NSA-style surveillance by having a good chunk of the population streaming lots of random data over the internet. Essentially, Alice piping her /dev/random to Bob's /dev/null over netcat or something. Make a slick looking app that does it 24/7 in the background using excess bandwidth and tell people it sticks it to the NSA.

Spy agencies would not only have to store it all in case it was something valuable, but at some point they may try to crack it because it's indistinguishable from encrypted data and waste resources on it. If enough people did it, total web surveillance could become impractical.

adzm

3 hours ago

It is worth noting that as the length of data increases it becomes extremely unlikely that the index and length of the sequence within pi would actually be smaller than the data.

jastr

30 minutes ago

Back in college, I thought I could compress my phone number by telling people its index in pi, but my 7 digit phone number is at an 8 digit index.

I didn’t have the compute to find my 10 digit number with the area code.

hatthew

an hour ago

TFA addresses this

> Now, we all know that it can take a while to find a long sequence of digits in π, so for practical reasons, we should break the files up into smaller chunks that can be more readily found.

> In this implementation, to maximise performance, we consider each individual byte of the file separately, and look it up in π.

ithkuil

8 minutes ago

Why stop at bytes? Let's split it in individual bits and then look up the bits in pi!

But Pi's binary expansion is not very practical for this purpose, since it's 11.0010...

OTOH. e is 10.1011...

Let's stick to fractional digits (the ones right of the binary point) at index 0 we have 1 and at index 1 we have 0.

So, to encode a stream of bytes so that each bit is encoded as the index of that bit in the e, all you need to do is to xor it with 0xFF

mondrian

3 hours ago

The index of your 20 line file is <20TB number>

russfink

an hour ago

Unless, in turn, you locate the index itself in pi at a much smaller index. And so on...

Find k candidate indices for your data, then locate each of them. If the smallest one is a significantly smaller index space, repeat.

akoboldfrying

28 minutes ago

Can't tell if you're in on the joke or not, but for anyone who is genuinely wondering whether this might work: Consider that there are at most 256 different indexes that could be represented by a 1-byte index value, but if you're trying to store 9 bits of data, there are already 512 different possible things it could be that each need to be represented by a different index value, otherwise you won't be able to tell them apart. Those pigeons aren't gonna fit.

12_throw_away

3 hours ago

yes I believe that's the joke

jwpapi

3 hours ago

He’s aware, he just added some curious information.

liamYC

an hour ago

Point taken about the index potentially being really long. Why would the length be longer than the data? Don’t you need to find the right sequence?

dang

3 hours ago

Related. Others?

πfs – A data-free filesystem - https://news.ycombinator.com/item?id=36357466 - June 2023 (107 comments)

πfs – A data-free filesystem - https://news.ycombinator.com/item?id=28699499 - Sept 2021 (30 comments)

PiFS – The Data-Free Filesystem - https://news.ycombinator.com/item?id=26208704 - Feb 2021 (1 comment)

Πfs: Never worry about data again - https://news.ycombinator.com/item?id=21359338 - Oct 2019 (1 comment)

The π Filesystem for FUSE: Store Your Data in π - https://news.ycombinator.com/item?id=19223032 - Feb 2019 (1 comment)

pifs - Avoid disk space usage by saving your files in the digits of Pi - https://news.ycombinator.com/item?id=18687275 - Dec 2018 (1 comment)

πfs – A data-free filesystem - https://news.ycombinator.com/item?id=13869691 - March 2017 (105 comments)

Πfs: Stores your data in π - https://news.ycombinator.com/item?id=10856108 - Jan 2016 (1 comment)

Πfs: Never worry about data again - https://news.ycombinator.com/item?id=10847693 - Jan 2016 (1 comment)

File system that stores location of file in Pi - https://news.ycombinator.com/item?id=8018818 - July 2014 (98 comments)

100% Compression Using Pi - https://news.ycombinator.com/item?id=6698852 - Nov 2013 (32 comments)

(Reposts are fine after a year or so; links to past threads are just to satisfy extra-curious readers)

Levitating

3 hours ago

How are you generating these lists

programjames

3 hours ago

If you click the website's name to the right of the title, it pulls up all the submissions from the same site:

https://news.ycombinator.com/from?site=github.com/philipl

Levitating

3 hours ago

Even then I don't see a direct way to extract a list like this.

ChrisMarshallNY

2 hours ago

I think it's safe to assume that dang has access to tools that we mortals are unable to comprehend, without being driven to madness.

lukan

2 hours ago

For this use case, of finding related threads, I thought he wrote not special tools, but rather uses just

https://hn.algolia.com/

Levitating

2 hours ago

Even using algolia, I don't see a way to generate a list in this exact format.

I think ChrisMarshallNY is right, dang has access to eldritch powers.

jwpapi

3 hours ago

He’s the mod hero from HN

layer8

26 minutes ago

> In this implementation, to maximise performance, we consider each individual byte of the file separately, and look it up in π.

Considering each individual bit separately would be even more performant: you only need the indexes 2 and 33, and there is an efficient mapping of those to the bits in storage.

MisterTea

3 hours ago

ndiddy

an hour ago

I looked into this a bit a while ago, what Sloot did was at least a bit novel. Basically the way his encoding scheme actually worked was that it would store each line of video into a database, encode each video frame as a series of line lookups, and then store that encoded frame into another database. Then each video is a series of frame lookups. When you hear accounts of him being able to demo smooth playback of 16 videos at once on late 90s hardware, this is how he did it. Because each frame is a series of line lookups, splitting the screen horizontally 16 times and playing 16 videos at once is not any more taxing than playing a single video fullscreen. Similarly, he was able to fast-forward and rewind smoothly because each frame is individually decoded, it's not like traditional video compression where you have to calculate differences from each keyframe. Playing at 2x speed was not any more taxing than 1x speed. Of course he never would have been able to store a video file in 8KB or whatever, but this meant that (for example) if you had a whole season of a TV show in your database, the opening and ending credits would only be stored once.

Levitating

2 hours ago

> The SDCS is only possible if keys are allowed to become infinite, or the data store is allowed to become infinite (...) This would, of course, make the idea useless.

But Pi is infinite. And thus this genius contraption will work as long as we have Moore's law on our side :)

beng-nl

2 hours ago

I have very fond memories of reading that book.

giancarlostoro

3 hours ago

Never heard of that one, that's amazing! Love it.

windward

an hour ago

>One of the properties that π is conjectured to have is that it is normal

conjectured

Glad to see one of my pet points of pedantry come up. No non-constructed irrational number has never been proven to be normal or disjunctive.

oofbey

an hour ago

That’s a lot of negatives!

mikestew

an hour ago

One of which probably needs to go away.

bobim

4 hours ago

This is disturbing to realize that pi then contains all the past and future knowledge, including when I'll pass away.

mike_hock

3 hours ago

So does every other random infinite sequence of bits. The unintuitive part comes from infinity, not pi.

It also doesn't contain all past and future knowledge because it also contains all possible falsehoods about the past and future in a way that's indiscernible from the truth.

Encoding information as an offset into a pseudorandom sequence is no more storage efficient than storing the information directly.

smaudet

10 minutes ago

Keyword is conjectured.

Infinities of random sequences exist that can be shown not to contain all data, 0-8 (base 10) is one such random sequence that is trivially proven to never contain 9...

There are no known patterns to pi, but, (I am legitimately curious about this), are there any known sequences e.g. of 1 million 0s and a single other digit within the decimal sequence of pi?

Given how it (pi) looks, I'm of the strong suspicion is that the answer is "no". But of course, proving that requires that some property of the randomness is provable. Which it does feel as if, given there are different infinities, there are also different randomnesses, hence the conjecture is ill-formed and probably incorrect...

sph

3 hours ago

Are you aware this is meant as a joke, right?

LoganDark

2 hours ago

Jokes can be educational too.

nosioptar

3 hours ago

The worst part is that it contains Star Wars 4-6 from an alternate timeline where Disney did a reboot casting Chris Pratt as Han Solo.

(Fun fact: "Chrispratt" is an ancient Californian word that means "Joel McHale didn't want the role.")

Yokohiii

2 hours ago

Around here it just means chrisp ratt.

1attice

3 hours ago

Thank you for this Prattfall

layer8

23 minutes ago

It also contains all past and future fake news, and you don’t know which is which.

Yokohiii

2 hours ago

The person who starts reading ahead into pi will always gets the freshest numbers.

Perfect crypto!

xp84

2 hours ago

If it makes you feel better, consider that it also contains all plausible and implausible falsehoods about your demise as well.

cadamsdotcom

3 hours ago

Fear not! It’s probably so deep in pi that you’d pass away listening to someone tell you where!

OkayPhysicist

3 hours ago

So does a calendar, if you you buy them enough years in advance.

nighthawk454

3 hours ago

And also all the days you don’t, so, by itself not very meaningful. Especially since you can’t tell which one is right in advance. In some sense, so does a calendar

thih9

3 hours ago

It also contains all possible falsehoods and comes with no way to distinguish what's true from what isn't.

vadansky

2 hours ago

But enough about LLMs

koolala

3 hours ago

It isn't actually proven true.

anthonj

3 hours ago

So does a random number generator

aidenn0

3 hours ago

I vaguely remember an entry to a compression-benchmark that gamed the benchmark by treating the filename as part of the input to the decompression-algorithm, thus beating the metric that only measured the size of the file.

keithnz

24 minutes ago

isn't this relying on properties that aren't proven about pi? it needs to be disjunctive or normal, and neither of those are proven

partsch

4 hours ago

Finally, someone is doing something about the rising prices of storage!

bilsbie

an hour ago

I’d guess even the index in pi for my phone number would be more digits than the phone number.

So not really a compression scheme.

thangalin

3 hours ago

https://cs.stackexchange.com/a/53737/1704

> Matches that occur early enough in π to attain significant compression will not be varied. That is, it isn't possible to use π to compress interesting, real-world data because real-word strings are unlikely to arise early.

Levitating

3 hours ago

> Since the file is 128 bits long, one would expect this place to be around the 2*128th bit.

> Calculate the number of bits to encode that value using log2(938933556), which is ~29.8

Can someone explain these two statements to me?

csunoser

2 hours ago

for > Calculate the number of bits to encode that value using log2(938933556), which is ~29.8

This is roughly same as saying: "If you rewrite 938933556 as a binary number / usize, it will need 30 bits".

Sanity check: 1101111111|0110111111|0100110100 (| delimits every 10 bigits).

> Since the file is 128 bits long, one would expect this place to be around the 2*128th bit.

This statement is a bit more subtle. As a first ord approximation, we can see pi sort of as a RNG.

If we write pi (ignore the decimal point), as a binary number, we get: 11011001111111011110010101011110001010101111101101110001001100001...

You can... kind of squint and pretend this is a random sequence of 1s and 0s.

Now, if you had a file that is 128 bits (so lots of intermingling 0s and 1s), and each next digit of pi is effectively a coin flip. Pretend 1s are heads, and 0s are tails. You basically have to get the exact 128 consecutive coin flips of the same result as your file to get your file back.

Imagine now, PI not as a number, but a sequence of experiments of flipping the coin 128 times.

  - (11011..01000)(10000...00100)....
  - ^attempt 1     ^attempt 2
You have to try, on expectation, quite a few times to win this game! Now, you could easily get lucky for sure. But on average, your chance of winning per attempt is roughly 0.5^128! So, how many times do you have to try to win this game? Something like 2^128 times - and you have to consider that each attempt uses 128 bits as well. So more like 2^135. But you don't have to start fresh in each attempt, you can see it as like this:

  - 11011................00100...
  - (       128 flips     )
  -  (  another 128        )
  -   (                     )
  -     ... so on and so on
That's where the 2^128 number came from.

giancarlostoro

3 hours ago

I... I can't tell if this is an elaborate troll or pure genius. I love it.

z3t4

an hour ago

Someone should make a service "where in the pi am I" then you could use it as a short link. Then there will be hardware accelerated pi chips. All computers will come with pi preinstalled.

koolala

3 hours ago

Short Storage Number - SSN

0x123456789ABCDEF0

use this number as a shorter nibble storage alternative...

chris_sn

an hour ago

Funnily enough I’m reading Service Model and just got to the bit in the Library Archive, which has a very similar vibe to this project. Love it

woah

an hour ago

I've simplified it and made it more flexible

3._1_415926535897932384626433832795_0_288419716939

actusual

2 hours ago

This is why I got pi tattooed. It's a tattoo of all tattoos.

dekhn

an hour ago

yes, but can you get a tattoo of all tattoos that do not contain themself?

hnlmorg

3 hours ago

This is probably a dumb question, but do we actually know that pi has an infinite number of decimal digits or are we assuming that it does because we haven’t developed a sufficiently powerful computer to calculate the last digit of pi?

I’m guessing this is something that could be formally proven?

hasteg

3 hours ago

Here is a one page proof that pi is irrational - https://heuklyd.github.io/papers/pdf/Niven-1947.pdf

partsch

3 hours ago

Thanks for the PDF. I feel like I understand even less now than I did before.

hnlmorg

3 hours ago

Thanks for sharing. That’s a nice read. I’m glad I asked :)

stackghost

3 hours ago

It's amazing how inscrutable calculus can be when you return to reading it after not doing so for a period of time, much like lisp or forth. I don't think I've actually done an integral or taken a derivative in years. I can see the elegance of that proof but I'll be damned if I can actually follow the mathematics from one step to the next.

mike_hock

3 hours ago

We definitely know that Pi is irrational, we just don't know if it's normal (i.e. if the PiFS joke even works).

pixel_popping

3 hours ago

Well, that should get GPT-5.5 extended thinking going for a few weeks.

adzm

3 hours ago

I'm intrigued that π was capitalized to Π presumably automatically in the HN headline.

cbm-vic-20

3 hours ago

    jshell> "πfs".toUpperCase()
    $1 ==> "ΠFS"

    Welcome to Node.js v26.3.0.
    Type ".help" for more information.
    > "πfs".toUpperCase()
    'ΠFS'

    Python 3.14.5 (main, May 10 2026, 10:21:34) [Clang 21.0.0 (clang-2100.0.123.102)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> "πfs".upper()
    'ΠFS'

    echo 'πfs' | awk '{print toupper($0)}'
    ΠFS

noman-land

3 hours ago

Why does your Python terminal report May 10th? Today is June 10th.

atvrager

2 hours ago

It's the build date of their Python binary

Yokohiii

2 hours ago

He prepared the comment a month ago.

danlitt

2 hours ago

Probably daylight savings

amluto

3 hours ago

> Why is this thing so slow? It took me five minutes to store a 400 line text file!

> Well, this is just an initial prototype, and don't worry, there's always Moore's law!

Seriously? They're only storing individual bytes in pi:

> In this implementation, to maximise performance, we consider each individual byte of the file separately, and look it up in π.

So the whole transformation should be trivially reducible to a 256-element lookup table from source byte to location in pi and a similar table used to convert back the other way. Maybe a fancy formula could be used for the (never actually encountered) case in which a byte is encoded by one of the infinite available noncanonical encodings.

glitchc

3 hours ago

At what point is the metadata larger than the actual file?

wavemode

3 hours ago

Part of the joke is that, in this implementation, the metadata is guaranteed to be larger than the file:

> Now, we all know that it can take a while to find a long sequence of digits in π, so for practical reasons, we should break the files up into smaller chunks that can be more readily found.

> In this implementation, to maximise performance, we consider each individual byte of the file separately, and look it up in π.

mike_hock

3 hours ago

Half the time it should be larger, right?

anon291

2 hours ago

It is actually not proven that the decimal expansion (or any rational base expansion) of pi contains all possible sequences of numbers. It sounds like it intuitively would be since the expansion is infinite, but it is not necessarily true. For example, the number 0.101001... (i.e., decimal formed by concatenating N zeros and then 1 for all N 0 to infinity) is infinite, never-ending, and irrational but does not contain every sequence of numbers.

j3th9n

3 hours ago

Why would anyone need πfs, since you can already build such a system yourself quite trivially on Linux.

leephillips

3 hours ago

What a brilliant idea! Of course, of course, it’s not in the repository so I can’t apt-get install it. Debian...always so far behind.

mzelling

2 hours ago

Looked at the repo but it says NOTHING about what value this project offers.

I mean, I get that it's "fun" to store information within the digits of pi. But is this just amusement, or is there a value prop for production use here?

(Speaking as a math major, by the way. I'm sympathetic to the cause.)

windward

an hour ago

It's a(n IMO weak) argument raised when discussing illegal files/numbers.

This project makes clear the counter-argument: the input that gets you the file out of π is a badly compressed version of the file.

tcoff91

2 hours ago

I think it's pretty clearly for amusement. And it would kind of spoil the amusement if it were to explicitly mention that it's a joke...

spchampion2

2 hours ago

This is interesting, but I feel like my use cases would better align with a different irrational number. Could I get an option to do this with e instead? /s