Live data from Hacker News

Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

salsa.debian.org

21–30 of 33 posts

Re: Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

#21
post #5

Sorry for plugging in. NixOS has a plan to use DisorderFS in making 100% reproducible build. https://r13y.com/ As I understand it, currently several packages are not reproducible (like, python, pytest, gcc), so it is not priority, but when those large packages will be done, r13y will start using DisorderFS to uncover remaining reproducibility bugs. This is too idealistic, but gives lots of pleasure about package spac…

Strictly speaking, this is nothing new. Debian has been doing it for 5 years.

https://reproducible-builds.org/citests/

All distros there are essentially reproducible fuzzing CI systems that introduces determinism through disorderfs, lang changes and so on. These changes are fine to fix but nothing you'd normally get when reproducing packages for a distribution.

Personally the important part is if the patches are upstreamed or not. This isn't something that is a priority among distribution.

Results from a fuzzing in Arch:

https://tests.reproducible-builds.org/archlinux/archlinux.ht...

Results from just chroot recreation:

https://reproducible.archlinux.org

Re: Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

#22
post #15
post #6

Earlier quoted context omitted.

Instead of introducing non-determinism, shouldn't it instead try to enforce determinism in any possible way? (E.g. running all processes under ptrace or by using virtualization and thereby making the OS behave in a deterministic way during a build).

> shouldn't it instead try to enforce determinism in any possible way That would only fix the build machine's problem, it wouldn't fix anyone else's builds. A repeatable build without determinism is a fix for all people everywhere.

> That would only fix the build machine's problem, it wouldn't fix anyone else's builds.

It would fix everyone else's builds if they added determinism in their builds (as opposed to adding non-determinism in the test-procedure). Besides, a test-procedure never gives a guarantee because a bug depending on non-determinism can be subtle.

Re: Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

#23
post #20
post #14

Earlier quoted context omitted.

You use disorderfs as part of a CI process. The CI builds the package once without disorderfs, and once with disorderfs. If they produce the same output, the package is reproducible (at least with respect to filesystem order). Otherwise, something in the build process is depending on filesystem order and should be fixed to sort directory entries before using them. You wouldn't use disorderfs when building a package n…

I think you need to build many times to be sure. Therefore (the original question), instead of using "disorderfs", why not write and use an "orderedfs" for every build?

Because doing it that way will make building (and verifying) a deterministic build more difficult for users, while forcing the builds to be deterministic in the face of randomised non-determinism means that anyone can build the project and get the same output without needing any complicated build configuration. That end goal (all builds are deterministic even if you don't have some magical reproducible build machine) is the holy grail of reproducible builds.

And since this is run as part of a CI process, you will get lots of builds over time and will root out all sorts of issues caused by non-determinism.

Re: Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

#24
post #20
post #14

Earlier quoted context omitted.

You use disorderfs as part of a CI process. The CI builds the package once without disorderfs, and once with disorderfs. If they produce the same output, the package is reproducible (at least with respect to filesystem order). Otherwise, something in the build process is depending on filesystem order and should be fixed to sort directory entries before using them. You wouldn't use disorderfs when building a package n…

I think you need to build many times to be sure. Therefore (the original question), instead of using "disorderfs", why not write and use an "orderedfs" for every build?

The original behavior of disorderfs was to randomly shuffle directory entries, but we quickly realized that this meant that sometimes the shuffle wouldn't do anything, so I changed the default behavior to simply reverse the directory entries instead. Therefore, you only have to build twice. (Ironically, disorderfs' "non-determinism" is actually deterministic.)

As to your original question, there are so many sources of nondeterminism that trying to emulate them all away would make builds more complicated, less performant (FUSE adds overhead), and less safe (since there would be more components that could potentially be backdoored).

Re: Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

#25

From the headline, I was picturing EXIF tags, which would be pretty amusing. Store your photos at this mountpoint here, read 'em from that mountpoint over there, and their locations and camera details get anonymized. But the real data still lives on disk. Alas that's not what this is about, but now I wonder how hard it would be to make the thing I had in my head.

Not too hard. You should build it !

Re: Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

#26
post #22
post #15

Earlier quoted context omitted.

> shouldn't it instead try to enforce determinism in any possible way That would only fix the build machine's problem, it wouldn't fix anyone else's builds. A repeatable build without determinism is a fix for all people everywhere.

> That would only fix the build machine's problem, it wouldn't fix anyone else's builds. It would fix everyone else's builds if they added determinism in their builds (as opposed to adding non-determinism in the test-procedure). Besides, a test-procedure never gives a guarantee because a bug depending on non-determinism can be subtle.

> a bug depending on non-determinism can be subtle.

That's the point - to uncover bugs dependent on nondeterminism by using a filesystem that introduces it. This is for fuzz testing at the filesystem level, not literally reproducing the builds correctly multiple times.

From the linked README:

"This is useful for detecting non-determinism in the build process."

Re: Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

#27
post #6
post #5

Sorry for plugging in. NixOS has a plan to use DisorderFS in making 100% reproducible build. https://r13y.com/ As I understand it, currently several packages are not reproducible (like, python, pytest, gcc), so it is not priority, but when those large packages will be done, r13y will start using DisorderFS to uncover remaining reproducibility bugs. This is too idealistic, but gives lots of pleasure about package spac…

Instead of introducing non-determinism, shouldn't it instead try to enforce determinism in any possible way? (E.g. running all processes under ptrace or by using virtualization and thereby making the OS behave in a deterministic way during a build).

[deleted]

Re: Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

#28
post #20
post #14

Earlier quoted context omitted.

You use disorderfs as part of a CI process. The CI builds the package once without disorderfs, and once with disorderfs. If they produce the same output, the package is reproducible (at least with respect to filesystem order). Otherwise, something in the build process is depending on filesystem order and should be fixed to sort directory entries before using them. You wouldn't use disorderfs when building a package n…

I think you need to build many times to be sure. Therefore (the original question), instead of using "disorderfs", why not write and use an "orderedfs" for every build?

Because then your software is relying on guarantees not provided by the POSIX API and it would be incorrect.

Re: Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

#29

From the headline, I was picturing EXIF tags, which would be pretty amusing. Store your photos at this mountpoint here, read 'em from that mountpoint over there, and their locations and camera details get anonymized. But the real data still lives on disk. Alas that's not what this is about, but now I wonder how hard it would be to make the thing I had in my head.

A FUSE mount, or even a webdav virtual directory hierarchy, wouldn't be that tricky. Stripping metadata is trivial, thanks to ExifTool.

Re: Disorderfs: FUSE-based filesystem that introduces non-determinism into metadata

#30
post #10

Earlier quoted context omitted.

The goal is to ensure that builds can be deterministic despite non-determinism. Once such criterion is enforced, then everybody can reproduce the build with that set of source files and build instructions, without requiring a special environment that forces a specific order of events.

> The goal is to ensure that builds can be deterministic despite non-determinism ...by using non-determinism? Very mind bending for me, I'm not sure I understand, but I'm glad smart people are figuring this stuff out.

Repro build folks are introducing variation in the build environment (inc with disorderfs) in order to uncover reproducibility bugs and then fix them. Here are the variations Debian is introducing:

https://tests.reproducible-builds.org/debian/index_variation...

It is similar to how Chaos Monkey increases the resilience of Netflix's service by introducing random failures and then for each of those failures working out how to prevent the failure from affecting the overall status of the service.

Post reply on HN