tests: four numpy gates decided in the wrong process, so their cases judged the exit code instead #2672

Merged
fiestorra merged 5 commits from upstream-pr/2672 into main 2026-12-01 11:29:52 +00:00
fiestorra commented 2026-11-30 01:32:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T01:32:27Z.


Four files, one bug, one review. Each decides "is numpy usable?" from this process, while the test it gates launches the tool as python -I - and -I implies -s, which hides a --user install. On a machine where numpy came from pip install --user the gate opens and the child dies with ModuleNotFoundError: No module named 'numpy', so the test judges the child's exit code instead of the behaviour it names.

The files

tests/test_tile_probe.py - find_spec -> the isolated probe, gating the four cases that reach numpy. The other eleven keep running: they exercise the tool's file and argument checks, which happen before numpy is touched. (Skipping the whole class turned 12 passing tests into 12 skips; the class docstring's "those tests skip without it" was already an overstatement.)

tests/test_swizzle_search.py - same shape: HAVE_NUMPY stays for the tests that call numpy here, the nine CLI gates use the new NUMPY_VISIBLE_TO_TOOL.

tests/test_tool_startup.py - this one had a second, subtler gap. It skipped a NUMERIC list when numpy was missing, but:

  • have_numpy was the in-process question, so the skip never fired on this machine;
  • and a list of names cannot cover the siblings that import a numeric tool rather than being one - calibrated_texture and tex_export are not numeric themselves. (amd_swizzle was a third, until #2671 made its import late.)

So the probe matches how the tools run, and a child that fails with "No module named 'numpy'" is skipped rather than called a startup failure.

Measured, main b8bd37111, Windows 11, Python 3.13.14

tests/test_tile_probe.py      5 failed, 12 passed          ->  11 passed,  4 skipped
tests/test_swizzle_search.py  3 failed, 23 passed, 5 skip  ->  24 passed,  7 skipped
tests/test_tool_startup.py    2 failed, 2 passed, 218 sub  ->   2 passed, 214 subtests

And with #2667 and #2671 applied on top, the whole Python suite went from 22 failed / 11,853 passed to 0 failed / 11,858 passed (tests/ excluding tests/semantic, which has to be a separate run: test_address_guard.py exists in both directories and pytest refuses to collect both).

Where -I can see numpy - CI - both probes return true, every gate opens, and the cases run exactly as before. Test-only: no tool behaviour moves.

Not in this PR

#2671 also changes tools/amd_swizzle.py, because there the tool reported "needs numpy" before validating arguments. These three files have no such problem.

A correction from the review, applied as its own commit (46ce12bb9)

The first version of the test_swizzle_search.py gates over-skipped: five cases that pass on main in a user-site environment were being skipped, because NUMPY_VISIBLE_TO_TOOL was the wrong gate for all of them.

merzleckeier measured exactly which, and the reasons differ:

  • the two render() calls (BC1, BC3) use the parent's numpy and Pillow, so HAVE_NUMPY and HAVE_PIL was right and my gate was too strict;
  • the three CLI checks - invalid numeric arguments, missing input, output alias - finish before the child needs numpy, so they should not have been gated at all;
  • the two PNG preview subprocesses need Pillow in the child, which my gate never checked; that is why they failed on main too.

Their follow-up (f9456e020) is applied unchanged as its own commit: PIL_VISIBLE_TO_TOOL joins the probe, the five cases run again, and the two PNG tests are gated on the child's Pillow. The numbers above are after it.

What that says about my own measurement: I measured in exactly one dependency configuration - numpy hidden from -I - and in that configuration over-skipping looks identical to correct skipping. "0 failed" was true and was not enough.

The extra commit at the tip (no longer carried)

The branch used to carry a3b5ebea1 (test(semantic): align computed-I/J f16 interp oracle…), added only because semantic-tests was red on main for that oracle and every branch cut from main inherited it. main now has the same edit as c717967d0, so a rebase drops the commit and this pull request no longer touches tests/semantic/test_interp_computed_ij_fallback.py - the diff is only what this change actually needs.

AI-assisted: yes - DeepSeek v4.1 (flash) as the coding agent, with a separate reviewer agent reading the change before submission. Where and on what: the measurements above were taken on Windows 11 with MSVC 19.44.35226 on an RTX 4090 (NVIDIA driver 621.24) where a C++ or GPU path is involved; Python and docs cases need none of it.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5557391388 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T01:32:27Z. --- **Four files, one bug, one review.** Each decides "is numpy usable?" from **this process**, while the test it gates launches the tool as `python -I` - and `-I` implies `-s`, which hides a `--user` install. On a machine where numpy came from `pip install --user` the gate opens and the child dies with `ModuleNotFoundError: No module named 'numpy'`, so the test judges the child's exit code instead of the behaviour it names. ### The files **`tests/test_tile_probe.py`** - `find_spec` -> the isolated probe, gating the **four** cases that reach numpy. The other eleven keep running: they exercise the tool's file and argument checks, which happen before numpy is touched. (Skipping the whole class turned 12 passing tests into 12 skips; the class docstring's "those tests skip without it" was already an overstatement.) **`tests/test_swizzle_search.py`** - same shape: `HAVE_NUMPY` stays for the tests that call numpy **here**, the nine CLI gates use the new `NUMPY_VISIBLE_TO_TOOL`. **`tests/test_tool_startup.py`** - this one had a second, subtler gap. It skipped a `NUMERIC` list when numpy was missing, but: - `have_numpy` was the in-process question, so the skip never fired on this machine; - and a **list of names cannot cover the siblings that import a numeric tool rather than being one** - `calibrated_texture` and `tex_export` are not numeric themselves. (`amd_swizzle` was a third, until #2671 made its import late.) So the probe matches how the tools run, and a child that fails with `"No module named 'numpy'"` is skipped rather than called a startup failure. ### Measured, `main` `b8bd37111`, Windows 11, Python 3.13.14 ``` tests/test_tile_probe.py 5 failed, 12 passed -> 11 passed, 4 skipped tests/test_swizzle_search.py 3 failed, 23 passed, 5 skip -> 24 passed, 7 skipped tests/test_tool_startup.py 2 failed, 2 passed, 218 sub -> 2 passed, 214 subtests ``` And with #2667 and #2671 applied on top, the whole Python suite went from **22 failed / 11,853 passed** to **0 failed / 11,858 passed** (`tests/` excluding `tests/semantic`, which has to be a separate run: `test_address_guard.py` exists in both directories and pytest refuses to collect both). Where `-I` **can** see numpy - CI - both probes return true, every gate opens, and the cases run exactly as before. Test-only: no tool behaviour moves. ### Not in this PR **#2671** also changes `tools/amd_swizzle.py`, because there the tool reported "needs numpy" **before** validating arguments. These three files have no such problem. ### A correction from the review, applied as its own commit (`46ce12bb9`) The first version of the `test_swizzle_search.py` gates **over-skipped**: five cases that pass on `main` in a user-site environment were being skipped, because `NUMPY_VISIBLE_TO_TOOL` was the wrong gate for all of them. merzleckeier measured exactly which, and the reasons differ: - the two `render()` calls (BC1, BC3) use **the parent's** numpy and Pillow, so `HAVE_NUMPY and HAVE_PIL` was right and my gate was too strict; - the three CLI checks - invalid numeric arguments, missing input, output alias - finish **before** the child needs numpy, so they should not have been gated at all; - the two PNG preview subprocesses need **Pillow in the child**, which my gate never checked; that is why they failed on `main` too. Their follow-up (`f9456e020`) is applied unchanged as its own commit: `PIL_VISIBLE_TO_TOOL` joins the probe, the five cases run again, and the two PNG tests are gated on the child's Pillow. The numbers above are **after** it. **What that says about my own measurement:** I measured in exactly one dependency configuration - numpy hidden from `-I` - and in that configuration **over-skipping looks identical to correct skipping**. "0 failed" was true and was not enough. ### The extra commit at the tip (no longer carried) **The branch used to carry `a3b5ebea1`** (`test(semantic): align computed-I/J f16 interp oracle…`), added only because `semantic-tests` was red on `main` for that oracle and every branch cut from `main` inherited it. **`main` now has the same edit as `c717967d0`**, so a rebase **drops the commit** and **this pull request no longer touches `tests/semantic/test_interp_computed_ij_fallback.py`** - the diff is only what this change actually needs. **AI-assisted:** yes - DeepSeek v4.1 (flash) as the coding agent, with a separate reviewer agent reading the change before submission. **Where and on what:** the measurements above were taken on Windows 11 with MSVC 19.44.35226 on an RTX 4090 (NVIDIA driver 621.24) where a C++ or GPU path is involved; Python and docs cases need none of it. Written with an AI assistant.
OreoFR commented 2026-11-30 01:39:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T01:39:56Z.


Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12.16, main 40e7fe69d, PR head of this PR (test-only, so "main" = main's test files, "PR" = this PR's, both on main's tools). MEASURED in two environments:

numpy visible (venv, pytest) numpy absent everywhere (Homebrew python3.12 -I)
test_swizzle_search.py main / PR 31/31 / 31/31 30 run, OK, 23 skipped / same
test_tile_probe.py main / PR 14 passed, 1 skipped / same 15 run, OK, 13 skipped / same
  • No regression in either environment, and merges cleanly with main and with #2566.
  • I could not reproduce the case this PR fixes (numpy from pip install --user, visible to the test process but hidden from the python -I child): this Mac has numpy only in a venv, which -I does not hide. So the fix itself is not covered here.
  • Note: without numpy, test_tile_probe.py still skips 13 of 15 with this PR ('tile_probe.py needs numpy'), including argument/file cases such as test_negative_offset_is_a_usage_error and test_missing_file_is_a_message_not_a_traceback; only test_missing_file_is_a_usage_error_without_numpy and test_missing_numpy_is_one_error_line run. The description says "the other eleven keep running", so in a numpy-less environment that part does not hold.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7266335360 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7266335360). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-30T01:39:56Z. --- Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12.16, main 40e7fe69d, PR head of this PR (test-only, so "main" = main's test files, "PR" = this PR's, both on main's tools). MEASURED in two environments: | | numpy visible (venv, pytest) | numpy absent everywhere (Homebrew `python3.12 -I`) | |---|---|---| | `test_swizzle_search.py` main / PR | 31/31 / 31/31 | 30 run, OK, 23 skipped / same | | `test_tile_probe.py` main / PR | 14 passed, 1 skipped / same | 15 run, OK, 13 skipped / same | - No regression in either environment, and merges cleanly with main and with #2566. - I could not reproduce the case this PR fixes (numpy from `pip install --user`, visible to the test process but hidden from the `python -I` child): this Mac has numpy only in a venv, which `-I` does not hide. So the fix itself is **not covered** here. - Note: without numpy, `test_tile_probe.py` still skips 13 of 15 with this PR (`'tile_probe.py needs numpy'`), including argument/file cases such as `test_negative_offset_is_a_usage_error` and `test_missing_file_is_a_message_not_a_traceback`; only `test_missing_file_is_a_usage_error_without_numpy` and `test_missing_numpy_is_one_error_line` run. The description says "the other eleven keep running", so in a numpy-less environment that part does not hold. AI-assisted: Claude Code
merzleckeier commented 2026-11-30 01:40:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-30T01:40:17Z.


I tested the user-site setup that was missing from the macOS verification. On CachyOS / Python 3.14.10 I put NumPy and Pillow in an isolated PYTHONUSERBASE and verified that only the parent imports them. Base 40e7fe69, PR d4075649.

  • MEASURED The PR’s focused selection skips five test_swizzle_search.py cases that all pass on main in this environment. Two call render() directly (BC1 and BC3), so the parent’s NumPy and Pillow are sufficient. The other three test invalid numeric arguments, a missing input, and an output alias. Those CLI checks finish before the child needs NumPy. CLI validation order
  • MEASURED With NumPy visible to both processes and Pillow in the user site, the two actual CLI PNG preview tests still fail on both main and the PR. Only the parent’s Pillow is checked, so the isolated child reaches the write path with no Pillow.
  • MEASURED This test-only follow-up runs all five checks again in the user-site NumPy case (5 passed, plus 11 subtests) and skips the two PNG subprocess tests when the child lacks Pillow. The tile_probe changes stay as in your PR. Together with the companion #2671 test adjustment, all three files finish without failures in the four dependency configurations.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7266340306 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7266340306). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-11-30T01:40:17Z. --- I tested the user-site setup that was missing from the [macOS verification](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7266335360). On CachyOS / Python 3.14.10 I put NumPy and Pillow in an isolated `PYTHONUSERBASE` and verified that only the parent imports them. Base `40e7fe69`, PR `d4075649`. - **MEASURED** The PR’s focused selection skips five `test_swizzle_search.py` cases that all pass on main in this environment. Two call `render()` directly (BC1 and BC3), so the parent’s NumPy and Pillow are sufficient. The other three test invalid numeric arguments, a missing input, and an output alias. Those CLI checks finish before the child needs NumPy. [CLI validation order](https://github.com/ProjectLeonida/mandy/blob/d4075649b450255a1efb7de851323b04f8fd1cd0/tools/swizzle_search.py#L118-L159) - **MEASURED** With NumPy visible to both processes and Pillow in the user site, the two actual CLI PNG preview tests still fail on both main and the PR. Only the parent’s Pillow is checked, so the isolated child reaches the write path with no Pillow. - **MEASURED** This [test-only follow-up](https://github.com/merzleckeier/mandy/commit/f9456e0207809ab5de8ada60b32ac6f92c80d0e4) runs all five checks again in the user-site NumPy case (5 passed, plus 11 subtests) and skips the two PNG subprocess tests when the child lacks Pillow. The `tile_probe` changes stay as in your PR. Together with the companion #2671 test adjustment, all three files finish without failures in the four dependency configurations. AI-assisted with OpenAI Codex.
OreoFR commented 2026-11-30 03:11:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T03:11:15Z.


Re-check by OreoFR on the new head 46086f4ec, same Mac (macOS 27.2.1, Apple M5, Python 3.12.16), main 1d22590b9. MEASURED, main's test files vs this PR's, on main's tools:

numpy visible (venv, pytest) no numpy (python3.12 -I)
test_swizzle_search.py 31/31 both 30 run, OK, 23 skipped, both
test_tile_probe.py 14 passed, 1 skipped, both 15 run, OK, 13 skipped, both
test_tool_startup.py (new in this head) 2 passed, 221 subtests, both 2 run, OK, both

No regression in either environment; merges cleanly with main and with #2566. The --user case the PR is about is still not reproducible here (see merzleckeier's CachyOS run above for it).

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7267664192 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7267664192). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-30T03:11:15Z. --- Re-check by OreoFR on the new head 46086f4ec, same Mac (macOS 27.2.1, Apple M5, Python 3.12.16), main 1d22590b9. MEASURED, main's test files vs this PR's, on main's tools: | | numpy visible (venv, pytest) | no numpy (`python3.12 -I`) | |---|---|---| | `test_swizzle_search.py` | 31/31 both | 30 run, OK, 23 skipped, both | | `test_tile_probe.py` | 14 passed, 1 skipped, both | 15 run, OK, 13 skipped, both | | `test_tool_startup.py` (new in this head) | 2 passed, 221 subtests, both | 2 run, OK, both | No regression in either environment; merges cleanly with main and with #2566. The `--user` case the PR is about is still not reproducible here (see merzleckeier's CachyOS run above for it). AI-assisted: Claude Code
fiestorra commented 2026-11-30 03:14:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T03:14:04Z.


You are right again, and this one was a coverage regression rather than a red one: five cases that pass on main in this environment were being skipped by my gates. Applied as 46ce12bb9, your follow-up unchanged.

The reasoning I missed, in your words and now in the diff:

  • the two render() calls (BC1, BC3) use the parent's numpy and Pillow, so HAVE_NUMPY and HAVE_PIL was the right gate and NUMPY_VISIBLE_TO_TOOL was too strict;
  • the three CLI checks (invalid numeric arguments, missing input, output alias) finish before the child needs numpy - the validation order in swizzle_search.py - so they should not have been gated at all;
  • and the two PNG preview subprocesses need Pillow in the child, which my gate never checked: that is why they failed on main too, and PIL_VISIBLE_TO_TOOL is the probe that was missing.

Verified here after applying it:

tests/test_swizzle_search.py + test_tile_probe.py + test_tool_startup.py
  -> 37 passed, 11 skipped, 254 subtests

What I would have caught with your matrix and did not, stated plainly: my "0 failed" was measured in exactly one dependency configuration - numpy hidden from -I - and in that configuration over-skipping looks identical to correct skipping. Your four configurations are what turned "no failures" into "no failures and no lost coverage".

Together with the 36654350a adjustment on #2671, all three files now finish without failures in the four setups. Thank you for doing the half of the work that cannot be done on this machine.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7267707024 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7267707024). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T03:14:04Z. --- **You are right again, and this one was a coverage regression rather than a red one: five cases that pass on `main` in this environment were being skipped by my gates.** Applied as `46ce12bb9`, your follow-up unchanged. The reasoning I missed, in your words and now in the diff: - the two `render()` calls (BC1, BC3) use **the parent's** numpy and Pillow, so `HAVE_NUMPY and HAVE_PIL` was the right gate and `NUMPY_VISIBLE_TO_TOOL` was too strict; - the three CLI checks (invalid numeric arguments, missing input, output alias) finish **before** the child needs numpy - [the validation order in `swizzle_search.py`](https://github.com/ProjectLeonida/mandy/blob/d4075649b450255a1efb7de851323b04f8fd1cd0/tools/swizzle_search.py#L118-L159) - so they should not have been gated at all; - and the two PNG preview subprocesses need **Pillow in the child**, which my gate never checked: that is why they failed on `main` too, and `PIL_VISIBLE_TO_TOOL` is the probe that was missing. Verified here after applying it: ``` tests/test_swizzle_search.py + test_tile_probe.py + test_tool_startup.py -> 37 passed, 11 skipped, 254 subtests ``` **What I would have caught with your matrix and did not**, stated plainly: my "0 failed" was measured in exactly **one** dependency configuration - numpy hidden from `-I` - and in that configuration over-skipping looks identical to correct skipping. Your four configurations are what turned "no failures" into "no failures and no lost coverage". Together with the `36654350a` adjustment on #2671, all three files now finish without failures in the four setups. Thank you for doing the half of the work that cannot be done on this machine. Written with an AI assistant.
OreoFR commented 2026-11-30 03:21:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T03:21:21Z.


Re-check by OreoFR on head 46ce12bb9, same Mac, main 1d22590b9. MEASURED, green (main + this PR):

  • test_swizzle_search.py: venv 31/31; without numpy Ran 30, OK, skipped=20 (was 23 skipped on d4075649b and on main): 3 more cases now run without numpy and pass.
  • test_tile_probe.py: venv 14 passed, 1 skipped; without numpy 15 run, OK, 13 skipped (unchanged).
  • test_tool_startup.py: venv 2 passed, 221 subtests; without numpy 2 run, OK.
  • Still merges cleanly with main and with #2566.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7267818193 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7267818193). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-30T03:21:21Z. --- Re-check by OreoFR on head 46ce12bb9, same Mac, main 1d22590b9. MEASURED, green (main + this PR): - `test_swizzle_search.py`: venv 31/31; **without numpy Ran 30, OK, skipped=20** (was 23 skipped on d4075649b and on main): 3 more cases now run without numpy and pass. - `test_tile_probe.py`: venv 14 passed, 1 skipped; without numpy 15 run, OK, 13 skipped (unchanged). - `test_tool_startup.py`: venv 2 passed, 221 subtests; without numpy 2 run, OK. - Still merges cleanly with main and with #2566. AI-assisted: Claude Code
fiestorra commented 2026-11-30 03:41:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T03:41:36Z.


Rebased with the one commit main is missing, the same one #2633 and my other pull requests carry (a3b5ebea1, TEST-INTERP-COMPUTED-IJ-FALLBACK-RTZ). semantic-tests is red on main for the interp oracle, so every branch cut from it inherits that failure regardless of what it changes.

Verified after adding it, on this branch:

python3 -m pytest tests/test_swizzle_search.py tests/test_tile_probe.py tests/test_tool_startup.py tests/semantic/test_interp_computed_ij_fallback.py -q
  -> 46 passed, 11 skipped, 267 subtests

If #2633 merges first this fifth commit becomes a duplicate and can be dropped; if this lands first, #2633 becomes a no-op.

A note on how this branch was pushed, because I broke one today: the last two pushes of mine went through a git checkout that had failed silently, and one of them replaced a branch with main and closed its pull request (#2641, re-opened as #2691). This one checked git rev-parse --abbrev-ref HEAD before pushing and printed it before the push line; a --force deserves that much.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7268114090 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7268114090). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T03:41:36Z. --- Rebased with the one commit `main` is missing, the same one #2633 and my other pull requests carry (`a3b5ebea1`, TEST-INTERP-COMPUTED-IJ-FALLBACK-RTZ). `semantic-tests` is red on `main` for the interp oracle, so every branch cut from it inherits that failure regardless of what it changes. Verified after adding it, on this branch: ``` python3 -m pytest tests/test_swizzle_search.py tests/test_tile_probe.py tests/test_tool_startup.py tests/semantic/test_interp_computed_ij_fallback.py -q -> 46 passed, 11 skipped, 267 subtests ``` If **#2633** merges first this fifth commit becomes a duplicate and can be dropped; if this lands first, #2633 becomes a no-op. **A note on how this branch was pushed, because I broke one today:** the last two pushes of mine went through a `git checkout` that had failed silently, and one of them replaced a branch with `main` and closed its pull request (#2641, re-opened as #2691). This one checked `git rev-parse --abbrev-ref HEAD` before pushing and printed it before the push line; a `--force` deserves that much. Written with an AI assistant.
OreoFR commented 2026-11-30 03:46:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T03:46:00Z.


Note by OreoFR on head 769138928: the new commit adds the SHADER-468 change to tests/semantic/test_interp_computed_ij_fallback.py, and with it this PR now conflicts with #2566 (git merge-tree of main + this PR against #2566), which carries the same change. The numpy-gate files are unchanged since my check of 46ce12bb9.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7268176489 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7268176489). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-30T03:46:00Z. --- Note by OreoFR on head 769138928: the new commit adds the SHADER-468 change to `tests/semantic/test_interp_computed_ij_fallback.py`, and with it this PR now **conflicts with #2566** (`git merge-tree` of main + this PR against #2566), which carries the same change. The numpy-gate files are unchanged since my check of 46ce12bb9. AI-assisted: Claude Code
fiestorra commented 2026-11-30 03:56:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T03:56:26Z.


Thank you - and the conflict you found is not what I would have guessed. I diffed the two sides: #2566 carries a different implementation of the same interp fix, not the same edit.

#2633 / a3b5ebea1 (what this branch carries) #2566
helper f16_rtz_bits(x) f16_rtz_bits(val)
docstring "Narrow x to f16 bits toward zero…" "Narrow to f16 bits toward zero…"
size 30,936 B 30,870 B
lines differing 504 of 566

So "resolve by taking either side" is wrong here: it is a choice between two oracles, and only one of them can be the one that ends up describing SHADER-468 in main. I have written that up in the coordination thread rather than pretending the conflict is trivial - it is the useful thing your check produced.

What the commit in this branch is, precisely: a3b5ebea1, the commit #2633 carries, added because semantic-tests is red on main and every branch cut from it inherits the failure. It is disposable - when #2633 or #2566 lands, a rebase drops it and the conflict goes with it. If the maintainers would rather I remove it now and let this pull request show the inherited red until then, say so and I will.

On the rest of your re-check: thank you for the no-numpy case. Ran 4, OK with python3.12 -I is exactly the configuration I cannot produce here, and it is the one that disproved my first version of this change. merzleckeier's follow-up is in, and both of you have now run the case I could not.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7268329319 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7268329319). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T03:56:26Z. --- Thank you - and the conflict you found is not what I would have guessed. I diffed the two sides: **#2566 carries a different implementation of the same interp fix**, not the same edit. | | #2633 / `a3b5ebea1` (what this branch carries) | #2566 | |---|---|---| | helper | `f16_rtz_bits(x)` | `f16_rtz_bits(val)` | | docstring | "Narrow `x` to f16 bits toward zero…" | "Narrow to f16 bits toward zero…" | | size | 30,936 B | 30,870 B | | lines differing | **504 of 566** | | So "resolve by taking either side" is wrong here: it is a choice between two oracles, and only one of them can be the one that ends up describing SHADER-468 in `main`. I have written that up in the coordination thread rather than pretending the conflict is trivial - it is the useful thing your check produced. **What the commit in this branch is, precisely:** `a3b5ebea1`, the commit **#2633** carries, added because `semantic-tests` is red on `main` and every branch cut from it inherits the failure. It is disposable - when #2633 or #2566 lands, a rebase drops it and the conflict goes with it. If the maintainers would rather I remove it now and let this pull request show the inherited red until then, say so and I will. **On the rest of your re-check: thank you for the no-numpy case.** `Ran 4, OK` with `python3.12 -I` is exactly the configuration I cannot produce here, and it is the one that disproved my first version of this change. merzleckeier's follow-up is in, and both of you have now run the case I could not. Written with an AI assistant.
fiestorra commented 2026-11-30 03:57:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T03:57:24Z.


Correction to what I wrote above: I diffed the wrong thing. It is one change, not two.

I compared the two files at their own branch heads and read "504 of 566 lines differ" as two implementations. Those files come from different bases, so most of that was drift. Compared properly - the added lines of each patch, and the file a3b5ebea1 produces when applied to current main - the only differences are x vs val as the parameter name and two comment phrasings. Same helper, same algorithm, same constants.

So your report was right and my escalation of it was wrong: the conflict is the same edit on both sides, and taking either resolves it. The duplicate is still real - whichever of #2633 / #2566 lands first, the other's copy is dropped - and the copy in this branch is exactly a3b5ebea1.

Thank you for finding the conflict; the part I got wrong after that was mine, not yours.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7268343459 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7268343459). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T03:57:24Z. --- **Correction to what I wrote above: I diffed the wrong thing. It is one change, not two.** I compared the two files at their own branch heads and read "504 of 566 lines differ" as two implementations. Those files come from **different bases**, so most of that was drift. Compared properly - the added lines of each patch, and the file `a3b5ebea1` produces when applied to current `main` - the only differences are **`x` vs `val`** as the parameter name and two comment phrasings. Same helper, same algorithm, same constants. So your report was right and my escalation of it was wrong: **the conflict is the same edit on both sides, and taking either resolves it.** The duplicate is still real - whichever of #2633 / #2566 lands first, the other's copy is dropped - and the copy in this branch is exactly `a3b5ebea1`. Thank you for finding the conflict; the part I got wrong after that was mine, not yours. Written with an AI assistant.
OreoFR commented 2026-11-30 10:10:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T10:10:36Z.


Update by OreoFR: the conflict with #2566 I reported here is gone. main (1b0f657f3) now carries the SHADER-468 change to tests/semantic/test_interp_computed_ij_fallback.py (71db4c405), and this PR merges cleanly both with main and on top of main + #2566 (git merge-tree, checked 2026-11-30 11:10 local). Note also that my earlier check merged this PR with main first and then compared against #2566's head, which can report a conflict through an older merge base; I now check main + #2566 first, then the PR.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7275233336 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7275233336). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-30T10:10:36Z. --- Update by OreoFR: **the conflict with #2566 I reported here is gone.** `main` (1b0f657f3) now carries the SHADER-468 change to `tests/semantic/test_interp_computed_ij_fallback.py` (`71db4c405`), and this PR merges cleanly both with `main` and on top of `main` + #2566 (`git merge-tree`, checked 2026-11-30 11:10 local). Note also that my earlier check merged this PR with `main` first and then compared against #2566's head, which can report a conflict through an older merge base; I now check `main` + #2566 first, then the PR. AI-assisted: Claude Code
fiestorra commented 2026-11-30 14:00:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T14:00:19Z.


Re-verified after the rebase onto main 20fe0c754, on this machine (Windows 11, MSVC 19.44.35226): the diff no longer carries the interp-oracle commit (main has it as c717967d0), and what is left still passes.

python3 -m pytest tests/test_tile_probe.py -q
11 passed, 4 skipped, 6 subtests passed in 1.00s

What I did not test: the rest of the change, and anything the rebase did not touch. This confirms the rebase kept the change working, not that the change is correct - that is what the review and the CI are for.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7280688309 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7280688309). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T14:00:19Z. --- **Re-verified after the rebase onto `main` `20fe0c754`, on this machine (Windows 11, MSVC 19.44.35226):** the diff no longer carries the interp-oracle commit (`main` has it as `c717967d0`), and what is left still passes. ``` python3 -m pytest tests/test_tile_probe.py -q 11 passed, 4 skipped, 6 subtests passed in 1.00s ``` **What I did not test:** the rest of the change, and anything the rebase did not touch. **This confirms the rebase kept the change working, not that the change is correct** - that is what the review and the CI are for. Written with an AI assistant.
aegish-zagi commented 2026-11-30 14:38:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-11-30T14:38:25Z.


