pub(in crate::inspect::smp) fn format_u16_word_signature(words: &[u16]) -> String {
    words
        .iter()
        .map(|word| format!("0x{word:04x}"))
        .collect::<Vec<_>>()
        .join(", ")
}

pub(in crate::inspect::smp) fn compact_nondirect_signature_family(
    grouped_marker_relative_offset: Option<usize>,
    head_signature_words: &[u16],
    post_group_signature_words: &[u16],
) -> String {
    let grouped_marker_bucket = grouped_marker_relative_offset.unwrap_or(0);
    let head_word_2 = head_signature_words.get(2).copied().unwrap_or_default();
    let head_word_4 = head_signature_words.get(4).copied().unwrap_or_default();
    let head_word_6 = head_signature_words.get(6).copied().unwrap_or_default();
    let head_word_8 = head_signature_words.get(8).copied().unwrap_or_default();
    let head_word_10 = head_signature_words.get(10).copied().unwrap_or_default();
    let post_word_1 = post_group_signature_words
        .get(1)
        .copied()
        .unwrap_or_default();
    let post_word_3 = post_group_signature_words
        .get(3)
        .copied()
        .unwrap_or_default();
    let post_word_5 = post_group_signature_words
        .get(5)
        .copied()
        .unwrap_or_default();
    let post_word_7 = post_group_signature_words
        .get(7)
        .copied()
        .unwrap_or_default();

    format!(
        "nondirect-ge{:02x}-h{:04x}-{:04x}-{:04x}-{:04x}-{:04x}-p{:04x}-{:04x}-{:04x}-{:04x}",
        grouped_marker_bucket,
        head_word_2,
        head_word_4,
        head_word_6,
        head_word_8,
        head_word_10,
        post_word_1,
        post_word_3,
        post_word_5,
        post_word_7,
    )
}
