/ docs / ROADMAP.md
ROADMAP.md
 1  # Groth.jl Roadmap
 2  
 3  This roadmap consolidates the previous planning notes (CODEX roadmap, polishing
 4  plan, coset status, TODO) into a single reference. It tracks our progress toward
 5  an arkworks-aligned, production-friendly Groth16 stack.
 6  
 7  ## Snapshot (September 2025)
 8  
 9  - **GrothAlgebra** — Prime fields, polynomials, MSM helpers in place. Coset path
10    now recovers coefficients via barycentric interpolation; FFT guard prevents
11    truncation. Pending: align evaluation domain population with arkworks and then
12    revisit FFT optimisations.
13  - **GrothCurves** — BN254 tower/curve/pairing fully implemented with pairing
14    engine abstraction. Pending: second-curve prototype (e.g., BLS12-381) and
15    optional GT optimisations.
16  - **GrothProofs** — R1CS/QAP/Groth16 path mirrors arkworks; coset FFT is the
17    default. Dense path retained for assertions. Pending: domain alignment, optional
18    proof aggregation, polishing docs.
19  - **GrothExamples** — Scripts and README now expose coset vs dense parity so the
20    tutorial output matches implementation.
21  - **Benchmarks** — Run/plot workflow produces JSON + PNG artefacts; latest
22    baseline `results_2025-09-29_121914.json` captures coset-default timings.
23  
24  ## Near-term Focus
25  
26  1. **Align QAP domain with arkworks**
27     - Populate all domain slots (`num_constraints + num_inputs`, next power of
28       two) before IFFT.
29     - Remove the barycentric interpolation helper, rely on native IFFT/FFT.
30     - Update tests/examples/benchmarks accordingly.
31  
32  2. **Tooling & verification hardening**
33     - Run JET sweeps after major refactors, keep coset/dense parity assertions.
34     - Extend documentation (package reference, RareSkills map, implementation vs
35       arkworks) as behaviour changes.
36  
37  3. **Documenter-based docs rollout**
38     - Inventory target modules/pages (`GrothAlgebra`, `GrothCurves`, `GrothProofs`, landing page) and decide how existing markdown (roadmap, implementation notes) folds into the site.
39     - Create a dedicated `docs/` environment (`Project.toml`/`Manifest.toml`) with `Documenter`, `DocumenterTools`, `LiveServer`, and `dev` the in-tree packages for live loading.
40     - Seed `docs/make.jl` and `docs/src/index.md`; configure `makedocs` (site name, modules, `pages` layout, HTML settings, metadata, repo URL).
41     - Design the sidebar navigation (`pages` keyword) and map existing prose/tutorial chapters into `docs/src/*.md` skeletons.
42     - Populate pages using `@meta CurrentModule`, `@docs`, and targeted `@autodocs`; weave narrative text with the cleaned docstrings and add contents/index blocks plus cross references.
43     - Add deterministic `@example`/`@repl` blocks and doctests where useful; provide `DocTestSetup` scaffolding per page.
44     - Build locally (`julia --project=docs docs/make.jl`), preview with `LiveServer`, resolve warnings/missing refs, and iterate until clean.
45     - Wire up CI deployment via `Documenter.deploydocs` (GitHub Actions workflow, `DOCUMENTER_KEY`, publish to `gh-pages`), and document the workflow in contributing notes.
46  
47  ## Upcoming Work
48  
49  | Track | Items |
50  | --- | --- |
51  | Performance | Evaluate FFT twiddle caching, implement Pippenger-style variable/fixed-base MSM (with thresholds and w-NAF tables), keep batch normalisation fast, explore GT optimisations |
52  
53  ### MSM & Batch Optimisation Notes
54  
55  - Variable-base MSM: introduce a Pippenger backend with window heuristics/thresholds and optional threading.
56  - Fixed-base MSM: build w-NAF tables for setup query generation (`FixedBaseTable`) and reuse in benchmarks.
57  - Batch normalisation: keep `batch_to_affine!` hot and normalise CRS vectors post-setup.
58  - Fallback strategy: keep naive loops for very small N and gate optimised paths behind thresholds.
59  
60  
61  | Features | Arkworks-style proof aggregation; second curve/pairing engine prototype |
62  | Tooling | Unified docs site (Documenter), CI matrix, contribution guide |
63  | Packaging | Compat bounds, CHANGELOGs, eventual registration |
64  
65  ## Completed Milestones
66  
67  - Coset FFT path aligned (dense fallback removed, assertion on parity).
68  - Prepared verifier matches arkworks (batched pairing path).
69  - Benchmarks expanded (pairing & Groth16 hot paths with JSON/PNG artefacts).
70  - Groth16 tests cover multiple circuits, randomized seeds, prepared-path
71    negatives, and randomized R1CS fixtures.
72  
73  ## References
74  
75  - Package reference: `CODEX_ANALYSIS.md`
76  - Implementation vs arkworks: `docs/Implementation_vs_Arkworks.md`
77  - RareSkills mapping: `docs/RareSkills_Groth16_Map.md`
78  
79  This roadmap should be updated as milestones land or priorities shift.