Skip to content

Commit 3ceea30

Browse files
committed
Fix doc, pin version, add test
1 parent 67430a1 commit 3ceea30

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

.github/workflows/bench-vs-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
- name: Install SP1 toolchain
3434
run: |
3535
export PATH="$HOME/.cargo/bin:$HOME/.sp1/bin:$PATH"
36-
if ! cargo prove --version >/dev/null 2>&1; then
36+
if ! cargo prove --version 2>/dev/null | grep -q "6.0.1"; then
3737
curl -L https://sp1up.succinct.xyz | bash
3838
export PATH="$HOME/.sp1/bin:$PATH"
39-
sp1up
39+
sp1up --version v6.0.1
4040
fi
4141
cargo prove --version
4242

bin/cli/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ enum Commands {
136136
#[arg(long)]
137137
cycles: bool,
138138

139-
/// Build traces and print total main-trace field elements (rows × columns summed across all tables)
139+
/// Build traces and print total main-trace field elements (rows × columns summed across
140+
/// all tables) and aux-trace field elements (committed EF columns × rows)
140141
#[arg(long)]
141142
elements: bool,
142143
},
@@ -160,7 +161,7 @@ enum Commands {
160161
time: bool,
161162
},
162163

163-
/// Count main-trace field elements (rows × columns, summed across all tables) without proving
164+
/// Count main-trace and aux-trace field elements without proving
164165
CountElements {
165166
/// Path to the ELF file
166167
#[arg(value_parser, value_hint = ValueHint::FilePath)]

prover/src/tests/prove_elfs_tests.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,3 +1909,20 @@ fn test_addiw_neg_immediate() {
19091909
let result = crate::prove_and_verify(&elf_bytes).expect("prove_and_verify failed");
19101910
assert!(result, "addiw with negative immediate should verify");
19111911
}
1912+
1913+
/// Regression test: both main and aux field element counts must be nonzero for any real ELF.
1914+
/// Guards against silent under-count if a table is added to `Traces` but not enumerated in
1915+
/// `total_field_elements` or `total_auxiliary_field_elements`.
1916+
#[test]
1917+
fn test_count_elements_nonzero() {
1918+
let elf_bytes = crate::test_utils::asm_elf_bytes("addi_one");
1919+
let (main, aux) = crate::count_elements(&elf_bytes, &[]).expect("count_elements failed");
1920+
assert!(
1921+
main > 0,
1922+
"total_field_elements should be nonzero (got {main})"
1923+
);
1924+
assert!(
1925+
aux > 0,
1926+
"total_auxiliary_field_elements should be nonzero (got {aux})"
1927+
);
1928+
}

0 commit comments

Comments
 (0)