docs/testing: two verdicts that are not about the pull request #3188

Open
fiestorra wants to merge 2 commits from upstream-pr/3188 into main
fiestorra commented 2026-12-02 17:37:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T17:37:09Z.


docs/testing: two verdicts that are not about the pull request

red_green.py reports a verdict, and two of them read as statements about the change when they are
statements about something else. Both cost me a run today.

green fails can be the machine. A test that fails on main alone fails with the pull request
merged too, so every run reads that verdict whatever the change does. Here it is
descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in, because the crate's tests make
their device with D3D12CreateDevice(None, ..) and that is the integrated Radeon on this machine -
cargo test -p leonida-gpu --lib on main is 695 passed, 1 failed, and that is the one. Two pull
requests I checked (#3153, #3150) read green fails for it while their own tests passed.

red not constructible: the pull request changes no test is also what a merged pull request reads:
its merge base is its own head, so nothing is left to compare. #3148 read that after it merged, and the
phrasing sends you looking for a test that is not missing.

The section is otherwise right; these are the two lines a reader needs before the verdict means
anything.

python -m unittest discover -s tests -p "test_docs_*.py": 57 tests, OK.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5611703068 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3188). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T17:37:09Z. --- docs/testing: two verdicts that are not about the pull request `red_green.py` reports a verdict, and two of them read as statements about the change when they are statements about something else. Both cost me a run today. **`green fails` can be the machine.** A test that fails on `main` alone fails with the pull request merged too, so every run reads that verdict whatever the change does. Here it is `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in`, because the crate's tests make their device with `D3D12CreateDevice(None, ..)` and that is the integrated Radeon on this machine - `cargo test -p leonida-gpu --lib` on `main` is 695 passed, 1 failed, and that is the one. Two pull requests I checked (#3153, #3150) read `green fails` for it while their own tests passed. **`red not constructible: the pull request changes no test` is also what a merged pull request reads**: its merge base is its own head, so nothing is left to compare. #3148 read that after it merged, and the phrasing sends you looking for a test that is not missing. The section is otherwise right; these are the two lines a reader needs before the verdict means anything. `python -m unittest discover -s tests -p "test_docs_*.py"`: 57 tests, OK. Written with an AI assistant.
MoonEyes commented 2026-12-02 18:18:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:18:04Z.


Verification of #3188 (third party, Linux, no GPU, no game files)

  • Head verified: ff85245aaf3cd6bbb83e211533ddf48b236bf596 (1 file, docs/testing.md, +8).
  • Merge base 5b1fff821; merged with git merge --no-ff onto main 45dc41f95, no conflict.

What was run (Python 3.13, python -I)

Command Result
python -I scripts/check_no_game_data.py docs/testing.md exit 0
git diff --check origin/main...pr/3188 clean
the 13 tests/test_docs_*.py + tests/test_design_contract_rows.py, one by one all pass, same as on main

Docs-only, so no red/green applies.

Checked against scripts/red_green.py

  • Second bullet (red not constructible on a merged pull request): holds. check() diffs merge_base..head
    (red_green.py:656, :664). After a merge-commit merge the merge base is the head, the diff is empty and
    red_commit returns None, so the report reads "not constructible: the pull request changes no test".
    Nit: this is only true of a merge-commit merge, not of a squash merge. main uses merge commits, so it is right here.

  • First bullet (green fails from a test that already fails on main): overstated. compare()
    (red_green.py:501-522) puts a test that fails on both sides in fail_on_both. verdict() (:531-533)
    only says green fails for regressions or a failing only_on_green row. Checked by calling the two functions
    directly:

    • red {pre_broken: failed, new: failed}, green {pre_broken: failed, new: ok} gives red then green, not
      green fails;
    • with no red side (red_why set, red=None), the same green gives green fails.

    So a test that fails on main makes every run read green fails only when the red side has no result for it.
    That happens when the red side is not constructible or does not build, or when the test exists only on green.
    When the red side runs the crate, a deterministic failure on main does not change the verdict. The cases
    quoted in the body (#3153, #3150) may have had no red side, or a flaky test. The bullet as written,
    "every run reads that verdict whatever the change does", says more than the code does.

Defects

  1. docs/testing.md:162-166: limit the claim to runs where the red side gives no result for the test (red not
    constructible or does not build, or the test only exists on green). In the other runs, point to the
    fail on both rows of the report. The advice to compare with the crate's tests on main holds in both cases.
  2. Process: the pull request body has no claim in the coordination issue, and "Written with an AI assistant"
    does not name the models or the reviewer agent (CONTRIBUTING.md, AI-assisted contributions).
  3. docs/testing.md:166: "#2995 and the crate switches it adds are the way out" points to an open, unmerged pull
    request. Say "proposed in #2995" so the line stays right if #2995 changes or is closed.

Verdict: defects. The first bullet needs narrowing to what verdict() actually does. The rest is correct and the doc tests are green.

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354323438 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3188#issuecomment-7354323438). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:18:04Z. --- **Verification of #3188 (third party, Linux, no GPU, no game files)** - Head verified: `ff85245aaf3cd6bbb83e211533ddf48b236bf596` (1 file, `docs/testing.md`, +8). - Merge base `5b1fff821`; merged with `git merge --no-ff` onto `main` `45dc41f95`, no conflict. **What was run (Python 3.13, `python -I`)** | Command | Result | |---|---| | `python -I scripts/check_no_game_data.py docs/testing.md` | exit 0 | | `git diff --check origin/main...pr/3188` | clean | | the 13 `tests/test_docs_*.py` + `tests/test_design_contract_rows.py`, one by one | all pass, same as on `main` | Docs-only, so no red/green applies. **Checked against `scripts/red_green.py`** - Second bullet (`red not constructible` on a merged pull request): holds. `check()` diffs `merge_base..head` (`red_green.py:656`, `:664`). After a merge-commit merge the merge base is the head, the diff is empty and `red_commit` returns `None`, so the report reads "not constructible: the pull request changes no test". Nit: this is only true of a merge-commit merge, not of a squash merge. `main` uses merge commits, so it is right here. - First bullet (`green fails` from a test that already fails on `main`): **overstated**. `compare()` (`red_green.py:501-522`) puts a test that fails on both sides in `fail_on_both`. `verdict()` (`:531-533`) only says `green fails` for `regressions` or a failing `only_on_green` row. Checked by calling the two functions directly: - red `{pre_broken: failed, new: failed}`, green `{pre_broken: failed, new: ok}` gives **`red then green`**, not `green fails`; - with no red side (`red_why` set, `red=None`), the same green gives `green fails`. So a test that fails on `main` makes every run read `green fails` only when the red side has no result for it. That happens when the red side is not constructible or does not build, or when the test exists only on green. When the red side runs the crate, a deterministic failure on `main` does not change the verdict. The cases quoted in the body (#3153, #3150) may have had no red side, or a flaky test. The bullet as written, "every run reads that verdict whatever the change does", says more than the code does. **Defects** 1. `docs/testing.md:162-166`: limit the claim to runs where the red side gives no result for the test (red not constructible or does not build, or the test only exists on green). In the other runs, point to the `fail on both` rows of the report. The advice to compare with the crate's tests on `main` holds in both cases. 2. Process: the pull request body has no claim in the coordination issue, and "Written with an AI assistant" does not name the models or the reviewer agent (CONTRIBUTING.md, AI-assisted contributions). 3. `docs/testing.md:166`: "#2995 and the crate switches it adds are the way out" points to an open, unmerged pull request. Say "proposed in #2995" so the line stays right if #2995 changes or is closed. **Verdict: defects.** The first bullet needs narrowing to what `verdict()` actually does. The rest is correct and the doc tests are green. AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
fiestorra commented 2026-12-02 21:45:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T21:45:48Z.


You are right, and I have corrected the bullet in 9fa90bab7.

I called the two functions from the installed script to see it rather than take it on trust:

red  = {pre_broken: failed, new: failed}
green = {pre_broken: failed, new: ok}
compare() -> fail_on_both: ['pre_broken'], red_to_green: ['new']
verdict() with the red side present   -> red then green
verdict() with red_why and no red set -> green fails

So a deterministic failure on main does not change the verdict when the red side ran the test — it lands in fail_on_both and the run still reads red then green. What I saw in #3153 and #3150 must have been the other case: the red side had no result for those tests (not constructed, did not build, or the test only existed on green), which is the only path to green fails from a machine-level failure.

The bullet now says that, and names the three cases that produce it. I also took the nit: the merged-pull-request red not constructible holds for a merge-commit merge (what this repository uses); a squash merge would leave a diff, so the sentence now says so.

My thanks — this is the second time tonight that a third-party review found a claim of mine that was stronger than the code. The other was #2995's adapter selector.

Checks on the new head: python -I scripts/check_no_game_data.py docs/testing.md exit 0, tests/test_docs_links.py OK, tests/test_docs_encoding.py OK, tests/test_docs_list_items.py OK.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7359745419 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3188#issuecomment-7359745419). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T21:45:48Z. --- **You are right, and I have corrected the bullet in `9fa90bab7`.** I called the two functions from the installed script to see it rather than take it on trust: ``` red = {pre_broken: failed, new: failed} green = {pre_broken: failed, new: ok} compare() -> fail_on_both: ['pre_broken'], red_to_green: ['new'] verdict() with the red side present -> red then green verdict() with red_why and no red set -> green fails ``` **So a deterministic failure on `main` does not change the verdict when the red side ran the test** — it lands in `fail_on_both` and the run still reads `red then green`. What I saw in #3153 and #3150 must have been the other case: **the red side had no result for those tests** (not constructed, did not build, or the test only existed on green), which is the only path to `green fails` from a machine-level failure. The bullet now says that, and names the three cases that produce it. **I also took the nit**: the merged-pull-request `red not constructible` holds for a **merge-commit merge** (what this repository uses); a squash merge would leave a diff, so the sentence now says so. **My thanks — this is the second time tonight that a third-party review found a claim of mine that was stronger than the code.** The other was #2995's adapter selector. Checks on the new head: `python -I scripts/check_no_game_data.py docs/testing.md` exit 0, `tests/test_docs_links.py` OK, `tests/test_docs_encoding.py` OK, `tests/test_docs_list_items.py` OK. Written with an AI assistant.
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/3188:upstream-pr/3188'
git switch 'upstream-pr/3188'

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