Scripts: skip memory growth limit when main crashed or aborted early #1103

Open
heditrigui wants to merge 1 commit from upstream-pr/1112 into main
heditrigui commented 2026-11-24 11:45:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by heditrigui on 2026-11-24T11:45:33Z.


When main experiences crashes, device removals, or terminates before logging frames, its reported peak commit represents an incomplete run rather than full working-set memory. A PR that fixes the crash runs for the full duration and naturally commits more memory than the prematurely aborted baseline, triggering a false-positive rejection ("the PR's run commits much more memory than main's").

What is in it

  • In scripts/pr_check.py: detect when main suffered crashes, device removals, non-zero exit status, or incomplete frame logging (frames shown: none logged). Skip the 125% peak commit ceiling check against crashed baselines.
  • Retain the 125% growth ceiling when main ran and exited cleanly.
  • In scripts/test_pr_check.py: add SmokeComparisonTests covering clean baseline growth limit enforcement, crashed baseline tolerance, and device removal / incomplete run cases.

Tested

  • Host: Windows 11 Pro, Python 3.12.10
  • python -B -m unittest discover -s scripts -p "test_*.py" -v: 11 passed, 0 failed.
  • Verified against the regression smoke report of PR #1087 (which was blocked by this exact failure after fixing an early crash): successfully resolves to 0 problems.
  • Verified that clean baselines with >125% memory consumption still trigger the expected problem message.

Not tested

  • Real retail title smoke runs (this change affects only scripts/pr_check.py and scripts/test_pr_check.py; no runtime files modified).

AI use

  • Antigravity (Gemini 3.8 Flash (High)) investigated the false-positive rejection on crash fixes, implemented the checker update and unit tests, and prepared this PR under author review.
<!-- greyfinch-sync:ivall/xcl:issue:5471499794 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1112). Originally posted by [heditrigui](https://github.com/heditrigui) on 2026-11-24T11:45:33Z. --- When `main` experiences crashes, device removals, or terminates before logging frames, its reported `peak commit` represents an incomplete run rather than full working-set memory. A PR that fixes the crash runs for the full duration and naturally commits more memory than the prematurely aborted baseline, triggering a false-positive rejection ("the PR's run commits much more memory than main's"). **What is in it** - In `scripts/pr_check.py`: detect when `main` suffered crashes, device removals, non-zero exit status, or incomplete frame logging (`frames shown: none logged`). Skip the 125% peak commit ceiling check against crashed baselines. - Retain the 125% growth ceiling when `main` ran and exited cleanly. - In `scripts/test_pr_check.py`: add `SmokeComparisonTests` covering clean baseline growth limit enforcement, crashed baseline tolerance, and device removal / incomplete run cases. **Tested** - Host: Windows 11 Pro, Python 3.12.10 - `python -B -m unittest discover -s scripts -p "test_*.py" -v`: 11 passed, 0 failed. - Verified against the regression smoke report of PR #1087 (which was blocked by this exact failure after fixing an early crash): successfully resolves to 0 problems. - Verified that clean baselines with >125% memory consumption still trigger the expected problem message. **Not tested** - Real retail title smoke runs (this change affects only `scripts/pr_check.py` and `scripts/test_pr_check.py`; no runtime files modified). **AI use** - Antigravity (Gemini 3.8 Flash (High)) investigated the false-positive rejection on crash fixes, implemented the checker update and unit tests, and prepared this PR under author review.
futurepro62 commented 2026-11-24 15:05:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:15:46Z.


Tested exact head 003071f, script tests only, since this PR has no test report yet.

Tested

  • Windows 11 Home 26300, Python 3.14.3 with pytest 9.0.3, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here).
  • python -m pytest scripts/test_pr_check.py at the head: 11 passed, 12 subtests passed.
  • The PR's test file(s) against current main's script (930e8b4): 4 subtests of test_crashed_baseline_skips_memory_growth_limit fail. So the new test catches the problem the PR fixes.

Not tested

  • PowerShell 7, the CI workflow itself, a game (no runtime code changed).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7134092913 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1112#issuecomment-7134092913). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T14:15:46Z. --- Tested exact head `003071f`, script tests only, since this PR has no test report yet. **Tested** - Windows 11 Home 26300, Python 3.14.3 with pytest 9.0.3, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here). - `python -m pytest scripts/test_pr_check.py` at the head: 11 passed, 12 subtests passed. - The PR's test file(s) against current main's script (`930e8b4`): 4 subtests of `test_crashed_baseline_skips_memory_growth_limit` fail. So the new test catches the problem the PR fixes. **Not tested** - PowerShell 7, the CI workflow itself, a game (no runtime code changed). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-25 09:08:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T08:16:06Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7156816705 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1112#issuecomment-7156816705). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T08:16:06Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
