-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ADD: trace length print in executor test. * MOD: benchmark hash method. * MOD: op selector of and, or, xor combined into s_bitwise. * MOD: cpu combined simple arithmatic operations. * MOD: unify test db. * FIX: tstore constraints. * FIX: poseidon_chunk generate trace. * MOD: trace for program * ADD: ctl for cpu and program. * ADD: ctl for program and program_chunk. * ADD: ctl prog_chunk to poseidon. * ADD: ctl prog_chunk to storage. * MOD: program trace * ADD: prog starks and ctls. * MOD: test vm exec for circuit. * ADD: ctl print. * ADD: ProgChunk Hash in PoseidonTable. * ADD: ctl test cpu-program. * FIX: cpu and prog generate trace. * FIX: cpu-prog ctl data. * FIX: generate program trace. * ADD: set challenge for program in verifier. * FIX: prog_chunk ctl data to program. * MOD: program degree. * MOD: tape tx_idx. --------- Co-authored-by: web3Softcloud <renzhexin@web3.com> Co-authored-by: Pierre Hong <hongyuanyang2019@163.com>
- Loading branch information
1 parent
531ca9d
commit 0f64d7b
Showing
26 changed files
with
993 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
use core::types::{merkle_tree::decode_addr, Field, GoldilocksField}; | ||
|
||
use crate::{ | ||
builtins::poseidon::columns::*, | ||
generation::{ | ||
poseidon::generate_poseidon_trace, poseidon_chunk::generate_poseidon_chunk_trace, | ||
prog::generate_prog_chunk_trace, | ||
}, | ||
program::columns::*, | ||
}; | ||
|
||
use super::debug_trace_print::{get_exec_trace, get_rows_vec_from_trace, print_title_data}; | ||
|
||
#[test] | ||
fn print_chunk_poseidon_ctl_info() { | ||
let program_file_name: String = "storage_u32.json".to_string(); | ||
let call_data = vec![ | ||
GoldilocksField::from_canonical_u64(0), | ||
GoldilocksField::from_canonical_u64(2364819430), | ||
]; | ||
|
||
let trace = get_exec_trace(program_file_name, Some(call_data), None); | ||
let poseidon_chunk_cols = generate_poseidon_chunk_trace(&trace.builtin_poseidon_chunk); | ||
let poseidon_chunk_rows = get_rows_vec_from_trace(poseidon_chunk_cols); | ||
|
||
let progs = trace | ||
.addr_program_hash | ||
.into_iter() | ||
.map(|(addr, hash)| (decode_addr(addr), hash)) | ||
.collect::<Vec<_>>(); | ||
let prog_chunk_cols = generate_prog_chunk_trace(progs); | ||
let prog_chunk_rows = get_rows_vec_from_trace(prog_chunk_cols); | ||
|
||
let poseidon_cols = generate_poseidon_trace::<GoldilocksField>(&trace.builtin_poseidon); | ||
let poseidon_rows = get_rows_vec_from_trace(poseidon_cols); | ||
|
||
let psdn_chunk_looking_cols: Vec<usize> = COL_POSEIDON_CHUNK_VALUE_RANGE | ||
.chain(COL_POSEIDON_CHUNK_CAP_RANGE) | ||
.chain(COL_POSEIDON_CHUNK_HASH_RANGE) | ||
.collect(); | ||
let prog_chunk_looking_cols: Vec<usize> = COL_PROG_CHUNK_INST_RANGE | ||
.chain(COL_PROG_CHUNK_CAP_RANGE) | ||
.chain(COL_PROG_CHUNK_HASH_RANGE) | ||
.collect(); | ||
let poseidon_looked_cols: Vec<usize> = COL_POSEIDON_INPUT_RANGE | ||
.chain(COL_POSEIDON_OUTPUT_RANGE) | ||
.collect(); | ||
|
||
print_title_data( | ||
"psdn_chunk", | ||
get_poseidon_chunk_col_name_map(), | ||
&poseidon_chunk_rows, | ||
psdn_chunk_looking_cols, | ||
|row: &[GoldilocksField], _| row[COL_POSEIDON_CHUNK_FILTER_LOOKING_POSEIDON].is_one(), | ||
0, | ||
None, | ||
); | ||
print_title_data( | ||
"prog_chunk", | ||
get_prog_chunk_col_name_map(), | ||
&prog_chunk_rows, | ||
prog_chunk_looking_cols, | ||
|row: &[GoldilocksField], _| row[COL_PROG_CHUNK_IS_PADDING_LINE].is_zero(), | ||
0, | ||
None, | ||
); | ||
print_title_data( | ||
"poseidon", | ||
get_poseidon_col_name_map(), | ||
&poseidon_rows, | ||
poseidon_looked_cols, | ||
|row: &[GoldilocksField], _| row[FILTER_LOOKED_NORMAL].is_one(), | ||
0, | ||
None, | ||
); | ||
} |
Oops, something went wrong.