forked from powdr-labs/powdr
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: witness generation and PIL formatting for empty_vm
The empty_vm test was failing due to two issues: 1. Incorrect witness generation for operation_id 2. Formatting issues in the PIL output causing assertion failures Description ----------- - Modified witness generation to use constant value 2 for main._operation_id - Fixed PIL formatting in linker to match expected output format - Proper formating in polynomial declarations - Aligned witness generation with the expected values for registers - Introduced build automation testing the fix -------------- fetch this PR branch and from the root directory run ``` make setup ``` and then ``` cargo test test::compile_empty_vm ``` to see all available repo commands during development, run ``` make help ```
- Loading branch information
1 parent
5ddbe75
commit 5543e25
Showing
8 changed files
with
144 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ Cargo.lock | |
|
||
riscv/runtime/target | ||
cargo_target/ | ||
pilcom |
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,66 @@ | ||
.PHONY: all setup build test lint format clean check | ||
|
||
all: setup build test | ||
|
||
setup: | ||
@echo "Setting up development environment..." | ||
@if ! rustup target list | grep -q "riscv32imac-unknown-none-elf (installed)"; then \ | ||
echo "Installing RISC-V target..." && \ | ||
rustup target add riscv32imac-unknown-none-elf; \ | ||
else \ | ||
echo "RISC-V target already installed"; \ | ||
fi | ||
@if [ ! -d "pilcom" ]; then \ | ||
git clone https://github.com/0xPolygonHermez/pilcom.git && \ | ||
cd pilcom && npm install; \ | ||
fi | ||
|
||
export PILCOM := $(shell pwd)/pilcom | ||
export OUT_DIR := $(shell pwd)/target/out | ||
|
||
build: | ||
@echo "Building project..." | ||
cargo build | ||
|
||
test: setup | ||
@echo "Running tests..." | ||
@export PILCOM=$(PILCOM) && \ | ||
export OUT_DIR=$(OUT_DIR) && \ | ||
cargo test -- --test-threads=1 | ||
|
||
test-%: setup | ||
@echo "Running test $*..." | ||
@export PILCOM=$(PILCOM) && \ | ||
export OUT_DIR=$(OUT_DIR) && \ | ||
cargo test -- --test-threads=1 $* | ||
|
||
lint: | ||
@echo "Running linter..." | ||
cargo clippy -- -D warnings | ||
cargo fmt -- --check | ||
|
||
format: | ||
@echo "Formatting code..." | ||
cargo fmt | ||
|
||
clean: | ||
@echo "Cleaning build artifacts..." | ||
cargo clean | ||
rm -rf target/ | ||
rm -rf pilcom/node_modules | ||
|
||
check: format lint test | ||
@echo "All checks passed!" | ||
|
||
help: | ||
@echo "\nAvailable targets:" | ||
@echo " all - Setup environment, build and test (default)" | ||
@echo " setup - Setup development environment" | ||
@echo " build - Build the project" | ||
@echo " test - Run all tests" | ||
@echo " test-X - Run specific test (e.g., make test-empty_vm)" | ||
@echo " lint - Run linter checks" | ||
@echo " format - Format code" | ||
@echo " clean - Clean build artifacts" | ||
@echo " check - Run format, lint, and test" | ||
@echo " help - Show this help message\n" |
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 |
---|---|---|
|
@@ -84,7 +84,7 @@ mod test { | |
array_size: None | ||
}], | ||
None, | ||
false | ||
None | ||
) | ||
]) | ||
); | ||
|