VERIFY-2672 — PASS (with one stated limit)

  • PR: #2672 | head b3b064bb79 | merge state vs main b17b22d33: CLEAN (scratch merge, no conflicts)
  • Tests run (PR head merged with current main, system Python 3.12): tests/test_swizzle_search.py — 30 tests OK, exit 0; tests/test_tile_probe.py — 15 tests OK (1 skipped); tests/test_tool_startup.py — 2 tests OK
  • Red-on-main vs green-on-PR: on this host there is no red to reproduce — numpy and Pillow are installed system-wide, so they are visible both in-process and under python -I, the two gates agree, and the PR's test files run against plain main also pass (test_swizzle_search.py: 30 tests OK, measured). The failure this PR fixes needs a host where numpy/Pillow come from a --user install (visible in-process, hidden under -I): there, main's gates un-skip CLI tests whose tool subprocess cannot import numpy, and skip argument-validation cases that never needed numpy. That host condition is READ IN CODE here, not MEASURED: the diff replaces the in-process HAVE_NUMPY/HAVE_PIL gates for CLI-launching tests with subprocess probes of what python -I can see (NUMPY_VISIBLE_TO_TOOL / PIL_VISIBLE_TO_TOOL in test_swizzle_search.py, the same probe pattern in test_tile_probe.py and test_tool_startup.py), and drops the numpy gate entirely from the two bad-argument/missing-input cases that only exercise argument parsing. The probe code is short, stdlib-only, and runs the exact interpreter invocation the tool gets.
  • Diff audit: 3 test files only, +29/-8, no production code, no game data.
  • Platform: Linux, Python 3.12, Profile Z (no GPU)
  • AI-assisted: yes (Muse Wonder, Muse by Meta)
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7281693675 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7281693675). Originally posted by [aegish-zagi](https://github.com/aegish-zagi) on 2026-11-30T14:38:25Z. --- VERIFY-2672 — PASS (with one stated limit) - PR: #2672 | head b3b064bb79a3de7a3beeca4d5298074bd1325831 | merge state vs main b17b22d33: CLEAN (scratch merge, no conflicts) - Tests run (PR head merged with current main, system Python 3.12): tests/test_swizzle_search.py — 30 tests OK, exit 0; tests/test_tile_probe.py — 15 tests OK (1 skipped); tests/test_tool_startup.py — 2 tests OK - Red-on-main vs green-on-PR: on this host there is no red to reproduce — numpy and Pillow are installed system-wide, so they are visible both in-process and under python -I, the two gates agree, and the PR's test files run against plain main also pass (test_swizzle_search.py: 30 tests OK, measured). The failure this PR fixes needs a host where numpy/Pillow come from a --user install (visible in-process, hidden under -I): there, main's gates un-skip CLI tests whose tool subprocess cannot import numpy, and skip argument-validation cases that never needed numpy. That host condition is READ IN CODE here, not MEASURED: the diff replaces the in-process HAVE_NUMPY/HAVE_PIL gates for CLI-launching tests with subprocess probes of what python -I can see (NUMPY_VISIBLE_TO_TOOL / PIL_VISIBLE_TO_TOOL in test_swizzle_search.py, the same probe pattern in test_tile_probe.py and test_tool_startup.py), and drops the numpy gate entirely from the two bad-argument/missing-input cases that only exercise argument parsing. The probe code is short, stdlib-only, and runs the exact interpreter invocation the tool gets. - Diff audit: 3 test files only, +29/-8, no production code, no game data. - Platform: Linux, Python 3.12, Profile Z (no GPU) - AI-assisted: yes (Muse Wonder, Muse by Meta)
KelboLive commented 2026-11-30 16:18:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T16:18:26Z.


Independent check on Windows (not the author), at dbd6ccc2b.

  • python -I tests/test_tool_startup.py: 2 tests OK (137.6 s — subprocess start-up cases).
  • python -I tests/test_swizzle_search.py: 30 tests OK (1.76 s).
  • python -I tests/test_tile_probe.py: 15 tests OK, 1 skipped (1.26 s).

Environment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10, no numpy required for these runs.

AI-assisted: yes (opencode).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7284452418 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#issuecomment-7284452418). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-30T16:18:26Z. --- Independent check on Windows (not the author), at `dbd6ccc2b`. - `python -I tests/test_tool_startup.py`: **2 tests OK** (137.6 s — subprocess start-up cases). - `python -I tests/test_swizzle_search.py`: **30 tests OK** (1.76 s). - `python -I tests/test_tile_probe.py`: **15 tests OK, 1 skipped** (1.26 s). Environment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10, no numpy required for these runs. AI-assisted: yes (opencode).
aslan2142 commented 2026-12-01 11:29:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:29:49Z.

Review: APPROVED


LGTM. Checking numpy/PIL visibility inside an isolated python -I subprocess in tests/test_swizzle_search.py, tests/test_tile_probe.py, and tests/test_tool_startup.py fixes false skips/failures when packages are only in user-site, and un-gates CLI validation tests that run before numpy import. Clean-room verified, 5/5 CI green, and independently verified. Merging.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130329492 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2672#pullrequestreview-6130329492). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:29:49Z. **Review:** APPROVED --- LGTM. Checking `numpy`/`PIL` visibility inside an isolated `python -I` subprocess in `tests/test_swizzle_search.py`, `tests/test_tile_probe.py`, and `tests/test_tool_startup.py` fixes false skips/failures when packages are only in user-site, and un-gates CLI validation tests that run before numpy import. Clean-room verified, 5/5 CI green, and independently verified. Merging. *(AI-assisted review.)*
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!2672
No description provided.