Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
24ab5c8
Added blake test cases
lorenzogentile404 May 15, 2026
8fe72e6
added comments and used more explicit names
lorenzogentile404 May 15, 2026
9daf65a
ras
lorenzogentile404 May 15, 2026
c900c75
properly checked exit code of the test
lorenzogentile404 May 15, 2026
8426ec7
Merge branch '3116-zktracer-add-more-blake-test-cases' of github.com:…
lorenzogentile404 May 15, 2026
2bd5bed
ras
lorenzogentile404 May 15, 2026
7b1b0c2
fixed run_blake2f_full.sh
lorenzogentile404 May 15, 2026
756c529
added README
lorenzogentile404 May 15, 2026
5ea4f29
test: add blake2f vector selectors
lorenzogentile404 May 15, 2026
b18db17
test: simplify blake2f all runner
lorenzogentile404 May 15, 2026
f5d92ce
added comment
lorenzogentile404 May 15, 2026
67ab39e
Merge branch 'main' into 3116-zktracer-add-more-blake-test-cases
lorenzogentile404 May 18, 2026
8466057
added atomic assembly tests to the repo and removed python script to …
lorenzogentile404 May 18, 2026
eb74c95
test: convert blake2f vectors to in bytes
lorenzogentile404 May 18, 2026
af15f81
updated README
lorenzogentile404 May 18, 2026
695d13d
added to repo atomic assembly tests
lorenzogentile404 May 18, 2026
b05eb70
ras
lorenzogentile404 May 18, 2026
9cdf23d
removed script to run op tests all together
lorenzogentile404 May 18, 2026
c5ddb4e
test: move blake2f all runner to examples makefile
lorenzogentile404 May 18, 2026
2b0d5c3
ras
lorenzogentile404 May 18, 2026
35c5bc9
test: rename blake all vectors target
lorenzogentile404 May 18, 2026
f49d4b6
ras
lorenzogentile404 May 18, 2026
e75ec01
ras
lorenzogentile404 May 18, 2026
404d1df
renamed zkc-test to riscv-test
lorenzogentile404 May 18, 2026
d0a782c
Merge branch 'main' into 3116-zktracer-add-more-blake-test-cases
lorenzogentile404 May 18, 2026
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ e2e/e2e-runtime-report.html
e2e/e2e-runtime-report-summary.json
.zig-cache/
arithmetization/src/test/examples/linker_script.ld
arithmetization/src/test/examples/asm/src/op/*.s

# Runtime sequencer deny-list, seeded empty by Makefile/gradle before each env start
# and mutated by E2E tests via withDenyListAddresses. Never commit.
Expand Down
13 changes: 11 additions & 2 deletions arithmetization/src/test/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# Moreover, ABI being LP64 (soft-float) is relevant only for float numbers, which we do not use, so it can be omitted as well.

# Declare all targets as phony to prevent conflicts with files of the same name
.PHONY: exec debug compile zkc-exec zkc-debug clean clean-all linker-script verify-elf
.PHONY: exec debug compile zkc-exec zkc-debug clean clean-all linker-script verify-elf blake-all

# Directory of this Makefile (used for relative paths)
MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

# Test to run (with src optional subfolder and extension), mandatory unless clean-all or linker-script are the targets
# src_optional_subfolder/your_test(.s|.zig|.rs)
ifeq ($(filter clean-all linker-script,$(MAKECMDGOALS)),)
ifeq ($(filter clean-all linker-script blake-all,$(MAKECMDGOALS)),)
ifndef TEST
$(error TEST is mandatory. Usage: make TEST=src_optional_subfolder/your_test(.s|.zig|.rs))
endif
Expand Down Expand Up @@ -192,3 +192,12 @@ verify-elf: $(BIN)
(echo "ERROR: SP mismatch: expected $(SP), got $(SP_FROM_ELF)" && exit 1)
@echo " SP: $(SP) (expected) = $(SP_FROM_ELF) (from ELF)"
@echo "All values match\n"

# Run all blake test vectors in `rust/src/blake/blake.all`
blake-all:
@i=0; while IFS= read -r in_bytes; do \
i=$$((i + 1)); \
output=$$(make -f $(MAKEFILE_DIR)Makefile TEST=blake/blake_with_in_bytes.rs IN_BYTES="$$in_bytes" 2>&1); \
result_line=$$(printf '%s\n' "$$output" | sed '/^[[:space:]]*$$/d' | tail -n 2 | head -n 1); \
echo "case $$i: $$result_line"; \
done < $(MAKEFILE_DIR)rust/src/blake/blake.all
39 changes: 21 additions & 18 deletions arithmetization/src/test/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ make -f /path/to/linea-monorepo/arithmetization/src/test/examples/Makefile TEST=
Useful shell function (add to `~/.zshrc` or `~/.bashrc`):

```bash
zkc-test() {
riscv-test() {
local makefile="path/to/linea-monorepo/arithmetization/src/test/examples/Makefile"
case "$1" in
clean-all|linker-script)
clean-all|linker-script|blake-all)
# targets that do NOT require TEST argument
make -f "$makefile" "$1" "${@:2}"
;;
Expand All @@ -48,7 +48,7 @@ zkc-test() {
make -f "$makefile" "$1" TEST="$2" "${@:3}"
;;
*)
# default target (zkc-test foo.<ext> is the same as zkc-test exec TEST=foo.<ext>)
# default target (riscv-test foo.<ext> is the same as riscv-test exec TEST=foo.<ext>)
make -f "$makefile" TEST="$1" "${@:2}"
;;
esac
Expand All @@ -57,33 +57,35 @@ zkc-test() {
# Usage examples

# Compile and execute (note that <name>.<ext> can be replaced by <src_optional_subfolder>/<name>.<ext>)
zkc-test <name>.<ext>
riscv-test <name>.<ext>
# Compile and execute with input bytes
zkc-test <name>.<ext> IN_BYTES="0xAABB"
riscv-test <name>.<ext> IN_BYTES="0xAABB"
# Compile and debug
zkc-test debug <name>.<ext>
riscv-test debug <name>.<ext>
# Compile and debug with input bytes
zkc-test debug <name>.<ext> IN_BYTES="0xAABB"
riscv-test debug <name>.<ext> IN_BYTES="0xAABB"
# Compile and execute with input bytes at a custom offset
zkc-test <name>.<ext> IN_BYTES="0xAABB" IN_BYTES_OFFSET=0x08800008
riscv-test <name>.<ext> IN_BYTES="0xAABB" IN_BYTES_OFFSET=0x08800008
# Compile only
zkc-test compile <name>.<ext>
riscv-test compile <name>.<ext>
# Clean build artifacts for a specific test
zkc-test clean <name>.<ext>
riscv-test clean <name>.<ext>
# Clean all build artifacts
zkc-test clean-all
riscv-test clean-all
# Run all converted Blake test vectors
riscv-test blake-all
# Run blake_with_in_embedded.rs (input bytes are embedded in main())
zkc-test blake/blake_with_in_embedded.rs
riscv-test blake/blake_with_in_embedded.rs
# Run blake_with_in_bytes.rs with IN_BYTES="0x<213_bytes_input_hex><64_bytes_expected_output_hex>"
zkc-test blake/blake_with_in_bytes.rs IN_BYTES="0x0000000c48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001ba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b74b12bb6fdbffa2d17d87c5392aab792dc252d5de4533cc9518d38aa8dbf1925ab92386edd4009923"
riscv-test blake/blake_with_in_bytes.rs IN_BYTES="0x0000000c48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001ba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b74b12bb6fdbffa2d17d87c5392aab792dc252d5de4533cc9518d38aa8dbf1925ab92386edd4009923"
# Generate the linker script with custom input bytes offset
zkc-test linker-script IN_BYTES_OFFSET=0x00000042
riscv-test linker-script IN_BYTES_OFFSET=0x00000042
# Verify ELF offsets, entry point and sp match the default ones
zkc-test verify-elf <name>.<ext>
riscv-test verify-elf <name>.<ext>
# Verify ELF offsets, entry point and sp match the custom ones
zkc-test verify-elf <name>.<ext> PROGRAM_OFFSET=0x10000000 IN_BYTES_OFFSET=0x18800000 SP=0x187fffff
riscv-test verify-elf <name>.<ext> PROGRAM_OFFSET=0x10000000 IN_BYTES_OFFSET=0x18800000 SP=0x187fffff
# Compile and verify generated ELF offsets, entry point and sp match the default ones
zkc-test compile <name>.<ext> VERIFY_ELF=true
riscv-test compile <name>.<ext> VERIFY_ELF=true
```

## Targets
Expand All @@ -99,6 +101,7 @@ zkc-test compile <name>.<ext> VERIFY_ELF=true
| `make clean-all` | Remove all build artifacts |
| `make linker-script` | Generate the linker script with the memory layout |
| `make verify-elf TEST=foo.<ext>` | Verify ELF offsets, entry point and sp match the ones in the Makefile |
| `make blake-all` | Run all blake test vectors in `rust/src/blake/blake.all` |

## Options

Expand Down Expand Up @@ -128,4 +131,4 @@ Moreover, ABI being `LP64` (soft-float) is relevant only for float numbers, whic
0x08800000 ── input starts
↓ input grows up (up to 1 GiB)
0x48800000 ── input ends at most
```
```
73 changes: 0 additions & 73 deletions arithmetization/src/test/examples/asm/scripts/README.md

This file was deleted.

Loading
Loading