-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add mips-zkm-zkvm-elf triple #134721
Add mips-zkm-zkvm-elf triple #134721
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jieyouxu (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
These commits modify compiler targets. |
This comment has been minimized.
This comment has been minimized.
// Some crates (*cough* crossbeam) assume you have 64 bit | ||
// atomics if the target name is not in a hardcoded list. |
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.
Btw, as for crossbeam, this issue was already resolved over a year ago. crossbeam-rs/crossbeam#1033
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
Thanks for the PR. Before this target can be accepted, this PR will need two things:
- Can you please also add platform support docs for this Tier 3 target?
- Please also confirm that the target conforms with the Tier 3 target policy, as described in Adding a new target.
- For example, see Add arm64e-apple-tvos target #130614 (comment).
It is not at all clear to me (as a compiler maintainer who just tried to use Google to learn about zkvm) that these two uses of the term "zkvm" are referring to the same thing. It would be rather bad if they are not, so I would like some step taken to prevent/clarify problems here. |
@saethlin there is one already. https://doc.rust-lang.org/rustc/platform-support/riscv32im-risc0-zkvm-elf.html @jieyouxu thanks! I will follow the instruction and add the docs. |
I have read that. It is not clear to me, based on the terminology and authorship of this PR that these two things called "zkvm" are affiliated with each other, or are referring to a generic concept that they both agree they do not own. |
Good question. you are right, zkVM is a general concept that representing it can generate the validity proof (I would use this instead of zero knowledge proof for easier understanding) for some instruction set. For RISC0, it builds a zkVM for RV32, and for zkMIPS, we build a zkVM for MIPS32R2. More generally speaking, there are also some other impls, like zkWASM, or custom instruction set, like Miden. For your concern, should dev be aware of different zkVMs? I think we should due to:
|
@eigmax Does "zkvm" actually have a specific meaning with regards to these targets that they all uniformly share, or are they allowed to have entirely different ZK proof implementations? Do they share a syscall standard or some other abstract interface? Why does "zkvm" matter for the target's name? To put it another way, if tomorrow Apple decided to make their entire Darwin OS run on a ZKVM, would we want to rename all the Apple targets to |
cc @flaub @jbruestle @SchmErik Can you explain your perspective on the matter of using |
//@ revisions: mips_zkm_zkvm_elf | ||
//@ [mips_unknown_linux_uclibc] compile-flags: --target mips-zkm-zkvm-elf | ||
//@ [mips_unknown_linux_uclibc] needs-llvm-components: mips |
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.
You copied the revision name, this is incorrect.
I suspect that the OS section is useful here, is that the ZK may be some different with BareMetal embedded software developing. |
I guess that there may be a case that, a same app can be useful for both baremetal embedded hardware and zKVM emulator. |
Would that mean I do not think it is appropriate to introduce future possibilities about "what if we make |
In general, code compiled for "bare metal" targets does not necessarily have code to initialize hardware. Case in point: |
The cfg is useful. When it runs on zkVM, the IO and some libraries it can use are different (like Math), it requires |
Will the IO and libraries between mips-zkm-zkvm-elf be the same as the ones of riscv32im-risc0-zkvm-elf, or are they allowed to be different? If I write a program that has an instance of An operating system is defined by having things in common for the target, for all the instances of that target OS string. While some architecture specific variation is to be expected, nothing you have said so far suggests that you are working together to make sure that your "OS" has even the faintest similarity to their "OS". "They both involve very fancy math" is not a functional similarity at the compiler level. A target OS is not defined simply by having things different from bare metal. All bare metal binaries are allowed to be unique and beautiful snowflakes. |
It's not same, we used different syscall(RV vs MIPS) to read and write data stream between the host and guest program, for the libraries, it's can be same, but not now. When saying a zkVM, it's basically an OS with a proof system. The proof systems are totally different from each others. |
Just so we are all crystal clear, the existing zkvm target has these syscalls, which it uses yolo linkage to pick up: rust/library/std/src/sys/pal/zkvm/abi.rs Line 21 in 917bfa7
And it helpfully documents
If you want to say you are target_os=zkvm, you are agreeing that these are your syscalls too. Which I am completely confident they are not, because not only did you just say they are not, the existing risc0 zkvm target says they are specific to the risc0 zkvm. It is my opinion that this PR should be rejected, and I would prefer that we delete the existing risc0 zkvm target. Both of these zkvms are just bare-metal runtimes. The std implementation that the risc0 zkvm target has is incomplete and panicky with no path to being a complete std implementation. Just like the much-hated/regretted wasm32-unknown-unknown. |
@eigmax So at this point the main question I think we have is: Why shouldn't we just have a MIPS bare metal target? I mean, we might need another such target. But then you can build programs for that, and supply the API calls needed via a library, and we can talk if your target grows complicated enough that it actually supplies half of the stdlib. |
@workingjubilee yes, at least we need a mips target here, like I believe it's not the time to import the a new zkVM OS, since there is not standard ABI. I was confused by the merge of risc0's target. |
I am too. We'll sort this all out and keep you informed. It will take some time. |
It looks like we have a mipsel-unknown-none target but not a mips-unknown-none target? I assume you want a big endian bare metal MIPS target, right, @eigmax? Yeah, that sounds fine. |
Yes, that's the point. Thanks! |
Hi @workingjubilee and @saethlin, We were away for the holidays but now we are back. We’ve read the conversation on this thread and wanted to respond. There have been zkVM’s before risc0’s but they have used a custom ISA. We are one of the first zkVMs to use an existing ISA and as we have gained more traction, many other implementations have popped up. The whole intention of using In hindsight, using Having Thanks, cc @flaub and @jbruestle |
I have created #135376 to summarize the discussion on RISC0 and nominated that instead to get the discussion out of this closed PR. |
We are trying to add a new target
mips-zkm-zkvm-elf
into rustc.We have implemented a MIPS zkVM(zero knowledge virtual machine) to generate validity/ZK proof for general purpose computing. It allows the dev to compile the rust program into MIPS ELF, and the it proves the MIPS emulator/VM and generate a succinct proof to tell the verifier that the computing has been executed as expected.
This new target can significantly reduce the installation overhead for Rust dev.