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

Missing dynamic layout features #1838

Merged
merged 120 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 117 commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
7d14e74
Fix Zero segment location.
Alon-Ti Jun 24, 2024
e71b052
Fixed has_zero_segment naming
yuvalsw Aug 13, 2024
0ec972a
Fix prover input.
Alon-Ti Jun 30, 2024
8c5c924
Fixed version reading when no version is supplied
yuvalsw Jul 7, 2024
057bc6f
Added change to changelog.
yuvalsw Aug 13, 2024
64c844b
fix test_from_serializable()
OmriEshhar1 Aug 21, 2024
51d25a7
fix panic_impl error
OmriEshhar1 Aug 25, 2024
88d1da1
fix cairo version
OmriEshhar1 Aug 26, 2024
c5d3bd5
Add dummy changelog
JulianGCalderon Aug 26, 2024
ea377a8
Pin wasm-bindgen
JulianGCalderon Aug 26, 2024
e8e7bb3
Register change in CHANGELOG
JulianGCalderon Aug 26, 2024
87a736a
Update Cargo.lock
JulianGCalderon Aug 26, 2024
2fe7f90
Remove changes from CHANGELOG
JulianGCalderon Aug 26, 2024
6c7237e
Add argument parsing for layout params file
JulianGCalderon Aug 23, 2024
e4b162b
Add dynamic support (no implement)
JulianGCalderon Aug 23, 2024
43360b9
Add cairo_layout_params_file.example.json
JulianGCalderon Aug 23, 2024
e3e31b8
Implement dynamic layout creation
JulianGCalderon Aug 23, 2024
ad97bd0
Update CHANGELOG
JulianGCalderon Aug 23, 2024
11edca3
Add cli dynamic support for cairo 1
JulianGCalderon Aug 23, 2024
adbba88
Make wasm compatible
JulianGCalderon Aug 23, 2024
8ac5b5b
Merge remote-tracking branch 'lambdaclass-cairo-vm/main' into yuval/f…
OmriEshhar1 Aug 28, 2024
a41f231
Use public_memory_fraction = 4 vy default
JulianGCalderon Aug 28, 2024
f7334f5
Deserialize bool from int
JulianGCalderon Aug 28, 2024
63eba32
Add comparison with python-vm (failing)
JulianGCalderon Aug 28, 2024
3d18e47
Merge remote-tracking branch 'lambdaclass-cairo-vm/main' into yuval/f…
OmriEshhar1 Aug 29, 2024
1f2098a
Rebuild .rs files in makefile
JulianGCalderon Aug 29, 2024
707e0d2
Use 8 as dynamic public_memory_fraction
JulianGCalderon Aug 29, 2024
723eaf2
Use None ratio for dynamic unused builtins
JulianGCalderon Aug 29, 2024
f20b97b
Add rangecheck96 to private inputs
JulianGCalderon Aug 29, 2024
e6d3f9b
Make dyn py files depend on params_file
JulianGCalderon Aug 29, 2024
3f5eef5
Use cpu_component_step=1 by default
JulianGCalderon Aug 29, 2024
026e459
Fix typo in private inputs
JulianGCalderon Aug 29, 2024
15b7742
Add range check value to air private input test
JulianGCalderon Aug 30, 2024
698b35c
Fix zero segment location
JulianGCalderon Aug 30, 2024
c58dc4e
Use zero builtin instead of None
JulianGCalderon Aug 30, 2024
ce985ba
Add debug scripts
JulianGCalderon Aug 30, 2024
6ea8ddf
Merge branch 'main' into dynamic-layout
JulianGCalderon Sep 2, 2024
08874bd
Remove dup makefile recipes
JulianGCalderon Sep 2, 2024
ba4d3c0
remove outdated test
JulianGCalderon Sep 2, 2024
0e0c65b
Enable ensure-no_std on test
JulianGCalderon Sep 2, 2024
0b9fed5
Fix tests
JulianGCalderon Sep 2, 2024
737850f
Add correct test
JulianGCalderon Sep 2, 2024
34e5eaf
Rename tset
JulianGCalderon Sep 3, 2024
2a4213f
Add comment
JulianGCalderon Sep 3, 2024
28eb15c
Add debugging document
JulianGCalderon Sep 3, 2024
20ce2aa
Update cairo layout params file
JulianGCalderon Sep 3, 2024
0036504
Merge branch 'fix-for-sw-fix-version' into dynamic-layout
JulianGCalderon Sep 3, 2024
30f7766
Merge branch 'main' into dynamic-layout
JulianGCalderon Sep 3, 2024
af9fadd
Remove duplicated range check
JulianGCalderon Sep 3, 2024
fbf074d
Remove dup
JulianGCalderon Sep 3, 2024
f8a7f78
Merge branch 'main' into dynamic-layout
JulianGCalderon Sep 4, 2024
24a1d47
Add support for dynamic memory units per step
JulianGCalderon Sep 17, 2024
3ed8df8
Add changelog
JulianGCalderon Sep 17, 2024
089e33b
Add support for negative log units per step
JulianGCalderon Sep 17, 2024
b000b2f
Add LowRatio struct to RangeCheck and Mod builtins
JulianGCalderon Sep 17, 2024
6baa70e
Fix test
JulianGCalderon Sep 17, 2024
2f76f62
Use ratio_den in get_allocated_instances
JulianGCalderon Sep 17, 2024
f94ae2b
Merge branch 'main' into dynamic-layout
JulianGCalderon Sep 17, 2024
fa6bcd1
Merge branch 'dynamic-layout' into dynamic-layout-2
JulianGCalderon Sep 17, 2024
050c71a
Remove debugging and scrippts (moveed to another branch)
JulianGCalderon Sep 17, 2024
3f9e684
Add comment
JulianGCalderon Sep 17, 2024
c7868b1
Merge branch 'dynamic-layout' into dynamic-layout-2
JulianGCalderon Sep 17, 2024
fca3cbf
Add tests
JulianGCalderon Sep 18, 2024
eb63b5c
Add dynamic test to cairo-vm-cli
JulianGCalderon Sep 18, 2024
a6f1511
Add parse test
JulianGCalderon Sep 18, 2024
351a9cd
Merge branch 'dynamic-layout' into dynamic-layout-2
JulianGCalderon Sep 18, 2024
f2c0abb
Remove compare all dynamic
JulianGCalderon Sep 18, 2024
5b6868e
Add script for comparing with dynamic layouts
JulianGCalderon Sep 18, 2024
cdab848
Add tests to workflow
JulianGCalderon Sep 18, 2024
dfa84ac
Merge branch 'dynamic-layout' into dynamic-layout-2
JulianGCalderon Sep 18, 2024
2015055
Delete logic changes
JulianGCalderon Sep 18, 2024
6d3c21c
Merge branch 'dynamic-layout' into dynamic-layout-2
JulianGCalderon Sep 18, 2024
c46ed76
Delete more logic changes
JulianGCalderon Sep 18, 2024
a89f9a8
Merge branch 'dynamic-layout' into dynamic-layout-2
JulianGCalderon Sep 18, 2024
b787982
Reorder fields
JulianGCalderon Sep 18, 2024
a99e864
Remove ref
JulianGCalderon Sep 18, 2024
5a59bfe
Add modulo tests with all_cairo
JulianGCalderon Sep 18, 2024
c6bd668
Add tests
JulianGCalderon Sep 18, 2024
7a44d4e
Update rust.yml
JulianGCalderon Sep 19, 2024
859b7fb
Rename compare_outputs_dynamic_layout.sh to compare_outputs_dynamic_l…
JulianGCalderon Sep 19, 2024
47e441b
Update test script
JulianGCalderon Sep 19, 2024
cd8143b
Merge branch 'dynamic-layout' into dynamic-layout-2
JulianGCalderon Sep 19, 2024
6e9e09a
Remove tests
JulianGCalderon Sep 19, 2024
6ecdf3d
Enforce prover constraints in add, sub, and mul
JulianGCalderon Sep 19, 2024
2630845
Remove debug prints
JulianGCalderon Sep 19, 2024
fa384fb
Add tests
JulianGCalderon Sep 19, 2024
6991904
Update CHANGELOG.md
JulianGCalderon Sep 19, 2024
deab241
Fix serialization
JulianGCalderon Sep 19, 2024
9db796a
Comment failing test
JulianGCalderon Sep 19, 2024
dd6d6ff
Uncomment test
JulianGCalderon Sep 19, 2024
63e606f
Merge branch 'mod-builtin-fix' into dynamic-layout-2
JulianGCalderon Sep 19, 2024
6ec16c3
Add fractional units per step test
JulianGCalderon Sep 19, 2024
53f119c
Change safe_div for div_ceil (bug)
JulianGCalderon Sep 19, 2024
2ba2dec
Add ratio_den tests
JulianGCalderon Sep 19, 2024
9202255
Fix tests
JulianGCalderon Sep 19, 2024
3480ca9
Merge branch 'mod-builtin-fix' into dynamic-layout-2
JulianGCalderon Sep 19, 2024
7346f80
Remove operation struct and use builtin type instead
JulianGCalderon Sep 20, 2024
399c14c
Add unit tests to modulo builtin operations
JulianGCalderon Sep 20, 2024
43c2d41
Fix security error message
JulianGCalderon Sep 20, 2024
707a7bf
Add mod_builtin to coverage
JulianGCalderon Sep 20, 2024
f8356df
Merge branch 'mod-builtin-fix' into dynamic-layout-2
JulianGCalderon Sep 20, 2024
6435a77
Test custom serde impl
JulianGCalderon Sep 23, 2024
80916e6
Upload mod_builtin coverage
JulianGCalderon Sep 23, 2024
9bbfc36
Merge branch 'main' into dynamic-layout
JulianGCalderon Sep 23, 2024
a913599
Merge branch 'dynamic-layout' into mod-builtin-fix
JulianGCalderon Sep 23, 2024
eb904b2
Test custom serde impl
JulianGCalderon Sep 23, 2024
1ec8e3b
Upload mod_builtin coverage
JulianGCalderon Sep 23, 2024
ba44310
Add Debug scripts (#1839)
JulianGCalderon Sep 23, 2024
1e2e36f
Merge branch 'mod-builtin-fix' into dynamic-layout-2
JulianGCalderon Sep 23, 2024
bcd5b31
Merge branch 'main' into mod-builtin-fix
JulianGCalderon Sep 30, 2024
6395615
Merge branch 'main' into dynamic-layout-2
JulianGCalderon Sep 30, 2024
c294f02
Add cpu_component_step
JulianGCalderon Oct 1, 2024
2e6ce1b
Merge branch 'mod-builtin-fix' into dynamic-layout-2
JulianGCalderon Oct 1, 2024
a8d73c0
Add comments
JulianGCalderon Oct 1, 2024
2a784f7
Add cairo pie tests
JulianGCalderon Oct 1, 2024
5d2d263
Restore zip
JulianGCalderon Oct 1, 2024
cfcfa53
Use .rs.pie.zip
JulianGCalderon Oct 1, 2024
c191a0a
Update Changelog
JulianGCalderon Oct 2, 2024
83c4838
Add dynamic layout documentation
JulianGCalderon Oct 2, 2024
a6e93da
Update CHANGELOG.md
pefontana Oct 2, 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
14 changes: 13 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ jobs:

compare-outputs-dynamic-layouts:
name: Compare outputs with dynamic layouts
needs: [ build-programs, build-release ]
needs: [ build-programs, build-release, run-cairo-release ]
runs-on: ubuntu-22.04
steps:
- name: Checkout
Expand Down Expand Up @@ -791,6 +791,18 @@ jobs:
key: cairo_proof_programs-cache-${{ hashFiles('cairo_programs/**/*.cairo', 'examples/wasm-demo/src/array_sum.cairo') }}
fail-on-cache-miss: true

- name: Fetch pie
uses: actions/cache/restore@v3
with:
path: |
cairo_programs/**/*.memory
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
cairo_programs/**/*.pie.zip
key: cairo_test_programs-release-trace-cache-${{ github.sha }}
fail-on-cache-miss: true

- name: Run script
run: ./vm/src/tests/compare_outputs_dynamic_layouts.sh

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#### Upcoming Changes

* feat: [#1838](https://github.com/lambdaclass/cairo-vm/pull/1824):
JulianGCalderon marked this conversation as resolved.
Show resolved Hide resolved
* Add support for missing dynamic layout features

* fix: [#1841](https://github.com/lambdaclass/cairo-vm/pull/1841):
* Fix modulo builtin to comply with prover constraints

Expand Down
133 changes: 133 additions & 0 deletions vm/src/tests/compare_outputs_dynamic_layouts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,70 @@ cat <<EOF > "$TEMP_FOLDER/double_all_cairo.json"
}
EOF

cat <<EOF > "$TEMP_FOLDER/fractional_units_per_step.json"
{
"rc_units": 4,
"log_diluted_units_per_step": -2,
"cpu_component_step": 8,
"memory_units_per_step": 8,
"uses_pedersen_builtin": false,
"pedersen_ratio": 0,
"uses_range_check_builtin": false,
"range_check_ratio": 0,
"uses_ecdsa_builtin": false,
"ecdsa_ratio": 0,
"uses_bitwise_builtin": false,
"bitwise_ratio": 0,
"uses_ec_op_builtin": false,
"ec_op_ratio": 0,
"uses_keccak_builtin": false,
"keccak_ratio": 0,
"uses_poseidon_builtin": false,
"poseidon_ratio": 0,
"uses_range_check96_builtin": false,
"range_check96_ratio": 0,
"range_check96_ratio_den": 1,
"uses_add_mod_builtin": false,
"add_mod_ratio": 0,
"add_mod_ratio_den": 1,
"uses_mul_mod_builtin": false,
"mul_mod_ratio": 0,
"mul_mod_ratio_den": 1
}
EOF

cat <<EOF > "$TEMP_FOLDER/ratio_den.json"
{
"rc_units": 4,
"log_diluted_units_per_step": 4,
"cpu_component_step": 8,
"memory_units_per_step": 512,
"uses_pedersen_builtin": false,
"pedersen_ratio": 0,
"uses_range_check_builtin": false,
"range_check_ratio": 0,
"uses_ecdsa_builtin": false,
"ecdsa_ratio": 0,
"uses_bitwise_builtin": false,
"bitwise_ratio": 0,
"uses_ec_op_builtin": false,
"ec_op_ratio": 0,
"uses_keccak_builtin": false,
"keccak_ratio": 0,
"uses_poseidon_builtin": false,
"poseidon_ratio": 0,
"uses_range_check96_builtin": true,
"range_check96_ratio": 1,
"range_check96_ratio_den": 2,
"uses_add_mod_builtin": true,
"add_mod_ratio": 1,
"add_mod_ratio_den": 2,
"uses_mul_mod_builtin": true,
"mul_mod_ratio": 1,
"mul_mod_ratio_den": 2
}
EOF

# Build cases to execute
CASES=(
"cairo_programs/proof_programs/factorial.json;all_cairo"
Expand All @@ -82,9 +146,33 @@ CASES=(
"cairo_programs/proof_programs/sha256.json;double_all_cairo"
"cairo_programs/proof_programs/keccak.json;all_cairo"
"cairo_programs/proof_programs/keccak.json;double_all_cairo"
# Mod builtin feature
"cairo_programs/mod_builtin_feature/proof/mod_builtin.json;all_cairo"
"cairo_programs/mod_builtin_feature/proof/mod_builtin_failure.json;all_cairo"
"cairo_programs/mod_builtin_feature/proof/apply_poly.json;all_cairo"
# Fractional units per step
"cairo_programs/proof_programs/factorial.json;fractional_units_per_step"
"cairo_programs/proof_programs/fibonacci.json;fractional_units_per_step"
# Ratio den
"cairo_programs/mod_builtin_feature/proof/mod_builtin.json;ratio_den"
"cairo_programs/mod_builtin_feature/proof/mod_builtin_failure.json;ratio_den"
"cairo_programs/mod_builtin_feature/proof/apply_poly.json;ratio_den"
)

# Build pie cases to execute
PIE_CASES=(
"cairo_programs/fibonacci.rs.pie.zip;all_cairo"
"cairo_programs/fibonacci.rs.pie.zip;double_all_cairo"
"cairo_programs/factorial.rs.pie.zip;all_cairo"
"cairo_programs/factorial.rs.pie.zip;double_all_cairo"
"cairo_programs/bigint.rs.pie.zip;all_cairo"
"cairo_programs/bigint.rs.pie.zip;double_all_cairo"
"cairo_programs/dict.rs.pie.zip;all_cairo"
"cairo_programs/dict.rs.pie.zip;double_all_cairo"
"cairo_programs/sha256.rs.pie.zip;all_cairo"
"cairo_programs/sha256.rs.pie.zip;double_all_cairo"
"cairo_programs/keccak.rs.pie.zip;all_cairo"
"cairo_programs/keccak.rs.pie.zip;double_all_cairo"
)

passed_tests=0
Expand Down Expand Up @@ -155,6 +243,51 @@ for case in "${CASES[@]}"; do
rm program_py.*
done


for case in "${PIE_CASES[@]}"; do
IFS=";" read -r program layout <<< "$case"

full_program="$program"
full_layout="$TEMP_FOLDER/$layout.json"

# Run cairo-vm
echo "Running cairo-vm with case: $case"
cargo run -p cairo-vm-cli --features mod_builtin --release -- "$full_program" \
--layout "dynamic" --cairo_layout_params_file "$full_layout" --run_from_cairo_pie \
--trace_file program_rs.trace --memory_file program_rs.memory

# Run cairo-lang
echo "Running cairo-lang with case: $case"
cairo-run --run_from_cairo_pie "$full_program" \
--layout "dynamic" --cairo_layout_params_file "$full_layout" \
--trace_file program_py.trace --memory_file program_py.memory

# Compare trace
echo "Running trace comparison for case: $case"
if ! diff -q program_rs.trace program_py.trace; then
echo "Trace differs for case: $case"
exit_code=1
failed_tests=$((failed_tests + 1))
else
passed_tests=$((passed_tests + 1))
fi

# Compare memory
echo "Running memory comparison for case: $case"
if ! ./vm/src/tests/memory_comparator.py program_rs.memory program_py.memory; then
echo "Memory differs for case: $case"
exit_code=1
failed_tests=$((failed_tests + 1))
else
passed_tests=$((passed_tests + 1))
fi

# Clean files generated by the script
echo "Cleaning files"
rm program_rs.*
rm program_py.*
done

if test $failed_tests != 0; then
echo "Comparisons: $failed_tests failed, $passed_tests passed, $((failed_tests + passed_tests)) total"
elif test $passed_tests = 0; then
Expand Down
18 changes: 14 additions & 4 deletions vm/src/types/instance_definitions/builtins_instance_def.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::types::layout::CairoLayoutParams;

use super::mod_instance_def::ModInstanceDef;
use super::LowRatio;
use super::{
bitwise_instance_def::BitwiseInstanceDef, ec_op_instance_def::EcOpInstanceDef,
ecdsa_instance_def::EcdsaInstanceDef, keccak_instance_def::KeccakInstanceDef,
Expand Down Expand Up @@ -199,7 +200,7 @@ impl BuiltinsInstanceDef {
ratio: Some(params.pedersen_ratio),
});
let range_check = Some(RangeCheckInstanceDef {
ratio: Some(params.range_check_ratio),
ratio: Some(LowRatio::new_int(params.range_check_ratio)),
});
let ecdsa = Some(EcdsaInstanceDef {
ratio: Some(params.ecdsa_ratio),
Expand All @@ -217,17 +218,26 @@ impl BuiltinsInstanceDef {
ratio: Some(params.poseidon_ratio),
});
let range_check96 = Some(RangeCheckInstanceDef {
ratio: Some(params.range_check96_ratio),
ratio: Some(LowRatio::new(
params.range_check96_ratio,
params.range_check96_ratio_den,
)),
});
#[cfg(feature = "mod_builtin")]
let add_mod = Some(ModInstanceDef {
ratio: Some(params.add_mod_ratio),
ratio: Some(LowRatio::new(
params.add_mod_ratio,
params.add_mod_ratio_den,
)),
word_bit_len: 96,
batch_size: 1,
});
#[cfg(feature = "mod_builtin")]
let mul_mod = Some(ModInstanceDef {
ratio: Some(params.mul_mod_ratio),
ratio: Some(LowRatio::new(
params.mul_mod_ratio,
params.mul_mod_ratio_den,
)),
word_bit_len: 96,
batch_size: 1,
});
Expand Down
11 changes: 11 additions & 0 deletions vm/src/types/instance_definitions/diluted_pool_instance_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use serde::Serialize;
#[derive(Serialize, Debug, PartialEq)]
pub(crate) struct DilutedPoolInstanceDef {
pub(crate) units_per_step: u32, // 2 ^ log_units_per_step (for cairo_lang comparison)
pub(crate) fractional_units_per_step: bool, // true when log_units_per_step is negative
pub(crate) spacing: u32,
pub(crate) n_bits: u32,
}
Expand All @@ -11,6 +12,7 @@ impl DilutedPoolInstanceDef {
pub(crate) fn default() -> Self {
DilutedPoolInstanceDef {
units_per_step: 16,
fractional_units_per_step: false,
spacing: 4,
n_bits: 16,
}
Expand All @@ -21,6 +23,15 @@ impl DilutedPoolInstanceDef {
units_per_step,
spacing,
n_bits,
..Self::default()
}
}

pub(crate) fn from_log_units_per_step(log_units_per_step: i32) -> Self {
DilutedPoolInstanceDef {
units_per_step: 2_u32.pow(log_units_per_step.unsigned_abs()),
fractional_units_per_step: log_units_per_step.is_negative(),
..DilutedPoolInstanceDef::default()
}
}
}
Expand Down
24 changes: 24 additions & 0 deletions vm/src/types/instance_definitions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use serde::Serialize;

pub mod bitwise_instance_def;
pub mod builtins_instance_def;
pub mod diluted_pool_instance_def;
Expand All @@ -9,3 +11,25 @@ pub mod mod_instance_def;
pub mod pedersen_instance_def;
pub mod poseidon_instance_def;
pub mod range_check_instance_def;

#[derive(Serialize, Debug, PartialEq, Copy, Clone)]
pub struct LowRatio {
pub numerator: u32,
pub denominator: u32,
}

impl LowRatio {
pub fn new(numerator: u32, denominator: u32) -> Self {
Self {
numerator,
denominator,
}
}

pub fn new_int(numerator: u32) -> Self {
Self {
numerator,
denominator: 1,
}
}
}
25 changes: 23 additions & 2 deletions vm/src/types/instance_definitions/mod_instance_def.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
use serde::Serialize;

use super::LowRatio;

pub(crate) const N_WORDS: usize = 4;

pub(crate) const CELLS_PER_MOD: u32 = 7;

#[derive(Serialize, Debug, PartialEq, Clone)]
pub(crate) struct ModInstanceDef {
pub(crate) ratio: Option<u32>,
pub(crate) ratio: Option<LowRatio>,
pub(crate) word_bit_len: u32,
pub(crate) batch_size: usize,
}

impl ModInstanceDef {
pub(crate) fn new(ratio: Option<u32>, batch_size: usize, word_bit_len: u32) -> Self {
ModInstanceDef {
ratio,
ratio: ratio.map(LowRatio::new_int),
word_bit_len,
batch_size,
}
}
}

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

#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::*;

#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn test_new() {
let builtin_instance = ModInstanceDef {
ratio: Some(LowRatio::new_int(10)),
word_bit_len: 3,
batch_size: 3,
};
assert_eq!(ModInstanceDef::new(Some(10), 3, 3), builtin_instance);
}
}
Loading
Loading