MCPcopy Create free account
hub / github.com/argumentcomputer/ix / per_shard_steps

Function per_shard_steps

crates/kernel/src/shard.rs:1732–1749  ·  view source on GitHub ↗

Per-shard predicted full STEPS (floor + member step-cost + cross-ingress), indexed by shard id, from a built manifest and its block assignment.

(
  profile: &BlockProfile,
  shard_of: &[u32],
  manifest: &ShardManifest,
)

Source from the content-addressed store, hash-verified

1730 fbytes[src] += f64::from(size(b));
1731 }
1732 *e = src_consumers;
1733 }
1734 if fcnt[dst].remove(&b).is_some() {
1735 fbytes[dst] -= f64::from(size(b));
1736 }
1737 moves += 1;
1738 }
1739 moves
1740}
1741
1742/// Predicted per-shard costs under the static model for a given assignment
1743/// (fresh recomputation — used for reports and tests).
1744pub fn static_predicted_costs(
1745 profile: &BlockProfile,
1746 shard_of: &[u32],
1747 num_shards: usize,
1748) -> Vec<f64> {
1749 use rustc_hash::FxHashMap;
1750 let mut owned = vec![0.0f64; num_shards];
1751 let mut fr: Vec<FxHashMap<u32, ()>> = vec![FxHashMap::default(); num_shards];
1752 for b in 0..profile.num_blocks() as u32 {

Callers 1

prove_reportFunction · 0.85

Calls 3

block_step_costFunction · 0.85
blockMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected