Skip to content
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

implement (non-)volatile table modular circuits and e2e public io #457

Merged
merged 24 commits into from
Oct 31, 2024

Conversation

hero78119
Copy link
Collaborator

@hero78119 hero78119 commented Oct 24, 2024

Working items & Scope

  • add module table circuit, e.g. DynVolatileRamTable for memory, NonVolatileRamCircuit for Register/Public IO/ProgramDataCircuit.
  • separate program data into dedicate circuit, and keep memory volatile.
  • prover/verifier protocol to evaluate public io
  • evaluate DynVolatileRamTable table address on verifier succinctly
  • register public_io and test e2e

succinctly address vector argument refer here: #378 (comment)

Public IO Auxiliary will cover in next PR

@hero78119 hero78119 changed the title memory init/finalize and public io [WIP] jmemory init/finalize and public io Oct 24, 2024
@hero78119 hero78119 changed the title [WIP] jmemory init/finalize and public io [WIP] memory init/finalize and public io Oct 24, 2024
@kunxian-xia kunxian-xia self-requested a review October 24, 2024 11:06
ceno_zkvm/src/structs.rs Outdated Show resolved Hide resolved
@hero78119 hero78119 changed the title [WIP] memory init/finalize and public io memory init/finalize and public io Oct 25, 2024
@hero78119 hero78119 changed the title memory init/finalize and public io implement (non-)volatile table modular circuits and e2e public io Oct 25, 2024
ceno_emul/src/platform.rs Outdated Show resolved Hide resolved
@matthiasgoergens
Copy link
Collaborator

What does 'volatile' mean in this context?

// Find the final mem data and cycles.
// TODO retrieve max address access
// as we already support non-uniform proving of memory
let num_entry = 1 << 12;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this magic number come from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just the previous hardcode value in memory gadget. We will have "max address access" in trace to replace it.

@naure
Copy link
Collaborator

naure commented Oct 29, 2024

@hero78119 I resolved the merge conflicts in here; hope you don’t mind.

@naure
Copy link
Collaborator

naure commented Oct 30, 2024

@hero78119 Ready to merge?

@hero78119
Copy link
Collaborator Author

@hero78119 Ready to merge?

@kunxian-xia is under reviewing and will finish sooner (BTW thanks for help resolving conflicts 🙏)

@kunxian-xia
Copy link
Collaborator

@hero78119 I think I don't have time to do the review by this week. You can merge it. We can follow up in future PRs.

@hero78119
Copy link
Collaborator Author

@hero78119 I think I don't have time to do the review by this week. You can merge it. We can follow up in future PRs.

okay, I will address above typo then merge first !

@hero78119
Copy link
Collaborator Author

hero78119 commented Oct 31, 2024

Have address most of comments and clarified and resolve conflicts. To unlock developments, I will merge to master first and track issue in follow up tasks

@hero78119 hero78119 merged commit 6541209 into master Oct 31, 2024
6 checks passed
@hero78119 hero78119 deleted the feat/mem_proof_v2 branch October 31, 2024 16:56
@matthiasgoergens
Copy link
Collaborator

Public IO Auxiliary will cover in next PR

@hero78119 Do you have a link to that PR, please?

for instance_num_vars in args.start..args.end {
// The performance benchmark is hook on number of "add" opcode instances.
// Each iteration in the loop contributes 2 add instances,
// so we divide by 2 here to ensure "instance_num_vars" aligns with the actual number of add instances.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hero78119

What does this mean?

What does instance_num_vars mean?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means the number of variables in the multilinear polynomial which encodes witnesses of the add opcode circuit. For example, if we have 2^10 add execution traces, then we can use ml polynomials of nv = 10 to encode the witnesses (rs1.value: UInt, rs2.value: UInt, rd.value: UInt).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants