Skip to content

Scripts: require peak commit measurements for smoke comparisons - #1103

Open
anakatt wants to merge 1 commit into
xcl-dev:mainfrom
anakatt:scripts/require-smoke-memory-metrics
Open

anakatt wants to merge 1 commit into
xcl-dev:mainfrom
anakatt:scripts/require-smoke-memory-metrics

Conversation

@anakatt

@anakatt anakatt commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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 Scripts: require numeric crash and device removal counts #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.

An absent or n/a peak commit parsed as None and skipped the memory
comparison, so incomplete smoke reports passed the documented limit.

Require a measurement from both matching runs. Keep the existing growth
threshold, update the minimal smoke fixture and document the requirement.

Eight invalid subcases were accepted before the fix. The focused checker
suite now passes: 11 tests, 0 failures, 0 skipped on macOS/Python 3.15.2.

Assisted-by: omp (openai-codex/gpt-6-astra)
@futurepro62

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

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

@throny throny added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 25, 2026
@RavenCurseBurg

RavenCurseBurg commented Nov 26, 2026 •

Copy link
Copy Markdown

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.

@luckyteagirl luckyteagirl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants