Skip to content

fix: build_readme.py — probe correct JIT-time keys + handle NaN (Phase 4 follow-up)#12

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/build-readme-key-fix
May 16, 2026
Merged

fix: build_readme.py — probe correct JIT-time keys + handle NaN (Phase 4 follow-up)#12
Jammy2211 merged 1 commit into
mainfrom
feature/build-readme-key-fix

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Phase 4 follow-up bug surfaced when running the dashboard generator against the first real CPU artifacts produced today on this machine. Every cell in every auto-table rendered as even with fresh artifacts present.

Two related bugs

Bug 1: key-probe mismatch

Shipped likelihood scripts emit full_pipeline_single_jit (no _s suffix); the datacube script emits full_pipeline_cube_single_jit. But _likelihood_headline_seconds was only probing for _s-suffixed variants nested under summary / aggregate. Result: every cell rendered .

Fix: prepend (\"full_pipeline_single_jit\",) and (\"full_pipeline_cube_single_jit\",) to the probe-path list. Older _s-suffixed and nested variants stay in the list for forward-compat.

Bug 2: NaN renders as nan s

datacube/delaunay.py emits full_pipeline_cube_single_jit = NaN when the JIT-compiled cube pipeline doesn't converge — a real signal worth preserving. Python's json.loads parses that as float('nan'), which slipped through unchanged and rendered as nan s in the table.

Fix: math.isnan guard returns None, so _format_time renders the cell as (matches the "no data" semantic while preserving the signal that the artifact exists but the measurement didn't land).

Verification

Ran 4 known-clean scripts in the canonical autolens_profiling repo today (Intel i9-10885H, CPU-only JAX, PyAutoLens 2026.5.14.2). With this fix, the headline auto-table renders:

Section Script Instrument Latest single-JIT per-call
likelihood/imaging mge.py hst 106.8 ms
likelihood/interferometer mge.py sma 38.5 ms
likelihood/datacube delaunay.py hannah (NaN: cube JIT didn't converge)
simulators/imaging.py 3.12 s total wall

build_readme.py --check exits 0 on a second run — idempotence preserved.

Test plan

  • Run python scripts/build_readme.py against 4 fresh artifacts; verify cells populate.
  • Re-run python scripts/build_readme.py --check immediately after; exit 0 (idempotent).
  • Verify NaN cell renders as not nan s (datacube hannah artifact).

Refs

🤖 Generated with Claude Code

Phase 4 follow-up bug surfaced when running the dashboard generator
against real artifacts produced today on this machine.

Bug 1 — key-probe mismatch
--------------------------
The shipped likelihood scripts emit `full_pipeline_single_jit` (no `_s`
suffix) and the datacube script emits `full_pipeline_cube_single_jit`,
but `_likelihood_headline_seconds` was only probing for `_s`-suffixed
variants nested under `summary` / `aggregate`. Result: every cell in
every auto-table rendered `—` even when fresh artifacts were present.

Fix: prepend `("full_pipeline_single_jit",)` and
`("full_pipeline_cube_single_jit",)` to the probe path list. The older
`_s`-suffixed and nested-under-`summary` variants stay in the list for
forward-compat with any historic artifacts that might land later.

Bug 2 — NaN renders as `nan s`
------------------------------
Datacube scripts emit `full_pipeline_cube_single_jit = NaN` when the
JIT-compiled cube pipeline doesn't converge (real signal, not a bug
in the dashboard). Python's `json.loads` parses that as `float('nan')`,
which slipped through `_likelihood_headline_seconds` unchanged and
rendered as `nan s` in the table.

Fix: explicit `math.isnan` guard returning None, so `_format_time`
renders the cell as `—`. Matches the semantic of "no data" while
preserving the signal that the artifact exists but the measurement
didn't land.

Verification
------------
Ran the 4 known-clean scripts in the canonical autolens_profiling repo
today (Intel i9-10885H, CPU-only JAX, PyAutoLens 2026.5.14.2). With this
fix, the headline auto-table renders:

  | likelihood/imaging       | mge.py      | hst       | 106.8 ms |
  | likelihood/interferometer| mge.py      | sma       | 38.5 ms  |
  | likelihood/datacube      | delaunay.py | hannah    | —        |  (NaN -> `—`)
  | (simulators table)       | imaging.py  | —         | 3.12 s   |

`build_readme.py --check` exits 0 on a second run — idempotence is
preserved by this fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 1eebaee into main May 16, 2026
1 check failed
@Jammy2211 Jammy2211 deleted the feature/build-readme-key-fix branch May 16, 2026 14:16
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.

1 participant