Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reducing some dependencies from the compiler into ulib #2883

Merged
merged 12 commits into from
Apr 20, 2023
Merged

Conversation

mtzguido
Copy link
Member

From the commit message:

Machine integers in the F* library depend on several modules, such as
Math.Lemmas, BitVector, Calc, etc, which in turn bring in dependencies
to many more.

Since the compiler sources mention these modules, we are bringing in
thees dependencies. The main reason the compiler uses these modules is
to use UInt32, which is the representation for characters in F*.

However, we do not really need any fact about them, we only need to use
the type and some extremely basic operations such as going to and from
int.

So, to fix this, we play a dependency analysis trick by introducing some
rather empty modules in src/basic/boot, which take priority in the
dependency analysis, and effectively hide the ones in ulib/ and their
dependencies. This reduces the dependency graph considerably.

This PR also adds a rule to easily obtain a PDF of the dependency graph of the compiler. Here's before and after (maybe not a "considerable" reduction come to think of it :) )

depgraph_old.pdf
depgraph_new.pdf

This also saves about a minute of (sequential) bootstrapping time.

@nikswamy
Copy link
Collaborator

This looks great, Guido ... thanks!

I've kicked an everest build as well (on everest branch nik_wf) just to check that we don't have anyone relying on BaseTypes in HACL etc.

If it all comes back green, please merge

@mtzguido
Copy link
Member Author

I've kicked an everest build as well

oops, good point! I now see everparse uses it. Feel free to kill that build as I make a PR for it.

@mtzguido
Copy link
Member Author

Got a local green, merging.

@mtzguido mtzguido merged commit 3c372b2 into master Apr 20, 2023
@mtzguido mtzguido deleted the guido_deps branch April 20, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants