Refactor docs and make Input API more explicit (#235)

This commit is contained in:
Han
2025-12-06 12:02:14 +09:00
committed by GitHub
parent 3d844b9f8b
commit 8f6cee8a32
64 changed files with 1297 additions and 456 deletions

View File

@@ -7,7 +7,6 @@
use ere_platform_airbender::AirbenderPlatform;
use ere_test_utils::{
guest::Sha256,
io::serde::bincode::BincodeLegacy,
program::{basic::BasicProgram, Program},
};
@@ -16,5 +15,5 @@ mod airbender_rt;
#[inline(never)]
fn main() {
BasicProgram::<BincodeLegacy>::run::<AirbenderPlatform<Sha256>>();
BasicProgram::<BincodeLegacy>::run_output_sha256::<AirbenderPlatform>();
}

View File

@@ -1,10 +1,9 @@
use ere_platform_openvm::OpenVMPlatform;
use ere_test_utils::{
guest::Sha256,
io::serde::bincode::BincodeLegacy,
program::{basic::BasicProgram, Program},
};
fn main() {
BasicProgram::<BincodeLegacy>::run::<OpenVMPlatform<Sha256>>();
BasicProgram::<BincodeLegacy>::run_output_sha256::<OpenVMPlatform>();
}

View File

@@ -1,10 +1,12 @@
#![no_std]
#![no_main]
extern crate alloc;
use alloc::vec::Vec;
use core::sync::atomic::Ordering;
use core::sync::atomic::AtomicU16;
use core::sync::atomic::Ordering;
mod openvm_rt;
fn main() {

View File

@@ -1,10 +1,11 @@
#![no_std]
#![no_main]
extern crate alloc;
use alloc::vec::Vec;
use core::sync::atomic::Ordering;
use core::sync::atomic::AtomicU16;
use core::sync::atomic::Ordering;
mod pico_rt;

View File

@@ -1,9 +1,9 @@
use ere_platform_risc0::{Platform, Risc0Platform};
type P = Risc0Platform;
use ere_platform_risc0::risc0_zkvm::guest::env::read_slice;
fn main() {
let alignment = u32::from_le_bytes(P::read_whole_input().try_into().unwrap()) as usize;
let mut alignment = [0; 4];
read_slice(&mut alignment);
let alignment = u32::from_le_bytes(alignment) as usize;
let layout = std::alloc::Layout::from_size_align(1, alignment).unwrap();
let ptr = unsafe { std::alloc::alloc(layout) };

View File

@@ -1,10 +1,11 @@
#![no_std]
#![no_main]
extern crate alloc;
use alloc::vec::Vec;
use core::sync::atomic::Ordering;
use core::sync::atomic::AtomicU16;
use core::sync::atomic::Ordering;
mod risc0_rt;

View File

@@ -1,10 +1,11 @@
#![no_std]
#![no_main]
extern crate alloc;
use alloc::vec::Vec;
use core::sync::atomic::Ordering;
use core::sync::atomic::AtomicU16;
use core::sync::atomic::Ordering;
mod sp1;