fn position_map(layer: &[usize]) -> Vec<(usize, usize)>
Build a map from node_id → position_index within a layer.