From e5aca73c55c710f54a2ec875ad3322aeb2088a2e Mon Sep 17 00:00:00 2001 From: jelly013 <22855910+jelly013@users.noreply.github.com> Date: Tue, 24 Nov 2026 20:29:53 +0100 Subject: [PATCH] cli: use a neutral default folder for probe reports `xenora probe` and `xenora imports sync` defaulted to a folder named after one commercial game. Give both one shared default, `diagnostics/probe`, and ignore it in Git. Keep the old ignore rules so existing local reports stay out of commits. Closes #364 Signed-off-by: jelly013 <22855910+jelly013@users.noreply.github.com> --- .gitignore | 1 + CHANGELOG.md | 1 + crates/cli/src/main.rs | 7 +++++-- crates/cli/tests/default_report.rs | 27 +++++++++++++++++++++++++++ docs/interfaces.md | 3 ++- 5 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 crates/cli/tests/default_report.rs diff --git a/.gitignore b/.gitignore index 56c77c4..7e912eb 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ __pycache__/ *.pyc +/diagnostics/probe/ /diagnostics/gta6-candidate-*/ /diagnostics/gta6-check/ diff --git a/CHANGELOG.md b/CHANGELOG.md index a96ed77..fe5eb4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ remains unsupported. ### Changed - Resolve the tiled BC1 mip and array layer once per linearization and copy contiguous block runs within each tile row. Partial edge blocks are retained and padding slots are skipped. Closes #349. +- Changed the default report folder of `xenora probe` and `xenora imports sync` to `diagnostics/probe`, which Git ignores (#364). Anyone relying on the earlier default has to pass `--report`. - Relocation reports now build their type histogram once per image, avoiding a tree lookup for every entry. Target checks and fixup order are unchanged; synthetic regressions and an opt-in relocation timing test cover the change (#109). - Moved the six supported gfx1030 SOPP compute control forms into the semantic registry, preserving instruction decoding and shader lowering. Part of #215. - Moved gfx1030 `s_mov_b32` (SOP1) into the semantic registry, preserving its existing decode domain and shader output. The move operand rule retains explicit VCC and EXEC half destinations. Part of #215. diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index a9c85a1..55ba78d 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -6,6 +6,9 @@ mod shaders; use std::process::ExitCode; +/// Where `probe` writes and `imports sync` reads without `--report`. +const DEFAULT_REPORT_DIR: &str = "diagnostics/probe"; + fn main() -> ExitCode { match std::env::args().nth(1).as_deref() { Some("info") => { @@ -46,7 +49,7 @@ fn main() -> ExitCode { let args: Vec = std::env::args().collect(); let mut pe_path: Option = None; let mut mode = "static".to_string(); - let mut report_dir = "diagnostics/gta6-candidate-e95020b2".to_string(); + let mut report_dir = DEFAULT_REPORT_DIR.to_string(); let mut i = 2; while i < args.len() { @@ -373,7 +376,7 @@ fn run_imports_generate_cli(args: &[String]) -> ExitCode { } fn run_imports_sync_cli(args: &[String]) -> ExitCode { - let mut report_dir = "diagnostics/gta6-candidate-e95020b2".to_string(); + let mut report_dir = DEFAULT_REPORT_DIR.to_string(); let mut check_mode = false; let mut i = 0; diff --git a/crates/cli/tests/default_report.rs b/crates/cli/tests/default_report.rs new file mode 100644 index 0000000..3164f14 --- /dev/null +++ b/crates/cli/tests/default_report.rs @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +//! Default report folder of `xenora probe` and `xenora imports sync`. + +use std::process::Command; + +#[test] +fn probe_and_sync_use_the_same_default_folder() { + let fixture = concat!( + env!("CARGO_MANIFEST_DIR"), + "/../../fixtures/pe/delay-imports.exe" + ); + let folder = std::env::temp_dir().join(format!("xenora-default-{}", std::process::id())); + std::fs::create_dir(&folder).unwrap(); + for arguments in [&["probe", "--pe", fixture][..], &["imports", "sync"]] { + let status = Command::new(env!("CARGO_BIN_EXE_xenora")) + .args(arguments) + .current_dir(&folder) + .status() + .unwrap(); + assert!(status.success(), "{arguments:?}"); + } + let written = ["imports.csv", "import_backlog.md"] + .map(|name| folder.join("diagnostics/probe").join(name).is_file()); + std::fs::remove_dir_all(folder).unwrap(); + assert_eq!(written, [true, true]); +} diff --git a/docs/interfaces.md b/docs/interfaces.md index a03ad56..b00bd7a 100644 --- a/docs/interfaces.md +++ b/docs/interfaces.md @@ -70,7 +70,8 @@ uses a Win64-aligned stack and terminates with HLT. The result includes the load guest memory and the entry execution outcome. `xenora probe --mode static` inventories ordinary and delay-loaded PE imports -without guest execution. `missing_imports.csv` lists unresolved ordinary keys +without guest execution. Without `--report` it writes to `diagnostics/probe`, +where `xenora imports sync` also looks. `missing_imports.csv` lists unresolved ordinary keys with their import address table relative virtual addresses. The full inventory, `imports.csv`, marks each entry `ordinary` or `delayed` in its `import_table` column and records whether each key is registered, its implementation