Promote candidate table row families into export

This commit is contained in:
Jan Petykiewicz 2026-04-21 17:56:53 -07:00
commit f7a2342a7c
4 changed files with 370 additions and 10 deletions

View file

@ -2301,5 +2301,101 @@
}
]
}
],
"files_with_port01_11_run_at_45_55_count": 37,
"files_with_warehouse01_11_run_at_56_66_count": 37,
"port00_warehouse00_row_pair_map_counts": {
"35/43": 30,
"10/18": 7
},
"port00_warehouse00_row_pair_map_paths": {
"35/43": [
"rt3_wineprefix/drive_c/rt3/maps/Alternate USA.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Argentina Opens Up.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Britain.gmp",
"rt3_wineprefix/drive_c/rt3/maps/British Isles.gmp",
"rt3_wineprefix/drive_c/rt3/maps/California Island.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Chicago to New York.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Coast to Coast.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Dutchlantis.gmp",
"rt3_wineprefix/drive_c/rt3/maps/East of Mississippi.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Eastern Canada.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Eastern China.gmp",
"rt3_wineprefix/drive_c/rt3/maps/France.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Germantown.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Greenland Growing.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Ireland.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Japan Trembles.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Louisiana.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Mexico.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Mississippi Valley.gmp",
"rt3_wineprefix/drive_c/rt3/maps/New Beginnings.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Orient Express.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Pacific Coastal.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Pacific NW.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Poland.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Russia.gmp",
"rt3_wineprefix/drive_c/rt3/maps/South East Australia.gmp",
"rt3_wineprefix/drive_c/rt3/maps/South East USA.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Southern Pacific.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Spanish Mainline.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Third Republic.gmp"
],
"10/18": [
"rt3_wineprefix/drive_c/rt3/maps/Crossing the Alps.gmp",
"rt3_wineprefix/drive_c/rt3/maps/East Coast, USA.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Germany.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Go West!.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Rhodes Unfinished.gmp",
"rt3_wineprefix/drive_c/rt3/maps/State of Germany.gmp",
"rt3_wineprefix/drive_c/rt3/maps/War Effort.gmp"
]
},
"numbered_port_warehouse_trailer_family_map_counts": {
"0x00000001": 28,
"0x00000000": 9
},
"numbered_port_warehouse_trailer_family_map_paths": {
"0x00000001": [
"rt3_wineprefix/drive_c/rt3/maps/Alternate USA.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Argentina Opens Up.gmp",
"rt3_wineprefix/drive_c/rt3/maps/California Island.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Chicago to New York.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Coast to Coast.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Crossing the Alps.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Dutchlantis.gmp",
"rt3_wineprefix/drive_c/rt3/maps/East of Mississippi.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Eastern Canada.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Eastern China.gmp",
"rt3_wineprefix/drive_c/rt3/maps/France.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Germantown.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Go West!.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Japan Trembles.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Louisiana.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Mexico.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Mississippi Valley.gmp",
"rt3_wineprefix/drive_c/rt3/maps/New Beginnings.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Orient Express.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Pacific Coastal.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Pacific NW.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Poland.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Rhodes Unfinished.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Russia.gmp",
"rt3_wineprefix/drive_c/rt3/maps/South East Australia.gmp",
"rt3_wineprefix/drive_c/rt3/maps/South East USA.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Southern Pacific.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Third Republic.gmp"
],
"0x00000000": [
"rt3_wineprefix/drive_c/rt3/maps/Britain.gmp",
"rt3_wineprefix/drive_c/rt3/maps/British Isles.gmp",
"rt3_wineprefix/drive_c/rt3/maps/East Coast, USA.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Germany.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Greenland Growing.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Ireland.gmp",
"rt3_wineprefix/drive_c/rt3/maps/Spanish Mainline.gmp",
"rt3_wineprefix/drive_c/rt3/maps/State of Germany.gmp",
"rt3_wineprefix/drive_c/rt3/maps/War Effort.gmp"
]
}
}

View file

@ -79,9 +79,11 @@ Taken together they keep the current frontier narrow and concrete:
families remain binding-only canonical stems rather than stock numbered assets.
- `event-effects-building-bindings.json` is still the checked event-side naming surface that
proves those numbered `Port%02d` / `Warehouse%02d` families matter to runtime dispatch.
- `candidate-table-named-runs.json` now shows the shipped `37` probe-bearing maps split into two
stable `00`-row families while keeping `Port01..11` fixed at rows `45..55` and
`Warehouse01..11` fixed at rows `56..66` in every probe-bearing map.
- `candidate-table-named-runs.json` now carries those stable families explicitly:
`port00_warehouse00_row_pair_map_counts` keeps the `35/43 -> 30 maps` versus `10/18 -> 7 maps`
split visible directly, `port00_warehouse00_row_pair_map_paths` keeps the carrier maps checked
in, and the same export also keeps `files_with_port01_11_run_at_45_55_count = 37` plus
`files_with_warehouse01_11_run_at_56_66_count = 37` across the whole probe-bearing corpus.
So the open question is no longer whether the numbered families exist in stock assets, bindings,
or shipped candidate tables. The real remaining question is which earlier seed/projection seam
@ -243,6 +245,10 @@ So the surviving frontier is narrower again:
`0x00438c70` allocates the live candidate pool through `0x004131f0` and the auxiliary/source
pool through `0x0041aa50`, and both constructors tail directly into the same fixed tagged-import
families rooted at `0x005c93fc` and `.\Data\BuildingTypes\`
- the trailer split is checked in directly too: the same export's
`numbered_port_warehouse_trailer_family_map_counts` keeps the `0x00000001 -> 28 maps` versus
`0x00000000 -> 9 maps` split on the fixed `Port01..11` / `Warehouse01..11` rows visible without
reopening per-map samples
- but the still-missing owner is the earlier non-stock writer or restore-time projection seam that
makes some live candidates reach those later consumers with nonzero `[candidate+0xba/+0xbb]`
despite the observed all-zero BCA corpus

View file

@ -61,10 +61,26 @@ pub(crate) struct RuntimeCandidateTableNamedRunScanReport {
pub(crate) files_with_any_numbered_port_runs_count: usize,
pub(crate) files_with_any_numbered_warehouse_runs_count: usize,
pub(crate) files_with_both_numbered_run_families_count: usize,
pub(crate) files_with_port01_11_run_at_45_55_count: usize,
pub(crate) files_with_warehouse01_11_run_at_56_66_count: usize,
pub(crate) port00_warehouse00_row_pair_map_counts: BTreeMap<String, usize>,
pub(crate) port00_warehouse00_row_pair_map_paths: BTreeMap<String, Vec<String>>,
pub(crate) numbered_port_warehouse_trailer_family_map_counts: BTreeMap<String, usize>,
pub(crate) numbered_port_warehouse_trailer_family_map_paths: BTreeMap<String, Vec<String>>,
pub(crate) skipped_file_count: usize,
pub(crate) samples: Vec<RuntimeCandidateTableNamedRunScanSample>,
}
#[derive(Debug, Default)]
struct RuntimeCandidateTableNamedRunAggregates {
files_with_port01_11_run_at_45_55_count: usize,
files_with_warehouse01_11_run_at_56_66_count: usize,
port00_warehouse00_row_pair_map_counts: BTreeMap<String, usize>,
port00_warehouse00_row_pair_map_paths: BTreeMap<String, Vec<String>>,
numbered_port_warehouse_trailer_family_map_counts: BTreeMap<String, usize>,
numbered_port_warehouse_trailer_family_map_paths: BTreeMap<String, Vec<String>>,
}
pub(crate) fn scan_candidate_table_headers(
root_path: &Path,
) -> Result<(), Box<dyn std::error::Error>> {
@ -193,6 +209,7 @@ pub(crate) fn scan_candidate_table_named_runs(
.iter()
.filter(|sample| !sample.port_runs.is_empty() && !sample.warehouse_runs.is_empty())
.count();
let aggregates = build_named_run_aggregates(&samples);
let report = RuntimeCandidateTableNamedRunScanReport {
root_path: root_path.display().to_string(),
@ -201,6 +218,15 @@ pub(crate) fn scan_candidate_table_named_runs(
files_with_any_numbered_port_runs_count,
files_with_any_numbered_warehouse_runs_count,
files_with_both_numbered_run_families_count,
files_with_port01_11_run_at_45_55_count: aggregates.files_with_port01_11_run_at_45_55_count,
files_with_warehouse01_11_run_at_56_66_count: aggregates
.files_with_warehouse01_11_run_at_56_66_count,
port00_warehouse00_row_pair_map_counts: aggregates.port00_warehouse00_row_pair_map_counts,
port00_warehouse00_row_pair_map_paths: aggregates.port00_warehouse00_row_pair_map_paths,
numbered_port_warehouse_trailer_family_map_counts: aggregates
.numbered_port_warehouse_trailer_family_map_counts,
numbered_port_warehouse_trailer_family_map_paths: aggregates
.numbered_port_warehouse_trailer_family_map_paths,
skipped_file_count,
samples,
};
@ -386,3 +412,233 @@ pub(crate) fn load_candidate_table_named_run_scan_sample(
warehouse_runs,
})
}
fn build_named_run_aggregates(
samples: &[RuntimeCandidateTableNamedRunScanSample],
) -> RuntimeCandidateTableNamedRunAggregates {
let mut aggregates = RuntimeCandidateTableNamedRunAggregates::default();
for sample in samples {
if find_named_run(&sample.port_runs, "Port01", "Port11", 45, 55, 11).is_some() {
aggregates.files_with_port01_11_run_at_45_55_count += 1;
}
if find_named_run(
&sample.warehouse_runs,
"Warehouse01",
"Warehouse11",
56,
66,
11,
)
.is_some()
{
aggregates.files_with_warehouse01_11_run_at_56_66_count += 1;
}
if let (Some(port00_run), Some(warehouse00_run)) = (
find_named_run_by_names(&sample.port_runs, "Port00", "Port00", 1),
find_named_run_by_names(&sample.warehouse_runs, "Warehouse00", "Warehouse00", 1),
) {
let row_pair_key =
format!("{}/{}", port00_run.start_index, warehouse00_run.start_index);
*aggregates
.port00_warehouse00_row_pair_map_counts
.entry(row_pair_key.clone())
.or_insert(0) += 1;
aggregates
.port00_warehouse00_row_pair_map_paths
.entry(row_pair_key)
.or_default()
.push(sample.path.clone());
}
if let (Some(port_run), Some(warehouse_run)) = (
find_named_run(&sample.port_runs, "Port01", "Port11", 45, 55, 11),
find_named_run(
&sample.warehouse_runs,
"Warehouse01",
"Warehouse11",
56,
66,
11,
),
) {
let port_signature = trailer_signature(port_run);
let warehouse_signature = trailer_signature(warehouse_run);
let trailer_family_key = if port_signature == warehouse_signature {
port_signature
} else {
format!("port={port_signature} | warehouse={warehouse_signature}")
};
*aggregates
.numbered_port_warehouse_trailer_family_map_counts
.entry(trailer_family_key.clone())
.or_insert(0) += 1;
aggregates
.numbered_port_warehouse_trailer_family_map_paths
.entry(trailer_family_key)
.or_default()
.push(sample.path.clone());
}
}
for paths in aggregates
.port00_warehouse00_row_pair_map_paths
.values_mut()
{
paths.sort();
}
for paths in aggregates
.numbered_port_warehouse_trailer_family_map_paths
.values_mut()
{
paths.sort();
}
aggregates
}
fn find_named_run<'a>(
runs: &'a [RuntimeCandidateTableNamedRun],
first_name: &str,
last_name: &str,
start_index: usize,
end_index: usize,
count: usize,
) -> Option<&'a RuntimeCandidateTableNamedRun> {
runs.iter().find(|run| {
run.first_name == first_name
&& run.last_name == last_name
&& run.count == count
&& run.start_index == start_index
&& run.end_index == end_index
})
}
fn find_named_run_by_names<'a>(
runs: &'a [RuntimeCandidateTableNamedRun],
first_name: &str,
last_name: &str,
count: usize,
) -> Option<&'a RuntimeCandidateTableNamedRun> {
runs.iter().find(|run| {
run.first_name == first_name && run.last_name == last_name && run.count == count
})
}
fn trailer_signature(run: &RuntimeCandidateTableNamedRun) -> String {
run.distinct_trailer_hex_words.join("|")
}
#[cfg(test)]
mod tests {
use super::{
RuntimeCandidateTableNamedRun, RuntimeCandidateTableNamedRunScanSample,
build_named_run_aggregates,
};
#[test]
fn builds_named_run_aggregate_split_fields() {
let samples = vec![
RuntimeCandidateTableNamedRunScanSample {
path: "Louisiana.gmp".to_string(),
profile_family: "unknown".to_string(),
source_kind: "map-fixed-catalog-range".to_string(),
observed_entry_count: 67,
port_runs: vec![
sample_run("Port00", "Port00", 35, 35, 1, vec!["0x00000001"]),
sample_run("Port01", "Port11", 45, 55, 11, vec!["0x00000001"]),
],
warehouse_runs: vec![
sample_run("Warehouse00", "Warehouse00", 43, 43, 1, vec!["0x00000001"]),
sample_run("Warehouse01", "Warehouse11", 56, 66, 11, vec!["0x00000001"]),
],
},
RuntimeCandidateTableNamedRunScanSample {
path: "State of Germany.gmp".to_string(),
profile_family: "unknown".to_string(),
source_kind: "map-fixed-catalog-range".to_string(),
observed_entry_count: 67,
port_runs: vec![
sample_run("Port00", "Port00", 10, 10, 1, vec!["0x00000000"]),
sample_run("Port01", "Port11", 45, 55, 11, vec!["0x00000000"]),
],
warehouse_runs: vec![
sample_run("Warehouse00", "Warehouse00", 18, 18, 1, vec!["0x00000000"]),
sample_run("Warehouse01", "Warehouse11", 56, 66, 11, vec!["0x00000000"]),
],
},
];
let aggregates = build_named_run_aggregates(&samples);
assert_eq!(aggregates.files_with_port01_11_run_at_45_55_count, 2);
assert_eq!(aggregates.files_with_warehouse01_11_run_at_56_66_count, 2);
assert_eq!(
aggregates
.port00_warehouse00_row_pair_map_counts
.get("35/43"),
Some(&1)
);
assert_eq!(
aggregates
.port00_warehouse00_row_pair_map_counts
.get("10/18"),
Some(&1)
);
assert_eq!(
aggregates
.numbered_port_warehouse_trailer_family_map_counts
.get("0x00000001"),
Some(&1)
);
assert_eq!(
aggregates
.numbered_port_warehouse_trailer_family_map_counts
.get("0x00000000"),
Some(&1)
);
assert_eq!(
aggregates
.port00_warehouse00_row_pair_map_paths
.get("35/43")
.cloned()
.unwrap_or_default(),
vec!["Louisiana.gmp".to_string()]
);
assert_eq!(
aggregates
.numbered_port_warehouse_trailer_family_map_paths
.get("0x00000000")
.cloned()
.unwrap_or_default(),
vec!["State of Germany.gmp".to_string()]
);
}
fn sample_run(
first_name: &str,
last_name: &str,
start_index: usize,
end_index: usize,
count: usize,
distinct_trailer_hex_words: Vec<&str>,
) -> RuntimeCandidateTableNamedRun {
RuntimeCandidateTableNamedRun {
prefix: first_name
.trim_end_matches(|ch: char| ch.is_ascii_digit())
.to_string(),
start_index,
end_index,
count,
first_name: first_name.to_string(),
last_name: last_name.to_string(),
start_offset: 0,
end_offset: 0,
distinct_trailer_hex_words: distinct_trailer_hex_words
.into_iter()
.map(str::to_string)
.collect(),
}
}
}

View file

@ -1246,12 +1246,14 @@
families.
The root scan narrows the real corpus for that question too. `runtime scan-candidate-table-headers
rt3_wineprefix/drive_c/rt3/maps` shows `37` probe-bearing shipped maps and `4` skips, while the
narrower `runtime scan-candidate-table-named-runs` command shows two stable `00`-row families
across those `37` probe-bearing maps: `30` maps keep `Port00` / `Warehouse00` at rows `35` /
`43`, while `7` maps move just those two `00` rows earlier to `10` / `18`; the
`Port01..11` and `Warehouse01..11` runs stay fixed at rows `45..55` and `56..66` in every
probe-bearing map. Trailer families split independently too: `28` maps keep the numbered rows
on trailer `0x00000001`, while `9` maps keep the same row layout but zero the same trailers.
narrower `runtime scan-candidate-table-named-runs` command now keeps those aggregates explicit
too: `port00_warehouse00_row_pair_map_counts` records the two stable `00`-row families across
those `37` probe-bearing maps as `35/43 -> 30 maps` and `10/18 -> 7 maps`, while
`files_with_port01_11_run_at_45_55_count = 37` and
`files_with_warehouse01_11_run_at_56_66_count = 37` keep the `Port01..11` / `Warehouse01..11`
runs fixed at rows `45..55` and `56..66` in every probe-bearing map. Trailer families split
independently too: `numbered_port_warehouse_trailer_family_map_counts` keeps the fixed numbered
rows on `0x00000001 -> 28 maps` versus `0x00000000 -> 9 maps`.
The checked-in evidence join is explicit now too:
`artifacts/exports/rt3-1.06/building-type-sources.json` still bounds the stock side to bare
`port` / `warehouse`, `artifacts/exports/rt3-1.06/event-effects-building-bindings.json` keeps