Repository navigation
Description
Overview
Phase A3b: NSS onto Fitness via the factory with traced assertions, the eval_shape trace preflight per declared kind after the test-mode bypass with chained tracebacks, the x64 warning, and Dynesty's single-core RuntimeError control flow replaced by an explicit sentinel that no longer swallows XlaRuntimeError. Depends on A2 and A3. Launched --auto by the human on 2026-10-08; effective level safe (refactor cap); Tier: judge.
Plan
"A3b — NSS onto Fitness, trace preflight, x64 (depends on A2 and A3; surveys/02 P3; D2, D8). Repo: PyAutoFit. Scope: NSS onto Fitness via the factory (traced assertions; the sanity check moves to the start of the run); the eval_shape trace preflight per declared kind, after the test-mode bypass, chained tracebacks, plus the optional numerical probe; the x64 check; Dynesty's RuntimeError single-core control flow becomes an explicit sentinel that no longer catches XlaRuntimeError. Risk: low-medium. Verify: NSS with assertions under jit; the preflight raises on an np.asarray likelihood with the original error chained; an fp32 warning test; the D2 smoke-profile regression test. Witness: NSS fits gaussian_x3_blend with its ordered-centre assertions under JAX."
Tier: judge — merge mode: human /prm, after A2 and A3
Detailed implementation plan
Affected Repositories
- PyAutoFit (library,
pending-release)
Branch Survey
All affected canonical checkouts on main, clean (verified 2026-10-08 before the worktree was created).
Suggested branch: feature/search-ext-a3b-nss-preflight (stacked on A2+A3) (worktree ~/Code/PyAutoLabs-wt/search-ext-a2-objective-bridge (after A2 and A3))
Implementation Steps
See the prompt's Pins, Verification and Shape sections (embedded below); commit in the order the Shape names.
Validation checklist (--auto run — plan was not pre-approved)
- Effective level: safe (refactor cap)
- Gate legs recorded in the PR body at ship
Original Prompt
Click to expand starting prompt
NSS onto Fitness, trace preflight and x64 check (epic search-extensibility, phase A3b)
Type: refactor
Target: autofit
Repos:
- PyAutoFit
Themes: - searches
- jax
Difficulty: medium
Autonomy: safe
Consequence: judge
Witness: NSS fitsgaussian_x3_blendwith its ordered-centre assertions under JAX (the autofit_inference harness's blend model, 10 parameters) and the A0a conformance layers pass for NSS throughFitness.objective; the preflight raises on annp.asarraylikelihood with the original tracer error chained; the D2 regression (REQUIRED +PYAUTO_DISABLE_JAX=1+PYAUTO_TEST_MODE=2completes) still passes
Unattended: ready
Priority: high
Epic: search-extensibility
Blocked-by: search-ext-a2-objective-bridge, search-ext-a3-samples-checkpointer (PyAutoFit; both must be on the branch this stacks on)
Status: draft
Filed: 2026-10-08
Human launch 2026-10-08: --auto for A2, A3, A3b and B3. Plan draft/research/autofit/search_extensibility_epic_report.md §4 (phase text quoted verbatim below), architecture §3.3–§3.5, decisions in §8. A0, A0c, A1 and B2 are merged (A1: capability attributes, Analysis.is_jax, REQUIRED gate, registry/manifest, docs/design/run_ctx.md frozen). Golden identifiers (A0a(i)) are frozen by human ruling: any identifier change stops the item and is flagged. The nine A0 strict xfails are witnesses: flip only the ones a phase names, never add silent ones. Depends on A2 (objective factory) and A3 (adapter/checkpointer); implemented stacked on a branch that carries both.
Original request (verbatim from the epic plan)
"A3b — NSS onto Fitness, trace preflight, x64 (depends on A2 and A3; surveys/02 P3; D2, D8). Repo: PyAutoFit. Scope: NSS onto Fitness via the factory (traced assertions; the sanity check moves to the start of the run); the eval_shape trace preflight per declared kind, after the test-mode bypass, chained tracebacks, plus the optional numerical probe; the x64 check; Dynesty's RuntimeError single-core control flow becomes an explicit sentinel that no longer catches XlaRuntimeError. Risk: low-medium. Verify: NSS with assertions under jit; the preflight raises on an np.asarray likelihood with the original error chained; an fp32 warning test; the D2 smoke-profile regression test. Witness: NSS fits gaussian_x3_blend with its ordered-centre assertions under JAX."
Pins
Survey 02 §5.3: preflight = jax.eval_shape(objective, prior-median vector) (+ eval_shape(grad) when gradient == uses), one trace, no compile; raise naming the tracer error and the search, raise ... from e; it is a trace preflight, not a validity certificate; the optional numerical probe is separate. x64: warn once when analysis.is_jax and not jax.config.jax_enable_x64 (raise only if a search declares requires_fp64; none do today). Placement: after the test-mode bypass and after A1's REQUIRED gate. Dynesty: survey 01 §8 "Single-core control flow" (dynesty/abstract.py raise RuntimeError inside a try) → explicit sentinel exception class; except RuntimeError must no longer swallow XlaRuntimeError. NSS sanity check: moves to the start of run.
Verification
Full pytest test_autofit; nojax emulation; afT searches/NSS.py, Dynesty_jax.py, Nautilus_jax.py under test mode; the autofit_inference blend NSS fit (run _runner.run_search from the canonical fit/autofit_inference checkout with sampler=NSS, local_jax_cpu_fp64, test-mode budget) completing with assertions.
Shape
One PyAutoFit PR (pending-release) based on the A2+A3 integration branch; merges after both. Tier judge.
Activity
Jammy2211 commentedon Oct 8, 2026
Shipped
Merged 2026-10-08 via
/prm, after A2 (#1679) and A3 (#1680): #1681 (labelpending-release: it is on main but not yet on PyPI).Fitness.objective(viamake_fitness) and runs onrun(ctx)+raw_samples_from. It resumes fromNativeFileCheckpointer("nss_checkpoint.pkl"). Assertions are traced, so NSS no longer raisesTracerBoolConversionErrorunderjit.autofit/non_linear/search/preflight.py:trace_preflightruns ajax.eval_shapeof each declared objective kind. It runs after the test-mode bypass and the REQUIRED gate. A likelihood that cannot be traced raises aSearchExceptionchained to the tracer error.check_x64warns once when x64 is off, and raises when a search setsrequires_fp64=True._SingleCoreRunsentinel. ARuntimeErrororXlaRuntimeErrorraised mid-run no longer silently restarts the run single-core.Witness (run on a983123): PASS
gaussian_x3_blendunder JAX on CPU at fp64.not_assessedbecause the jax_cpu reference is still pending.TracerBoolConversionError.-k NSS, 16 passed.np.asarrayJAX likelihood raises a chainedSearchExceptionin 0.05 s.requires_fp64=True.Follow-ups filed in Mind (not fixed here):
preflight.py:65-66is wrong.autonerves/jax_wrapper.pyforces x64 on for any value that is not"true".autofit_inferencelocal_jax_cpu_fp32config actually runs fp64.Next in the epic: A4 or B4 (human to choose).