V2 powdr#56
Draft
leonardoalt wants to merge 9 commits into
Draft
Conversation
- Add PC tracing in execute_trampoline and TCO derive for PGO collection - Make VmStateMut.custom_pvs public for powdr executor destructuring Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add apc_by_pc_index to Program for APC instruction overrides - Add APC override in interpreter (TCO handlers, pre_compute, pre_compute_max_size) - Add APC override in interpreter_preflight with is_apc flag on PcEntry - Add APC override in AOT metered execution assembly generation - Add MutGetters on AppProver for mutable instance access - Improve debug assert message for timestamp bounds Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ColumnsAir<F> impl for all AIR types (default empty impl) - Add custom ColumnsAir impl for VmAirWrapper that chains adapter + core columns - Add custom_pvs field to VmState for powdr executor destructuring - Update WhirParams construction for new upstream fields - Point workspace dependencies to powdr-labs/stark-backend v2-powdr branch Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… names - Add struct-reflection dependency to openvm-circuit-primitives, re-export StructReflection and StructReflectionHelper - Add #[derive(StructReflection)] to ~60 Cols structs across primitives, VM system, and extensions - Populate ColumnsAir impls with struct_reflection() calls for ~50 AIRs - Manual StructReflectionHelper impls for Poseidon2PeripheryCols and KeccakfPermCols (external p3 inner types) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
leonardoalt
commented
Mar 11, 2026
| k: k_whir, | ||
| log_final_poly_len: 11, | ||
| query_phase_pow_bits: WHIR_POW_BITS, | ||
| }; |
leonardoalt
commented
Mar 11, 2026
| query_phase_pow_bits: WHIR_POW_BITS, | ||
| }; | ||
| let whir_config = WhirConfig::new(log_blowup, l_skip + n_stack, whir_params, SECURITY_LEVEL); | ||
| SystemParams { |
leonardoalt
commented
Mar 11, 2026
| { | ||
| pub program_name: Option<String>, | ||
| #[getset(get = "pub")] | ||
| #[getset(get = "pub", get_mut = "pub")] |
leonardoalt
commented
Mar 11, 2026
| let pc_index = ((pc - pc_base) / openvm_instructions::program::DEFAULT_PC_STEP) as usize; | ||
| if let Some((apc_inst, _)) = exe.program.apc_by_pc_index.get(&pc_index) { | ||
| instruction = apc_inst.clone(); | ||
| } |
leonardoalt
commented
Mar 11, 2026
| memory: &mut self.memory.memory, | ||
| streams: &mut self.streams, | ||
| rng: &mut self.rng, | ||
| custom_pvs: &mut custom_pvs, |
leonardoalt
commented
Mar 11, 2026
| pub streams: &'a mut Streams<F>, | ||
| pub rng: &'a mut StdRng, | ||
| /// Custom public values to be set by the system PublicValuesExecutor | ||
| pub custom_pvs: &'a mut Vec<Option<F>>, |
leonardoalt
commented
Mar 11, 2026
| let handlers = repeat_n(&None, get_pc_index(program.pc_base)) | ||
| let base_index = get_pc_index(program.pc_base); | ||
| #[cfg(feature = "tco")] | ||
| let handlers = repeat_n(&None, base_index) |
Member
Author
There was a problem hiding this comment.
apc stuff here and below
leonardoalt
commented
Mar 11, 2026
| pub insn: Instruction<F>, | ||
| pub executor_idx: ExecutorId, | ||
| /// Whether this instruction was overridden by an APC (auto-precompile) instruction. | ||
| pub is_apc: bool, |
Member
Author
There was a problem hiding this comment.
apc stuff here and lower
leonardoalt
commented
Mar 11, 2026
| pub memory: MEM, | ||
| pub streams: Streams<F>, | ||
| pub rng: StdRng, | ||
| pub custom_pvs: Vec<Option<F>>, |
Member
Author
There was a problem hiding this comment.
why was this added in our update branch?
Member
Author
|
Do we also need the POWDR_SEGMENT_DELTA thing here? |
The v2-powdr branch of powdr-labs/stark-backend is up to date, no need for local path overrides. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Schaeff
reviewed
Mar 11, 2026
|
|
||
| #[repr(C)] | ||
| #[derive(Clone, Copy, Debug, PartialEq, Default, AlignedBorrow, Serialize, Deserialize)] | ||
| #[derive(Clone, Copy, Debug, PartialEq, Default, AlignedBorrow, StructReflection, Serialize, Deserialize)] |
Schaeff
reviewed
Mar 11, 2026
| .map( | ||
| |(pc_idx, (inst_opt, pre_compute))| -> Result<Handler<F, Ctx>, StaticProgramError> { | ||
| if let Some((inst, _)) = inst_opt { | ||
| let program_idx = if pc_idx >= base_index { pc_idx - base_index } else { usize::MAX }; |
Schaeff
reviewed
Mar 11, 2026
| .map( | ||
| |(pc_idx, (inst_opt, pre_compute))| -> Result<Handler<F, Ctx>, StaticProgramError> { | ||
| if let Some((inst, _)) = inst_opt { | ||
| let program_idx = if pc_idx >= base_index { pc_idx - base_index } else { usize::MAX }; |
Schaeff
reviewed
Mar 11, 2026
| // `PreComputeInstruction`s. | ||
| let buf: &mut [u8] = unsafe { &mut *(*buf as *mut [u8]) }; | ||
| let pre_inst = if let Some((inst, _)) = inst_opt { | ||
| let program_idx = if i >= base_index { i - base_index } else { usize::MAX }; |
…tion - Revert APC override pattern in interpreter.rs, interpreter_preflight.rs, and metered_execute.rs back to the cleaner if-let style with proper pc_index computation and unwrap() instead of unwrap_or(0) - Add timestamp field back to MeteredCtx, tracked via on_memory_operation - Add POWDR_OPENVM_SEGMENT_DELTA env-var-based timestamp segmentation to SegmentationCtx::should_segment_with_ts() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AOT execution does not emit pc tracing events needed by the PGO collector. Add execute_interpreted() which always uses the interpreter path, so PGO profiling works regardless of the aot feature flag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The internal verifier circuit can produce traces of height 2^20, which exceeds the max stacked height of 2^19 (l_skip=2 + n_stack=17). Bump n_stack to 18 so max log height is 20. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.