Skip to content

Commit

Permalink
refactor: Refactor and simplify, removing legacy lurk (#945)
Browse files Browse the repository at this point in the history
* refactor: Refactor store module and remove let_store tests

- Changed the `store` module's visibility to private, restricting its direct accessibility.
- Eliminated the `let_store` macro, enforcing all `Store` manipulations to be conducted without it.
- Removed the `lurk_macro_test.rs` file, which contained major test functions, causing significant changes to the test suite.

* refactor: Refactor and simplify, removing legacy lurk

Cleans up Lurk Alpha structures.

In detail:
- Entire deletion of files `src/expr.rs`, `src/writer.rs`, `src/cont.rs` and `src/ptr.rs`, which held sizeable and complex code structures and functionalities.
- Significant simplification and removal of code in `src/circuit/gadgets/data.rs` and `src/circuit/gadgets/pointer.rs`, affecting allocation and handling of various tags, symbols, pointers, and numbers.
- Removal of implementations relating to `Store<F>`, `GlobalAllocations` and `TypePredicates` among others, shifting away from Lurk Alpha.
- Substantial rewrite in `lib.rs`, removing outdated modules and adding new ones. A tiny new `store` module is added with an `Error` struct.
- Changes to `ZExpr` and `ZStore` handling in `z_expr.rs` and `z_store.rs` respectively.
- Deletion of substantial functions and units tests related to `CaseConstraint` and `multi_case` in `src/circuit/gadgets/case.rs`.
- Removal of code related to `ptr` and `cont` handling across multiple files.
- Major codebase cleanup through removal of unused imports, functions, structs, modules and files across multiple directories.
  • Loading branch information
huitseeker authored Dec 11, 2023
1 parent f4ea425 commit 2bd8b8c
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 4,484 deletions.
9 changes: 0 additions & 9 deletions lurk-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,6 @@ impl Lurk {
}
}

#[proc_macro]
/// Binds a mutable `Store` to the variable `s_`, which is (somewhat unfortunately) hard-coded into the `lurk!` macro.
/// Users should therefore avoid using `s_` for other purposes, and will need to use `s_` directly when manipulating the
/// `Store`. The name `s_` was chosen to walk the line between obscurity and brevity/clarity. Accidental collisions are
/// undesirable, but so is an awkward or unwieldy name.
pub fn let_store(_tokens: TokenStream) -> TokenStream {
quote!(let s_ = &mut Store::<Fr>::default();).into()
}

#[proc_macro]
pub fn lurk(tokens: TokenStream) -> TokenStream {
Lurk::parse_raw(tokens.into()).emit()
Expand Down
47 changes: 0 additions & 47 deletions lurk-macros/tests/lurk_macro_test.rs

This file was deleted.

Loading

1 comment on commit 2bd8b8c

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarks

Table of Contents

Overview

This benchmark report shows the Fibonacci GPU benchmark.
NVIDIA GeForce RTX 4070
AMD Ryzen 9 3950X 16-Core Processor
125.711 GB RAM
Workflow run: https://github.com/lurk-lab/lurk-rs/actions/runs/7167774400

Benchmark Results

LEM Fibonacci Prove - rc = 100

fib-ref=f4ea42592ab4f2153e48b1b03533c2a8dc0bf3a8 fib-ref=2bd8b8c486a95ea4219a2d455f51bdbd644a130d
num-100 3.85 s (✅ 1.00x) 3.00 s (✅ 1.29x faster)
num-200 7.76 s (✅ 1.00x) 6.10 s (✅ 1.27x faster)

LEM Fibonacci Prove - rc = 600

fib-ref=f4ea42592ab4f2153e48b1b03533c2a8dc0bf3a8 fib-ref=2bd8b8c486a95ea4219a2d455f51bdbd644a130d
num-100 3.34 s (✅ 1.00x) 2.67 s (✅ 1.25x faster)
num-200 7.33 s (✅ 1.00x) 5.77 s (✅ 1.27x faster)

Made with criterion-table

Please sign in to comment.