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

refactor: Rename top-level crate to lurk #363

Merged
merged 5 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/BENCH_REGRESSION.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: "perf: Benchmark regression detected"
labels: debt, automated-issues
labels: debt, automated-issue
---
A performance regression has occurred for the benchmarks in `tests`.

{{ env.SLOW_TESTS }}

See {{ env.WORKFLOW_URL }}) for details.
See [Workflow URL]({{ env.WORKFLOW_URL }}) for details.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Tests

on:
push:
branches:
- main
merge_group:
pull_request:

concurrency:
Expand Down Expand Up @@ -151,9 +149,9 @@ jobs:

${{ steps.regression-check.outputs.slow-tests }}

${{ env.WORKFLOW_URL }}
[Workflow URL](${{ env.WORKFLOW_URL }})
- uses: JasonEtco/create-an-issue@v2
if: steps.regression-check.outputs.regression == 'true' && github.event_name == 'push'
if: steps.regression-check.outputs.regression == 'true' && github.event_name == 'merge_group'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: ${{ env.WORKFLOW_URL }}
Expand Down
33 changes: 13 additions & 20 deletions .github/workflows/rust-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,32 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Parse rust-toolchain.toml
run: echo "TOOLCHAIN_VERSION=$(rustup show | grep rustc | awk -F'[()]| ' '{ print $(NF-1) }')" | tee -a $GITHUB_ENV
- name: Get latest nightly Rust version
run: |
echo "RUST_VERSION=$(rustup check | grep nightly | awk -F'[()]| ' '{print $(NF-1)}')" | tee -a $GITHUB_ENV
- name: Compare Rust versions
id: compare-versions
run: |
if [[ $(printf '%s\n' "$TOOLCHAIN_VERSION" "$RUST_VERSION" | sort -V | head -n 1) != "$RUST_VERSION" ]]; then
echo "outdated=true" | tee -a $GITHUB_OUTPUT
fi
- name: Update Cargo.toml
if: steps.compare-versions.outputs.outdated == 'true'
run: |
sed -i 's/channel = .*/channel = "nightly-${{ env.RUST_VERSION }}"/' rust-toolchain.toml
- uses: actions/checkout@v4
with:
repository: argumentcomputer/ci-workflows
path: ci-workflows
- uses: ./ci-workflows/.github/actions/rust-version
id: rust-version
with:
toolchain: nightly
- uses: tibdex/github-app-token@v2
if: steps.compare-versions.outputs.outdated == 'true'
if: steps.rust-version.outputs.outdated == 'true'
id: generate-token
with:
app_id: ${{ secrets.TOKEN_APP_ID }}
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}
# Open PR if Rust version is out of date with latest nightly
- name: Create Pull Request
if: steps.compare-versions.outputs.outdated == 'true'
if: steps.rust-version.outputs.outdated == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
branch: "ci-update-rust-version"
title: "chore: Update Rust version to nightly-${{ env.RUST_VERSION }}"
commit-message: "chore: Update Rust version to nightly-${{ env.RUST_VERSION }}"
title: "chore: Update Rust version to `nightly-${{ steps.rust-version.outputs.new-version }}`"
commit-message: "chore: Update Rust version to `nightly-${{ steps.rust-version.outputs.new-version }}`"
labels: "automated-issue"
reviewers: "arthurpaulino, wwared, huitseeker, samuelburnham"
body: |
This is an automated PR updating the Rust version from `nightly-${{ env.TOOLCHAIN_VERSION }}` to `nightly-${{ env.RUST_VERSION }}`
This is an automated PR updating the Rust version from `nightly-${{ steps.rust-version.outputs.old-version }}` to `nightly-${{ steps.rust-version.outputs.new-version }}`

Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
80 changes: 40 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "loam"
version = "0.1.0"
name = "lurk"
version = "0.5.0"
edition.workspace = true
repository.workspace = true

Expand All @@ -11,7 +11,7 @@ path = "src/main.rs"
[workspace.package]
authors = ["Argument Engineering <[email protected]>"]
edition = "2021"
repository = "https://github.com/argumentcomputer/loam"
repository = "https://github.com/argumentcomputer/lurk"
license = "MIT"


Expand Down
10 changes: 5 additions & 5 deletions benches/fib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ use sphinx_core::{
};
use std::time::Duration;

