Skip to content

xcl_compare: protect binaries and transcripts from report output - #7542

Open
Barbital11111 wants to merge 1 commit into
ItsNotRexed:mainfrom
Barbital11111:fix/xcl-compare-report-paths
Open

Barbital11111 wants to merge 1 commit into
ItsNotRexed:mainfrom
Barbital11111:fix/xcl-compare-report-paths

Conversation

@Barbital11111

Copy link
Copy Markdown
Contributor

Summary

Claim: #7496 (comment)

Check the report path against the selected XCL launcher, synthetic title and DLL, the Leonida loader, the optional debugger, and both runtime transcripts. The shared path comparison covers aliases such as hard links. A collision is refused before creating the work area, resetting existing transcripts, or launching a runtime.

#5791 covers a report path that names a directory.

Validation

Windows 11, Python 3.14.3, CPU-only synthetic inputs.

  • The nine collision cases reached workspace setup on upstream 3e1e6ea1. With the patch they are refused before setup, leaving binary and transcript contents intact.
  • test_xcl_compare.py: 18 passed. test_report_paths.py: 22 passed.
  • The isolated CLI refused both a binary path and a future transcript path from a separate working directory. With stubbed runtimes, both default and distinct explicit report paths still produced JSON and both transcripts.
  • git diff --check and the repository file-content check passed. No game data or actual XCL/Leonida executable was run.

AI-assisted (Codex).

@leoleahy leoleahy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Windows 11 / Python 3.14.8 review of e8a1fe25 (synthetic inputs, CPU only, no game data).

Checks run

  • python -I tests/test_xcl_compare.py: 18/18 OK on e8a1fe25 (including Windows NTFS hard-link alias check).
  • Negative control against parent 3e1e6ea1's tools/xcl_compare.py: 9 failures across the new ReportPath cases (all five binaries, both transcripts, and hard-link alias), confirming run_all previously proceeded into runtime setup.
  • python -m compileall -q tools/xcl_compare.py tests/test_xcl_compare.py, git diff --check 3e1e6ea1..e8a1fe25, and git merge-tree --write-tree upstream/main HEAD: all clean.

Code review notes

  • Running the same_report_path checks before work.mkdir(...) and before opening/truncating transcripts ensures invalid --out paths neither create work/ nor clobber existing transcripts.

LGTM.

AI-assisted.

@morodirule

Copy link
Copy Markdown

Tested e8a1fe2 on Arch Linux, Python 3.14.10, CPU only: pass — first Linux check. tests/test_xcl_compare.py 18/18 OK. Negative control: merge-base tool → 9 failures (binary/transcript/hard-link report-replacement cases); restored, green again. No game files. AI-assisted.

@rideinstead

Copy link
Copy Markdown

Independent Windows check at e8a1fe25a (Windows 11, CPython 3.12.10, CPU-only, synthetic fixtures, no game files).

  • python -I tests/test_xcl_compare.py: 18 tests, OK (8.9 s).
  • python -m compileall -q tools/xcl_compare.py tests/test_xcl_compare.py: clean.
  • python -I scripts/check_no_game_data.py tools/xcl_compare.py tests/test_xcl_compare.py: clean.
  • git diff --check: clean.

Writing the report no longer overwrites a binary or transcript that shares its path. AI-assisted.

@airp1ane

Copy link
Copy Markdown
Contributor

Tested e8a1fe2 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass.

Ran the test files this PR adds or changes, from a clean checkout of the PR head: test_xcl_compare.py - all exit 0.

AI-assisted (Claude Code).

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested e8a1fe25 on Linux, CPython 3.14, CPU only, synthetic inputs, merged onto main 867d922f: pass

  • python -I tests/test_xcl_compare.py: Ran 18 tests, OK. With only the non-test files reverted to main: FAILED (failures=9), so the new tests exercise the change.
  • compileall and scripts/check_no_game_data.py on the changed files: clean.

Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants