Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
642850d
Basic structure to try out doxygen.
codygunton Feb 7, 2023
3e0b147
Links, snippet, biblio.
codygunton Feb 14, 2023
18e38bb
Don't supply template arg to get link.
codygunton Feb 14, 2023
aea4403
Add outline from HackMD.
codygunton Feb 14, 2023
35072ee
Add function name lost in rebase.
codygunton Mar 1, 2023
f458d66
Add PlonK VIP to biblio.
codygunton Mar 9, 2023
e342cbd
Add notes to readme.
codygunton Mar 9, 2023
67cba2e
Add latex macros file.
codygunton Mar 9, 2023
f55c780
Restrict files; add sidebar; add macros.
codygunton Mar 9, 2023
1fcdd45
Hide Honk outline WIP.
codygunton Mar 9, 2023
5540597
First pass at public inputs.
codygunton Mar 9, 2023
6ba6434
First draft of outline (remove later)?
codygunton Mar 17, 2023
09e2091
Update pippenger file; how to include?
codygunton Mar 17, 2023
48e8913
Add more macros.
codygunton Mar 27, 2023
4b2b340
Add comments on Doxygen.
codygunton Mar 27, 2023
7f316d4
Tweak Doxyfile.
codygunton Mar 27, 2023
b140f7a
Make comment general & format; move rest to body.
codygunton Mar 27, 2023
d89cc70
Add some tags
codygunton Mar 27, 2023
30862f2
Fix typo.
codygunton Mar 27, 2023
c1b63c2
Naming mainpage helps sidebar.
codygunton Mar 27, 2023
d670cbd
Format comments; move some to @details.
codygunton Mar 27, 2023
26dc449
Add a glossary.
codygunton Mar 27, 2023
2557574
Wid moving some PIs doc to details.
codygunton Mar 27, 2023
9c49805
Fix compilation.
codygunton Mar 27, 2023
3994ec7
aztec/ ~> barretenberg
codygunton Apr 2, 2023
be77620
Update doxyfile and ensure equations render correctly and more readable
Apr 19, 2023
b58c5ae
wip
May 2, 2023
ad5c6e2
Merge branch 'master' into cg/doxygen
codygunton Jul 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ node_modules
.yarn/install-state.gz
ts/dest
.tsbuildinfo
.doxygen/*
doxydoc/*
.idea
cmake-build-debug
2,776 changes: 2,776 additions & 0 deletions Doxyfile

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
\page README README
## Barretenberg, an optimized elliptic curve library for the bn128 curve, and PLONK SNARK prover

**This code is highly experimental, use at your own risk!**
Expand Down Expand Up @@ -201,6 +202,71 @@ Alternatively you can build separate test binaries, e.g. honk_tests or numeric_t

A default configuration for VS Code is provided by the file [`barretenberg.code-workspace`](barretenberg.code-workspace). These settings can be overridden by placing configuration files in `.vscode/`.

### Doxygen

An alternative might be retrofitting https://www.cryptologie.net/article/553/the-code-is-the-specification-introducing-cargo-spec/ to our needs.

Installation: run boostrap_doxygen.sh.

The file ./Doxyfile is a config for doxygen. There are tons of options. For example, you can generate very cool but often uselessly huge diagrams by setting `HAVE_DOT` to `YES`.

To generate the documentation: `doxygen Doxyfile`

To browse the generated documentation, a good starting point is: ./doxydoc/html/index.html

Reference: http://web.evolbio.mpg.de/~boettcher//other/2016/creating_source_graph.html

#### Notes

All words that contain a dot (.) that is not the last character in the word are considered to be file names. If the word is indeed the name of a documented input file, a link will automatically be created to the documentation of that file.

Large delimiters (`\big(`, `\left(`, also the `cases` environment) are not natively supported.


The purpose of this documentation:
- The goal of this documentation is to be self-contained and authoritative.
- It cannot be used to record speculations or planned developments. It is documentation of what's implemented.
- It should always be accurate.
- It should use notation that facilitates the documentation being accurate.
- It should be "direct" in the sense of the reflecting the code. It should not use unnecessary abstractions or notation that that is unnatural to use in code comments.
- It should remove ambiguity rather than to add it. It is not just another HackMD document.
- It should _not depend_ on external references except for published or widely-used papers (PlonK; Honk; Bulletproofs). It should not reference things published on HackMD.
- It may _make_ external references to publicly-available sources, but that should be to resolve potential confusions that a user might face when reconciling differences between sources.


There is a global file barretenberg/spec/macros.tex that allows for using latex macros. This is convenient, it encourages standarization of notation across the repo, and it also enables changing that notation with minimal footprint in the diffs.

Grouping can be used to make pages that list classes or pages together even though they're not grouped together in the code.

Call graph and caller graph are different


"Let's repeat that, because it is often overlooked: to document global objects (functions, typedefs, enum, macros, etc), you must document the file in which they are defined. In other words, there must at least be a /*! \file */ or a ..."

