Compare region fixed-row candidate families
This commit is contained in:
parent
0bb7d44f82
commit
aa4147fcf2
4 changed files with 874 additions and 9 deletions
|
|
@ -24,11 +24,11 @@ use rrt_runtime::{
|
|||
RuntimeSaveSliceDocument, RuntimeSaveSliceDocumentSource, RuntimeSnapshotDocument,
|
||||
RuntimeSnapshotSource, RuntimeSummary, SAVE_SLICE_DOCUMENT_FORMAT_VERSION,
|
||||
SNAPSHOT_FORMAT_VERSION, SmpClassicPackedProfileBlock, SmpInspectionReport, SmpLoadedSaveSlice,
|
||||
SmpRt3105PackedProfileBlock, SmpSaveLoadSummary, WinInspectionReport, execute_step_command,
|
||||
extract_pk4_entry_file, inspect_campaign_exe_file, inspect_cargo_economy_sources_with_bindings,
|
||||
inspect_cargo_skin_pk4, inspect_cargo_types_dir, inspect_pk4_file,
|
||||
inspect_save_company_and_chairman_analysis_file, inspect_save_infrastructure_asset_trace_file,
|
||||
inspect_save_periodic_company_service_trace_file,
|
||||
SmpRt3105PackedProfileBlock, SmpSaveLoadSummary, WinInspectionReport,
|
||||
compare_save_region_fixed_row_run_candidates, execute_step_command, extract_pk4_entry_file,
|
||||
inspect_campaign_exe_file, inspect_cargo_economy_sources_with_bindings, inspect_cargo_skin_pk4,
|
||||
inspect_cargo_types_dir, inspect_pk4_file, inspect_save_company_and_chairman_analysis_file,
|
||||
inspect_save_infrastructure_asset_trace_file, inspect_save_periodic_company_service_trace_file,
|
||||
inspect_save_placed_structure_dynamic_side_buffer_file,
|
||||
inspect_save_region_queued_notice_records_file, inspect_save_region_service_trace_file,
|
||||
inspect_smp_file, inspect_unclassified_save_collection_headers_file, inspect_win_file,
|
||||
|
|
@ -134,6 +134,10 @@ enum Command {
|
|||
RuntimeInspectSaveCompanyChairman {
|
||||
smp_path: PathBuf,
|
||||
},
|
||||
RuntimeCompareRegionFixedRowRuns {
|
||||
left_path: PathBuf,
|
||||
right_path: PathBuf,
|
||||
},
|
||||
RuntimeInspectPeriodicCompanyServiceTrace {
|
||||
smp_path: PathBuf,
|
||||
},
|
||||
|
|
@ -304,6 +308,13 @@ struct RuntimeSaveCompanyChairmanAnalysisOutput {
|
|||
analysis: rrt_runtime::SmpSaveCompanyChairmanAnalysisReport,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
struct RuntimeRegionFixedRowRunComparisonOutput {
|
||||
left_path: String,
|
||||
right_path: String,
|
||||
comparison: rrt_runtime::SmpSaveRegionFixedRowRunComparisonReport,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
struct RuntimePeriodicCompanyServiceTraceOutput {
|
||||
path: String,
|
||||
|
|
@ -893,6 +904,12 @@ fn real_main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
Command::RuntimeInspectSaveCompanyChairman { smp_path } => {
|
||||
run_runtime_inspect_save_company_chairman(&smp_path)?;
|
||||
}
|
||||
Command::RuntimeCompareRegionFixedRowRuns {
|
||||
left_path,
|
||||
right_path,
|
||||
} => {
|
||||
run_runtime_compare_region_fixed_row_runs(&left_path, &right_path)?;
|
||||
}
|
||||
Command::RuntimeInspectPeriodicCompanyServiceTrace { smp_path } => {
|
||||
run_runtime_inspect_periodic_company_service_trace(&smp_path)?;
|
||||
}
|
||||
|
|
@ -1114,6 +1131,14 @@ fn parse_command() -> Result<Command, Box<dyn std::error::Error>> {
|
|||
smp_path: PathBuf::from(path),
|
||||
})
|
||||
}
|
||||
[command, subcommand, left_path, right_path]
|
||||
if command == "runtime" && subcommand == "compare-region-fixed-row-runs" =>
|
||||
{
|
||||
Ok(Command::RuntimeCompareRegionFixedRowRuns {
|
||||
left_path: PathBuf::from(left_path),
|
||||
right_path: PathBuf::from(right_path),
|
||||
})
|
||||
}
|
||||
[command, subcommand, path]
|
||||
if command == "runtime"
|
||||
&& subcommand == "inspect-periodic-company-service-trace" =>
|
||||
|
|
@ -1362,7 +1387,7 @@ fn parse_command() -> Result<Command, Box<dyn std::error::Error>> {
|
|||
})
|
||||
}
|
||||
_ => Err(
|
||||
"usage: rrt-cli [validate [repo-root] | finance eval <snapshot.json> | finance diff <left.json> <right.json> | runtime validate-fixture <fixture.json> | runtime summarize-fixture <fixture.json> | runtime export-fixture-state <fixture.json> <snapshot.json> | runtime diff-state <left.json> <right.json> | runtime summarize-state <snapshot.json> | runtime import-state <input.json> <snapshot.json> | runtime inspect-smp <file.smp> | runtime summarize-save-load <file.smp> | runtime load-save-slice <file.smp> | runtime inspect-save-company-chairman <file.smp> | runtime inspect-periodic-company-service-trace <file.smp> | runtime inspect-region-service-trace <file.smp> | runtime inspect-infrastructure-asset-trace <file.smp> | runtime inspect-save-region-queued-notice-records <file.smp> | runtime inspect-placed-structure-dynamic-side-buffer <file.smp> | runtime inspect-unclassified-save-collections <file.smp> | runtime import-save-state <file.smp> <snapshot.json> | runtime export-save-slice <file.smp> <save-slice.json> | runtime export-overlay-import <snapshot.json> <save-slice.json> <overlay-import.json> | runtime inspect-pk4 <file.pk4> | runtime inspect-cargo-types <CargoTypes-dir> | runtime inspect-cargo-skins <Cargo106.PK4> | runtime inspect-cargo-economy-sources <CargoTypes-dir> <Cargo106.PK4> | runtime inspect-cargo-production-selector <CargoTypes-dir> <Cargo106.PK4> | runtime inspect-cargo-price-selector <CargoTypes-dir> <Cargo106.PK4> | runtime inspect-win <file.win> | runtime extract-pk4-entry <file.pk4> <entry-name> <output-path> | runtime inspect-campaign-exe <RT3.exe> | runtime compare-classic-profile <save1.gms> <save2.gms> [saveN.gms...] | runtime compare-105-profile <save1.gms> <save2.gms> [saveN.gms...] | runtime compare-candidate-table <file1> <file2> [fileN...] | runtime compare-recipe-book-lines <file1> <file2> [fileN...] | runtime compare-setup-payload-core <file1> <file2> [fileN...] | runtime compare-setup-launch-payload <file1> <file2> [fileN...] | runtime compare-post-special-conditions-scalars <file1> <file2> [fileN...] | runtime scan-candidate-table-headers <root-dir> | runtime scan-special-conditions <root-dir> | runtime scan-aligned-runtime-rule-band <root-dir> | runtime scan-post-special-conditions-scalars <root-dir> | runtime scan-post-special-conditions-tail <root-dir> | runtime scan-recipe-book-lines <root-dir> | runtime export-profile-block <save.gms> <profile.json>]"
|
||||
"usage: rrt-cli [validate [repo-root] | finance eval <snapshot.json> | finance diff <left.json> <right.json> | runtime validate-fixture <fixture.json> | runtime summarize-fixture <fixture.json> | runtime export-fixture-state <fixture.json> <snapshot.json> | runtime diff-state <left.json> <right.json> | runtime summarize-state <snapshot.json> | runtime import-state <input.json> <snapshot.json> | runtime inspect-smp <file.smp> | runtime summarize-save-load <file.smp> | runtime load-save-slice <file.smp> | runtime inspect-save-company-chairman <file.smp> | runtime compare-region-fixed-row-runs <left.gms> <right.gms> | runtime inspect-periodic-company-service-trace <file.smp> | runtime inspect-region-service-trace <file.smp> | runtime inspect-infrastructure-asset-trace <file.smp> | runtime inspect-save-region-queued-notice-records <file.smp> | runtime inspect-placed-structure-dynamic-side-buffer <file.smp> | runtime inspect-unclassified-save-collections <file.smp> | runtime import-save-state <file.smp> <snapshot.json> | runtime export-save-slice <file.smp> <save-slice.json> | runtime export-overlay-import <snapshot.json> <save-slice.json> <overlay-import.json> | runtime inspect-pk4 <file.pk4> | runtime inspect-cargo-types <CargoTypes-dir> | runtime inspect-cargo-skins <Cargo106.PK4> | runtime inspect-cargo-economy-sources <CargoTypes-dir> <Cargo106.PK4> | runtime inspect-cargo-production-selector <CargoTypes-dir> <Cargo106.PK4> | runtime inspect-cargo-price-selector <CargoTypes-dir> <Cargo106.PK4> | runtime inspect-win <file.win> | runtime extract-pk4-entry <file.pk4> <entry-name> <output-path> | runtime inspect-campaign-exe <RT3.exe> | runtime compare-classic-profile <save1.gms> <save2.gms> [saveN.gms...] | runtime compare-105-profile <save1.gms> <save2.gms> [saveN.gms...] | runtime compare-candidate-table <file1> <file2> [fileN...] | runtime compare-recipe-book-lines <file1> <file2> [fileN...] | runtime compare-setup-payload-core <file1> <file2> [fileN...] | runtime compare-setup-launch-payload <file1> <file2> [fileN...] | runtime compare-post-special-conditions-scalars <file1> <file2> [fileN...] | runtime scan-candidate-table-headers <root-dir> | runtime scan-special-conditions <root-dir> | runtime scan-aligned-runtime-rule-band <root-dir> | runtime scan-post-special-conditions-scalars <root-dir> | runtime scan-post-special-conditions-tail <root-dir> | runtime scan-recipe-book-lines <root-dir> | runtime export-profile-block <save.gms> <profile.json>]"
|
||||
.into(),
|
||||
),
|
||||
}
|
||||
|
|
@ -1603,6 +1628,23 @@ fn run_runtime_inspect_save_company_chairman(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn run_runtime_compare_region_fixed_row_runs(
|
||||
left_path: &Path,
|
||||
right_path: &Path,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let left = inspect_save_company_and_chairman_analysis_file(left_path)?;
|
||||
let right = inspect_save_company_and_chairman_analysis_file(right_path)?;
|
||||
let comparison = compare_save_region_fixed_row_run_candidates(&left, &right)
|
||||
.ok_or("save inspection did not expose grounded region fixed-row candidate probes")?;
|
||||
let report = RuntimeRegionFixedRowRunComparisonOutput {
|
||||
left_path: left_path.display().to_string(),
|
||||
right_path: right_path.display().to_string(),
|
||||
comparison,
|
||||
};
|
||||
println!("{}", serde_json::to_string_pretty(&report)?);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn run_runtime_inspect_periodic_company_service_trace(
|
||||
smp_path: &Path,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue