Split infrastructure mixed prelude class by mode family

This commit is contained in:
Jan Petykiewicz 2026-04-18 15:49:53 -07:00
commit 785d953bd7

View file

@ -2210,8 +2210,7 @@ pub struct SmpSavePlacedStructureDynamicSideBufferNamePreludeCandidatePatternCor
pub dominant_mode_family: Option<String>,
pub dominant_mode_family_count: usize,
#[serde(default)]
pub mode_family_counts:
Vec<SmpSavePlacedStructureDynamicSideBufferNamePreludeModeFamilyCount>,
pub mode_family_counts: Vec<SmpSavePlacedStructureDynamicSideBufferNamePreludeModeFamilyCount>,
#[serde(default)]
pub sample_rows: Vec<SmpSavePlacedStructureDynamicSideBufferNamePreludeCandidateSample>,
}
@ -2237,6 +2236,12 @@ pub struct SmpSavePlacedStructureDynamicSideBufferNamePreludeProfileSpanCorrelat
#[serde(default)]
pub dominant_candidate_pattern:
Option<SmpSavePlacedStructureDynamicSideBufferNamePreludeCandidatePattern>,
#[serde(default)]
pub dominant_mode_family: Option<String>,
pub dominant_mode_family_count: usize,
#[serde(default)]
pub mode_family_counts:
Vec<SmpSavePlacedStructureDynamicSideBufferNamePreludeModeFamilyCount>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@ -4613,6 +4618,36 @@ fn build_infrastructure_asset_trace_report(
.unwrap_or_else(|| {
"no mode-family correlation summary was available for the prelude candidates".to_string()
}),
side_buffer
.and_then(|probe| probe.payload_envelope_summary.as_ref())
.and_then(|summary| summary.name_prelude_candidate_summary.as_ref())
.map(|summary| {
format!(
"profile-span mode-family correlations now also split the previous 0x55f3 spans directly: {:?}",
summary
.profile_span_correlations
.iter()
.map(|entry| format!(
"span=0x{:x} rows={} dominant-mode={:?} x{} mode-counts={:?}",
entry.previous_profile_chunk_len_to_next_name_or_end,
entry.row_count,
entry.dominant_mode_family,
entry.dominant_mode_family_count,
entry
.mode_family_counts
.iter()
.map(|mode| format!(
"{}:{}",
mode.mode_family, mode.count
))
.collect::<Vec<_>>()
))
.collect::<Vec<_>>()
)
})
.unwrap_or_else(|| {
"no profile-span mode-family correlation summary was available".to_string()
}),
side_buffer
.and_then(|probe| probe.payload_envelope_summary.as_ref())
.and_then(|summary| summary.name_prelude_candidate_summary.as_ref())
@ -4734,7 +4769,7 @@ fn build_infrastructure_asset_trace_report(
"the smaller attach primitive 0x00490a3c no longer looks like the semantic fork by itself: it just allocates one literal Infrastructure child, seeds it through 0x455b70 with caller-provided stem input, attaches it through 0x5395d0, seeds position lanes through 0x539530/0x53a5b0, and optionally caches it as primary child".to_string(),
],
blockers: vec![
"how the remaining compact-prefix regimes subdivide the now-grounded save-side mode families inside the dominant mixed 0x0001/0xff class, which the new mode-family correlation already narrows to bridge:62 / track_cap:21 / tunnel:19 on grounded q.gms, now that the pure bridge 0x0002/0xff class and pure BallastCap 0x0055/0x00 class already map cleanly".to_string(),
"how the remaining compact-prefix regimes subdivide the tiny residual outlier spans inside the dominant mixed 0x0001/0xff class, now that the new mode-family correlations already narrow grounded q.gms to bridge:62 / track_cap:21 / tunnel:19 overall and further split the prior 0x55f3 spans as 0x06 -> pure bridge, 0x03 -> mostly tunnel with a small track-cap residue, 0x0f/0x2d/0x33 -> track_cap, 0x36 -> tunnel, leaving only sparse mixed outliers such as 0x27".to_string(),
"how the payload streams reached through 0x00518380 -> 0x00518140 align with the embedded 0x55f1 name-pair groups and compact-prefix regimes surfaced by the save-side probe".to_string(),
"how the observed 0x55f3-to-next-0x55f1 gaps partition between the two 0x52ebd0 flag bytes and the next-record prelude now that 0x0048a6c0 is grounded as the writer for the outer child-count / primary-child prelude".to_string(),
"which fields written through the grounded 0x00490960 -> 0x004559d0 -> slot +0x4c -> 0x52ec50 chain retain the 0x38a5 embedded name-pair semantics before route/local-runtime follow-ons take over".to_string(),
@ -4849,7 +4884,7 @@ fn build_infrastructure_asset_trace_report(
),
];
let notes = vec![
"Infrastructure asset trace now makes the side-buffer-versus-triplet split explicit: owner seam identity is grounded, the pure bridge-only 0x0002/0xff candidate class is grounded save-side, the upstream chooser above the child attach path is grounded as paired DT/ST siblings at 0x004a2c80 and 0x004a34e0 with decoded Bridge/Tunnel/BallastCap/Overpass families, grounded top-level branch meaning, grounded bridge/tunnel material selector roles, a concrete child-construction/write-side chain through 0x00490960, 0x00491c60, 0x0048a6c0, 0x00455a40, and 0x004559d0, and stable 0x00490960 mode families for BallastCap, TrackCap, Overpass, Tunnel, and Bridge branches. The current save-side name corpus already maps BallastCap, TrackCap, Tunnel, and Bridge rows onto those families directly, and the new mode-family correlation further narrows the dominant mixed 0x0001/0xff class to bridge:62 / track_cap:21 / tunnel:19 on grounded q.gms; the remaining unknown is how that mixed one-child class subdivides before the seeded lanes, slot +0x4c payload, and trailing footer path reach the serialized stream.".to_string(),
"Infrastructure asset trace now makes the side-buffer-versus-triplet split explicit: owner seam identity is grounded, the pure bridge-only 0x0002/0xff candidate class is grounded save-side, the upstream chooser above the child attach path is grounded as paired DT/ST siblings at 0x004a2c80 and 0x004a34e0 with decoded Bridge/Tunnel/BallastCap/Overpass families, grounded top-level branch meaning, grounded bridge/tunnel material selector roles, a concrete child-construction/write-side chain through 0x00490960, 0x00491c60, 0x0048a6c0, 0x00455a40, and 0x004559d0, and stable 0x00490960 mode families for BallastCap, TrackCap, Overpass, Tunnel, and Bridge branches. The current save-side name corpus already maps BallastCap, TrackCap, Tunnel, and Bridge rows onto those families directly, the candidate-pattern correlation narrows the dominant mixed 0x0001/0xff class to bridge:62 / track_cap:21 / tunnel:19, and the profile-span correlation further splits most of that mixed class by prior 0x55f3 span, leaving only sparse outlier spans such as 0x27 and the small track-cap residue inside 0x03 as the remaining unknown.".to_string(),
if st_only_name_pair_corpus {
"The current save-side side-buffer corpus is ST-only, so this trace directly exercises the ST chooser sibling while the DT sibling remains grounded statically but unexercised in this save.".to_string()
} else {
@ -13502,15 +13537,27 @@ fn parse_save_placed_structure_dynamic_side_buffer_probe(
)
.take(8)
.collect::<Vec<_>>();
let mut name_prelude_profile_span_groups = BTreeMap::<usize, Vec<(u16, u8)>>::new();
for (_, _, _, child_count_candidate, saved_primary_child_byte_candidate, previous_span) in
&name_prelude_candidate_rows
let mut name_prelude_profile_span_groups =
BTreeMap::<usize, Vec<(u16, u8, Option<String>, Option<String>)>>::new();
for (
_,
primary_name,
secondary_name,
child_count_candidate,
saved_primary_child_byte_candidate,
previous_span,
) in &name_prelude_candidate_rows
{
if let Some(previous_span) = previous_span {
name_prelude_profile_span_groups
.entry(*previous_span)
.or_default()
.push((*child_count_candidate, *saved_primary_child_byte_candidate));
.push((
*child_count_candidate,
*saved_primary_child_byte_candidate,
primary_name.clone(),
secondary_name.clone(),
));
}
}
let profile_span_correlations = name_prelude_profile_span_groups
@ -13519,7 +13566,14 @@ fn parse_save_placed_structure_dynamic_side_buffer_probe(
let mut pattern_counts = BTreeMap::<(u16, u8), usize>::new();
let mut child_count_counts = BTreeMap::<u16, usize>::new();
let mut saved_primary_counts = BTreeMap::<u8, usize>::new();
for (child_count_candidate, saved_primary_child_byte_candidate) in &rows {
let mut mode_family_counts = BTreeMap::<String, usize>::new();
for (
child_count_candidate,
saved_primary_child_byte_candidate,
primary_name,
secondary_name,
) in &rows
{
*pattern_counts
.entry((*child_count_candidate, *saved_primary_child_byte_candidate))
.or_default() += 1;
@ -13529,6 +13583,15 @@ fn parse_save_placed_structure_dynamic_side_buffer_probe(
*saved_primary_counts
.entry(*saved_primary_child_byte_candidate)
.or_default() += 1;
*mode_family_counts
.entry(
classify_side_buffer_mode_family(
primary_name.as_deref(),
secondary_name.as_deref(),
)
.to_string(),
)
.or_default() += 1;
}
let dominant_pattern = pattern_counts
.iter()
@ -13567,6 +13630,14 @@ fn parse_save_placed_structure_dynamic_side_buffer_probe(
.then_with(|| right_key.cmp(left_key))
})
.map(|(value, count)| (*value, *count));
let dominant_mode_family = mode_family_counts
.iter()
.max_by(|(left_key, left_count), (right_key, right_count)| {
left_count
.cmp(right_count)
.then_with(|| right_key.cmp(left_key))
})
.map(|(mode_family, count)| (mode_family.clone(), *count));
SmpSavePlacedStructureDynamicSideBufferNamePreludeProfileSpanCorrelation {
previous_profile_chunk_len_to_next_name_or_end,
row_count: rows.len(),
@ -13582,6 +13653,21 @@ fn parse_save_placed_structure_dynamic_side_buffer_probe(
.map(|(_, count)| count)
.unwrap_or_default(),
dominant_candidate_pattern: dominant_pattern,
dominant_mode_family: dominant_mode_family
.as_ref()
.map(|(mode_family, _)| mode_family.clone()),
dominant_mode_family_count: dominant_mode_family
.map(|(_, count)| count)
.unwrap_or_default(),
mode_family_counts: mode_family_counts
.into_iter()
.map(|(mode_family, count)| {
SmpSavePlacedStructureDynamicSideBufferNamePreludeModeFamilyCount {
mode_family,
count,
}
})
.collect(),
}
})
.take(8)
@ -24444,7 +24530,103 @@ mod tests {
sample_rows: Vec::new(),
},
],
profile_span_correlations: Vec::new(),
profile_span_correlations: vec![
SmpSavePlacedStructureDynamicSideBufferNamePreludeProfileSpanCorrelation {
previous_profile_chunk_len_to_next_name_or_end: 3,
row_count: 17,
dominant_child_count_candidate: Some(1),
dominant_child_count_candidate_count: 17,
dominant_saved_primary_child_byte_candidate: Some(0xff),
dominant_saved_primary_child_byte_candidate_hex: Some(
"0xff".to_string(),
),
dominant_saved_primary_child_byte_candidate_count: 17,
dominant_candidate_pattern: Some(
SmpSavePlacedStructureDynamicSideBufferNamePreludeCandidatePattern {
child_count_candidate: 1,
child_count_candidate_hex: "0x0001".to_string(),
saved_primary_child_byte_candidate: 0xff,
saved_primary_child_byte_candidate_hex: "0xff"
.to_string(),
count: 17,
},
),
dominant_mode_family: Some("tunnel".to_string()),
dominant_mode_family_count: 15,
mode_family_counts: vec![
SmpSavePlacedStructureDynamicSideBufferNamePreludeModeFamilyCount {
mode_family: "track_cap".to_string(),
count: 2,
},
SmpSavePlacedStructureDynamicSideBufferNamePreludeModeFamilyCount {
mode_family: "tunnel".to_string(),
count: 15,
},
],
},
SmpSavePlacedStructureDynamicSideBufferNamePreludeProfileSpanCorrelation {
previous_profile_chunk_len_to_next_name_or_end: 6,
row_count: 72,
dominant_child_count_candidate: Some(1),
dominant_child_count_candidate_count: 62,
dominant_saved_primary_child_byte_candidate: Some(0xff),
dominant_saved_primary_child_byte_candidate_hex: Some(
"0xff".to_string(),
),
dominant_saved_primary_child_byte_candidate_count: 72,
dominant_candidate_pattern: Some(
SmpSavePlacedStructureDynamicSideBufferNamePreludeCandidatePattern {
child_count_candidate: 1,
child_count_candidate_hex: "0x0001".to_string(),
saved_primary_child_byte_candidate: 0xff,
saved_primary_child_byte_candidate_hex: "0xff"
.to_string(),
count: 62,
},
),
dominant_mode_family: Some("bridge".to_string()),
dominant_mode_family_count: 72,
mode_family_counts: vec![
SmpSavePlacedStructureDynamicSideBufferNamePreludeModeFamilyCount {
mode_family: "bridge".to_string(),
count: 72,
},
],
},
SmpSavePlacedStructureDynamicSideBufferNamePreludeProfileSpanCorrelation {
previous_profile_chunk_len_to_next_name_or_end: 0x27,
row_count: 3,
dominant_child_count_candidate: Some(1),
dominant_child_count_candidate_count: 3,
dominant_saved_primary_child_byte_candidate: Some(0xff),
dominant_saved_primary_child_byte_candidate_hex: Some(
"0xff".to_string(),
),
dominant_saved_primary_child_byte_candidate_count: 3,
dominant_candidate_pattern: Some(
SmpSavePlacedStructureDynamicSideBufferNamePreludeCandidatePattern {
child_count_candidate: 1,
child_count_candidate_hex: "0x0001".to_string(),
saved_primary_child_byte_candidate: 0xff,
saved_primary_child_byte_candidate_hex: "0xff"
.to_string(),
count: 3,
},
),
dominant_mode_family: Some("bridge".to_string()),
dominant_mode_family_count: 2,
mode_family_counts: vec![
SmpSavePlacedStructureDynamicSideBufferNamePreludeModeFamilyCount {
mode_family: "bridge".to_string(),
count: 2,
},
SmpSavePlacedStructureDynamicSideBufferNamePreludeModeFamilyCount {
mode_family: "tunnel".to_string(),
count: 1,
},
],
},
],
sample_rows: Vec::new(),
},
),
@ -24608,9 +24790,19 @@ mod tests {
.iter()
.any(|line| line.contains("compact-prefix regimes subdivide")
&& line.contains("bridge:62 / track_cap:21 / tunnel:19")
&& line.contains("0x0002/0xff")
&& line.contains("0x0001/0xff")
&& line.contains("0x0055/0x00"))
&& line.contains("0x06 -> pure bridge")
&& line.contains("0x03 -> mostly tunnel")
&& line.contains("0x27"))
);
assert!(
trace.candidate_consumer_hypotheses[0]
.evidence
.iter()
.any(|line| line.contains(
"profile-span mode-family correlations now also split the previous 0x55f3 spans directly"
) && line.contains("span=0x6 rows=72")
&& line.contains("span=0x3 rows=17")
&& line.contains("span=0x27 rows=3"))
);
assert!(
trace.candidate_consumer_hypotheses[0]
@ -24691,17 +24883,20 @@ mod tests {
trace.candidate_consumer_hypotheses[0]
.evidence
.iter()
.any(|line| line.contains("BridgeSTWood_Section.3dp aligns with mode 0x01 Bridge")
&& line.contains("TunnelSTBrick_Cap/Section.3dp with mode 0x02 Tunnel")
&& line.contains("BallastCapST_Cap.3dp with mode 0x0a BallastCap")
&& line.contains("TrackCapST_Cap.3dp with mode 0x0b TrackCap"))
.any(
|line| line.contains("BridgeSTWood_Section.3dp aligns with mode 0x01 Bridge")
&& line.contains("TunnelSTBrick_Cap/Section.3dp with mode 0x02 Tunnel")
&& line.contains("BallastCapST_Cap.3dp with mode 0x0a BallastCap")
&& line.contains("TrackCapST_Cap.3dp with mode 0x0b TrackCap")
)
);
assert!(
trace.candidate_consumer_hypotheses[0]
.evidence
.iter()
.any(|line| line.contains("mode-family correlations now also split the candidate patterns directly")
&& line.contains("0x0002/0xff rows=18")
.any(|line| line.contains(
"mode-family correlations now also split the candidate patterns directly"
) && line.contains("0x0002/0xff rows=18")
&& line.contains("bridge"))
);
assert!(