Skip to content

Modernize JAX BaSiC prototype for Python 3.14 validation (OpenHCS #213) - #1

Merged
trissim merged 2 commits into
mainfrom
fix/python314-openhcs-20260929
Sep 30, 2026
Merged

trissim merged 2 commits into
mainfrom
fix/python314-openhcs-20260929

Conversation

@trissim

@trissim trissim commented Sep 29, 2026

Copy link
Copy Markdown

Purpose and ownership

Refs OpenHCSDev/openhcs#213. Linnaeus owns this paired
backend/dependency repair; the parent owns OpenHCS PR151 recipes/policy. Reuses
Tristan's clean trissim/BaSiCPy JAX prototype (ae2c647, prior fc9da06 JAX
dependency fix). Its original working checkout is preserved read-only.

This is the first coherent draft source checkpoint, not Python 3.14 fit or
installed readiness. No issue-closing claim. Paired OpenHCS draft follows with
an exact source pin; current memory/session OpenHCS PR208 remains independently
pending live validation.

Implementation

  • Existing JaxDCT uses JAX's public jax.scipy.fft.idctn, preserving ortho
    type-II semantics. Delete the copied private helper/tests and nonexistent
    module exports, no compatibility reader, alias or fallback.
  • Use Pydantic 2.12's model-owned config/dump/copy/JSON/validator APIs in the
    existing BaSiC and BaseFit owners; keep saved settings/profile names.
  • Candidate Python 3.11–3.14 metadata: JAX 0.9.2 line (matching JAXlib owned by
    JAX), NumPy 2, SciPy >=1.16.2, scikit-image 0.26 line, Pydantic 2.12 line.
    Wheel/API basis and limitations are in docs/python314-openhcs.md.
  • Hyperactive import/dependency belongs to the existing autotune method/extra,
    not ordinary fit. No autotuning readiness claim or alternate fit algorithm.
  • Remove historical Windows JAX0.4.11/legacy-resolver downgrade; update declared
    test matrix. No CI or package/environment installation executed.

Current upstream 2.x is PyTorch, with a different API. Its open
PR174 owns modern SciPy there;
PR170 targets Python3.12/3.13.
We are not duplicating those changes or switching the existing JAX wrapper to
a mismatched API. JAX public inverse-DCT docs
and Pydantic3.14 support
support the selected source API, not numerical correctness.

Actual evidence

  • /usr/bin/python3.14 scripts/check_source_contracts.py: 4 source checks
    pass
    , latest 0.046 s. AST syntax, public inverse-DCT owner, dependency
    contract, Pydantic owner API. No dependency imports/fit.
  • Focused Ruff E9/F63/F7/F82: pass. git diff --check: pass.
  • Added real SciPy-vs-JAX and DCT round-trip regression for odd/even 1D/2D/3D:
    not executed yet under shared live scheduling restriction.

Focused antipattern review

IMPL-13/TIME-1: public mechanism replaces copied private implementation in the
existing DCT owner, replaced path deleted. TIME-6: nonexistent exports removed.
BOUND-2: Pydantic models retain schema ownership. New backend cases use existing
DCT family/derived catalog; new model fields project through model dumps, not a
new mirror schema. Focused source/AST/catalog review only, no full NRA proof.
Inherited resize dispatch and historical unfinished CLI are outside this patch.

Remaining acceptance / scheduling

Python3.14 actual dependency resolve/import, real bounded synthetic
fit-transform plus field/leakage inspection, CPU time/RAM receipt, and paired
compiled OpenHCS/real MCP journey remain pending. Keep draft until these run.
Parent peng-lab#151/#212 gets the first released validation slot; this worker waits for
explicit next-slot handoff. No GUI/JVM/fit/new environment, installed packages
or active analysis baseline changed. Original prototype and blind inputs are
untouched. The docs separate wheel/syntax evidence from runtime readiness.

@trissim

trissim commented Sep 30, 2026

Copy link
Copy Markdown
Author

Parent numerical checkpoint is now published in 855af6b (original Linnaeus tree untouched). Existing Python 3.14.7 dependencies were sufficient: no download, environment, or install. Final real source-import CPU run: 6 passed in 13.96s pytest / 15.97s process, peak RSS 690508 KiB, zero swaps. Covers public JAX inverse DCT against SciPy, 2D/3D shaded synthetic fitting, measurement-unit preservation, save/load profile roundtrip, and stationary-biology leakage negative control. Original logs/XML/resources remain in the persistent issue-batch ledger; canonical receipt docs/python314-numeric-20260930.rst. This is not installed OpenHCS/MCP, CUDA, fresh-resolver, autotuning, or enabled-darkfield acceptance. Paired current-main integration is in progress.

@trissim
trissim marked this pull request as ready for review September 30, 2026 19:07
@trissim
trissim merged commit c1d7c3d into main Sep 30, 2026
0 of 26 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.

1 participant