Skip to content

conformance: reject diff heatmap path collisions - #2410

Open
iliko123456789 wants to merge 1 commit into
ProjectLeonida:mainfrom
iliko123456789:fix/conformance-diff-output-collision
Open

iliko123456789 wants to merge 1 commit into
ProjectLeonida:mainfrom
iliko123456789:fix/conformance-diff-output-collision

Conversation

@iliko123456789

@iliko123456789 iliko123456789 commented Nov 26, 2026 •

Copy link
Copy Markdown

Claimed in the coordination issue as:
CONFORMANCE-DIFF-OUTPUT-COLLISION

What and why

compare.py diff could overwrite a manifest, an input image, or another heatmap. Overwriting an image needed by a later scene could also produce a false pixel mismatch.

Plan every path before writing heatmaps. Index possible aliases and confirm collisions with the shared same_report_path helper. A collision exits 2 and names both paths. Existing heatmaps at distinct destinations can still be replaced.

Tested

Verified commit 2130199f1 on upstream e5a7c8942.

  • Windows 11 (Python 3.14.7) and Ubuntu WSL (Python 3.14.4).
  • Nine reported regression failures on upstream main. All runnable cases passed with the fix.
  • 968 alias comparisons and 250 ordered batches verified per platform.
  • Non-ASCII temporary directory tests passed.
  • All runnable cases across 10 focused test scripts passed.
  • All 22 comparator self-checks passed.
  • Ubuntu semantic suite: 6,374 tests across 500 files, zero failing files.
  • Compilation, whitespace, CLI help and no-game-data checks passed.
  • No conflicts found with nine overlapping open PRs.

Performance

Synthetic preflight benchmark (seconds):

Scenes Windows before Windows after Ubuntu before Ubuntu after
6 0.030 0.0046 0.0033 0.00045
30 0.865 0.027 0.070 0.0013
100 8.771 0.099 0.712 0.0053
300 64.650 0.345 6.329 0.029

Benchmarks used synthetic 1x1 PNGs. Results for 6 and 30 scenes are medians of three runs. Larger results are single runs.

Known limitations

Windows skipped symlink tests due to insufficient privileges. Ubuntu skipped Windows-specific and case-insensitive-volume tests. Both skipped APFS/HFS+ and five native-renderer tests.

All seven PowerShell conformance tests passed on Windows and were skipped on Ubuntu.

Validation assumes paths and links remain stable during comparison. Many paths sharing an alias key can still trigger repeated comparisons. Legacy Windows code pages may require Python UTF-8 mode for redirected CLI output.

GPUs tested: n/a (CPU-only synthetic tests)

AI-assisted: yes, with Codex

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption.
  • New translator rule documented (N/A - no translator changes).

@tiguan26 tiguan26 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.

Approving 2130199.

Every scene's paths are planned and checked before the first heatmap is written, so a collision fails the run without overwriting an input. find_report_path_collision's candidate keys cover each way same_report_path can match: the resolved path, the normalized key, the case-folded basename (which any case-folding match shares) and the file identity for hard links with unrelated names, so the index cannot miss a pair the pairwise check would catch, and inputs are checked before earlier outputs. Moving the basename test ahead of the split in _same_resolved_name keeps its meaning.

Merged onto main d1dff7949 together with #2403, #2299, #2297, #2330 and #2286 (no conflicts), on Linux with Python 3.13. tests/test_conformance_diff_output_paths.py 9 passed, 1 skipped; tests/test_report_paths.py 24 passed, 1 skipped (main: 23). AI-assisted (Claude Code, Claude Opus 5.5).

@iliko123456789

Copy link
Copy Markdown
Author

Thanks for reviewing and testing my fix! I noticed that the PR is still open, and I couldn't find the changes on the current main branch after the repository move. Does it still need to be merged, or is there anything I need to update on my side?

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.

2 participants