fix(tools): preserve progress history cache inputs #26736

Closed
cookie42073-cmd wants to merge 1 commit from upstream-pr/26736 into main
cookie42073-cmd commented 2026-11-24 18:21:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by cookie42073-cmd on 2026-11-24T18:21:57Z.


What

Reject nonregular progress history cache files and accept both supported Git object ID lengths when reusing cached measurements.

Tested

The 51-test progress history suite completed on Linux Python 3.12 and 3.14 and Windows Python 3.13. Linux passed 50 and Windows passed 49. The remaining cases were platform or symlink skips. The project overlap scan checked 2,469 open pull requests and reported no unresolved overlap for these files. Conventions and whitespace checks passed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5477908560 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26736). Originally posted by [cookie42073-cmd](https://github.com/cookie42073-cmd) on 2026-11-24T18:21:57Z. --- ### What Reject nonregular progress history cache files and accept both supported Git object ID lengths when reusing cached measurements. ### Tested The 51-test progress history suite completed on Linux Python 3.12 and 3.14 and Windows Python 3.13. Linux passed 50 and Windows passed 49. The remaining cases were platform or symlink skips. The project overlap scan checked 2,469 open pull requests and reported no unresolved overlap for these files. Conventions and whitespace checks passed. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
kripotker commented 2026-11-24 19:08:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kripotker on 2026-11-24T19:08:35Z.

Review: APPROVED


Review: fix(tools): preserve progress history cache inputs

Approve.

What I checked

  • load_cache refuses a cache path that stat()s as anything but a regular file before reading it. A missing cache still returns {}.
  • save_cache refuses to replace a non-regular target. It now reuses the stat result it already has for the POSIX chmod, instead of the earlier exists() + stat() pair.
  • Cached commit IDs may be 40 or 64 lowercase hex characters, so a SHA-256 repository's cache is reused instead of rejected. stat is already imported (tools/progress_history.py:7).
  • It edits different hunks of the same file as #26737. git merge-tree of the two heads merges cleanly.

What I ran

Windows 11, Python 3.14, PR head 76855003d8:

python3 tools/tests/test_progress_history.py
python3 tools/check_conventions.py
  • 51 tests, OK (2 skipped).
  • With main's progress_history.py, both new tests fail (the SHA-256 reuse and the non-regular cache), so they cover the change.
  • check_conventions.py: All conventions checks passed.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6045619609 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26736#pullrequestreview-6045619609). Originally posted by [kripotker](https://github.com/kripotker) on 2026-11-24T19:08:35Z. **Review:** APPROVED --- ## Review: fix(tools): preserve progress history cache inputs **Approve.** ### What I checked - `load_cache` refuses a cache path that `stat()`s as anything but a regular file before reading it. A missing cache still returns `{}`. - `save_cache` refuses to replace a non-regular target. It now reuses the `stat` result it already has for the POSIX `chmod`, instead of the earlier `exists()` + `stat()` pair. - Cached commit IDs may be 40 or 64 lowercase hex characters, so a SHA-256 repository's cache is reused instead of rejected. `stat` is already imported (`tools/progress_history.py:7`). - It edits different hunks of the same file as #26737. `git merge-tree` of the two heads merges cleanly. ### What I ran Windows 11, Python 3.14, PR head 76855003d8: ``` python3 tools/tests/test_progress_history.py python3 tools/check_conventions.py ``` - 51 tests, OK (2 skipped). - With `main`'s `progress_history.py`, both new tests fail (the SHA-256 reuse and the non-regular cache), so they cover the change. - `check_conventions.py`: `All conventions checks passed.` AI-assisted: yes (Claude Code).
MarcZX10 commented 2026-11-25 17:11:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T17:11:56Z.

Review: COMMENTED


Reviewed — no blocking findings

The cache validation and Git object ID handling are supported by the changed code and tests; I found no verified blocking defect.

What I ran

Reviewed head 76855003d850bdc90a6b6a506b22299430b09a04 using repo_read.py to inspect the prepared diff and changed code. No test commands were run.

Results

Check Result Note
Changed code review passed Two changed files read
Test suite not run No independent test execution
Prepared review bundle not applicable No files/ contents were exposed by the reader

Findings

Blocking

None.

Non-blocking

None.

Not verified

The author reports 51 suite cases on Linux Python 3.12 and 3.14 and Windows Python 3.13; those runs were not independently verified. I read tools/progress_history.py lines 125–220 and tools/tests/test_progress_history.py lines 230–275. The review bundle’s prepared files/ contents and any excluded-file list were not accessible through the reader, so full-file review was not verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6061833271 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26736#pullrequestreview-6061833271). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T17:11:56Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The cache validation and Git object ID handling are supported by the changed code and tests; I found no verified blocking defect. ## What I ran Reviewed head `76855003d850bdc90a6b6a506b22299430b09a04` using `repo_read.py` to inspect the prepared diff and changed code. No test commands were run. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Two changed files read | | Test suite | not run | No independent test execution | | Prepared review bundle | not applicable | No `files/` contents were exposed by the reader | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The author reports 51 suite cases on Linux Python 3.12 and 3.14 and Windows Python 3.13; those runs were not independently verified. I read `tools/progress_history.py` lines 125–220 and `tools/tests/test_progress_history.py` lines 230–275. The review bundle’s prepared `files/` contents and any excluded-file list were not accessible through the reader, so full-file review was not verified. ## To get this to a good state Nothing is required.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!26736
No description provided.