conformance: reject diff heatmap path collisions #2410

Open
github-bot wants to merge 1 commit from github-bot/gh-2410 into main AGit
Owner

@⁠iliko123456789 on GitHub · 2026-11-26 22:13 UTC · original
iliko123456789:fix/conformance-diff-output-collision → main · +270 −21 · 5 files · 1 commits · open

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).
**@⁠iliko123456789** on GitHub · 2026-11-26 22:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2410) `iliko123456789:fix/conformance-diff-output-collision` → `main` · +270 −21 · 5 files · 1 commits · open Claimed in the coordination issue as: [CONFORMANCE-DIFF-OUTPUT-COLLISION](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### 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 - [x] Based on current main and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption. - [ ] New translator rule documented (N/A - no translator changes).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:35:36 +00:00
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-27 04:43 UTC · original · approved these changes

Approving 2130199f1.

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).

**@⁠tiguan26** on GitHub · 2026-11-27 04:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2410#pullrequestreview-6083582717) · **approved these changes** Approving 2130199f1. 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).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2410/head:github-bot/gh-2410'
git switch 'github-bot/gh-2410'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2410'
git switch 'github-bot/gh-2410'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2410'
git switch 'github-bot/gh-2410'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2410'
git switch 'main'
git merge --squash 'github-bot/gh-2410'
git switch 'main'
git merge --ff-only 'github-bot/gh-2410'
git switch 'main'
git merge 'github-bot/gh-2410'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.