Scripts: require peak commit measurements for smoke comparisons #1094

Open
anakatt wants to merge 1 commit from upstream-pr/1103 into main
anakatt commented 2026-11-24 11:35:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by anakatt on 2026-11-24T11:35:40Z.


I fixed the PR checker accepting a memory comparison when either smoke run has no usable peak commit. Missing, empty and n/a measurements parsed as None, so the 125% memory-growth check was skipped.

What is in it

  • Require a numeric peak-commit measurement from both matched smoke runs before accepting the comparison. The existing growth threshold is unchanged.
  • Cover missing measurements on either side and the 125% boundary; update the existing minimal smoke fixture.
  • Clarify the measurement requirement in CONTRIBUTING.md.
  • This also rejects an incomplete baseline that crashed before recording memory; it does not manufacture a comparison from unavailable measurements. Separate from #635, which handles crash/device-removal counters.

Tested

  • macOS Darwin 24.6.0, arm64; Python 3.15.2. No GPU used.

  • Before the fix, python3 -B -m unittest discover -s scripts -p test_pr_check_memory.py -v exposed 8 accepted invalid subcases.

  • After the fix, python3 -B -m unittest discover -s scripts -p 'test_pr_check*.py' -v: 11 passed, 0 failed, 0 skipped.

  • Windows 11 Pro ARM64 10.0.26100.1742 in UTM, Python 3.14.0 ARM64; no GPU used. Exact source archive 49b30dc1f2333361a94ff739912b2d6a78dbe04c: C:\xcl-tests\python\python.exe -B -m unittest discover -s scripts -p "test_pr_check*.py" -v: 11 passed, 0 failed, 0 skipped.

Not tested

  • Live GitHub Actions execution of the modified checker, and the Rust/GPU suite. No runtime code changes.

AI use

  • I used omp (openai-codex/gpt-6-astra) to identify the gap, write the checker change and regressions, run the Python tests, and prepare this description.
<!-- greyfinch-sync:ivall/xcl:issue:5471365105 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1103). Originally posted by [anakatt](https://github.com/anakatt) on 2026-11-24T11:35:40Z. --- I fixed the PR checker accepting a memory comparison when either smoke run has no usable `peak commit`. Missing, empty and `n/a` measurements parsed as `None`, so the 125% memory-growth check was skipped. **What is in it** - Require a numeric peak-commit measurement from both matched smoke runs before accepting the comparison. The existing growth threshold is unchanged. - Cover missing measurements on either side and the 125% boundary; update the existing minimal smoke fixture. - Clarify the measurement requirement in `CONTRIBUTING.md`. - This also rejects an incomplete baseline that crashed before recording memory; it does not manufacture a comparison from unavailable measurements. Separate from #635, which handles crash/device-removal counters. **Tested** - macOS Darwin 24.6.0, arm64; Python 3.15.2. No GPU used. - Before the fix, `python3 -B -m unittest discover -s scripts -p test_pr_check_memory.py -v` exposed 8 accepted invalid subcases. - After the fix, `python3 -B -m unittest discover -s scripts -p 'test_pr_check*.py' -v`: 11 passed, 0 failed, 0 skipped. - Windows 11 Pro ARM64 10.0.26100.1742 in UTM, Python 3.14.0 ARM64; no GPU used. Exact source archive `49b30dc1f2333361a94ff739912b2d6a78dbe04c`: `C:\xcl-tests\python\python.exe -B -m unittest discover -s scripts -p "test_pr_check*.py" -v`: 11 passed, 0 failed, 0 skipped. **Not tested** - Live GitHub Actions execution of the modified checker, and the Rust/GPU suite. No runtime code changes. **AI use** - I used omp (`openai-codex/gpt-6-astra`) to identify the gap, write the checker change and regressions, run the Python tests, and prepare this description.
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:44Z.


Tested exact head 49b30dc, 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 scripts/test_pr_check_memory.py at the head: 9 passed and 2 passed.
  • The PR's test file(s) against current main's script (930e8b4): test_pr_check_memory.py: 8 subtests of test_both_runs_need_a_memory_measurement fail (both sides, peak None, '', n/a MB, unknown); test_pr_check.py still passes. 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:7134091727 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1103#issuecomment-7134091727). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T14:15:44Z. --- Tested exact head `49b30dc`, 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 scripts/test_pr_check_memory.py` at the head: 9 passed and 2 passed. - The PR's test file(s) against current main's script (`930e8b4`): `test_pr_check_memory.py`: 8 subtests of `test_both_runs_need_a_memory_measurement` fail (both sides, peak `None`, `''`, `n/a MB`, `unknown`); `test_pr_check.py` still passes. 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:13 +00:00 (Migrated from github.com)

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


Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7156934834 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1103#issuecomment-7156934834). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T08:21:55Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
RavenCurseBurg commented 2026-11-26 04:07:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-26T03:27:26Z.


Confirmed the reported merge conflict at 49b30dc1f2333361a94ff739912b2d6a78dbe04c against main b49be1836844. Only scripts/test_pr_check.py conflicted. Rebased commit keeps the PR’s memory check and the newer frame and error counters in main’s shared fixture. git merge-tree --write-tree --name-only completed cleanly for the rebase against that main.

I ran python -B scripts/pr_check.py --local --head <sha> --body <body.md> --files <files.tsv> with eight synthetic comparisons per revision. The PR and rebase gave the same result in all eight. With an 800 MB baseline both accepted 999 and 1,000 MB and rejected 1,001 MB. With a 1,200 MB baseline both accepted 1,500 MB and rejected 1,501 MB. When one or both measurements were absent, each named the corresponding missing measurement.

The two targeted test methods passed on the author head. On the rebase, python -B -m unittest discover -s scripts -p "test_*.py" passed all 27 tests, with no failures or skips. Windows build 26100, i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) resolved the conflict and ran the checks. Only synthetic data was used. Retail smoke, GPU tests and the Rust build were outside this run.

Follow-up on review feedback

I checked the positive-peak review through python -B scripts/pr_check.py --local --head <sha> --body <fixture.md> --files <fixture.tsv> with a private Git repository and two matched synthetic runs. The PR head accepted main/PR peak pairs of 0/400, 100/0 and 0/0 MB. The candidate on the exact PR head rejects each and identifies the run with the unusable measurement.

I repeated the eight CLI cases on the candidate on the earlier main-based rebase. Both candidates rejected either missing peak, kept 100/125 MB at the limit, rejected 100/126 MB, and accepted 1/1 MB. Python test discovery passed 12 tests on the PR-based candidate and 28 on the main-based one. This verifies the checker on synthetic input only.

Parent of the PR-based candidate: 49b30dc1f2333361a94ff739912b2d6a78dbe04c. OpenAI Codex (GPT-6) prepared the changes and ran the Windows CPU fixtures. No game, Rust workspace build or GPU workload.

<!-- greyfinch-sync:ivall/xcl:comment:7181735253 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1103#issuecomment-7181735253). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T03:27:26Z. --- Confirmed the [reported merge conflict](https://github.com/xcl-dev/xcl/pull/1103#issuecomment-7156934834) at `49b30dc1f2333361a94ff739912b2d6a78dbe04c` against main `b49be1836844`. Only `scripts/test_pr_check.py` conflicted. [Rebased commit](https://github.com/RavenCurseBurg/xcl/commit/88e1c40250036d51c8c79f7c6c8f0f5ed75ddbf8) keeps the PR’s memory check and the newer frame and error counters in main’s shared fixture. `git merge-tree --write-tree --name-only` completed cleanly for the rebase against that main. I ran `python -B scripts/pr_check.py --local --head <sha> --body <body.md> --files <files.tsv>` with eight synthetic comparisons per revision. The PR and rebase gave the same result in all eight. With an 800 MB baseline both accepted 999 and 1,000 MB and rejected 1,001 MB. With a 1,200 MB baseline both accepted 1,500 MB and rejected 1,501 MB. When one or both measurements were absent, each named the corresponding missing measurement. The two targeted test methods passed on the author head. On the rebase, `python -B -m unittest discover -s scripts -p "test_*.py"` passed all 27 tests, with no failures or skips. Windows build 26100, i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) resolved the conflict and ran the checks. Only synthetic data was used. Retail smoke, GPU tests and the Rust build were outside this run. **Follow-up on review feedback** I checked the positive-peak review through `python -B scripts/pr_check.py --local --head <sha> --body <fixture.md> --files <fixture.tsv>` with a private Git repository and two matched synthetic runs. The PR head accepted main/PR peak pairs of 0/400, 100/0 and 0/0 MB. The [candidate on the exact PR head](https://github.com/RavenCurseBurg/xcl/commit/9f6bd8733373feff7daf3e68b5ca2c572f198325) rejects each and identifies the run with the unusable measurement. I repeated the eight CLI cases on the [candidate on the earlier main-based rebase](https://github.com/RavenCurseBurg/xcl/commit/ced4353736e4c03749da495983af52e3786a30da). Both candidates rejected either missing peak, kept 100/125 MB at the limit, rejected 100/126 MB, and accepted 1/1 MB. Python test discovery passed 12 tests on the PR-based candidate and 28 on the main-based one. This verifies the checker on synthetic input only. Parent of the PR-based candidate: `49b30dc1f2333361a94ff739912b2d6a78dbe04c`. OpenAI Codex (GPT-6) prepared the changes and ran the Windows CPU fixtures. No game, Rust workspace build or GPU workload.
luckyteagirl commented 2026-11-26 05:41:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T05:41:29Z.

