Trace infrastructure mixed exact prefix classes

This commit is contained in:
Jan Petykiewicz 2026-04-18 16:05:22 -07:00
commit 7f0e863185
3 changed files with 148 additions and 14 deletions

View file

@ -2221,9 +2221,21 @@ pub struct SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixCorrel
pub mode_family_counts:
Vec<SmpSavePlacedStructureDynamicSideBufferNamePreludeModeFamilyCount>,
#[serde(default)]
pub name_pair_summaries:
Vec<SmpSavePlacedStructureDynamicSideBufferDominantProfileSpanNamePairSummary>,
#[serde(default)]
pub profile_span_counts:
Vec<SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixProfileSpanCount>,
#[serde(default)]
pub sample_rows: Vec<SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixSample>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixProfileSpanCount {
pub previous_profile_chunk_len_to_next_name_or_end: usize,
pub count: usize,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixSample {
pub sample_index: usize,
@ -4862,12 +4874,34 @@ fn build_infrastructure_asset_trace_report(
})
.map(|correlation| {
format!(
"the exact 0xff0000ff/0x0001/0xff compact-prefix class is now explicit: dominant name={:?}/{:?} x{}, dominant span={:?} x{}, and sample rows={:?}",
"the exact 0xff0000ff/0x0001/0xff compact-prefix class is now explicit: dominant name={:?}/{:?} x{}, dominant span={:?} x{}, mode counts={:?}, name-pair counts={:?}, span counts={:?}, and sample rows={:?}",
correlation.dominant_primary_name,
correlation.dominant_secondary_name,
correlation.dominant_name_pair_count,
correlation.dominant_profile_span,
correlation.dominant_profile_span_count,
correlation
.mode_family_counts
.iter()
.map(|mode| format!("{}:{}", mode.mode_family, mode.count))
.collect::<Vec<_>>(),
correlation
.name_pair_summaries
.iter()
.map(|entry| format!(
"{:?}/{:?}:{}",
entry.primary_name, entry.secondary_name, entry.count
))
.collect::<Vec<_>>(),
correlation
.profile_span_counts
.iter()
.map(|entry| format!(
"0x{:x}:{}",
entry.previous_profile_chunk_len_to_next_name_or_end,
entry.count
))
.collect::<Vec<_>>(),
correlation
.sample_rows
.iter()
@ -4895,12 +4929,26 @@ fn build_infrastructure_asset_trace_report(
})
.map(|correlation| {
format!(
"the exact 0xff0000ff/0x0002/0xff compact-prefix class is now explicit too: dominant name={:?}/{:?} x{}, dominant span={:?} x{}, and sample rows={:?}",
"the exact 0xff0000ff/0x0002/0xff compact-prefix class is now explicit too: dominant name={:?}/{:?} x{}, dominant span={:?} x{}, mode counts={:?}, span counts={:?}, and sample rows={:?}",
correlation.dominant_primary_name,
correlation.dominant_secondary_name,
correlation.dominant_name_pair_count,
correlation.dominant_profile_span,
correlation.dominant_profile_span_count,
correlation
.mode_family_counts
.iter()
.map(|mode| format!("{}:{}", mode.mode_family, mode.count))
.collect::<Vec<_>>(),
correlation
.profile_span_counts
.iter()
.map(|entry| format!(
"0x{:x}:{}",
entry.previous_profile_chunk_len_to_next_name_or_end,
entry.count
))
.collect::<Vec<_>>(),
correlation
.sample_rows
.iter()
@ -14189,6 +14237,27 @@ fn parse_save_placed_structure_dynamic_side_buffer_probe(
}
})
.collect(),
name_pair_summaries: name_pair_counts
.into_iter()
.map(|((primary_name, secondary_name), count)| {
SmpSavePlacedStructureDynamicSideBufferDominantProfileSpanNamePairSummary {
primary_name,
secondary_name,
count,
}
})
.collect(),
profile_span_counts: profile_span_counts
.into_iter()
.map(
|(previous_profile_chunk_len_to_next_name_or_end, count)| {
SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixProfileSpanCount {
previous_profile_chunk_len_to_next_name_or_end,
count,
}
},
)
.collect(),
sample_rows: rows
.iter()
.take(8)
@ -25321,6 +25390,24 @@ mod tests {
count: 15,
},
],
name_pair_summaries: vec![
SmpSavePlacedStructureDynamicSideBufferDominantProfileSpanNamePairSummary {
primary_name: Some("TunnelSTBrick_Section.3dp".to_string()),
secondary_name: Some("Infrastructure".to_string()),
count: 15,
},
SmpSavePlacedStructureDynamicSideBufferDominantProfileSpanNamePairSummary {
primary_name: Some("TrackCapST_Cap.3dp".to_string()),
secondary_name: Some("Infrastructure".to_string()),
count: 2,
},
],
profile_span_counts: vec![
SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixProfileSpanCount {
previous_profile_chunk_len_to_next_name_or_end: 3,
count: 17,
},
],
sample_rows: vec![
SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixSample {
sample_index: 0,
@ -25367,6 +25454,19 @@ mod tests {
count: 1,
},
],
name_pair_summaries: vec![
SmpSavePlacedStructureDynamicSideBufferDominantProfileSpanNamePairSummary {
primary_name: Some("TunnelSTBrick_Section.3dp".to_string()),
secondary_name: Some("Infrastructure".to_string()),
count: 1,
},
],
profile_span_counts: vec![
SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixProfileSpanCount {
previous_profile_chunk_len_to_next_name_or_end: 0x27,
count: 1,
},
],
sample_rows: vec![
SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixSample {
sample_index: 0,
@ -25413,6 +25513,19 @@ mod tests {
count: 2,
},
],
name_pair_summaries: vec![
SmpSavePlacedStructureDynamicSideBufferDominantProfileSpanNamePairSummary {
primary_name: Some("BridgeSTWood_Section.3dp".to_string()),
secondary_name: Some("Infrastructure".to_string()),
count: 2,
},
],
profile_span_counts: vec![
SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixProfileSpanCount {
previous_profile_chunk_len_to_next_name_or_end: 0x27,
count: 2,
},
],
sample_rows: vec![
SmpSavePlacedStructureDynamicSideBufferNamePreludeCompactPrefixSample {
sample_index: 0,