`@example` could be useful. There is a special toolbar icon for examples

useful: `@attention`, `@bug`, `@deprecated` (maintains a deprecated list page), `@note`, `@anchor` + `@ref`, `@tableofcontents`, `@details`?, `@copybrief` and `@copydetails`

[@dontinclude](https://www.doxygen.nl/manual/commands.html#cmddontinclude) could possibly be useful in special situations but it's overly manual to be a reasonable general solution to stitching things together, unfortunately.

It to be relatively easy to include hand-made dot diagrams in documentation.

There is support for creating message sequence charts as in: https://www.mcternan.me.uk//mscgen/ and more general kinds of diagrams as in https://plantuml.com/state-diagram

TODO:
- Control tree view alla [SO-28938063](https://stackoverflow.com/questions/28938063/customize-treeview-in-doxygen)?
- Use `@test` tag
- Use `@todo` tag
- Use `@deprecated` tag
- Investigate warnings when using `*_impl.hpp` implementations.
- use testing namespace everywhere (e.g. in plonk composer tests) to prevent tons of useless test documentation from being created at in general namespace level like plonk

The VS Code extension oijaz.unicode-latex is convenient for parsing latex to unicode, e.g., `\gamma` to becomes `γ`, and this can make latex-heavy comments much easier to parse (`\gamma` seems to render as well as `γ`, to my surprise).

The `@details` tag is 'greedy' int the sense that it wants to include lots of data specified by other tags. As far as I can tell, the most robust strategy for putting documentation with code is to make the `@details` part of the leading code (the one coming before the class/function/whatever definiton) and then putting unwanted stuff inside the function body.

I recall seeing a way to extract parts of comments that are inside function bodies. Not sure a good application of this, though, sounds fidgety.

### Integration tests with Aztec Circuits

CI will automatically run integration tests against Aztec's circuits which live [here](https://github.com/AztecProtocol/aztec-packages/tree/master/circuits). To change which Aztec branch or commit for CI to test against, modify [`.aztec-packages-commit`](./cpp/.aztec-packages-commit).
Expand Down
17 changes: 17 additions & 0 deletions biblio.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@misc{PlonK,
author = {Ariel Gabizon and Zachary J. Williamson and Oana Ciobotaru},
title = {PLONK: Permutations over Lagrange-bases for Oecumenical Noninteractive arguments of Knowledge},
howpublished = {Cryptology ePrint Archive, Paper 2019/953},
year = {2019},
note = {\url{https://eprint.iacr.org/2019/953}},
url = {https://eprint.iacr.org/2019/953}
}

@misc{PlonKVIP,
author = {Ariel Gabizon and Zachary J. Williamson},
title = {PLONK: VIP Edition},
howpublished = {GitHub},
year = {2020},
note = {\url{https://github.com/AztecProtocol/plonk-with-lookups-private/blob/new-stuff/PLONK-VIP%20edition.pdf}},
url = {https://github.com/AztecProtocol/plonk-with-lookups-private/blob/new-stuff/PLONK-VIP%20edition.pdf}
}
9 changes: 9 additions & 0 deletions bootstrap_doxygen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -ev

curl -SL https://github.com/doxygen/doxygen/releases/download/Release_1_9_6/doxygen-1.9.6.linux.bin.tar.gz -o doxygen.bin.tar.gz
tar -xvf doxygen.bin.tar.gz && mv doxygen-1.9.6 .doxygen
rm doxygen.bin.tar.gz
export PATH=$PWD/.doxygen/bin:$PATH
doxygen cpp/Doxyfile
Loading