Review: COMMENTED


Could a matched main run require a positive peak commit value? 0 MB passes the None check and disables the 125% comparison at if pc and mc. With otherwise valid matched 60-second, 100-frame smoke blocks, main 0 MB / PR 400 MB currently passes without a memory finding. I reproduced this on the exact head, and it also remains after #2219, whose nonzero check covers only the PR side. A baseline-zero fixture and an explicit rejection of that unusable measurement would close the comparison bypass. Synthetic checker run only at 49b30dc1f2333361a94ff739912b2d6a78dbe04c; no retail or GPU run. AI-assisted review with Codex.

<!-- greyfinch-sync:ivall/xcl:review:6069089884 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1103#pullrequestreview-6069089884). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T05:41:29Z. **Review:** COMMENTED --- Could a matched main run require a positive `peak commit` value? `0 MB` passes the `None` check and disables the 125% comparison at `if pc and mc`. With otherwise valid matched 60-second, 100-frame smoke blocks, main `0 MB` / PR `400 MB` currently passes without a memory finding. I reproduced this on the exact head, and it also remains after #2219, whose nonzero check covers only the PR side. A baseline-zero fixture and an explicit rejection of that unusable measurement would close the comparison bypass. Synthetic checker run only at `49b30dc1f2333361a94ff739912b2d6a78dbe04c`; no retail or GPU run. AI-assisted review with Codex.
Foniass commented 2026-12-01 04:49:33 +00:00 (Migrated from github.com)

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


Triage (#1607) – head 49b30dc

No open or merged PR makes the same change. Main's field_problems (#1133) requires title, seconds and frames, but not peak commit. #2268 rewrites the same peak-commit comparison (medians of 3 runs), so the two will conflict in check().
One thing to note in scripts/pr_check.py:check: a run under Wine reports peak commit: 0 MB. That counts as numeric and passes the new check, but if pc and mc still skips the comparison. The new CONTRIBUTING sentence implies the memory comparison then happens, and it does not.
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:7301139485 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1103#issuecomment-7301139485). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:49:33Z. --- **Triage (#1607)** – head 49b30dc No open or merged PR makes the same change. Main's `field_problems` (#1133) requires title, seconds and frames, but not `peak commit`. #2268 rewrites the same peak-commit comparison (medians of 3 runs), so the two will conflict in `check()`. One thing to note in `scripts/pr_check.py:check`: a run under Wine reports `peak commit: 0 MB`. That counts as numeric and passes the new check, but `if pc and mc` still skips the comparison. The new CONTRIBUTING sentence implies the memory comparison then happens, and it does not. 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/1103:upstream-pr/1103'
git switch 'upstream-pr/1103'

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