fix: build_readme.py — probe correct JIT-time keys + handle NaN (Phase 4 follow-up)#12
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_ssuffix); the datacube script emitsfull_pipeline_cube_single_jit. But_likelihood_headline_secondswas only probing for_s-suffixed variants nested undersummary/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 sdatacube/delaunay.pyemitsfull_pipeline_cube_single_jit = NaNwhen the JIT-compiled cube pipeline doesn't converge — a real signal worth preserving. Python'sjson.loadsparses that asfloat('nan'), which slipped through unchanged and rendered asnan sin the table.Fix:
math.isnanguard returnsNone, so_format_timerenders 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_profilingrepo today (Intel i9-10885H, CPU-only JAX, PyAutoLens 2026.5.14.2). With this fix, the headline auto-table renders:mge.pymge.pydelaunay.pyimaging.pybuild_readme.py --checkexits 0 on a second run — idempotence preserved.Test plan
python scripts/build_readme.pyagainst 4 fresh artifacts; verify cells populate.python scripts/build_readme.py --checkimmediately after; exit 0 (idempotent).—notnan s(datacube hannah artifact).Refs
🤖 Generated with Claude Code