pub trait SystemChipComplex<RA, PB: ProverBackend> {
// Required methods
fn load_program(&mut self, cached_program_trace: CommittedTraceData<PB>);
fn transport_init_memory_to_device(&mut self, memory: &GuestMemory);
fn generate_proving_ctx(
&mut self,
system_records: SystemRecords<PB::Val>,
record_arenas: Vec<RA>,
) -> Vec<AirProvingContext<PB>>;
// Provided method
fn finalize_trace_heights(&self, _heights: &mut [usize]) { ... }
}
Expand description
Trait for trace generation of all system AIRs. The system chip complex is special because we may
not exactly following the exact matching between Air
and Chip
. Moreover we may require more
flexibility than what is provided through the trait object [AnyChip
].
The SystemChipComplex is meant to be constructible once the VM configuration is known, and it can be loaded with arbitrary programs supported by the instruction set available to its configuration. The SystemChipComplex is meant to persistent between instances of proof generation.
Required Methods§
Sourcefn load_program(&mut self, cached_program_trace: CommittedTraceData<PB>)
fn load_program(&mut self, cached_program_trace: CommittedTraceData<PB>)
Loads the program in the form of a cached trace with prover data.
Sourcefn transport_init_memory_to_device(&mut self, memory: &GuestMemory)
fn transport_init_memory_to_device(&mut self, memory: &GuestMemory)
Transport the initial memory state to device. This may be called before preflight execution begins and start async device processes in parallel to execution.
Sourcefn generate_proving_ctx(
&mut self,
system_records: SystemRecords<PB::Val>,
record_arenas: Vec<RA>,
) -> Vec<AirProvingContext<PB>>
fn generate_proving_ctx( &mut self, system_records: SystemRecords<PB::Val>, record_arenas: Vec<RA>, ) -> Vec<AirProvingContext<PB>>
The caller must guarantee that record_arenas
has length equal to the number of system
AIRs, although some arenas may be empty if they are unused.
Provided Methods§
Sourcefn finalize_trace_heights(&self, _heights: &mut [usize])
fn finalize_trace_heights(&self, _heights: &mut [usize])
This function is only used for metric collection purposes and custom implementations are free to ignore it.
Since system chips (primarily memory) will only have all information needed to compute the
true used trace heights after generate_proving_ctx
is called, this method will be called
after generate_proving_ctx
on the trace heights
of all AIRs (including non-system AIRs)
in the AIR ID order.
The default implementation does nothing.