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

Split off LW/SW #1580

Open
wants to merge 595 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
595 commits
Select commit Hold shift + click to select a range
479bbf6
Merge remote-tracking branch 'origin/main' into matthias/parallel-cha…
matthiasgoergens Apr 8, 2024
7ea7ad1
Cargo update
matthiasgoergens Apr 8, 2024
338a895
Merge branch 'matthias/parallel-challenger' into matthias/memory-opt-…
matthiasgoergens Apr 8, 2024
5c63c70
Stuff
matthiasgoergens Apr 8, 2024
74ed4c1
Stuff
matthiasgoergens Apr 8, 2024
3a04be3
Restore timing, undo further parallelisation
matthiasgoergens Apr 8, 2024
a1c598f
Works?
matthiasgoergens Apr 8, 2024
3417715
Bitshift: use new unified constraints
matthiasgoergens Apr 11, 2024
2daf909
Fix test
matthiasgoergens Apr 11, 2024
257652e
Nicer
matthiasgoergens Apr 11, 2024
bcdce52
Fix types
matthiasgoergens Apr 11, 2024
bbb6ba7
Clippy
matthiasgoergens Apr 11, 2024
4e98fc8
Fix constraints
matthiasgoergens Apr 11, 2024
6be1be7
simpler constraints
matthiasgoergens Apr 11, 2024
a0a49c1
remove redundant types
matthiasgoergens Apr 11, 2024
c13c186
Minimize diff
matthiasgoergens Apr 11, 2024
039186d
Better names
matthiasgoergens Apr 11, 2024
429da4e
Better nows
matthiasgoergens Apr 11, 2024
2b03b8e
Clean up
matthiasgoergens Apr 11, 2024
01abf65
Clean up
matthiasgoergens Apr 11, 2024
1af3da7
Match comment
matthiasgoergens Apr 11, 2024
c429a8f
Cleaner
matthiasgoergens Apr 11, 2024
ad874b4
Minimize diff
matthiasgoergens Apr 11, 2024
26010ed
Convert Memory, too
matthiasgoergens Apr 11, 2024
8756133
suggestions: lifetimes (#1527)
eightfilms Apr 11, 2024
1fc4ce6
Merge remote-tracking branch 'origin/main' into matthias/expr/convert…
matthiasgoergens Apr 11, 2024
63e66bc
Merge remote-tracking branch 'origin/main' into matthias/expr/convert…
matthiasgoergens Apr 11, 2024
349d8c7
Make Clippy happy thanks to Bing
matthiasgoergens Apr 11, 2024
fe2a418
Simpler XOR
matthiasgoergens Apr 11, 2024
af8adb0
Simpler
matthiasgoergens Apr 11, 2024
595d6b6
Better names
matthiasgoergens Apr 11, 2024
00ae51d
Consumer
matthiasgoergens Apr 11, 2024
80f4494
Merge branch 'matthias/expr/convert-more' into matthias/expr/convert-…
matthiasgoergens Apr 11, 2024
bcfa61f
Merge remote-tracking branch 'origin/matthias/expr/convert-memory' in…
matthiasgoergens Apr 11, 2024
47085c0
refactor: easier to read names
matthiasgoergens Apr 11, 2024
5b790cc
Merge branch 'matthias/expr/clean-up-bitshift' into matthias/expr/con…
matthiasgoergens Apr 11, 2024
d07003a
Foo
matthiasgoergens Apr 11, 2024
5e6998e
Fix comment
matthiasgoergens Apr 11, 2024
533b0a5
Merge branch 'matthias/expr/clean-up-bitshift' into matthias/expr/con…
matthiasgoergens Apr 11, 2024
817bf14
Deal with public inputs to stark
matthiasgoergens Apr 11, 2024
f37c89f
Clean up
matthiasgoergens Apr 11, 2024
fe89670
Explicit error
matthiasgoergens Apr 11, 2024
0311003
Convert CPU
matthiasgoergens Apr 11, 2024
5f35857
Merge branch 'main' into matthias/expr/convert-more
matthiasgoergens Apr 11, 2024
707593d
Fix shift
matthiasgoergens Apr 11, 2024
77c7ef9
Merge remote-tracking branch 'origin/main' into matthias/expr/convert…
matthiasgoergens Apr 11, 2024
b4f38e6
Merge branch 'matthias/expr/convert-memory' into matthias/expr/conver…
matthiasgoergens Apr 11, 2024
9af8652
Fix
matthiasgoergens Apr 11, 2024
717884c
Merge remote-tracking branch 'origin/main' into matthias/expr/convert…
matthiasgoergens Apr 11, 2024
e8be224
Merge branch 'main' into matthias/expr/convert-more
matthiasgoergens Apr 11, 2024
03cdd41
Merge branch 'matthias/expr/convert-more' into matthias/expr/convert-…
matthiasgoergens Apr 11, 2024
759079c
Fix memory constraints and CTL, remove unnecessary columns
matthiasgoergens Apr 11, 2024
63bafd6
Move
matthiasgoergens Apr 11, 2024
7cfab79
Merge remote-tracking branch 'origin/main' into matthias/expr/convert…
matthiasgoergens Apr 11, 2024
f6d09a3
Merge remote-tracking branch 'origin/main' into matthias/fix-memory-ctl
matthiasgoergens Apr 11, 2024
e92ba3b
Restore
matthiasgoergens Apr 11, 2024
33ed683
Fix
matthiasgoergens Apr 12, 2024
37c8f62
Fix
matthiasgoergens Apr 12, 2024
f89bf0b
Merge branch 'main' into matthias/expr/convert-cpu
matthiasgoergens Apr 12, 2024
982c4a8
Restore
matthiasgoergens Apr 12, 2024
2b77970
Restore more
matthiasgoergens Apr 12, 2024
e19e396
Fixed?
matthiasgoergens Apr 12, 2024
f31d8c1
Better
matthiasgoergens Apr 12, 2024
1be0d84
Minimize diff
matthiasgoergens Apr 12, 2024
c14d919
Minimize diff
matthiasgoergens Apr 12, 2024
b9e3943
memory: rename `COL_MAP` to `MEM`
matthiasgoergens Apr 12, 2024
ae07cfc
Merge branch 'matthias/memories/rename-COL_MAP' into matthias/fix-mem…
matthiasgoergens Apr 12, 2024
6d52e39
Merge remote-tracking branch 'origin/main' into matthias/fix-memory-ctl
matthiasgoergens Apr 12, 2024
592db53
Merge branch 'main' into matthias/fix-memory-ctl
eightfilms Apr 12, 2024
b561acb
Works
matthiasgoergens Apr 12, 2024
1badbd6
Merge remote-tracking branch 'origin/main' into matthias/fix-memory-ctl
matthiasgoergens Apr 12, 2024
ae84870
Merge remote-tracking branch 'origin/matthias/fix-memory-ctl' into ma…
matthiasgoergens Apr 12, 2024
f66a5cf
Done the TODO
matthiasgoergens Apr 12, 2024
59c88df
Clean up
matthiasgoergens Apr 12, 2024
ec7c0cc
Merge branch 'main' into matthias/fix-memory-ctl
matthiasgoergens Apr 12, 2024
cacd435
Restore recproof
matthiasgoergens Apr 12, 2024
1bfca3d
Merge remote-tracking branch 'origin/main' into matthias/fix-memory-ctl
matthiasgoergens Apr 12, 2024
2847706
Merge remote-tracking branch 'origin/matthias/fix-memory-ctl' into ma…
matthiasgoergens Apr 12, 2024
0dfe687
Minimize diff
matthiasgoergens Apr 12, 2024
50f964b
Minimise diff
matthiasgoergens Apr 12, 2024
1e77cd5
Minimise diff
matthiasgoergens Apr 12, 2024
c81d9fe
Describe what 'work out' means
matthiasgoergens Apr 12, 2024
6e8ca7f
Comment on test
matthiasgoergens Apr 12, 2024
77fc1be
Minimise diff
matthiasgoergens Apr 12, 2024
cd37cf3
Remove F
matthiasgoergens Apr 12, 2024
cb4a889
Minimize diff
matthiasgoergens Apr 12, 2024
f61b4dd
Minimise diff
matthiasgoergens Apr 12, 2024
1af0024
Merge remote-tracking branch 'origin/main' into matthias/expr/convert…
matthiasgoergens Apr 12, 2024
907aff4
Elide lifetimes
matthiasgoergens Apr 12, 2024
b96c450
Eval
matthiasgoergens Apr 12, 2024
8cad5d6
Expr: support public values
matthiasgoergens Apr 12, 2024
c3c24e1
Tickle CI
matthiasgoergens Apr 12, 2024
ca04dc4
Minimize diff
matthiasgoergens Apr 12, 2024
80102bb
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens Apr 12, 2024
231812b
Merge branch 'matthias/expr/public-input' into matthias/rump-cpu
matthiasgoergens Apr 12, 2024
8572450
Fewer constraints
matthiasgoergens Apr 12, 2024
4ac3359
Clean up
matthiasgoergens Apr 12, 2024
f4aca3e
Clean up
matthiasgoergens Apr 12, 2024
eed7e11
Format
matthiasgoergens Apr 12, 2024
3752c68
Minimise diff
matthiasgoergens Apr 12, 2024
1dea12e
Merge branch 'matthias/expr/convert-cpu' into matthias/rump-cpu
matthiasgoergens Apr 12, 2024
a74af6f
Minimise diff
matthiasgoergens Apr 12, 2024
80b7a21
Clean up
matthiasgoergens Apr 12, 2024
1251c7a
Fix
matthiasgoergens Apr 12, 2024
7063b87
Stuff
matthiasgoergens Apr 12, 2024
923fe97
Merge branch 'matthias/fix-memory-ctl' into matthias/rump-cpu
matthiasgoergens Apr 12, 2024
91954f0
Convert more
matthiasgoergens Apr 12, 2024
4314a72
Unstark
matthiasgoergens Apr 12, 2024
e4e7d98
Recursive stuff
matthiasgoergens Apr 12, 2024
a6906c0
Merge branch 'main' into matthias/expr/convert-cpu
matthiasgoergens Apr 15, 2024
7e82b80
Handle conversion better
matthiasgoergens Apr 15, 2024
92f65cc
Merge remote-tracking branch 'origin/main' into matthias/expr/convert…
matthiasgoergens Apr 15, 2024
5bf1236
Merge remote-tracking branch 'origin/matthias/expr/convert-cpu' into …
matthiasgoergens Apr 15, 2024
fae1ff9
unify
matthiasgoergens Apr 15, 2024
0876a26
Minimize diff
matthiasgoergens Apr 15, 2024
af83d1a
Minimize diff
matthiasgoergens Apr 15, 2024
98e244e
Backport
matthiasgoergens Apr 15, 2024
ed7cb67
Minimize diff
matthiasgoergens Apr 15, 2024
4050055
Simpler
matthiasgoergens Apr 15, 2024
2fb361f
Merge branch 'matthias/expr/public-input' into matthias/expr/convert-cpu
matthiasgoergens Apr 15, 2024
a332512
Merge remote-tracking branch 'origin/main' into matthias/expr/convert…
matthiasgoergens Apr 15, 2024
bee2e23
Try to fix is_running
matthiasgoergens Apr 15, 2024
481fbf7
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens Apr 15, 2024
c585fcb
Fix
matthiasgoergens Apr 15, 2024
a63b181
Fix more
matthiasgoergens Apr 15, 2024
254918e
Merge branch 'main' into matthias/expr/convert-cpu
matthiasgoergens Apr 16, 2024
400d449
Merge remote-tracking branch 'origin/matthias/expr/convert-cpu' into …
matthiasgoergens Apr 16, 2024
672519f
Remove redundant parens
matthiasgoergens Apr 16, 2024
e0ca41c
Merge remote-tracking branch 'origin/matthias/expr/convert-cpu' into …
matthiasgoergens Apr 16, 2024
1720ee4
Create random and sort bench
matthiasgoergens Apr 17, 2024
77ae750
Clean up
matthiasgoergens Apr 17, 2024
3bd9386
More blackboxing
matthiasgoergens Apr 17, 2024
4bc1562
Format
matthiasgoergens Apr 17, 2024
2b4e81f
Clippy
matthiasgoergens Apr 17, 2024
f7ddf1a
Seed from tape?
matthiasgoergens Apr 17, 2024
6bbd916
sort bench (#1577)
codeblooded1729 Apr 17, 2024
7633c83
Simpler
matthiasgoergens Apr 17, 2024
39e24b9
Fix deps
matthiasgoergens Apr 17, 2024
c596021
Merge branch 'main' into matthias/benchmark/rust/sort
matthiasgoergens Apr 17, 2024
a7c4f55
Move away from dev
matthiasgoergens Apr 17, 2024
3db554d
More black boxing
matthiasgoergens Apr 17, 2024
85b773f
Better
matthiasgoergens Apr 17, 2024
9081fc8
Merge remote-tracking branch 'origin/main' into matthias/benchmark/ru…
matthiasgoergens Apr 17, 2024
c6dd14e
Sort
matthiasgoergens Apr 17, 2024
958d403
Pretty print
matthiasgoergens Apr 17, 2024
2c45841
Formatting
matthiasgoergens Apr 17, 2024
5ecffa8
Merge branch 'matthias/benchmark/rust/sort' into matthias/rump-cpu
matthiasgoergens Apr 17, 2024
f8959b2
Clippy
matthiasgoergens Apr 17, 2024
38f276c
Add percentages and total
matthiasgoergens Apr 17, 2024
97482ba
Merge branch 'matthias/benchmark/rust/sort' into matthias/rump-cpu
matthiasgoergens Apr 17, 2024
542cdad
More parallel by default
matthiasgoergens Apr 17, 2024
7282135
Merge remote-tracking branch 'origin/main' into matthias/memory-opt-m…
matthiasgoergens Apr 17, 2024
8c322e3
Merge branch 'matthias/rump-cpu' into matthias/memory-opt-more/parall…
matthiasgoergens Apr 17, 2024
9e6996b
Minimize diff
matthiasgoergens Apr 17, 2024
192b3b2
Recursive SW
matthiasgoergens Apr 17, 2024
f7922cf
More recursing
matthiasgoergens Apr 17, 2024
145a85e
Clean up
matthiasgoergens Apr 17, 2024
1e12516
Clean up
matthiasgoergens Apr 17, 2024
628cc46
Simpler omni-bench default
matthiasgoergens Apr 17, 2024
62d80bf
Clean up
matthiasgoergens Apr 17, 2024
8609c1e
Clean up more
matthiasgoergens Apr 17, 2024
c9b4751
Restore non-parallel
matthiasgoergens Apr 17, 2024
7eab887
Clean up
matthiasgoergens Apr 17, 2024
a9a66aa
Clean up
matthiasgoergens Apr 17, 2024
45df0e2
Clean up
matthiasgoergens Apr 17, 2024
28c5937
Fix
matthiasgoergens Apr 17, 2024
e88b6f0
Clean up
matthiasgoergens Apr 17, 2024
1b8405f
clean up
matthiasgoergens Apr 17, 2024
5f97287
Remove parallel challenger
matthiasgoergens Apr 17, 2024
173605f
Minimise diff
matthiasgoergens Apr 17, 2024
e4e4096
Restore cargo.lock
matthiasgoergens Apr 17, 2024
cfd7d96
More debug output
matthiasgoergens Apr 17, 2024
8fcf093
Merge remote-tracking branch 'origin/main' into matthias/expr/convert…
matthiasgoergens Apr 18, 2024
faf0de0
Consolidate requirements
matthiasgoergens Apr 18, 2024
df9858e
Docs
matthiasgoergens Apr 19, 2024
9511d51
Comments
matthiasgoergens Apr 19, 2024
25552b6
Rename
matthiasgoergens Apr 24, 2024
d2a78ff
More rename
matthiasgoergens Apr 24, 2024
6aceddd
More rename
matthiasgoergens Apr 24, 2024
ecea356
More rename
matthiasgoergens Apr 24, 2024
75653c7
More renaming
matthiasgoergens Apr 24, 2024
023454f
Merge remote-tracking branch 'origin/main' into matthias/memory-opt-m…
matthiasgoergens Apr 24, 2024
f9c0503
Merge remote-tracking branch 'origin/main' into matthias/memory-opt-m…
matthiasgoergens Apr 24, 2024
e66dfbd
Merge remote-tracking branch 'origin/main' into matthias/expr/convert…
matthiasgoergens Apr 24, 2024
27952c9
Merge branch 'matthias/expr/convert-cpu' into matthias/rump-cpu
matthiasgoergens Apr 24, 2024
148f3f7
Big Array
matthiasgoergens Apr 24, 2024
2ee9ec7
Merge branch 'matthias/rump-cpu' into matthias/memory-opt-more/parall…
matthiasgoergens Apr 24, 2024
4702eb0
Merge remote-tracking branch 'origin/main' into matthias/memory-opt-m…
matthiasgoergens Apr 24, 2024
d745c6e
Merge remote-tracking branch 'origin/matthias/memory-opt-more/paralle…
matthiasgoergens Apr 24, 2024
32d6a4d
Restore
matthiasgoergens Apr 24, 2024
7a735ff
Restore
matthiasgoergens Apr 24, 2024
1c74e1e
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens Apr 30, 2024
20867b1
Serde
matthiasgoergens Apr 30, 2024
81a5637
more debugging
matthiasgoergens Apr 30, 2024
bb5b5ab
Fix tests
matthiasgoergens Apr 30, 2024
6c2fa27
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens Apr 30, 2024
a1aa5b0
Merge branch 'matthias/rump-cpu' into matthias/memory-opt-more/parall…
matthiasgoergens Apr 30, 2024
efaf32d
Fix tests
matthiasgoergens Apr 30, 2024
d164e0f
Remove debug output
matthiasgoergens Apr 30, 2024
019f12b
Merge remote-tracking branch 'origin/main' into matthias/memory-opt-m…
matthiasgoergens Apr 30, 2024
e3f6f60
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens May 7, 2024
3448fd8
Simpler
matthiasgoergens May 7, 2024
c1ab2ba
Simpler
matthiasgoergens May 7, 2024
966a6dd
Is running
matthiasgoergens May 7, 2024
950d4d9
Simpler
matthiasgoergens May 7, 2024
f70e756
Minimise diff
matthiasgoergens May 7, 2024
1487507
Simplify skeleton generation
matthiasgoergens May 7, 2024
443914e
Fix batch tests
matthiasgoergens May 7, 2024
ff84e1f
Minimise diff
matthiasgoergens May 7, 2024
98a703a
Remove add
matthiasgoergens May 7, 2024
e2eb740
Instruction
matthiasgoergens May 7, 2024
783bcc6
Merge branch 'matthias/rump-cpu' into matthias/memory-opt-more/parall…
matthiasgoergens May 7, 2024
668fcab
Zip
matthiasgoergens May 7, 2024
4da611f
Remove toml
matthiasgoergens May 7, 2024
c75abe4
Simpler
matthiasgoergens May 7, 2024
454f2c1
Remove node-cli
matthiasgoergens May 7, 2024
8e31403
Remove rayon
matthiasgoergens May 7, 2024
c5f9a4e
Re-introduce parallel
matthiasgoergens May 7, 2024
2f8db9e
Make taplo happy
matthiasgoergens May 7, 2024
13b8235
Update
matthiasgoergens May 7, 2024
3c46e00
Criterion as workspace
matthiasgoergens May 7, 2024
f64e20c
No state
matthiasgoergens May 7, 2024
8bfa6a3
Delete rpc
matthiasgoergens May 7, 2024
7d4b968
Workaround rayon
matthiasgoergens May 7, 2024
8d00a46
Remove obsolete, empty crates
matthiasgoergens May 7, 2024
01bf4b5
Merge branch 'matthias/remove-obsolete-crates' into matthias/investig…
matthiasgoergens May 7, 2024
48e182f
Remove more
matthiasgoergens May 7, 2024
2441749
Merge branch 'matthias/remove-obsolete-crates' into matthias/investig…
matthiasgoergens May 7, 2024
4c39c5b
Merge remote-tracking branch 'origin/main' into matthias/investigate-…
matthiasgoergens May 7, 2024
3e6a758
Merge remote-tracking branch 'origin/main' into matthias/investigate-…
matthiasgoergens May 7, 2024
0d7abd5
Merge branch 'main' into matthias/rump-cpu
matthiasgoergens May 7, 2024
96aed33
Tickle CI
matthiasgoergens May 7, 2024
acc8fad
Tickle CI
matthiasgoergens May 7, 2024
c2c1a70
Merge branch 'matthias/investigate-rayon' into matthias/memory-opt-mo…
matthiasgoergens May 7, 2024
8a1fa5c
Merge remote-tracking branch 'origin/main' into matthias/memory-opt-m…
matthiasgoergens May 7, 2024
683bf9f
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens May 7, 2024
377d8a4
Merge remote-tracking branch 'origin/matthias/rump-cpu' into matthias…
matthiasgoergens May 7, 2024
37dde58
Merge branch 'matthias/rump-cpu' into matthias/memory-opt-more/parall…
matthiasgoergens May 7, 2024
e5b2952
More timing
matthiasgoergens May 7, 2024
549fb6f
Merge branch 'matthias/more-timing' into matthias/memory-opt-more/par…
matthiasgoergens May 7, 2024
c4f0b59
Simplify
matthiasgoergens May 7, 2024
49c76bc
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens May 9, 2024
50d16a0
Fix constraints
matthiasgoergens May 9, 2024
4706ad4
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens May 10, 2024
b214847
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens May 10, 2024
872efa1
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens May 10, 2024
314f554
Merge branch 'matthias/rump-cpu' into matthias/memory-opt-more/parall…
matthiasgoergens May 10, 2024
603a77b
Merge remote-tracking branch 'origin/main' into matthias/rump-cpu
matthiasgoergens May 21, 2024
32aac0b
Merge branch 'matthias/rump-cpu' into matthias/memory-opt-more/parall…
matthiasgoergens May 21, 2024
afac8b9
Merge remote-tracking branch 'origin/main' into matthias/memory-opt-m…
matthiasgoergens May 21, 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
3 changes: 2 additions & 1 deletion circuits/src/cpu/generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn generate_cpu_trace<F: RichField>(record: &ExecutionRecord<F>) -> Vec<CpuS
// Skip instruction handled by their own tables.
// TODO: refactor, so we don't repeat logic.
{
if let Op::ADD = inst.op {
if let Op::ADD | Op::SW | Op::LW = inst.op {
continue;
}

Expand Down Expand Up @@ -150,6 +150,7 @@ pub fn generate_cpu_trace<F: RichField>(record: &ExecutionRecord<F>) -> Vec<CpuS
trace.push(row);
}

dbg!(trace.len());
log::trace!("trace {:?}", trace);

pad_trace(trace)
Expand Down
18 changes: 14 additions & 4 deletions circuits/src/generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use crate::columns_view::HasNamedColumns;
use crate::cpu::generation::{generate_cpu_trace, generate_program_mult_trace};
use crate::cpu_skeleton::generation::generate_cpu_skeleton_trace;
use crate::memory::generation::generate_memory_trace;
use crate::memory_fullword::generation::generate_fullword_memory_trace;
use crate::memory_halfword::generation::generate_halfword_memory_trace;
use crate::memory_zeroinit::generation::generate_memory_zero_init_trace;
use crate::memoryinit::generation::{generate_elf_memory_init_trace, generate_memory_init_trace};
Expand Down Expand Up @@ -55,6 +54,8 @@ pub const MIN_TRACE_LENGTH: usize = 8;
/// ## Parameters
/// `program`: A serialized ELF Program
/// `record`: Non-constrained execution trace generated by the runner
// TODO(Matthias): refactor this function into something sane.
#[allow(clippy::too_many_lines)]
#[must_use]
#[allow(clippy::too_many_lines)]
pub fn generate_traces<F: RichField + Extendable<D>, const D: usize>(
Expand All @@ -67,6 +68,8 @@ pub fn generate_traces<F: RichField + Extendable<D>, const D: usize>(
let skeleton_rows = generate_cpu_skeleton_trace(record);
let add_rows = ops::add::generate(record);
let blt_taken_rows = ops::blt_taken::generate(record);
let store_word_rows = ops::sw::generate(&record.executed);
let load_word_rows = ops::lw::generate(&record.executed);
let xor_rows = generate_xor_trace(&cpu_rows);
let shift_amount_rows = generate_shift_amount_trace(&cpu_rows);
let program_rows = generate_program_rom_trace(program);
Expand All @@ -78,7 +81,6 @@ pub fn generate_traces<F: RichField + Extendable<D>, const D: usize>(
let memory_zeroinit_rows = generate_memory_zero_init_trace(&record.executed, program);

let halfword_memory_rows = generate_halfword_memory_trace(&record.executed);
let fullword_memory_rows = generate_fullword_memory_trace(&record.executed);
let private_tape_rows = generate_private_tape_trace(&record.executed);
let public_tape_rows = generate_public_tape_trace(&record.executed);
let call_tape_rows = generate_call_tape_trace(&record.executed);
Expand All @@ -95,7 +97,8 @@ pub fn generate_traces<F: RichField + Extendable<D>, const D: usize>(
&memory_init,
&memory_zeroinit_rows,
&halfword_memory_rows,
&fullword_memory_rows,
&store_word_rows,
&load_word_rows,
&private_tape_rows,
&public_tape_rows,
&call_tape_rows,
Expand All @@ -112,6 +115,8 @@ pub fn generate_traces<F: RichField + Extendable<D>, const D: usize>(
generate_register_trace(
&cpu_rows,
&add_rows,
&store_word_rows,
&load_word_rows,
&blt_taken_rows,
&poseiden2_sponge_rows,
&private_tape_rows,
Expand All @@ -128,6 +133,8 @@ pub fn generate_traces<F: RichField + Extendable<D>, const D: usize>(
&cpu_rows,
&add_rows,
&blt_taken_rows,
&store_word_rows,
&load_word_rows,
&memory_rows,
&register_rows,
);
Expand All @@ -136,6 +143,8 @@ pub fn generate_traces<F: RichField + Extendable<D>, const D: usize>(
let rangecheck_u8_rows = generate_rangecheck_u8_trace(&rangecheck_rows, &memory_rows);
let add_trace = ops::add::generate(record);
let blt_trace = ops::blt_taken::generate(record);
let store_word_trace = ops::sw::generate(&record.executed);
let load_word_trace = ops::lw::generate(&record.executed);
let tape_commitments_rows = generate_tape_commitments_trace(record);

TableKindSetBuilder {
Expand All @@ -150,7 +159,6 @@ pub fn generate_traces<F: RichField + Extendable<D>, const D: usize>(
memory_zeroinit_stark: trace_rows_to_poly_values(memory_zeroinit_rows),
rangecheck_u8_stark: trace_rows_to_poly_values(rangecheck_u8_rows),
halfword_memory_stark: trace_rows_to_poly_values(halfword_memory_rows),
fullword_memory_stark: trace_rows_to_poly_values(fullword_memory_rows),
private_tape_stark: trace_rows_to_poly_values(private_tape_rows),
public_tape_stark: trace_rows_to_poly_values(public_tape_rows),
call_tape_stark: trace_rows_to_poly_values(call_tape_rows),
Expand All @@ -168,6 +176,8 @@ pub fn generate_traces<F: RichField + Extendable<D>, const D: usize>(
cpu_skeleton_stark: trace_rows_to_poly_values(skeleton_rows),
add_stark: trace_rows_to_poly_values(add_trace),
blt_taken_stark: trace_rows_to_poly_values(blt_trace),
store_word_stark: trace_rows_to_poly_values(store_word_trace),
load_word_stark: trace_rows_to_poly_values(load_word_trace),
tape_commitments_stark: trace_rows_to_poly_values(tape_commitments_rows),
}
.build()
Expand Down
1 change: 0 additions & 1 deletion circuits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub mod generation;
pub mod linear_combination;
pub mod linear_combination_typed;
pub mod memory;
pub mod memory_fullword;
pub mod memory_halfword;
pub mod memory_zeroinit;
pub mod memoryinit;
Expand Down
36 changes: 27 additions & 9 deletions circuits/src/memory/columns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ use plonky2::hash::poseidon2::Poseidon2Permutation;

use crate::columns_view::{columns_view_impl, make_col_map};
use crate::cross_table_lookup::Column;
use crate::memory_fullword::columns::FullWordMemory;
use crate::memory_halfword::columns::HalfWordMemory;
use crate::memory_zeroinit::columns::MemoryZeroInit;
use crate::memoryinit::columns::{MemoryInit, MemoryInitCtl};
use crate::ops::lw::columns::LoadWord;
use crate::ops::sw::columns::StoreWord;
use crate::poseidon2_output_bytes::columns::{Poseidon2OutputBytes, BYTES_COUNT};
use crate::poseidon2_sponge::columns::Poseidon2Sponge;
use crate::rangecheck::columns::RangeCheckCtl;
Expand Down Expand Up @@ -97,18 +98,35 @@ impl<F: RichField> From<&HalfWordMemory<F>> for Vec<Memory<F>> {
}
}

impl<F: RichField> From<&FullWordMemory<F>> for Vec<Memory<F>> {
fn from(val: &FullWordMemory<F>) -> Self {
if (val.ops.is_load + val.ops.is_store).is_zero() {
impl<F: RichField> From<&StoreWord<F>> for Vec<Memory<F>> {
fn from(val: &StoreWord<F>) -> Self {
if (val.is_running).is_zero() {
vec![]
} else {
izip!(val.addrs, val.limbs)
.map(|(addr, value)| Memory {
izip!(0.., val.op1_limbs)
.map(|(i, limb)| Memory {
clk: val.clk,
addr,
addr: val.address + F::from_canonical_u8(i),
value: limb,
is_store: F::ONE,
..Default::default()
})
.collect()
}
}
}

impl<F: RichField> From<&LoadWord<F>> for Vec<Memory<F>> {
fn from(val: &LoadWord<F>) -> Self {
if (val.is_running).is_zero() {
vec![]
} else {
izip!(0.., val.dst_limbs)
.map(|(i, value)| Memory {
clk: val.clk,
addr: val.address + F::from_canonical_u8(i),
value,
is_store: val.ops.is_store,
is_load: val.ops.is_load,
is_load: F::ONE,
..Default::default()
})
.collect()
Expand Down
38 changes: 25 additions & 13 deletions circuits/src/memory/generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ use plonky2::hash::hash_types::RichField;
use crate::generation::MIN_TRACE_LENGTH;
use crate::memory::columns::Memory;
use crate::memory::trace::{get_memory_inst_addr, get_memory_inst_clk, get_memory_raw_value};
use crate::memory_fullword::columns::FullWordMemory;
use crate::memory_halfword::columns::HalfWordMemory;
use crate::memory_zeroinit::columns::MemoryZeroInit;
use crate::memoryinit::columns::MemoryInit;
use crate::ops::lw::columns::LoadWord;
use crate::ops::sw::columns::StoreWord;
use crate::poseidon2_output_bytes::columns::Poseidon2OutputBytes;
use crate::poseidon2_sponge::columns::Poseidon2Sponge;
use crate::storage_device::columns::StorageDevice;
Expand Down Expand Up @@ -115,12 +116,16 @@ pub fn transform_poseidon2_output_bytes<F: RichField>(
///
/// These need to be further interleaved with runtime memory trace generated
/// from VM execution for final memory trace.
pub fn transform_fullword<F: RichField>(
fullword_memory: &[FullWordMemory<F>],
pub fn transform_sw<F: RichField>(
store_word: &[StoreWord<F>],
) -> impl Iterator<Item = Memory<F>> + '_ {
fullword_memory
.iter()
.flat_map(Into::<Vec<Memory<F>>>::into)
store_word.iter().flat_map(Into::<Vec<Memory<F>>>::into)
}

pub fn transform_lw<F: RichField>(
load_word: &[LoadWord<F>],
) -> impl Iterator<Item = Memory<F>> + '_ {
load_word.iter().flat_map(Into::<Vec<Memory<F>>>::into)
}

/// Generates Memory trace from a storage device table.
Expand Down Expand Up @@ -153,7 +158,8 @@ pub fn generate_memory_trace<F: RichField>(
memory_init_rows: &[MemoryInit<F>],
memory_zeroinit_rows: &[MemoryZeroInit<F>],
halfword_memory_rows: &[HalfWordMemory<F>],
fullword_memory_rows: &[FullWordMemory<F>],
store_word_rows: &[StoreWord<F>],
load_word_rows: &[LoadWord<F>],
private_tape_rows: &[StorageDevice<F>],
public_tape_rows: &[StorageDevice<F>],
call_tape_rows: &[StorageDevice<F>],
Expand All @@ -172,7 +178,8 @@ pub fn generate_memory_trace<F: RichField>(
transform_memory_zero_init(memory_zeroinit_rows),
generate_memory_trace_from_execution(step_rows),
transform_halfword(halfword_memory_rows),
transform_fullword(fullword_memory_rows),
transform_sw(store_word_rows),
transform_lw(load_word_rows),
transform_storage(private_tape_rows),
transform_storage(public_tape_rows),
transform_storage(call_tape_rows),
Expand Down Expand Up @@ -218,10 +225,10 @@ mod tests {
use crate::memory::columns::Memory;
use crate::memory::stark::MemoryStark;
use crate::memory::test_utils::memory_trace_test_case;
use crate::memory_fullword::generation::generate_fullword_memory_trace;
use crate::memory_halfword::generation::generate_halfword_memory_trace;
use crate::memory_zeroinit::generation::generate_memory_zero_init_trace;
use crate::memoryinit::generation::generate_memory_init_trace;
use crate::ops;
use crate::poseidon2_output_bytes::generation::generate_poseidon2_output_bytes_trace;
use crate::poseidon2_sponge::generation::generate_poseidon2_sponge_trace;
use crate::stark::utils::trace_rows_to_poly_values;
Expand Down Expand Up @@ -282,7 +289,9 @@ mod tests {
let memory_zeroinit_rows = generate_memory_zero_init_trace(&record.executed, &program);

let halfword_memory = generate_halfword_memory_trace(&record.executed);
let fullword_memory = generate_fullword_memory_trace(&record.executed);
let store_word_rows = ops::sw::generate(&record.executed);
let load_word_rows = ops::lw::generate(&record.executed
);
let private_tape_rows = generate_private_tape_trace(&record.executed);
let public_tape_rows = generate_public_tape_trace(&record.executed);

Expand All @@ -299,7 +308,8 @@ mod tests {
&memory_init,
&memory_zeroinit_rows,
&halfword_memory,
&fullword_memory,
&store_word_rows,
&load_word_rows,
&private_tape_rows,
&public_tape_rows,
&call_tape_rows,
Expand Down Expand Up @@ -374,7 +384,8 @@ mod tests {
let memory_zeroinit_rows = generate_memory_zero_init_trace(&[], &program);

let halfword_memory = generate_halfword_memory_trace(&[]);
let fullword_memory = generate_fullword_memory_trace(&[]);
let store_word_rows = ops::sw::generate(&[]);
let load_word_rows = ops::lw::generate(&[]);
let private_tape_rows = generate_private_tape_trace(&[]);
let public_tape_rows = generate_public_tape_trace(&[]);
let call_tape_rows = generate_call_tape_trace(&[]);
Expand All @@ -390,7 +401,8 @@ mod tests {
&memory_init,
&memory_zeroinit_rows,
&halfword_memory,
&fullword_memory,
&store_word_rows,
&load_word_rows,
&private_tape_rows,
&public_tape_rows,
&call_tape_rows,
Expand Down
81 changes: 0 additions & 81 deletions circuits/src/memory_fullword/columns.rs

This file was deleted.

Loading