RavenCurseBurg commented 2026-11-26 01:05:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-26T00:36:05Z.


I combined 003071f1c9296264ba2343787b29ea67681a8d34 with #1496 at d96114c7665879b995a149859ce37bfcd8d0311a. Git merged cleanly, but three recovery subcases failed: the newer field validator rejected the literal none logged (the run did not reach its end) that smoke.ps1 emits. The PR block in those cases showed frames.

Tested integration accepts that exact marker on a matched main run when the PR shows a positive frame count. A zero-frame pair still fails; the marker on the PR or an unrecognized baseline value still reports an error. Clean baselines continue to enforce the 125% peak-memory ceiling.

On Windows 11, Core i7-13700, Python 3.14.3, python -B -m unittest discover -s scripts -p "test_*.py" passed 11 tests on #1112, 18 on #1496 and 21 on the candidate. I ran 16 synthetic pr_check.py --local --body BODY --files FILES --head HEAD cases on each version (48 executions), checking exit status and diagnostics for crash recovery, zero frames, and the 80% frame and 125% memory boundaries. No retail run or hosted workflow was used. OpenAI Codex (GPT-6) resolved the behavior difference, wrote the regression check and ran the tests.

<!-- greyfinch-sync:ivall/xcl:comment:7178924815 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1112#issuecomment-7178924815). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T00:36:05Z. --- I combined `003071f1c9296264ba2343787b29ea67681a8d34` with #1496 at `d96114c7665879b995a149859ce37bfcd8d0311a`. Git merged cleanly, but three recovery subcases failed: the newer field validator rejected the literal `none logged (the run did not reach its end)` that `smoke.ps1` emits. The PR block in those cases showed frames. [Tested integration](https://github.com/RavenCurseBurg/xcl/compare/d96114c7665879b995a149859ce37bfcd8d0311a...48b8b4b8354bd5354fa5917b4ac1986e77228000) accepts that exact marker on a matched main run when the PR shows a positive frame count. A zero-frame pair still fails; the marker on the PR or an unrecognized baseline value still reports an error. Clean baselines continue to enforce the 125% peak-memory ceiling. On Windows 11, Core i7-13700, Python 3.14.3, `python -B -m unittest discover -s scripts -p "test_*.py"` passed 11 tests on #1112, 18 on #1496 and 21 on the candidate. I ran 16 synthetic `pr_check.py --local --body BODY --files FILES --head HEAD` cases on each version (48 executions), checking exit status and diagnostics for crash recovery, zero frames, and the 80% frame and 125% memory boundaries. No retail run or hosted workflow was used. OpenAI Codex (GPT-6) resolved the behavior difference, wrote the regression check and ran the tests.
github-actions[bot] commented 2026-11-30 08:40:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:40:36Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7273203797 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1112#issuecomment-7273203797). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:40:36Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 04:50:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:50:53Z.


Triage (#1607) – head 003071f

No open or merged PR skips the peak-commit limit for a crashed main run. #2268 rewrites the same comparison in scripts/pr_check.py (medians of 3 runs, a different problem), so the two will conflict.
Problem: this branch predates main's field_problems check (1d83fd12, #1133). On the merged tree a main block with frames shown: none logged (...) already gets "has a non-numeric frames shown", so three of the four cases in test_crashed_baseline_skips_memory_growth_limit will fail, and the mf is None branch never matters. Rebase and adjust the test (or that check) accordingly.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301163242 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1112#issuecomment-7301163242). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:50:53Z. --- **Triage (#1607)** – head 003071f No open or merged PR skips the peak-commit limit for a crashed main run. #2268 rewrites the same comparison in `scripts/pr_check.py` (medians of 3 runs, a different problem), so the two will conflict. Problem: this branch predates main's `field_problems` check (1d83fd12, #1133). On the merged tree a main block with `frames shown: none logged (...)` already gets "has a non-numeric `frames shown`", so three of the four cases in `test_crashed_baseline_skips_memory_growth_limit` will fail, and the `mf is None` branch never matters. Rebase and adjust the test (or that check) accordingly. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1112:upstream-pr/1112'
git switch 'upstream-pr/1112'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1112'
git switch 'upstream-pr/1112'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1112'
git switch 'upstream-pr/1112'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1112'
git switch 'main'
git merge --squash 'upstream-pr/1112'
git switch 'main'
git merge --ff-only 'upstream-pr/1112'
git switch 'main'
git merge 'upstream-pr/1112'
git push origin 'main'
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
xcl-dev/xcl!1103
No description provided.