Skip to content

Makefile cleanup + recursion test guard fix (follow-ups to #742)#749

Merged
Oppen merged 1 commit into
pr/recursion-guestfrom
recursion-guest-cleanup
Jun 30, 2026
Merged

Makefile cleanup + recursion test guard fix (follow-ups to #742)#749
Oppen merged 1 commit into
pr/recursion-guestfrom
recursion-guest-cleanup

Conversation

@MauroToscano

Copy link
Copy Markdown
Contributor

Small follow-up cleanups on top of #742 (pr/recursion-guest), from reviewing that PR. Targets the PR branch so it can fold into #742 before it merges.

1. Dedupe the three guest-ELF Makefile recipes

The rust, bench, and new recursion %.elf pattern recipes had a byte-identical cargo build invocation — they differed only in the source directory and whether the copied binary has a -bench suffix. Collapsed them into one canned recipe:

define build_guest_elf
cd $(1)/$* && \
	... cargo build ... (unchanged flags)
cp $(SHARED_TARGET_DIR)/riscv64im-lambda-vm-elf/release/$*$(2) $@
endef
  • $(1) = source dir, $(2) = binary-name suffix (empty for rust/bench, -bench for the recursion suite).
  • Verified with make -n that the expansion is identical to before: rust/bench rules copy release/<stem>, recursion copies release/<stem>-bench, and the cd && cargo build stays a single shell command.
  • ~30 duplicated lines → a 14-line define + three one-line $(call)s.

2. Clarify the compile-programs NOTE

The old comment said the recursion ELFs are "temporarily unused by the main tests," which reads oddly now that compile-programs builds them on every make test. Reworded to: the recursion smoke tests are #[ignore]d (not run by the main test targets, only test-prover-all), but their ELFs are still compiled on every build so they keep building.

3. Fix an off-by-one in the recursion test's input-size guard

run_recursion_pipeline_with_options asserted blob.len() < MAX_PRIVATE_INPUT_SIZE, but the executor rejects only len > MAX (executor/src/vm/memory.rs:228) — a blob exactly at the cap is accepted by the VM but would have failed the test guard. Changed to <= to match the executor's actual boundary. (Harmless today, test-only.)

No behavior change to the build output or the proving path.

- Collapse the three byte-identical guest-ELF pattern recipes (rust, bench,
  recursion) into a single `build_guest_elf` canned recipe parameterized by
  source dir ($1) and built-binary name suffix ($2). The cargo invocation was
  identical across all three; only the directory and the `-bench` copy suffix
  differed. Verified with `make -n` that the rust/bench rules still copy
  `release/<stem>` and the recursion rule copies `release/<stem>-bench`.

- Clarify the compile-programs NOTE: the recursion smoke tests are #[ignore]d
  (not run by `make test`/`test-executor`, only `test-prover-all`), but their
  guest ELFs are still compiled on every build so they keep building.

- recursion_smoke_test: the pre-check asserted `blob.len() < MAX_PRIVATE_INPUT_SIZE`
  while the executor rejects only `len > MAX` (memory.rs:228), so a blob exactly
  at the cap is accepted by the VM but would have failed the test guard. Use `<=`.
@Oppen Oppen merged commit ffa6d28 into pr/recursion-guest Jun 30, 2026
11 checks passed
@Oppen Oppen deleted the recursion-guest-cleanup branch June 30, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants