Explain when a red-green head is already in the base #3203

Merged
merzleckeier merged 1 commit from upstream-pr/3203 into main 2026-12-03 16:17:24 +00:00
merzleckeier commented 2026-12-02 18:58:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T18:58:26Z.


Claimed in the coordination issue as TEST-RED-GREEN-BASE-CONTAINS-HEAD.

What and why

When the selected base already contains a PR head, scripts/red_green.py reports that the pull request changes no test. That message is misleading for a PR that added tests and has since been merged, as observed with #3148 and discussed in #3188. Compare the resolved head with the merge base to report the reason explicitly. The red not constructible verdict, exit status, and JSON shape stay the same.

Tested

  • A synthetic Git regression merges a branch that changed a test. It failed with the old reason and passed with this change. The existing unmerged branch with no test still reports its original reason.
  • python -I tests/test_red_green.py on Linux: 37 passed, one platform-specific skip.
  • On the same commit, all 38 tests passed under Wine 11.22 with Windows Python 3.12.10 and Git for Windows 2.56.1.windows.2.
  • Checked real head 1f158fe57 (#3148) with --no-cargo. With current main as base it reports that the head is already included. With the head’s first parent as the base it still selects tests/test_x64_recomp.py and reports red then green.
  • git diff --check and python -I scripts/check_no_game_data.py passed.

GPUs tested: n/a (synthetic Git fixtures and CPU-only checks).

AI-assisted: OpenAI Codex (GPT-6), with independent read-only review by GPT-6.2 Sol.

Checklist

  • Based on upstream main (b41763227).
  • One topic.
  • Synthetic fixtures only.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5612815154 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3203). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T18:58:26Z. --- Claimed in the coordination issue as [TEST-RED-GREEN-BASE-CONTAINS-HEAD](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7355351957). ### What and why When the selected base already contains a PR head, `scripts/red_green.py` reports that the pull request changes no test. That message is misleading for a PR that added tests and has since been merged, as observed with #3148 and discussed in #3188. Compare the resolved head with the merge base to report the reason explicitly. The `red not constructible` verdict, exit status, and JSON shape stay the same. ### Tested - A synthetic Git regression merges a branch that changed a test. It failed with the old reason and passed with this change. The existing unmerged branch with no test still reports its original reason. - `python -I tests/test_red_green.py` on Linux: 37 passed, one platform-specific skip. - On the same commit, all 38 tests passed under Wine 11.22 with Windows Python 3.12.10 and Git for Windows 2.56.1.windows.2. - Checked real head `1f158fe57` (#3148) with `--no-cargo`. With current `main` as base it reports that the head is already included. With the head’s first parent as the base it still selects `tests/test_x64_recomp.py` and reports `red then green`. - `git diff --check` and `python -I scripts/check_no_game_data.py` passed. GPUs tested: n/a (synthetic Git fixtures and CPU-only checks). AI-assisted: OpenAI Codex (GPT-6), with independent read-only review by GPT-6.2 Sol. ### Checklist - [x] Based on upstream `main` (`b41763227`). - [x] One topic. - [x] Synthetic fixtures only.
fiestorra commented 2026-12-02 19:39:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T19:39:11Z.


VERIFY-3203 — Windows nativo, independent of the author's Linux/Wine runs

Head d7deb51a2
Merge base b41763227 = current main (the PR sits exactly on today's main; git diff --stat merge-base..main over the two files is empty)

Ran (native Windows, Python 3.13, Git for Windows, worktree detached at the PR head)

python -I tests/test_red_green.py            Ran 38 tests in 92.4s — OK

Negative control (scripts/red_green.py reverted to main, new test kept)

python -I tests/test_red_green.py Sides.test_a_head_already_in_the_base_has_a_distinct_red_reason
FAILED (failures=1)
AssertionError: 'not constructible: the pull request changes no test'
             != 'not constructible: the head is already included in the base'

The real case the change is for — a head that main already contains (#3148, head 1f158fe57), both scripts on the same commit and base:

main's scripts/red_green.py  -> "red_why": "not constructible: the pull request changes no test"
this PR's red_green.py       -> "red_why": "not constructible: the head is already included in the base"

That is the artefact this closes: the misleading verdict I wrote into docs/testing.md in #3188 reads as if a merged pull request had no test. With this change the reason names the real one.

What I could not test

  • The --mutate path and the cargo sides: not exercised here; I ran only the Python/unittest side (--no-cargo --no-python for the two single-target runs above, the full file otherwise).
  • Platform-specific skip: the author reports one skip on Linux; on Windows the run had no skip and all 38 executed.

Verdict: red then green, and the real head the PR is about reports the new reason.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7356511252 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3203#issuecomment-7356511252). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T19:39:11Z. --- ## VERIFY-3203 — Windows nativo, independent of the author's Linux/Wine runs | | | |---|---| | Head | `d7deb51a2` | | Merge base | `b41763227` = current `main` (the PR sits exactly on today's `main`; `git diff --stat merge-base..main` over the two files is empty) | **Ran (native Windows, Python 3.13, Git for Windows, worktree detached at the PR head)** ``` python -I tests/test_red_green.py Ran 38 tests in 92.4s — OK ``` **Negative control (`scripts/red_green.py` reverted to `main`, new test kept)** ``` python -I tests/test_red_green.py Sides.test_a_head_already_in_the_base_has_a_distinct_red_reason FAILED (failures=1) AssertionError: 'not constructible: the pull request changes no test' != 'not constructible: the head is already included in the base' ``` **The real case the change is for** — a head that `main` already contains (`#3148`, head `1f158fe57`), both scripts on the same commit and base: ``` main's scripts/red_green.py -> "red_why": "not constructible: the pull request changes no test" this PR's red_green.py -> "red_why": "not constructible: the head is already included in the base" ``` **That is the artefact this closes**: the misleading verdict I wrote into `docs/testing.md` in #3188 reads as if a merged pull request had no test. With this change the reason names the real one. ## What I could not test - **The `--mutate` path and the cargo sides**: not exercised here; I ran only the Python/unittest side (`--no-cargo --no-python` for the two single-target runs above, the full file otherwise). - **Platform-specific skip**: the author reports one skip on Linux; on Windows the run had no skip and all 38 executed. Verdict: **red then green**, and the real head the PR is about reports the new reason. Written with an AI assistant.
merzleckeier commented 2026-12-02 20:27:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T20:27:51Z.


Integration check for this head (d7deb51a) and #3181 (1c62cfc6), both on main b41763227. git merge-tree is clean. In the clean combined checkout, python3 -I tests/test_red_green.py completed all 41 cases on Linux (40 passed, one platform-only skip). Both changes to the checker have coverage in the combined suite. Synthetic Git fixtures only. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7357775650 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3203#issuecomment-7357775650). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T20:27:51Z. --- Integration check for this head (`d7deb51a`) and #3181 (`1c62cfc6`), both on `main` `b41763227`. `git merge-tree` is clean. In the clean combined checkout, `python3 -I tests/test_red_green.py` completed all 41 cases on Linux (40 passed, one platform-only skip). Both changes to the checker have coverage in the combined suite. Synthetic Git fixtures only. AI-assisted.
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
ProjectLeonida/mandy!3203
No description provided.