You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(interop): remove Python from_pytorch bridge, make it pure Julia (#63)
## Summary
The audit found `from_pytorch` claimed a **"built-in Python bridge"**
for direct `.pt/.pth/.ckpt` import — but the bridge script
(`scripts/pytorch_to_axiom_descriptor.py`) **never shipped**, so that
path always threw, and shelling out to `python3` violates the
estate-wide Python ban anyway.
This removes the Python entirely and makes PyTorch import **pure
Julia**.
## Changes
- **`src/integrations/interop.jl`** — delete `_run_pytorch_bridge` (the
`python3` shell-out) and `_default_pytorch_bridge_script`.
`from_pytorch(path; strict)` now imports the pure-Julia
`axiom.pytorch.sequential.v1` JSON descriptor. A raw `.pt/.pth/.ckpt`
gets a clear `ArgumentError` (it needs a PyTorch/Python runtime; export
the descriptor first) instead of a false "bridge" promise. The
`bridge`/`python_cmd`/`bridge_script` params are gone.
- **`test/runtests.jl` + `test/ci/interop_smoke.jl`** — the interop
tests previously **wrote an inline `.py` bridge script and ran it via
`python3`** (banned-language content in tests). Replaced with pure-Julia
descriptor tests: write the JSON descriptor directly, load it, and
assert a `.pt` path is rejected.
- **`ROADMAP.adoc` + `README.adoc`** — correct the two false `[x] direct
.pt bridge shipped (via scripts/pytorch_to_axiom_descriptor.py)` claims
and the "built-in Python bridge (requires python3 + torch)" README text
to the honest pure-Julia descriptor scope.
## Verification
- Package loads; `from_pytorch` **rejects `.pt` with `ArgumentError`**
and **imports the descriptor to a real `Pipeline`** (checked directly).
- `grep` confirms **no dangling references** to the removed bridge
params (`_run_pytorch_bridge`, `bridge_script`, `python_cmd`,
`AXIOM_PYTHON`, `pytorch_to_axiom_descriptor`) anywhere in `src/` or
`test/`.
- Full `Pkg.test()` matrix runs here as the authoritative gate.
## Not in this change (flagged)
`src/integrations/huggingface.jl:633` has a **help-string** suggesting
the user run `python -c "import torch; …"` to convert a `.bin` to
safetensors — not executed Python, a different feature. Left as-is
pending a call on whether to reword it.
A **native Julia checkpoint reader** (zip + pickle, to read raw `.pt`
without Python) is possible but needs a real `.pt` fixture to build
safely (which needs PyTorch) — noted as future work.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01UPFC9YQ7g9gc3VnRox42Q1
---
_Generated by [Claude
Code](https://claude.ai/code/session_01UPFC9YQ7g9gc3VnRox42Q1)_
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: ROADMAP.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Must progress snapshot (2026-02-16):
44
44
* [x] Added non-GPU accelerator strategy checks and CI coverage: `test/ci/coprocessor_strategy.jl`.
45
45
* [x] Added certificate integrity CI checks and digest-report artifacts: `test/ci/certificate_integrity.jl`, `.github/workflows/verify-certificates.yml`.
46
46
* [x] Added in-tree gRPC unary protobuf binary-wire support (`application/grpc`) with JSON bridge fallback (`application/grpc+json`).
47
-
* [x] Added direct `.pt/.pth/.ckpt` import bridge and expanded ONNX export coverage (Dense/Conv/Norm/Pool + activations).
47
+
* [x] Added pure-Julia PyTorch **descriptor** import (`axiom.pytorch.sequential.v1`) and expanded ONNX export coverage (Dense/Conv/Norm/Pool + activations). (Direct `.pt/.pth/.ckpt` binary import is *not* shipped — it would need a PyTorch/Python runtime; export to the descriptor first.)
* [x] Added REAL authenticating hybrid Ed448+Dilithium5 (ML-DSA-87) certificate
50
50
signing (G01, opt-in): Rust `cdylib` shim in `crypto/` (`pqcrypto-dilithium`
@@ -88,7 +88,7 @@ Could completion gates:
88
88
89
89
These roadmap promises are still tracked explicitly (with current delivery state):
90
90
91
-
* [x] `from_pytorch(...)` import API (baseline shipped: descriptor import + direct `.pt/.pth/.ckpt` bridge + CI interop smoke via `scripts/pytorch_to_axiom_descriptor.py`).
91
+
* [x] `from_pytorch(...)` import API (shipped: pure-Julia `axiom.pytorch.sequential.v1` descriptor import + CI interop smoke). Direct binary `.pt/.pth/.ckpt` import is out of scope (needs a PyTorch/Python runtime); a native Julia checkpoint reader (zip + pickle) is future work.
92
92
* [x] `to_onnx(...)` export API (baseline shipped: Dense/Conv/Norm/Pool + common activations for supported `Sequential`/`Pipeline` models).
93
93
* [x] Production-hardened GPU paths across CUDA/ROCm/Metal (baseline shipped: deterministic fallback CI + optional hardware smoke + extension-hook dispatch + device-range guards + runtime self-healing diagnostics + backend-specific performance evidence via `test/ci/gpu_resilience.jl` and `scripts/gpu-performance-evidence.jl`).
94
94
* [ ] Non-GPU accelerators (TPU/NPU/PPU/MATH/FPGA/DSP) backend strategy (in progress: targets, detection, compiled dispatch, fallback/strategy CI, capability/evidence reporting, runtime self-healing diagnostics, resilience CI/evidence, and TPU/NPU/DSP/MATH strict-mode gating shipped via `coprocessor_capability_report`, `coprocessor_runtime_diagnostics`, `scripts/coprocessor-evidence.jl`, `test/ci/coprocessor_resilience.jl`, `scripts/coprocessor-resilience-evidence.jl`, `test/ci/tpu_required_mode.jl`, `scripts/tpu-strict-evidence.jl`, `test/ci/npu_required_mode.jl`, `scripts/npu-strict-evidence.jl`, `test/ci/dsp_required_mode.jl`, `scripts/dsp-strict-evidence.jl`, `test/ci/math_required_mode.jl`, and `scripts/math-strict-evidence.jl`; production kernels remain).
0 commit comments