unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ilmu <ilmu@rishi.is>
To: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Deep vs Shallow trace: Removing the tradeoff?
Date: Sat, 27 Mar 2021 16:56:08 +0000	[thread overview]
Message-ID: <Aq4aNuQHEv6zOZ8Z7GEwMR6FrWKQ0Pf7k13E-ofGQImdcAgNBeuCvywYruW0cu7uYAUM8sngwrYl6HJ6OLYNhd-_tlSYfGSlZwZBKy1qy6w=@rishi.is> (raw)

Hi,

I had this idea while reading about authenticated datastructures, I would be very thankful if you could tell me why it doesn't work.

Bear in mind the following disclaimer as you read this:

My experience with these things is mostly theoretical, I have never used Bazel and although I was a user of Nix and am now moving to Guix I have not contributed to nixpkgs and only written simple expressions.

Without further ado.


The premise I am assuming is the framework introduced in Build Systems a la Carte. They talk about Bazel and Nix as representatives of two different dependency tracing strategies:

- Shallow tracing :: You hash immediate dependencies.
- Deep tracing :: You hash the whole transitive closure.

Now the tradeoff is basically the following:

- In Nix when you put a comment in curl you need to rebuild every single package in nixpkgs because they more or less all depend on curl in one way or another and therefore the curl source is in the transitive closure for almost every package.
- In Bazel when you put a comment in curl then the direct dependents need to be rebuilt but if they are the same as before after being rebuilt then the propagation is killed and nothing else needs to change.

However, in Bazel you will need to traverse the whole dependency tree all of the time to verify that everything is as it should be.


Now the idea I have is very simple:

We use recursive zero knowledge proofs with shallow traces, the rzkp caches the traversal and provides the same guarantee as the deep traces do (transitive closure is verified to be as it should be). Now if someone puts a comment in curl there is a small amount of packages that need to be rebuilt and then we redo only the proofs all the way up. This way we save ourselves a potentially massive amount of compilation.

As I said before I do not have much experience with the real implementations of these ideas so I am sure this is not as simple as it is in my head. However the distri experimental operating system (which implements a similar model to guix and nixos) does not put the hash in the store path but rather keeps a small metadata file for each path and then has a natural number suffix for the path of concurrent versions of the same package. This gives a better UX imho and is probably also easier to extend with more appropriate authenticated datastructures as they are discovered.


I hope I am not a raving madman and that this actually makes at least a slight amount of sense. Very much looking forward to takedowns :)


Kind regards,
- Ilmu



             reply	other threads:[~2021-03-27 18:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27 16:56 ilmu [this message]
2021-03-28  0:50 ` Deep vs Shallow trace: Removing the tradeoff? Julien Lepiller
2021-03-28 23:16   ` ilmu
2021-03-30 10:46     ` Ludovic Courtès
2021-03-30 20:20     ` Bengt Richter
2021-04-02 15:45       ` ilmu
2021-04-17 15:05         ` Ludovic Courtès
2021-04-18  5:51           ` ilmu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='Aq4aNuQHEv6zOZ8Z7GEwMR6FrWKQ0Pf7k13E-ofGQImdcAgNBeuCvywYruW0cu7uYAUM8sngwrYl6HJ6OLYNhd-_tlSYfGSlZwZBKy1qy6w=@rishi.is' \
    --to=ilmu@rishi.is \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).