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

feat: Dynamic Address for Out-of-Domain Row in TASM AIR Evaluation #314

Merged
merged 26 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c843694
docs: Add AIR circuit node count to arithmetization overview
aszepieniec Aug 8, 2024
ac98c22
docs: Add constraints overview table after lowering AIR degree to 8
aszepieniec Aug 8, 2024
f8178df
docs: Test spec overview of tasm AIR eval cost only if code is present
aszepieniec Aug 8, 2024
c26cf9c
docs: Add column counts for various degree lowering targets
aszepieniec Aug 8, 2024
592d7bf
test: Deduplicate code using macros
aszepieniec Aug 8, 2024
3f363ae
refactor(constraints generator): Rename "tasm" --> "static tasm"
aszepieniec Aug 9, 2024
72b6f5b
feat: Add dynamic counterpart to tasm code generator
aszepieniec Aug 9, 2024
1dc54cc
refactor: Qualify `air_constraint_evaluation_tasm` by staticity
aszepieniec Aug 9, 2024
1fb9ddf
style: Abstract memory layouts properties for static and dynamic tasm
aszepieniec Aug 9, 2024
0c0310d
restructure: Add directory for logic related to AIR evaluation
aszepieniec Aug 9, 2024
3a6218c
feat: Emit dynamic tasm air evaluation code along with static
aszepieniec Aug 9, 2024
5e5a1a7
refactor: Factor out common imports
aszepieniec Aug 9, 2024
c7581aa
feat(dyn air): Copy row pointers to static dedicated memory locations
aszepieniec Aug 9, 2024
bea5f0e
feat(dyn air): Load input with pointer indirection
aszepieniec Aug 9, 2024
cb0bade
fix(dyn air): Fix auto-generated imports
aszepieniec Aug 9, 2024
c1f821e
style(dyn air): Rename variable after effect
aszepieniec Aug 9, 2024
be1029f
refactor(dyn air): Modify `push!` macro to not emit `+0`
aszepieniec Aug 9, 2024
009022f
fix(dyn air): Fix macro limit, wrong variable name
aszepieniec Aug 9, 2024
be9b441
docs: Add dynamic AIR eval cost to overview
aszepieniec Aug 9, 2024
574e407
test(dyn air): Verify that dynamic and static evaluators agree
aszepieniec Aug 9, 2024
38a6a1d
style: Rename test to shorter but equivalent description
aszepieniec Aug 9, 2024
14c270c
style: Move AIR tests to `air.rs`
aszepieniec Aug 9, 2024
6322c14
refactor: De-duplicate code
jan-ferdinand Aug 13, 2024
10405b0
refactor: Fix intra-doc links
jan-ferdinand Aug 14, 2024
67bc9df
refactor(test): Simplify spec generation
jan-ferdinand Aug 14, 2024
89aa21d
refactor(test): De-duplicate and streamline
jan-ferdinand Aug 14, 2024
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
18 changes: 16 additions & 2 deletions constraint-evaluation-generator/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,21 @@ pub(crate) struct TasmBackend {
scope: HashSet<usize>,

/// The number of elements written to the output list.
///
/// See [`TasmBackend::doc_comment`] for details.
elements_written: usize,

/// Whether the code that is to be generated can assume statically provided
/// addresses for the various input arrays.
input_location_is_static: bool,
}

#[cfg(test)]
pub mod tests {
use super::*;

pub fn print_constraints<B: Codegen>(constraints: &Constraints) {
let code = B::constraint_evaluation_code(constraints);
let syntax_tree = syn::parse2(code).unwrap();
let code = prettyplease::unparse(&syntax_tree);
println!("{code}");
}
}
17 changes: 6 additions & 11 deletions constraint-evaluation-generator/src/codegen/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ impl RustBackend {
mod tests {
use twenty_first::prelude::*;

use crate::codegen::tests::print_constraints;

use super::*;

#[test]
Expand All @@ -352,20 +354,13 @@ mod tests {
assert_eq!(expected, RustBackend::tokenize_xfe(xfe).to_string());
}

fn print_constraints_as_rust(constraints: &Constraints) {
let rust = RustBackend::constraint_evaluation_code(constraints);
let syntax_tree = syn::parse2(rust).unwrap();
let code = prettyplease::unparse(&syntax_tree);
println!("{code}");
}

#[test]
fn print_mini_constraints_as_rust() {
print_constraints_as_rust(&Constraints::mini_constraints());
fn print_mini_constraints() {
print_constraints::<RustBackend>(&Constraints::mini_constraints());
}

#[test]
fn print_test_constraints_as_rust() {
print_constraints_as_rust(&Constraints::test_constraints());
fn print_test_constraints() {
print_constraints::<RustBackend>(&Constraints::test_constraints());
}
}
Loading