Skip to content

Fix red CI on main (CPU-dependent organoid order) and link the live simulator - #2

Merged
Mecca-Research merged 1 commit into
mainfrom
claude/dazzling-dirac-pexsyc
Sep 29, 2026
Merged

Mecca-Research merged 1 commit into
mainfrom
claude/dazzling-dirac-pexsyc

Conversation

@Mecca-Research

Copy link
Copy Markdown
Owner

Summary

The first GitHub Actions run on main (CI run 36538589250) had one red job: Micrograph pipeline (Python) → Measurements are reproducible. The other two jobs passed: the model tests, and every 3D scene rendered in all three modes. The Pages deploy is now green (run 36538589319, attempt 2) after Pages was enabled. This PR fixes the red job and links the live site from the README.

Root cause

On the runner, assets/derived/organoids.json was rebuilt with some Hough circles in a different order (25 lines changed, same 91 circles). Ranking used np.argsort, which is an unstable SIMD sort: equal accumulator values come out in a different order under AVX2 (the CI runner) than under AVX-512 (where the assets were built). Two places ranked this way:

  • scikit-image's hough_circle_peaks, before its cross-radius distance suppression. There the tie order can also decide which of two nearby tied peaks survives.
  • our greedy organoid selection.

Reproduced locally with NPY_DISABLE_CPU_FEATURES=X86_V4, which gives the same diff as CI.

Fix (tools/build_assets.py)

  • hough_peaks() finds peaks one radius at a time, then ranks them by (accumulator ↓, y, x, r) before applying the same 8-px suppression and 400-peak cap.
  • select_organoids() uses the same canonical tie-break.
  • organoids.json is regenerated: the same 91 circles in canonical order, so every measurement and calibration value is unchanged. Builds on AVX2 and AVX-512 are now byte-identical (organoids.json, organoids_plate.jpg, calibration.json).

README

  • Links the live simulator at https://mecca-research.github.io/StemCellSimulator/, near the top.
  • Deep links go to the live site, and each scene preview image opens its scene.
  • The "enable Pages once" note is replaced with how to smoke-test the deployed bundle.

Smoke test

  • SITE_ROOT=<dir> node tests/e2e/smoke.mjs serves another directory, so the exact bundle assembled by pages.yml can be tested.

Testing

  • node --test tests/models/*.test.mjs: 98/98 pass.
  • pytest tests/tools: 15/15 pass, on both the AVX-512 and the AVX2 (X86_V4 disabled) numpy paths. Two new regression tests check that hough_peaks and select_organoids give the same result under input permutations with exact ties. The old ordering fails that check in 5 of 5 permutations.
  • Full python tools/build_assets.py on the AVX2 path: every derived file is byte-identical to the committed one, and git diff on assets/derived/*.json is empty after the rebuild.
  • node tests/e2e/smoke.mjs (every scene) and gallery?view=organoids --modes: PASS. Tracked files are unchanged afterwards.
  • The Pages bundle was assembled exactly as in pages.yml and smoke-tested with SITE_ROOT: colony, kidney, gallery and organoids all PASS.
  • git diff --check is clean.

Not verified from this container: loading the live github.io site in a browser, because the sandbox's network policy blocks that host. The deploy job reports success and the URL above.

🤖 Generated with Claude Code

https://claude.ai/code/session_016pbMe2Yw2abpatNN7kc6j2


Generated by Claude Code

The first CI run on main failed "Measurements are reproducible": the
runner rebuilt assets/derived/organoids.json with tied Hough circles in a
different order. numpy's argsort is an unstable SIMD sort whose tie order
differs between AVX2 and AVX-512, and both skimage's hough_circle_peaks
and our greedy selection ranked peaks with it. Reproduced locally with
NPY_DISABLE_CPU_FEATURES=X86_V4 (same 25/25-line diff as CI).

- hough_peaks(): per-radius peaks, then a canonical
  (accumulator desc, y, x, r) ranking before the cross-radius suppression
- select_organoids(): the same canonical tie-break
- regression tests: both functions give the same result under input
  permutations (the old ordering fails 5/5)
- organoids.json regenerated: the same 91 circles in canonical order, so
  no measurement changes; AVX2 and AVX-512 builds are byte-identical

README: link the GitHub Pages deployment, deep links and scene previews.
smoke.mjs: SITE_ROOT serves another directory, so the assembled Pages
bundle can be smoke-tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016pbMe2Yw2abpatNN7kc6j2
@Mecca-Research
Mecca-Research marked this pull request as ready for review September 29, 2026 12:33
@Mecca-Research
Mecca-Research merged commit 39b1cd9 into main Sep 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants