Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8c0a65e
fix: defer debug variable registration to build() to avoid dedup crash
djolertrk Mar 30, 2026
8c66a1d
debuginfo: add FrameBase variant and set_value_location to DebugVarInfo
djolertrk Mar 31, 2026
5c320d2
fixup: add FrameBase to serialization round-trip test
djolertrk Apr 1, 2026
d652822
chore: fix formatting and add changelog entry
djolertrk Apr 1, 2026
eaa2aff
fix: include debug vars in block fingerprint to prevent incorrect dedup
djolertrk Apr 1, 2026
16c81f5
refactor: keep debug vars external to builder, fix remove_nodes remap
djolertrk Apr 2, 2026
9e5576e
fix: transfer debug vars during merge_basic_blocks
djolertrk Apr 3, 2026
26d4f73
fix: preserve debug vars in repeat path's cloned-block dedup
djolertrk Apr 5, 2026
b95521b
fix: keep source block metadata during merge_basic_blocks
djolertrk Apr 6, 2026
7ef89f7
fix: transfer debug metadata during MastForest merge and compact
djolertrk Apr 6, 2026
ef701ec
fix: include debug vars in merger dedup key
djolertrk Apr 6, 2026
a128c2a
fix: preserve metadata in MAST dedup
huitseeker Apr 8, 2026
7685092
fix: preserve asm metadata in builder dedup
huitseeker Apr 8, 2026
de96248
fix: preserve metadata-sensitive assembler dedup
huitseeker Apr 8, 2026
9ed5675
doc: Update documentation
huitseeker Apr 8, 2026
bba7688
test: add more tests for merger
djolertrk Apr 8, 2026
4b5ed5d
fix: first-name-wins for procedure names, exact static-link resolution
djolertrk Apr 10, 2026
c08f28c
fix: skip metadata fingerprint augmentation in stripped builds
djolertrk Apr 10, 2026
d758093
fix: import only selected alias in ensure_external_link
djolertrk Apr 11, 2026
ac7b38a
chore: bump rand to fix
djolertrk Apr 14, 2026
637c51a
fix: normalize padded static-link asm-op metadata for padded blocks
huitseeker Apr 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Implemented project assembly ([#2877](https://github.com/0xMiden/miden-vm/pull/2877)).
- Added `FastProcessor::into_parts()` to extract advice provider, memory, and precompile transcript after step-based execution ([#2901](https://github.com/0xMiden/miden-vm/pull/2901)).
- Added `FrameBase` variant to `DebugVarLocation` and `set_value_location` to `DebugVarInfo` for frame-pointer-relative debug variable locations ([#2955](https://github.com/0xMiden/miden-vm/pull/2955)).

## 0.22.0 (2026-03-18)

Expand Down
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions core/src/mast/debuginfo/asm_op_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ impl OpToAsmOpId {
entries.first().map(|(_, id)| *id)
}

/// Returns all `(op_idx, AsmOpId)` pairs for the given node, or an empty vec if the
/// node has no asm ops.
pub fn asm_ops_for_node(&self, node_id: MastNodeId) -> Vec<(usize, AsmOpId)> {
self.inner.row(node_id).map(|r| r.to_vec()).unwrap_or_default()
}

/// Validates the CSR structure integrity.
///
/// # Arguments
Expand Down
65 changes: 65 additions & 0 deletions core/src/mast/debuginfo/debug_var_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,71 @@ impl OpToDebugVarIds {
Ok(result)
}

/// Returns all `(op_idx, DebugVarId)` pairs for the given node, or an empty vec if the
/// node has no debug vars.
pub fn debug_vars_for_node(&self, node: MastNodeId) -> Vec<(usize, DebugVarId)> {
let op_range = match self.operation_range_for_node(node) {
Ok(range) => range,
Err(_) => return Vec::new(),
};

let mut result = Vec::new();
for (op_offset, op_idx) in op_range.clone().enumerate() {
if op_idx + 1 >= self.op_indptr_for_var_ids.len() {
break;
}
let var_start = self.op_indptr_for_var_ids[op_idx];
let var_end = self.op_indptr_for_var_ids[op_idx + 1];
for &var_id in &self.debug_var_ids[var_start..var_end] {
result.push((op_offset, var_id));
}
}
result
}

/// Creates a new [`OpToDebugVarIds`] with remapped node IDs.
///
/// This is used when nodes are removed from a MastForest and the remaining nodes are
/// renumbered. The remapping maps old node IDs to new node IDs.
///
/// Nodes that are not in the remapping are considered removed and their debug var data
/// is discarded.
pub fn remap_nodes(
&self,
remapping: &alloc::collections::BTreeMap<MastNodeId, MastNodeId>,
) -> Self {
if self.is_empty() {
return Self::new();
}
if remapping.is_empty() {
return self.clone();
}

let max_new_id = remapping.values().map(|id| id.to_usize()).max().unwrap_or(0);
let num_new_nodes = max_new_id + 1;

let mut new_node_data: alloc::collections::BTreeMap<usize, Vec<(usize, DebugVarId)>> =
alloc::collections::BTreeMap::new();

for (old_id, new_id) in remapping {
let vars = self.debug_vars_for_node(*old_id);
if !vars.is_empty() {
new_node_data.insert(new_id.to_usize(), vars);
}
}

let mut new_storage = Self::new();
for idx in 0..num_new_nodes {
let node_id = MastNodeId::new_unchecked(idx as u32);
let vars = new_node_data.remove(&idx).unwrap_or_default();
new_storage
.add_debug_var_info_for_node(node_id, vars)
.expect("failed to remap debug var storage");
}

new_storage
}

/// Clears this storage.
pub fn clear(&mut self) {
self.debug_var_ids.clear();
Expand Down
19 changes: 19 additions & 0 deletions core/src/mast/debuginfo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ impl DebugInfo {
self.debug_vars.get(debug_var_id)
}

/// Returns all `(op_idx, DebugVarId)` pairs for the given node, or an empty vec if the
/// node has no debug vars.
pub fn debug_vars_for_node(&self, node_id: MastNodeId) -> Vec<(usize, DebugVarId)> {
self.op_debug_var_storage.debug_vars_for_node(node_id)
}

/// Returns debug variable IDs for a specific operation within a node.
pub fn debug_vars_for_operation(
&self,
Expand Down Expand Up @@ -364,6 +370,11 @@ impl DebugInfo {
self.asm_ops.get(asm_op_id)
}

/// Returns all `(op_idx, AsmOpId)` pairs for the given node.
pub fn asm_ops_for_node(&self, node_id: MastNodeId) -> Vec<(usize, AsmOpId)> {
self.asm_op_storage.asm_ops_for_node(node_id)
}

// ASSEMBLY OP MUTATORS
// --------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -413,6 +424,14 @@ impl DebugInfo {
self.asm_op_storage = self.asm_op_storage.remap_nodes(remapping);
}

/// Remaps the debug var storage to use new node IDs after nodes have been removed/reordered.
///
/// This should be called after nodes are removed from the MastForest to ensure the debug
/// var storage still references valid node IDs.
pub(super) fn remap_debug_var_storage(&mut self, remapping: &BTreeMap<MastNodeId, MastNodeId>) {
self.op_debug_var_storage = self.op_debug_var_storage.remap_nodes(remapping);
}

// DEBUG VARIABLE MUTATORS
// --------------------------------------------------------------------------------------------

Expand Down
Loading
Loading