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

enable continuations and mem on main, reduce intermediates stage 3 #135

Draft
wants to merge 28 commits into
base: feature/rom_sm
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a138e21
enable continuations and mem on main, reduce intermediates stage 3
zkronos73 Oct 27, 2024
0cec4a5
fix-sctx (#137)
xavi-pinsach Oct 28, 2024
f1c47b4
ROM SM and ROM merkelizer tool (#136)
fractasy Oct 28, 2024
96de74c
update main.pil
zkronos73 Oct 28, 2024
594d0f6
Merge branch 'develop' into feature/main-continuations
zkronos73 Oct 28, 2024
5d94172
update pil, remove end column
zkronos73 Oct 28, 2024
30f3124
Distributed WC (#134)
rickb80 Oct 28, 2024
7dda331
Backup changes to support main continuations
fractasy Oct 28, 2024
763ed6f
Merge remote-tracking branch 'origin/develop' into feature/main-conti…
fractasy Oct 29, 2024
685c040
Fix most constraints, except the last one
fractasy Oct 29, 2024
9e045f8
update pil with last continuations contraints
zkronos73 Oct 29, 2024
78d60f2
Feature/executor (#140)
xavi-pinsach Oct 30, 2024
46481c4
fix doc
xavi-pinsach Oct 30, 2024
6cd9736
Merge pull request #142 from 0xPolygonHermez/fix/doc
xavi-pinsach Oct 30, 2024
61117ea
Compile new main.pil and fix Emu accordingly
fractasy Oct 30, 2024
5b45ab2
binary continuations working except global constraints
xavi-pinsach Oct 30, 2024
60cb3ae
Fixes to RomSM assume/prove
fractasy Oct 30, 2024
a22560d
Merge remote-tracking branch 'origin/develop' into feature/main-conti…
xavi-pinsach Oct 30, 2024
e73f412
cargo fmt & clippy
xavi-pinsach Oct 30, 2024
da14564
improve code
xavi-pinsach Oct 30, 2024
ed47f79
wip main continuations
xavi-pinsach Oct 31, 2024
6e714dd
Stats per register usage. Remove debug asserts from binary SM.
fractasy Oct 31, 2024
f60be5f
Merge branch 'feature/main-continuations' of github.com:0xPolygonHerm…
fractasy Oct 31, 2024
0179068
main continuations working
xavi-pinsach Nov 1, 2024
4abecee
cargo fmt&clippy
xavi-pinsach Nov 1, 2024
35293e5
remove unnecessary println
xavi-pinsach Nov 3, 2024
3776e98
End zisk emulation in ROM_EXIT address
fractasy Nov 4, 2024
758b6d8
Merge branch 'feature/main-continuations' of github.com:0xPolygonHerm…
fractasy Nov 4, 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
68 changes: 45 additions & 23 deletions Cargo.lock

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

26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ members = [
"state-machines/mem",
"state-machines/rom",
"witness-computation",
"ziskos/entrypoint",
"ziskos/entrypoint",
]

resolver = "2"
Expand All @@ -26,19 +26,19 @@ opt-level = 3
opt-level = 3

[workspace.dependencies]
#proofman-common = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
#proofman-macros = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
#proofman-util = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
#proofman = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
#pil-std-lib = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
#stark = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
proofman-common = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
proofman-macros = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
proofman-util = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
proofman = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
pil-std-lib = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
stark = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", branch ="develop" }
#Local development
proofman-common = { path = "../pil2-proofman/common" }
proofman-macros = { path = "../pil2-proofman/macros" }
proofman-util = { path = "../pil2-proofman/util" }
proofman = { path = "../pil2-proofman/proofman" }
pil-std-lib = { path = "../pil2-proofman/pil2-components/lib/std/rs" }
stark = { path = "../pil2-proofman/provers/stark" }
#proofman-common = { path = "../pil2-proofman/common" }
#proofman-macros = { path = "../pil2-proofman/macros" }
#proofman-util = { path = "../pil2-proofman/util" }
#proofman = { path = "../pil2-proofman/proofman" }
#pil-std-lib = { path = "../pil2-proofman/pil2-components/lib/std/rs" }
#stark = { path = "../pil2-proofman/provers/stark" }

p3-field = { git = "https://github.com/Plonky3/Plonky3.git", rev = "c3d754ef77b9fce585b46b972af751fe6e7a9803" }
log = "0.4"
Expand Down
6 changes: 2 additions & 4 deletions book/getting_started/quickstart_dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ git clone -b develop https://github.com/0xPolygonHermez/pil2-compiler.git
git clone -b develop https://github.com/0xPolygonHermez/zisk.git
git clone -b develop https://github.com/0xPolygonHermez/pil2-proofman.git
git clone -b develop https://github.com/0xPolygonHermez/pil2-stark-js.git

git clone --recursive -b develop https://github.com/0xPolygonHermez/pil2-stark.git
git clone -b feature/setup https://github.com/0xPolygonHermez/pil2-proofman-js
```

Expand Down Expand Up @@ -116,7 +114,7 @@ node ../pil2-compiler/src/pil.js pil/zisk.pil -I pil,../pil2-components/lib/std_

### Compile the PIl2 Stark C++ Library (run only once):
```bash
(cd ../pil2-stark && git submodule init && git submodule update && make clean && make -j starks_lib && make -j bctree)
(cd ../pil2-proofman/pil2-stark && git submodule init && git submodule update && make clean && make -j starks_lib && make -j bctree)
```

### Generate PIL-Helpers Rust Code
Expand All @@ -140,7 +138,7 @@ cargo build --release

> If you get a library not found error, set the path manually:
> ```bash
> export RUSTFLAGS="-L native=/home/{path to your pil2-stark folder}/lib"
> export RUSTFLAGS="-L native={path to your pil2-stark folder}/pil2-stark/lib"
> ```

## Generate & Verify Proofs
Expand Down
4 changes: 4 additions & 0 deletions core/src/inst_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ impl InstContext {
end: false,
}
}
pub fn to_text(&self) -> String {
let s = format! {"a={:x} b={:x} c={:x} flag={} sp={} pc={} step={} end={}", self.a, self.b, self.c, self.flag, self.sp, self.pc, self.step, self.end};
s
}
}

impl Default for InstContext {
Expand Down
5 changes: 4 additions & 1 deletion core/src/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ impl Mem {

// Check that the address and width fall into this section address range
if (addr < section.start) || ((addr + width) > section.end) {
panic!("Mem::write_silent() invalid addr={}", addr);
panic!(
"Mem::write_silent() invalid addr={}={:x} write section start={:x} end={:x}",
addr, addr, section.start, section.end
);
}

// Calculate the write position
Expand Down
20 changes: 11 additions & 9 deletions core/src/zisk_definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ pub const STORE_IND: u64 = 2;

/* Memory map:

|--------------- ROM_ENTRY (0x1000)
| (rom entry, calls program, ~BIOS)
|---------------
|--------------- ROM_ENTRY first instr ( 0x1000)
| calls program at ROM_ADDR, then returns
| kind of a BIOS
|--------------- ROM_EXIT last instr (0x10000000)
...
|--------------- ROM_ADDR (0x80000000)
|--------------- ROM_ADDR (0x80000000)
| (rom program)
|--------------- INPUT_ADDR
|--------------- INPUT_ADDR (0x90000000)
| (input data)
|--------------- SYS_ADDR (= RAM_ADDR)
|--------------- SYS_ADDR (= RAM_ADDR) (0xa0000000)
| (sys = 32 registers)
|--------------- OUTPUT_ADDR
|--------------- OUTPUT_ADDR (0xa0010000)
| (output data)
|--------------- AVAILABLE_MEM_ADDR
|--------------- AVAILABLE_MEM_ADDR (0xa0020000)
| (program memory)
|---------------
|--------------- (0xb0000000)

*/
pub const ROM_ADDR: u64 = 0x80000000;
Expand All @@ -44,6 +45,7 @@ pub const OUTPUT_MAX_SIZE: u64 = 0x10000; // 64K
pub const AVAILABLE_MEM_ADDR: u64 = OUTPUT_ADDR + OUTPUT_MAX_SIZE;
pub const AVAILABLE_MEM_SIZE: u64 = RAM_SIZE - OUTPUT_MAX_SIZE - SYS_SIZE;
pub const ROM_ENTRY: u64 = 0x1000;
pub const ROM_EXIT: u64 = 0x10000000;
pub const ARCH_ID_ZISK: u64 = 0xFFFEEEE;
pub const UART_ADDR: u64 = SYS_ADDR + 512;

Expand Down
Loading
Loading