Skip to content

support guest program "println!" in e2e flow #929

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

hero78119
Copy link
Collaborator

@hero78119 hero78119 commented Apr 29, 2025

To close issue #632
named io as debug_println in guest program debug build, assuming no "println!" use case in guest program.

Design rationales

In debug build, we extend stack address a bit to cover a reserved 256k for io. This extra reserved space also reflect in linker script, so the write to this region wont got any complaints from either elf or riscv emulator

Besides, this PR also fix a previous problem where meaningful symbol in bss/sbss section will be skip due to their value are 0. We need to reserve and padding to cover them, since those might be some static variables initialized with 0 or uninitialized. Without do it, emulator will also complain regions is not writable.

Change scope

  • cleanup previois workaround in guest program for io
  • extend stack address for io consistency check during debug build
  • refactor load_elf bss/sbss padding issue.
  • e2e command also shows io result.
  • respect profile in guest program examples compilation.

Example testing command:

An guest program with IO

# release run
cargo run --release --features sanity-check --package ceno_zkvm --bin e2e  -- --platform=ceno --hints=10 --public-io=4191 examples/target/riscv32im-ceno-zkvm-elf/release/examples/ceno_rt_io

# debug run
cargo run --features sanity-check --package ceno_zkvm --bin e2e  -- --platform=ceno --hints=10 --public-io=4191 examples/target/riscv32im-ceno-zkvm-elf/debug/examples/ceno_rt_io

@hero78119 hero78119 changed the title Feat/io debug only support guest program "println!" in e2e flow Apr 29, 2025
@hero78119 hero78119 marked this pull request as draft April 29, 2025 02:37
@hero78119 hero78119 marked this pull request as ready for review April 29, 2025 09:10
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.

1 participant