From ea551bd85388b1b71ce458e53f7c2884fb15af22 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 19 Apr 2026 10:01:48 -0700 Subject: [PATCH] Split add-building dispatch cluster counts --- crates/rrt-cli/src/main.rs | 54 ++++++++++++++++++++++++++++++++++++++ docs/rehost-queue.md | 4 ++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/crates/rrt-cli/src/main.rs b/crates/rrt-cli/src/main.rs index 458c865..5b04dda 100644 --- a/crates/rrt-cli/src/main.rs +++ b/crates/rrt-cli/src/main.rs @@ -336,6 +336,11 @@ struct RuntimeCompactEventDispatchClusterReport { unknown_descriptor_special_condition_label_matches: Vec, unknown_descriptor_occurrences: BTreeMap>, + add_building_dispatch_record_count: usize, + add_building_dispatch_records_with_trigger_kind: usize, + add_building_dispatch_records_missing_trigger_kind: usize, + add_building_descriptor_occurrence_counts: BTreeMap, + add_building_descriptor_map_counts: BTreeMap, } #[derive(Debug, Serialize)] @@ -351,6 +356,11 @@ struct RuntimeCompactEventDispatchClusterCountsReport { dispatch_descriptor_map_counts: BTreeMap, unknown_descriptor_ids: Vec, unknown_descriptor_special_condition_label_matches: Vec, + add_building_dispatch_record_count: usize, + add_building_dispatch_records_with_trigger_kind: usize, + add_building_dispatch_records_missing_trigger_kind: usize, + add_building_descriptor_occurrence_counts: BTreeMap, + add_building_descriptor_map_counts: BTreeMap, } #[derive(Debug, Clone, Serialize)] @@ -1817,6 +1827,14 @@ fn run_runtime_inspect_compact_event_dispatch_cluster_counts( unknown_descriptor_ids: report.unknown_descriptor_ids, unknown_descriptor_special_condition_label_matches: report .unknown_descriptor_special_condition_label_matches, + add_building_dispatch_record_count: report.add_building_dispatch_record_count, + add_building_dispatch_records_with_trigger_kind: report + .add_building_dispatch_records_with_trigger_kind, + add_building_dispatch_records_missing_trigger_kind: report + .add_building_dispatch_records_missing_trigger_kind, + add_building_descriptor_occurrence_counts: report + .add_building_descriptor_occurrence_counts, + add_building_descriptor_map_counts: report.add_building_descriptor_map_counts, }, }; println!("{}", serde_json::to_string_pretty(&output)?); @@ -1838,6 +1856,11 @@ fn build_runtime_compact_event_dispatch_cluster_report( let mut dispatch_strip_payload_families = BTreeMap::::new(); let mut dispatch_descriptor_occurrence_counts = BTreeMap::::new(); let mut dispatch_descriptor_map_counts = BTreeMap::::new(); + let mut add_building_dispatch_record_count = 0usize; + let mut add_building_dispatch_records_with_trigger_kind = 0usize; + let mut add_building_dispatch_records_missing_trigger_kind = 0usize; + let mut add_building_descriptor_occurrence_counts = BTreeMap::::new(); + let mut add_building_descriptor_map_counts = BTreeMap::::new(); let mut dispatch_descriptor_occurrences = BTreeMap::>::new(); let mut unknown_descriptor_occurrences = @@ -1852,6 +1875,7 @@ fn build_runtime_compact_event_dispatch_cluster_report( let mut map_dispatch_strip_record_count = 0usize; let mut map_descriptor_keys = BTreeSet::::new(); + let mut map_add_building_descriptor_keys = BTreeSet::::new(); for record in &summary.records { let matching_rows = record .grouped_effect_rows @@ -1885,6 +1909,7 @@ fn build_runtime_compact_event_dispatch_cluster_report( *dispatch_strip_payload_families .entry(record.payload_family.clone()) .or_insert(0) += 1; + let mut record_has_add_building = false; let condition_tuples = record .standalone_condition_rows .iter() @@ -1912,6 +1937,13 @@ fn build_runtime_compact_event_dispatch_cluster_report( .entry(descriptor_key.clone()) .or_insert(0) += 1; map_descriptor_keys.insert(descriptor_key.clone()); + if compact_event_dispatch_add_building_descriptor_id(descriptor_id) { + record_has_add_building = true; + *add_building_descriptor_occurrence_counts + .entry(descriptor_key.clone()) + .or_insert(0) += 1; + map_add_building_descriptor_keys.insert(descriptor_key.clone()); + } dispatch_descriptor_occurrences .entry(descriptor_key) .or_default() @@ -1923,6 +1955,14 @@ fn build_runtime_compact_event_dispatch_cluster_report( .push(occurrence); } } + if record_has_add_building { + add_building_dispatch_record_count += 1; + if record.trigger_kind.is_some() { + add_building_dispatch_records_with_trigger_kind += 1; + } else { + add_building_dispatch_records_missing_trigger_kind += 1; + } + } } if map_dispatch_strip_record_count > 0 { @@ -1934,6 +1974,11 @@ fn build_runtime_compact_event_dispatch_cluster_report( .entry(descriptor_key) .or_insert(0) += 1; } + for descriptor_key in map_add_building_descriptor_keys { + *add_building_descriptor_map_counts + .entry(descriptor_key) + .or_insert(0) += 1; + } } let unknown_descriptor_ids = unknown_descriptor_occurrences @@ -1962,9 +2007,18 @@ fn build_runtime_compact_event_dispatch_cluster_report( unknown_descriptor_ids, unknown_descriptor_special_condition_label_matches, unknown_descriptor_occurrences, + add_building_dispatch_record_count, + add_building_dispatch_records_with_trigger_kind, + add_building_dispatch_records_missing_trigger_kind, + add_building_descriptor_occurrence_counts, + add_building_descriptor_map_counts, }) } +fn compact_event_dispatch_add_building_descriptor_id(descriptor_id: u32) -> bool { + (503..=613).contains(&descriptor_id) +} + fn run_runtime_summarize_save_load(smp_path: &Path) -> Result<(), Box> { let inspection = inspect_smp_file(smp_path)?; let summary = inspection.save_load_summary.ok_or_else(|| { diff --git a/docs/rehost-queue.md b/docs/rehost-queue.md index 4951cd0..6d7a457 100644 --- a/docs/rehost-queue.md +++ b/docs/rehost-queue.md @@ -321,7 +321,9 @@ Working rule: `runtime inspect-compact-event-dispatch-cluster-counts ` reuses the same analysis but emits only the corpus-level count fields, so the next broader map-install pass no longer needs to wade through every occurrence payload just to compare descriptor or trigger-kind - coverage. + coverage; the same counts output now also carries an explicit add-building subset so the + acquisition-side branch can compare `Add Building` records and their still-missing trigger-kind + coverage without grepping the full occurrence dump. - the per-record trigger gate is explicit now too: direct disassembly of `0x004323a0` shows the service returns before dispatch unless one-shot latch `[event+0x81f]` is clear, mode byte `[event+0x7ef]` matches the selected