use loam::{
use lurk::{
core::{
eval_direct::build_lurk_toplevel_native,
zstore::{lurk_zstore, ZPtr},
},
lair::{
chipset::{Chipset, NoChip},
execute::{QueryRecord, Shard},
Expand All @@ -18,10 +22,6 @@ use loam::{
toplevel::Toplevel,
List,
},
lurk::{
eval_direct::build_lurk_toplevel_native,
zstore::{lurk_zstore, ZPtr},
},
};

const DEFAULT_FIB_ARG: usize = 100000;
Expand Down
10 changes: 5 additions & 5 deletions benches/lcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ use sphinx_core::{
};
use std::time::Duration;

use loam::{
use lurk::{
core::{
eval_direct::build_lurk_toplevel_native,
zstore::{lurk_zstore, ZPtr},
},
lair::{
chipset::{Chipset, NoChip},
execute::{QueryRecord, Shard},
Expand All @@ -18,10 +22,6 @@ use loam::{
toplevel::Toplevel,
List,
},
lurk::{
eval_direct::build_lurk_toplevel_native,
zstore::{lurk_zstore, ZPtr},
},
};

fn get_lcs_args() -> (&'static str, &'static str) {
Expand Down
2 changes: 1 addition & 1 deletion benches/lurk.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};
use std::time::Duration;

use loam::lurk::eval_direct::build_lurk_toplevel_native;
use lurk::core::eval_direct::build_lurk_toplevel_native;

fn toplevel(c: &mut Criterion) {
c.bench_function("toplevel", |b| {
Expand Down
10 changes: 5 additions & 5 deletions benches/sum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ use sphinx_core::{
};
use std::time::Duration;

use loam::{
use lurk::{
core::{
eval_direct::build_lurk_toplevel_native,
zstore::{lurk_zstore, ZPtr},
},
lair::{
chipset::{Chipset, NoChip},
execute::{QueryRecord, Shard},
Expand All @@ -18,10 +22,6 @@ use loam::{
toplevel::Toplevel,
List,
},
lurk::{
eval_direct::build_lurk_toplevel_native,
zstore::{lurk_zstore, ZPtr},
},
};

const DEFAULT_SUM_ARG: usize = 100000;
Expand Down
4 changes: 2 additions & 2 deletions examples/byte_lookup/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
loam = { path = "../.." }
lurk = { path = "../.." }
p3-air = { workspace = true }
p3-baby-bear = { workspace = true }
p3-field = { workspace = true }
Expand All @@ -15,4 +15,4 @@ p3-maybe-rayon = { workspace = true }
sphinx-core = { workspace = true }
sphinx-derive = { workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
rand_chacha = { workspace = true }
4 changes: 2 additions & 2 deletions examples/byte_lookup/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pub mod memoset;

use crate::memoset::DemoChip;
use loam::air::builder::{LookupBuilder, ProvideRecord, RequireRecord};
use loam::air::debug::{debug_constraints_collecting_queries, TraceQueries};
use lurk::air::builder::{LookupBuilder, ProvideRecord, RequireRecord};
use lurk::air::debug::{debug_constraints_collecting_queries, TraceQueries};
use p3_air::{Air, AirBuilder, BaseAir, PairBuilder};
use p3_baby_bear::BabyBear;
use p3_field::{AbstractField, Field, PrimeField32};
Expand Down
2 changes: 1 addition & 1 deletion examples/byte_lookup/src/memoset.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use loam::air::builder::{LookupBuilder, ProvideRecord, RequireRecord};
use lurk::air::builder::{LookupBuilder, ProvideRecord, RequireRecord};
use p3_air::{Air, AirBuilder, BaseAir};
use p3_field::{AbstractField, Field, PrimeField32};
use p3_matrix::dense::RowMajorMatrix;
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
# The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy.
profile = "default"
channel = "nightly-2024-08-13"
channel = "nightly-2024-11-04"
6 changes: 3 additions & 3 deletions src/air/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ pub struct DebugConstraintBuilder<'a, F> {
queries: &'a mut TraceQueries<F>,
}

impl<'a, F: PrimeField32> PairBuilder for DebugConstraintBuilder<'a, F> {
impl<F: PrimeField32> PairBuilder for DebugConstraintBuilder<'_, F> {
fn preprocessed(&self) -> Self::M {
self.preprocessed
}
}

impl<'a, F: PrimeField32> LookupBuilder for DebugConstraintBuilder<'a, F> {
impl<F: PrimeField32> LookupBuilder for DebugConstraintBuilder<'_, F> {
fn receive(
&mut self,
relation: impl Relation<Self::Expr>,
Expand Down Expand Up @@ -318,7 +318,7 @@ impl<'a, F: PrimeField32> AirBuilderWithPublicValues for DebugConstraintBuilder<
}
}

impl<'a, F: PrimeField32> LairBuilder for DebugConstraintBuilder<'a, F> {}
impl<F: PrimeField32> LairBuilder for DebugConstraintBuilder<'_, F> {}

impl<'a, F: PrimeField32> DebugConstraintBuilder<'a, F> {
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/lurk/big_num.rs → src/core/big_num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ mod test {

use crate::{
air::debug::debug_chip_constraints_and_queries_with_sharding,
core::chipset::lurk_chip_map_native,
func,
lair::{
execute::{QueryRecord, Shard},
func_chip::FuncChip,
lair_chip::{build_chip_vector, build_lair_chip_vector, LairMachineProgram},
toplevel::Toplevel,
},
lurk::chipset::lurk_chip_map_native,
};

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/lurk/chipset.rs → src/core/chipset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
poseidon::config::{BabyBearConfig24, BabyBearConfig32, BabyBearConfig40},
};

use crate::lurk::poseidon::PoseidonChipset;
use crate::core::poseidon::PoseidonChipset;

use super::{big_num::BigNum, u64::U64, zstore::Hasher};

Expand Down
4 changes: 2 additions & 2 deletions src/lurk/cli/comm_data.rs → src/core/cli/comm_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use serde::{Deserialize, Serialize};
use std::hash::Hash;

use crate::{
lair::chipset::Chipset,
lurk::{
core::{
tag::Tag,
zstore::{ZPtr, ZStore, DIGEST_SIZE, HASH3_SIZE},
},
lair::chipset::Chipset,
};

use super::zdag::ZDag;
Expand Down
File renamed without changes.
Loading