-
Notifications
You must be signed in to change notification settings - Fork 355
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
rv32im circuit updates #1690
rv32im circuit updates #1690
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
40a7968
to
84d916a
Compare
@@ -136,8 +136,7 @@ impl KernelBuild { | |||
|
|||
fn compile_cuda(&mut self, output: &str) { | |||
println!("cargo:rerun-if-env-changed=RISC0_CUDA_OPT"); | |||
println!("cargo:rerun-if-env-changed=NVCC_PREPEND_FLAGS"); | |||
println!("cargo:rerun-if-env-changed=NVCC_APPEND_FLAGS"); | |||
println!("cargo:rerun-if-env-changed=RISC0_NVCC_FLAGS"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Some comments provided as suggestions, or considerations.
#[cfg_attr(feature = "export-syscalls", no_mangle)] | ||
pub extern "C" fn sys_input(index: u32) -> u32 { | ||
let t0 = ecall::INPUT; | ||
let index = index & 0x07; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it important that this does not panic? My default here would have been to panic is out of range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Panic in this codepath would cause a lot of bloat. Ideally this function could be inlined. Generally I don't like the idea of the low-level sys-
functions doing a panic. We should maybe have them return error codes (I'd say Result
but it'd be nice for these functions to be callable from C). I also don't know how C will handle panics, so another reason to avoid panic from these functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that's helpful context
.clone(); | ||
post.pc = post | ||
.pc | ||
.checked_sub(WORD_SIZE as u32) | ||
.ok_or(VerificationError::ReceiptFormatError)?; | ||
post.digest() | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love to see it 🎉
NVCC_PREPEND_FLAGS
andNVCC_APPEND_FLAGS
withRISC0_NVCC_FLAGS
. IfRISC0_NVCC_FLAGS
is not set, then-arch=native
is used as a default.sys_input
which is a syscall that guests can use to access the input digest that is optionally specified for each proof request.Digest::ZERO
when the exit code isHalted
.