WIP: make_game: stage the runtime install before replacing the old files (RT-249) #204

Closed
leonida/mandy
Andretuta wants to merge 0 commits from old-pr/9937 into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

Andretuta commented 2026-11-24 02:43:08 +00:00

Carried over from old PR 9937 by LouisRiverstone in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9937, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
LouisRiverstone: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

RT-249: the runtime stage of make_game.py can leave --out half replaced.

Re-submission of #5278. #5278 was closed unmerged during the 2026-11-23 22:45 UTC cleanup, along with the other open PRs. This is the same branch, now merged with current main.

Checked on #5278 by: King1565 (Linux), Atomic258 (Windows Server 2022), JRamos1993 (Windows 11), kapitche (Linux).

No game files.

AI-assisted (Claude Code): I reviewed the change and re-ran its tests on the merge with main.

> Carried over from **old PR 9937** by `LouisRiverstone` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9937`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `LouisRiverstone`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): RT-249: the runtime stage of `make_game.py` can leave `--out` half replaced. Re-submission of `#5278`. `#5278` was closed unmerged during the 2026-11-23 22:45 UTC cleanup, along with the other open PRs. This is the same branch, now merged with current `main`. Checked on `#5278` by: King1565 (Linux), Atomic258 (Windows Server 2022), JRamos1993 (Windows 11), kapitche (Linux). No game files. AI-assisted (Claude Code): I reviewed the change and re-ran its tests on the merge with `main`.
sodove commented 2026-11-24 06:25:08 +00:00

Native Windows finding on 560c3fa9246a2f07d1c75c449f1c2fe7376e1aa8, Windows 11 build 26100, Python 3.12. The nine stock runtime-staging tests pass.

The current file's recovery copy is lost if the new install and the inner rollback are both blocked. I used two synthetic files and inserted a synchronization point after moving the second old file to staging. At that point a contender created the destination and held it without FILE_SHARE_DELETE. The actual Windows renames for publishing and restoring that file both failed.

The first file rolled back correctly. The second old file had never been added to the rollback list, so publish raised PermissionError and install_runtime deleted staging, including the only .old copy. The expected result here is IncompleteRollback with that copy preserved.

I verified a temporary local correction. Record an old file in the rollback list immediately after moving it aside, and let the outer rollback handle it if publishing fails. For a file with no previous copy, add it to the list only after successfully publishing it. The lock tests went from 2/3 to 3/3 with this change and the stock suite stayed at 9/9. The test with no previous copy also confirmed that rollback leaves a contending file alone.

Synthetic files only. AI-assisted verification.

Current main comparison at 8f481cf16f261c7f37458aeb45e8f4e19994146d. With the second of two synthetic destinations already locked for reading, main raises PermissionError after replacing the first file, leaving mixed versions. This PR leaves both originals in place for that case. The separate test that locks the destination after the backup rename still reproduces the missing recovery copy on this PR head.

Native Windows finding on 560c3fa9246a2f07d1c75c449f1c2fe7376e1aa8, Windows 11 build 26100, Python 3.12. The nine stock runtime-staging tests pass. The current file's recovery copy is lost if the new install and the inner rollback are both blocked. I used two synthetic files and inserted a synchronization point after moving the second old file to staging. At that point a contender created the destination and held it without FILE_SHARE_DELETE. The actual Windows renames for publishing and restoring that file both failed. The first file rolled back correctly. The second old file had never been added to the rollback list, so publish raised PermissionError and install_runtime deleted staging, including the only .old copy. The expected result here is IncompleteRollback with that copy preserved. I verified a temporary local correction. Record an old file in the rollback list immediately after moving it aside, and let the outer rollback handle it if publishing fails. For a file with no previous copy, add it to the list only after successfully publishing it. The lock tests went from 2/3 to 3/3 with this change and the stock suite stayed at 9/9. The test with no previous copy also confirmed that rollback leaves a contending file alone. Synthetic files only. AI-assisted verification. Current main comparison at 8f481cf16f261c7f37458aeb45e8f4e19994146d. With the second of two synthetic destinations already locked for reading, main raises PermissionError after replacing the first file, leaving mixed versions. This PR leaves both originals in place for that case. The separate test that locks the destination after the backup rename still reproduces the missing recovery copy on this PR head.
LouisRiverstone commented 2026-11-25 00:24:36 +00:00

Taken over by its author in #1446 (rebased on main). This draft can be closed.

Taken over by its author in #1446 (rebased on main). This draft can be closed.
Andretuta commented 2026-11-27 04:01:47 +00:00

Closing carried-over draft: taken over by original author in #1446 (OLD-9937).

Closing carried-over draft: taken over by original author in #1446 (OLD-9937).
Sign in to join this conversation.
No description provided.