fn inp2idx(node_id: NodeId, v: &Value) -> i16