From 824ea58daaebd4d128ffab85391e32cb12170d32 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Aug 2026 11:57:04 +0000 Subject: [PATCH] prompt: route pyautogalaxy-mge-sigma-test (PyAutoGalaxy#550) -> library-dev Advance the prompt draft/test/autogalaxy/ -> active/ and register the task. Fix is committed and pushed to PyAutoGalaxy 91eb878. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011tJFsEesnF7rZmn2xvfxUe --- active.md | 14 ++++++++++++++ active/pyautogalaxy_mge_bitwise_sigma_test.md | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 active/pyautogalaxy_mge_bitwise_sigma_test.md diff --git a/active.md b/active.md index 3b4dcb220..618f1fb6c 100644 --- a/active.md +++ b/active.md @@ -1,5 +1,19 @@ # Active Tasks +## pyautogalaxy-mge-sigma-test +- issue: https://github.com/PyAutoLabs/PyAutoGalaxy/issues/550 +- status: library-dev — fix COMMITTED AND PUSHED to `claude/pyautogalaxy-mge-sigma-test-3neq07` (PyAutoGalaxy 91eb878). NO PR opened (not requested). Cloud session, no worktree and no `gh` CLI; issue filed via the GitHub MCP surface. +- what it fixes: the two `*_default_sigma_list_is_bitwise_unchanged` tests added with PyAutoGalaxy#549 compared the implementation's per-element scalar power (`gaussian.sigma = 10 ** log10_sigma_list[i]`, `autogalaxy/analysis/model_util.py:190` and `:271`) against a vectorised `10 ** np.linspace(...)` in the test. Different numpy code paths; numpy does not guarantee scalar and SIMD power loops agree bit for bit. Fix builds the expected ladder element-wise so both sides take the same path. +- REPRODUCED, not assumed: this cloud runner is itself AVX-512 (`avx512f/bw/cd/dq/vl/vnni` in /proc/cpuinfo) with numpy 2.4.6, so `pytest` failed on the unmodified tree exactly as reported, and passes after. The prompt named one index (mask_radius=3.0/n=20 -> index 18); the actual footprint is wider — mge also drifts at 3.5/30 index 8, and the POINT test drifts too (0.1/10 at indices 4 and 9, 0.05/5 at index 3). Both tests were broken, not just the first. +- the guarantee was NOT weakened (explicit human instruction): `pytest.approx(rel=1e-8)` deliberately not used; the docstring's reasoning for that is kept verbatim and both docstrings now carry a PORTABILITY TRAP note so the expectation is not re-vectorised by a later tidy-up. +- control test (the check that matters — an element-wise expectation could have been vacuous): perturbed the implementation defaults by a relative 1e-7 (`sigma_min` 1e-4 -> 1.0000001e-4, 0.01 -> 0.010000001) and BOTH tests still fail. The exactness guarantee survives the change; implementation restored afterwards, only the test file is modified. +- validation: `test_autogalaxy/analysis/test_model_util.py` 29 passed; full `test_autogalaxy/` 1004 passed, 3 skipped. Ran on Python 3.11 (the only interpreter with a stack in this sandbox) — CI grades 3.12/3.13, and the change is pure-Python test code with no version-sensitive surface. +- deliberately untouched: the neighbouring `pytest.approx(..., 1.0e-8)` assertions at L129/L237 are tolerance-based by design. `np.log10(1e-4) == -4.0` and `np.log10(0.01) == -2.0` exactly (verified), so the tests' literal endpoints remain a faithful stand-in for the implementation's `np.log10(sigma_min)`. +- scope: test-only, no library source changed, so no downstream workspace impact and no `pending-release` gate. PyAutoLens has no equivalent `10 ** np.linspace` exact-equality assertion (grepped). +- prompt: active/pyautogalaxy_mge_bitwise_sigma_test.md +- worktree: (none — cloud session, worked in the canonical /home/user/PyAutoGalaxy checkout on the mandated branch) +- repos-single-claim: PyAutoGalaxy is the only affected repo, named on this one line deliberately and NOT as a 2-space ` - PyAutoGalaxy` bullet, because worktree_check_conflict reads any such bullet as a live claim. + ## covariance-interpolator-rng-seed - issue: https://github.com/PyAutoLabs/PyAutoFit/issues/1450 - status: library-dev — fix COMMITTED AND PUSHED to `claude/covariance-interpolator-rng-seed-8zexp3` (PyAutoFit 68a8b391). NO PR opened (not requested). Cloud session, no worktree and no `gh` CLI; issue filed via the GitHub MCP surface. diff --git a/active/pyautogalaxy_mge_bitwise_sigma_test.md b/active/pyautogalaxy_mge_bitwise_sigma_test.md new file mode 100644 index 000000000..fff724507 --- /dev/null +++ b/active/pyautogalaxy_mge_bitwise_sigma_test.md @@ -0,0 +1,14 @@ +# Bug in PyAutoGalaxy: the MGE bitwise sigma-ladder tests fail on + +Type: test +Target: PyAutoGalaxy +Repos: +- PyAutoGalaxy +Difficulty: medium +Autonomy: safe +Priority: high +Status: formalised + +Bug in PyAutoGalaxy: the MGE bitwise sigma-ladder tests fail on AVX-512 hardware. In PyAutoGalaxy, test__mge_model_from__default_sigma_list_is_bitwise_unchanged and test__mge_point_model_from__default_sigma_list_is_bitwise_unchanged in test_autogalaxy/analysis/test_model_util.py assert exact equality between two different numpy code paths. The PyAutoGalaxy implementation builds each sigma with a per-element scalar power, gaussian.sigma = 10 ** log10_sigma_list[i] at autogalaxy/analysis/model_util.py line 190, while the test builds its expectation with a vectorised 10 ** np.linspace(...). numpy does not guarantee the scalar and SIMD power loops agree bit for bit; on an x86-64-v4 / AVX-512 CPU they differ by 1 ULP at index 18, exactly the index pytest reports. Reproduced in isolation with numpy 2.4.6. The effect is cosmetic, not functional: the run identifier quantizes at RESOLUTION 1e-8 and this drift is ~1e-16 relative, so no identifier moves and no archived fit is orphaned. But the tests are green on GitHub runners and red on AVX-512 developer machines, so the regression guard added with PyAutoGalaxy#549 is not portable. Fix in PyAutoGalaxy by building the expected ladder element by element the way the implementation does, or by comparing with a tolerance far below the 1e-8 identifier resolution. + +