Repository navigation
Description
Overview
Phase 3 of the jax-compile-stall epic: root-cause the hang that has now
quarantined seven entries across the two test workspaces, and restore the
coverage those quarantines removed. Phase 1 (PyAutoFit#1516/#1517/#1518) made a
stalled run report itself; phase 2 (autolens_workspace_test#271) measured it
across 60 script executions and captured the stacks. This phase is the fix.
The epic's name is wrong, and this issue starts from the correction. Every
prior marker, prompt and issue calls this an "intermittent XLA compile stall".
Phase 2's faulthandler stacks — captured from two different repos running two
different scripts, and identical — put the process in
jax.block_until_ready / try_to_block. Compilation completes (~16s, per
autolens_workspace_test's own 2026-08-24 marker); what never returns is the wait
for the result to materialize. The phase-2 record closes on the instruction:
"Do not restart from 'why is XLA slow to compile'. Start from 'why does
block_until_ready never return'."
There is now a deterministic reproducer. autolens_workspace_test
imaging/jax_likelihood/mge_group has 16/16 lifetime executions with zero
completions — 5/5 at the 300s cap on both Python legs (run 32664682689) and 3/3
at the 1800s cap on both legs (run 32758924176). Every A/B below therefore has a
binary readout rather than needing the underpowered n=10/arm probability
estimates phase 2 was forced into.
Plan
- Fix two instrumentation defects in
autofit/non_linear/jax_compile.pyfirst —
~30 lines, and every experiment below is unreadable without them. Ships
regardless of what the investigation finds. - Establish the deterministic reproducer under the fixed instrumentation with a
singleretime.ymldispatch, capturing a phase-labelled log and a stack. - Walk a hypothesis ladder re-ordered for an execution hang, each rung an A/B
on that reproducer, driven through the existingretime.yml+
PyAutoHeart reusable-workflow harness. - Fork on the outcome: a root cause is fixed in PyAutoFit library-first; no root
cause after the ladder is recorded as an explicit infrastructure-limit
decision. Not a fourth quarantine, either way. - Restore the seven quarantined entries, or re-mark each with the real reason
and the measurement behind it. - Repair the epic bookkeeping: the "compile stall" misnomer across ledger,
markers and issue titles, and a ledger that routes resumers to a file that
does not exist.
Detailed implementation plan
Work Classification
Both (library + workspace) — library-first: the PyAutoFit PR merges before
the workspace PRs consume it.
Affected Repositories
- PyAutoFit (primary) —
autofit/non_linear/jax_compile.py,autofit/non_linear/fitness.py - autogalaxy_workspace_test —
config/build/no_run.yaml,smoke_tests.txt,config/build/profile_smoke.yaml - autolens_workspace_test —
config/build/no_run.yaml,smoke_tests.txt,config/build/profile_smoke.yaml
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoFit | main @ 34d6dff |
clean |
| ./autogalaxy_workspace_test | main @ e187c0e |
clean |
| ./autolens_workspace_test | main @ 8be3d59 |
clean |
worktree_check_conflict → exit 0; nothing claimed in active.md.
PyAutoFit still carries experiment/jax-vmap-jit-ordering @ 0a40c31 from
phase 2, unmerged. Its autogalaxy_workspace_test twin has been deleted —
which matters, because PyAutoHeart's reusable workflow clones the dependency
chain at the matching branch name, so driving a library-side A/B through
workspace CI requires identically-named branches in both.
Suggested branch: feature/jax-stall-block-until-ready
Worktree root: ~/Code/PyAutoLabs-wt/jax-stall-block-until-ready/
Scope — verified against the live marker files, not the phase records
| Repo | File | Entry | Marker |
|---|---|---|---|
| ag_test | config/build/no_run.yaml |
multi_dataset/jax_likelihood/rectangular.py |
NEEDS_FIX 2026-08-01 |
| ag_test | config/build/no_run.yaml |
imaging/jax_likelihood/mge_group.py |
NEEDS_FIX 2026-08-23 |
| ag_test | config/build/no_run.yaml |
imaging/jax_likelihood/rectangular_mge.py |
NEEDS_FIX 2026-08-23 |
| al_test | config/build/no_run.yaml |
imaging/jax_likelihood/mge_group |
NEEDS_FIX 2026-08-24 (16/16, deterministic) |
| al_test | config/build/no_run.yaml |
multi_dataset/jax_likelihood/delaunay.py |
NEEDS_FIX 2026-08-01 (#245) |
| al_test | smoke_tests.txt |
multi_dataset/jax_likelihood/mge.py |
disabled 2026-08-22 |
| al_test | smoke_tests.txt |
multi_dataset/jax_likelihood/shared_preloads.py |
disabled 2026-07-22 |
Two exclusion-list disagreements also in scope, both of which let a script
disabled on one channel burn a cap on another:
- al_test:
multi_dataset/jax_likelihood/shared_preloads.pyis admitted by
no_run.yaml(the 2026-08-24 retime removed its SLOW marker) but excluded
bysmoke_tests.txt. It then stalled at 300s on the very next weekly run
(PyAutoHeartWorkspace Smoke32902243623). - ag_test:
multi_dataset/jax_likelihood/rectangular.pyis NEEDS_FIX in
no_run.yamlbut still enabled insmoke_tests.txt.
Implementation Steps
Step 0 — PyAutoFit instrumentation, two defects. Both in
autofit/non_linear/jax_compile.py:
_Heartbeatis constructed as_Heartbeat(description, start)and its
_beatprintsJAX jit still compiling {description}, {n}s elapsed...for
the entire first call. That is why a stalled run logged
still compiling ... 1770s elapsedwhile parked inblock_until_ready.
Give it a mutable phase and havewrapperflip it the instant
func(*args, **kwargs)returns, so the heartbeat names the half it is
actually in. The phase-2 record flags this explicitly: "Fix the message to
name the phase before anyone reads another one of these logs."- The
traced, lowered and compiled in Xs, result materialized in Ysline is
emitted only after both halves finish, so a stalled run prints neither
number and characterises the healthy case only. Emit the compile-half
duration as soon asfunc()returns, beforejax.block_until_ready. A
stalled run then self-classifies from its log alone, with no stack required.
Tests in test_autofit/non_linear/test_jax_compile.py: assert the heartbeat
text changes across the phase boundary, and that the compile-half line is
emitted when the execute half never returns (blocking sentinel). Assert the
relationship, not literal wordings — the trap phase 1 recorded when #1517's
tests could not catch a 300s dump default colliding with a 300s cap.
Step 1 — baseline the reproducer. Dispatch retime.yml on
autolens_workspace_test with scripts=imaging/jax_likelihood/mge_group.py,
repeats=2, script-timeout=1800, from a branch named identically to the
PyAutoFit branch carrying step 0. Expected readout: compiled in ~16s,
heartbeats naming the materialize phase, and a block_until_ready stack at
1440s (DUMP_FRACTION_OF_CAP = 0.8). That confirms the reproducer and validates
step 0 in one run.
Step 2 — the ladder, re-ordered for an execution hang. Each rung is an A/B
on the deterministic reproducer; a completion in the experiment arm is a
positive result, because the control arm is 16/16 hangs.
- Persistent compilation cache.
JAX_COMPILATION_CACHE_DIR, default-on
since PyAutoConf#128 (2026-07-17). Never tested, and phase 2 sharpened the
hypothesis: a cache hit satisfies compile instantly and leaves execution to
hang — exactly the ~16s-then-nothing shape observed. A/B by overriding the
var to empty inconfig/build/profile_smoke.yaml. Cheapest rung, strongest
timeline correlation (both NEEDS_FIX stalls post-date the default; the SLOW
batch predates it). vmap(jit)ordering, re-run on the deterministic case.Fitness._vmap
(autofit/non_linear/fitness.py) buildsjax.vmap(jax.jit(self.call));
analysis/latent.pybuilds the conventionaljax.jit(jax.vmap(...)). Phase 2
measured 80% → 30% at Fisher exact p = 0.070 on a probabilistic script with
n=10/arm — underpowered and inconclusive. On a 16/16 script the same swap is
a clean binary. Phase 2 also reframes why it matters now: the ordering changes
the shape of the executed computation, a more plausible route to an
execution hang than to a compile one. Reuse
experiment/jax-vmap-jit-ordering; recreate the matching workspace branch.- Async dispatch / device transfer. Whether one buffer hangs or the whole
batch: block on individual pytree leaves rather than the aggregate; vary the
vmapbatch size;JAX_DISABLE_JIT=1;
XLA_FLAGS=--xla_force_host_platform_device_count. - Runner resource exhaustion. The affected set is uniformly the heavy
multi_dataset/composite paths on 2-core hosted runners, and an execution
hang there is as consistent with memory thrashing as with a deadlock. Read
the stalled job's runner memory; check whether the reusable workflow can be
pointed at a larger machine. - JAX/jaxlib version bisect. Last — expensive. The repo has form
(delaunay_mge.pyis disabled outright becausejax 0.7removed
jax.interpreters.xla.pytype_aval_mappings), so it is plausible but not
cheap. Re-decide before starting this rung rather than rolling into it.
Step 3 — outcome fork. A root cause is fixed in PyAutoFit and shipped first,
its API-change summary consumed by the workspace PRs. No root cause after rungs
1–4 is recorded as an explicit infrastructure-limit decision naming what was
tested and excluded — which this task's acceptance permits as an alternative to
a fix. Not a fourth quarantine either way.
Step 4 — restore coverage. Clear the five NEEDS_FIX markers; re-enable
multi_dataset/jax_likelihood/mge.py and shared_preloads.py in al_test
smoke_tests.txt; resolve both exclusion-list disagreements deliberately rather
than by whichever file is edited next. Anything that stays out stays out with a
recorded reason and the measurement behind it — never as an accumulated one-off.
Step 5 — epic bookkeeping. Rename the "XLA compile stall" misnomer across
the ledger, the markers and the issue titles. PyAutoMind/epics.md routes
resumers to draft/research/ci/smoke_timing_and_profiling.md, which does not
exist — repoint it at this task. Flip the epic from CLOSED AS PARTIAL back
to in flight.
Key Files
autofit/non_linear/jax_compile.py—_Heartbeat(phase-blind message),log_on_first_compile.wrapper(split line emitted too late);jax.block_until_readyat the hang siteautofit/non_linear/fitness.py—Fitness._vmap, thejax.vmap(jax.jit(...))ordering under test in rung 2test_autofit/non_linear/test_jax_compile.py— phase-boundary and stalled-execute-half tests<workspace>/config/build/no_run.yaml— the five NEEDS_FIX stall markers<workspace>/smoke_tests.txt— the two disabled al_test entries and the ag_test disagreement<workspace>/config/build/profile_smoke.yaml— env-profile overrides for the rung-1 cache A/B<workspace>/.github/workflows/retime.yml+.github/scripts/retime.py— phase 2's dispatchable A/B harness
Testing
PyAutoFit unit suite for step 0. Every ladder rung is a CI dispatch returning a
retime.py JSON verdict (STALL / SLOW / NEITHER / AMBIGUOUS with the
ratio that drove it). Final validation is the un-quarantined scripts passing
their own smoke gates on both Python legs.
Scope floor
The Bug Agent sizes this too-large (heuristic score 13) and an open-ended
root-cause hunt has no natural end. Steps 0, 4 and 5 ship regardless of whether
the ladder lands a cause, which gives the task a floor.
Known environment constraint
pyauto-heart was unreachable from the web-github environment in both prior
phases, and this is the same environment. Expect the ship gate's Heart leg to be
un-consulted again, as recorded on phases 1 and 2.
Original Prompt
Click to expand starting prompt
Phase 3: root-cause the XLA vmap compile stall and clear every NEEDS_FIX it caused
Type: bug
Target: ci
Repos:
- @PyAutoFit
- @autogalaxy_workspace_test
- @autolens_workspace_test
Difficulty: large
Autonomy: supervised
Priority: high
Status: formalised
Epic: jax-compile-stall
Phase: 3
Campaign: bug/ci/jax_vmap_jit_compile_stall.md (Phase 3 — the fix; blocked on phases 1 and 2)
Filed: 2026-08-23
Blocked on phase 1
Do not start this before phase 1's watchdog has shipped and a CI stall has
actually dumped a traceback. Diagnosing a hang that leaves no evidence is what
produced three quarantines and no root cause; repeating it without the
instrumentation would be a fourth.
Reproduce deliberately
Loop imaging/jax_likelihood/mge_group.py under its declared CI env profile
until it hangs, rather than waiting for CI to hit it. Attach py-spy dump to
the hung process as well as reading phase 1's own faulthandler output — the
two see different things, and py-spy can read native frames the in-process
dump cannot.
Hypotheses, in the order they are cheapest to test
vmapofjit, the inverted ordering.Fitness._vmap
(autofit/non_linear/fitness.py) buildsjax.vmap(jax.jit(self.call));
autofit/non_linear/analysis/latent.pybuilds
jax.jit(jax.vmap(compute_latent_for_model)), the conventional order. The
stalling path is exactly thevmappath, and the_jit-only scripts in the
same directories do not stall. One-line A/B — try it first.- Persistent compilation cache contention.
JAX_COMPILATION_CACHE_DIRhas
defaulted on since PyAutoConf#128 (merged 2026-07-17). Both NEEDS_FIX stalls
post-date it; the eight SLOW entries predate it. A/B with the cache dir set
to empty (which disables it) and see whether the stall probability moves. - JAX/XLA version interaction. This repo has form:
delaunay_mge.pyis
disabled outright becausejax 0.7removed
jax.interpreters.xla.pytype_aval_mappings, and the smoke installer once
clobbered a workingtfp-nightly. Pin-bisect jax/jaxlib across a run set. - Runner CPU contention.
complete/2026/07/jax-compile-time-research.md
records that XLA compiles on host CPUs and that compile timing is
load-sensitive by up to 7×, which is why a hosted runner is the place this
reproduces and a workstation is not. - Graph size in the vmap trace. The affected set has a shape: plain
mge.py
passes in 9.4s, while the composite variants — group, rectangular-MGE,
delaunay-MGE — stall or are already out. Complexity-driven compile blowup was
argued against by the autolens_profiling#71 research ("compile cost is
op-pattern-driven, not complexity-driven"), so treat this as the hypothesis
of last resort, not the first.
Then restore the coverage
The point of the campaign. Quarantining removes exactly the heaviest JAX paths,
which are the ones most worth testing.
- Clear the NEEDS_FIX markers this campaign inherits — including the
2026-08-01multi_dataset/jax_likelihood/rectangular.pyone and the
autolens_workspace_testdelaunay.pyentry citing Zeus gives error due to pickling #245. - Re-enable
multi_dataset/jax_likelihood/mge.pyandshared_preloads.pyin
autolens_workspace_test'ssmoke_tests.txt(folded in from the superseded
2026-08-22 filing). - Anything that stays out after the fix stays out with a recorded deliberate
reason, not as an accumulated one-off.
Acceptance
- A stated root cause, or an explicit recorded decision that it is an
infrastructure limit to be worked around rather than fixed. Not another
quarantine. - Every entry marked NEEDS_FIX for this signature restored to its suite, or
re-marked with the real reason phase 2 established. - The
multi_dataset/jax_likelihood/family back under CI coverage in both test
workspaces, or its absence recorded as a deliberate choice.
Activity
Jammy2211 commentedon Aug 27, 2026
Step 1 baseline: the hang is not in the compile or the
block_until_ready, and every stalled run has been throwing away the evidenceautolens_workspace_test run 33032703787 —
imaging/jax_likelihood/mge_group.py, 2 repeats, 1800s cap, onfeature/jax-stall-block-until-readyin both PyAutoFit and the workspace (chain checkout confirmed againstsmoke-tests.yml:142, which resolvesgithub.head_ref || github.ref_name).The legs disagreed, and the instrumentation says why
3.13 —
NEITHER, completed 2/2 in 44.6s and 36.6s. Against a 16/16 lifetime zero-completion record.3.12 —
AMBIGUOUS, capped 2/2. Both repeats identical:The JAX first call completed. Both halves. In 17.5 seconds. Compilation finished,
jax.block_until_readyreturned,log_on_first_compilereturned — and then the script hung for another half hour.Note the two legs materialized in 1.3 seconds each. The half phase 2 identified as the hang site is, in this run, the fastest and most consistent part of the whole thing.
What this overturns
The epic ledger,
epics.md, and autolens_workspace_test's own 2026-08-24no_run.yamlmarker all now record as established fact that "the stack sits injax.block_until_ready". On this evidence that is wrong, in the same way "XLA compile stall" was wrong before it — a real stack, read correctly, generalised to a failure mode it did not cover.Phase 2's stack was genuine; there is no reason to doubt it. But it was one stack from one run, and this run's own instrumentation contradicts it directly. Either there is more than one failure mode here, or the failure point moves. Both readings are live and I am not picking one.
There is a second-order consequence worth stating plainly: the watchdog is armed and cancelled around the first compile only (
watchdog.cancel()in thefinally). Because the first call completed at 17.5s, thefaulthandlertimer was disarmed 1782 seconds before the process was killed. This run produced no stack at all, and could not have. The instrumentation is watching the wrong window.The finding that probably explains the whole campaign
The script is spawned by
retime.py/run_smoke.pyas[sys.executable, script_path]withstdout=subprocess.PIPE, and nothing anywhere setsPYTHONUNBUFFERED. A pipe is not a tty, so the child'sprint()output is block-buffered and only flushed at process exit.loggerwrites to stderr, which is not.So on a run that gets SIGKILLed at the cap, 100% of the script's own
print()output is destroyed, and the "captured tail" that this whole campaign has been reading is stderr-only.This is not inference from the hanging leg. The passing leg proves it: in the 3.13 log every
loggerline appears in real time, interleaved correctly by timestamp, and then all eightprint()lines arrive afterwards in a single block at exit. That is the block-buffered-then-flushed-at-exit signature, unmistakably.It matters here because everything
mge_group.pydoes after the wrapper returns isprint()— lines 313, 314, 318-321, 362, 374, 380, 387. The script could have got most of the way to the end and we would see exactly what we see: silence. We cannot currently localise this hang at all, and never could have.Every "then silence for the full 300s" observation in this epic — the 2026-08-01, 2026-08-23, 2026-08-24 and 2026-08-25 markers — was recorded under this blindfold.
The fix is one line, in a fourth repo
autohands/env_config.py:45already carries the right home:Adding
"PYTHONUNBUFFERED": "1"there applies it to every profiled run, layered beforeapply_profileso a profile can still override it. That makes a killed script's own output survive, for this stall and for every future one.That is PyAutoHands, which is outside this issue's stated affected-repo list, so it is a scope call rather than something to slip in.
Consequences for the plan
JAX_COMPILATION_CACHE_DIRrung is unchanged in principle, but its rationale in the issue body needs correcting:autonerves/jax_wrapper.py:98sets the default onlyif "JAX_COMPILATION_CACHE_DIR" not in os.environand treats an explicitly empty value as disabled, so the A/B adds a quotedJAX_COMPILATION_CACHE_DIR: ""to the workspace profile rather than overriding an existing key. Unquoted,apply_profile'senv[key] = str(value)turns YAML's empty value into the literal string"None"— a truthy cache directory namedNone.Nothing has been un-quarantined and no marker has been rewritten. The 3.13 completions are not grounds to readmit anything; that is precisely the mistake the 2026-08-24 retime made with
shared_preloads.py, which stalled on the very next weekly run.Generated by Claude Code
Jammy2211 commentedon Aug 27, 2026
The hang is caught with a stack:
block_until_ready, compile already finishedRun 33076408637, 300s cap, 2 repeats — both legs hung 2/2, and the PyAutoHands diagnostics (PyAutoHands
a108f7f) produced exactly what the campaign has never had:Phase 2 was right and I was wrong. My previous comment argued the
block_until_readyfinding had been over-generalised. It had not. The hang is inblock_until_ready/try_to_block, with compilation complete — exactly where phase 2's stack put it.Both instrumentation fixes earned their place here. The heartbeat says "compiled in 15.7s and is still waiting for the result to materialize"; on the old code this identical run would have logged "still compiling ... 270s elapsed" and produced a sixth marker calling it a compile stall. And the SIGABRT is what produced the stack at all — PyAutoFit's own watchdog cannot, because it is armed only around the first compile.
The two observations reconcile
This morning's run 33032703787 showed the wrapper completing (17.5s) and the hang landing later. That is almost certainly the same failure one call site further on.
mge_group.pycallsfitness._vmap(parameters)twice — line 313 and line 318 — and on the second calllog_on_first_compile.wrappershort-circuits atif state["compiled"], returningfunc(*args)directly: no log line, no heartbeat, no watchdog, and noblock_until_ready. JAX dispatches asynchronously, so that call returns a future immediately and the wait moves toprint(result)on line 319.One failure mode — materializing a vmap result never completes — at whichever call site gets unlucky. Not two bugs.
That also means the wrapper's one-shot design leaves every call after the first completely uninstrumented, which is worth fixing regardless of root cause.
Refuted along the way
0.11.1, jaxlib0.11.1, ml_dtypes0.6.0, numpy2.5.2, scipy1.17.1— identical to today. No bisect needed.Next: the compilation cache, now sharply motivated
Dispatched:
JAX_COMPILATION_CACHE_DIR: "", 3 repeats × 2 legs (autolens_workspace_testf1c77f8).The 15.7s compile time is what promotes this from speculation.
autonerves/jax_wrapper.pysetsJAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS=1whenever the cache is on, so a 15.7s compile is far past the threshold and is written to disk. A hosted runner starts with an empty~/.cache/pyauto_jax, so every CI run is a miss followed by a write — putting a large artifact's disk write in the same window as the execution that never returns.Control is this run: 4/4 hangs with the cache at its default. Experiment is 6 executions with it off. 6/6 completions would be Fisher exact p≈0.002.
Two traps handled: the empty value must be quoted, because
env_config.apply_profiledoesenv[key] = str(value)and an unquoted empty YAML value becomes the literal string"None"— a truthy cache directory. Verified the resolved value is'', and that the strict profile validator passes.Nothing un-quarantined, no marker rewritten.
Generated by Claude Code
Jammy2211 commentedon Aug 27, 2026
Cache rung refuted — and it handed over the actual locus
Run 33078033016,
JAX_COMPILATION_CACHE_DIR: "", 3 repeats × 2 legs.6/6 hangs, against 4/4 with the cache on.
AMBIGUOUS — hit the cap in all 3 runson both legs. The persistent compilation cache is not the cause.The experiment did apply — I checked rather than assuming. No
"The JAX persistent compilation cache has been enabled at ..."line fromautonervesanywhere in the log (it emits that only when it sets the default, which an explicit empty value skips), and compile times dropped to a consistent 11.8 / 12.0 / 12.3s from 15.7s with the cache on.What it bought instead: three identical stacks
Line 319 is
print(result). The hang is injax.Array._value— the device-to-host transfer.And
PYTHONUNBUFFEREDis what makes that readable:JAX Time To VMAP + JIT Function 12.87 / 13.50 / 13.08survived the kill in all three repeats. Without it those prints die with the process and the hang is unplaceable, exactly as it has been all month.One failure, two doors
block_until_ready→try_to_block_vmap)__str__→_valueprintof the second_vmapresult)block_until_readyand_valueare two ways of forcing the same thing. Materialising the output of the vmap'd computation never returns — which means the computation itself does not terminate. Compilation finished ~13s earlier andlog_on_first_compilereturned cleanly all three times.This also confirms the reconciliation proposed in my previous comment: the second
_vmapcall short-circuits the wrapper, so it dispatches asynchronously, logs nothing, and the wait lands on theprint.Ledger of the ladder
0.11.1stack on 2026-08-24 when it hung 3/3 on both legsvmap(jit)orderingNext: intra-op thread pool
Dispatched (
222f5d8):XLA_FLAGS="--xla_cpu_multi_thread_eigen=false --xla_force_host_platform_device_count=1"withOMP_NUM_THREADS=1, compilation cache restored to default so this is a single variable against the 4/4 control.The rationale is the shape of the evidence: a computation that never terminates while nothing appears to be burning CPU is what an intra-op thread pool deadlock looks like, and a hosted runner advertising more CPUs than its container can actually schedule is the classic way to get one.
Caveat stated up front: three variables move together here. If it passes, that is not the answer yet — it needs narrowing one at a time before anything is proposed as a real profile change.
Nothing un-quarantined, no marker rewritten.
Generated by Claude Code
Jammy2211 commentedon Aug 27, 2026
Narrowed to one flag:
--xla_cpu_multi_thread_eigen=falseJAX_COMPILATION_CACHE_DIR: ""OMP_NUM_THREADS=1--xla_cpu_multi_thread_eigen=falsealone62.3s alone against 63.2s for all three together is the same number, so the other two variables did nothing.
--xla_force_host_platform_device_count=1was almost certainly a no-op (CPU already exposes one host device) andOMP_NUM_THREADSbounds OpenMP inside numpy/scipy BLAS, not XLA's own pool.That is consistent with the mechanism the stacks pointed at: multithreaded Eigen is the XLA CPU intra-op thread pool, and a deadlock there is exactly "the computation never terminates while the compile finished 13s ago and nothing is burning CPU".
Sufficiency is not necessity — one more run before any of this counts
Twelve passes with the flag prove nothing if the hang merely went quiet. This script passed 2/2 at 02:18 today and hung 2/2 at 13:33 on the identical commit, so the rate demonstrably wanders, and that is the single most likely way to fool myself here.
Dispatched (
8cb1695): the stock profile again, 3 repeats × 2 legs. That turns the sequence into an ABAB design rather than a before/after.What I would propose only if it hangs — not yet done
XLA_FLAGS: "--xla_cpu_multi_thread_eigen=false"intoprofile_smoke.yamlandprofile_release.yamlin both test workspaces.mge_groupit costs ~50s against ~44s unpatched — fine — but that says nothing about the rest of the suite. If the whole-suite cost is material, scope it to ajax_likelihood/overrides:pattern instead of the globaldefaults:block.imaging/jax_likelihood/mge_group,multi_dataset/jax_likelihood/delaunay.py, plussmoke_tests.txt'smulti_dataset/jax_likelihood/mge.pyandshared_preloads.py; ag_testmulti_dataset/jax_likelihood/rectangular.py,imaging/jax_likelihood/mge_group.py,imaging/jax_likelihood/rectangular_mge.py. A flag that fixes one script is not evidence about seven.Nothing un-quarantined, no marker rewritten.
Generated by Claude Code
Jammy2211 commentedon Aug 27, 2026
Shipped
Four PRs merged 2026-08-27, library-first:
4130b22ad64e1269ee97cadf5ffeBoth workspace smoke gates went green with the restored scripts back in
smoke_tests.txt, which is the validation that matters.What this settles
The epic's name was wrong for a month. It is not an XLA compile stall. Compilation completes in ~12–18s; what never returns is materialising the vmap result — captured at
jax.block_until_ready→try_to_block(line 313) and atjax.Array._value→__str__(line 319), both doors onto the same failure, both caught in the same run.Trigger: XLA CPU's multithreaded Eigen thread pool.
XLA_FLAGS=--xla_cpu_multi_thread_eigen=false, in the smoke and release profiles of both test workspaces. ABAB:STALL12 passes / 0 hangs with the flag; 2 passes / 14 hangs without. Fisher exact p ≈ 3e-6.
All seven quarantined entries restored — 42/42 completions, verdict
NEITHERon every entry and every leg, slowest 20% of cap.mge_grouphad 16/16 lifetime cap hits and zero completions before this.Refuted along the way
0.11.1stack on 2026-08-24 when it hung 3/3 on both legs — no bisect needed);Two instrumentation defects fixed, and why they mattered
The heartbeat said
"still compiling"in both halves, so a stalled run produced positive evidence for the wrong cause — five markers were written against it. And the compile/execute split was only emitted once both halves finished, so a stalled run reported neither number.Underneath both: nothing set
PYTHONUNBUFFERED, and the runners capture through a pipe. Every "and then silence" tail in this campaign was silence of stderr alone, with the scripts' own prints discarded by the SIGKILL. Five scripts were quarantined on evidence truncated before anyone read it.Left deliberately undone
This is a workaround, not a root cause. We know where it hangs and what avoids it; we do not know why XLA's CPU thread pool wedges on these graphs —
faulthandlershows Python frames only, so the pool itself is still opaque. Recorded as such in bothno_run.yamlfiles, with the note that removing the flag brings the entries back. A follow-up research prompt and an upstream JAX/XLA report are the next step.Heart: not consulted —
pyauto-heartis unreachable from theweb-githubenvironment, as on phases 1 and 2.Generated by Claude Code