Skip to content

Expose no‑GIL readiness axis and add pyisolate doctor CLI#208

Merged
seanwevans merged 1 commit into
mainfrom
codex/make-no-gil-readiness-a-visible-axis
May 13, 2026
Merged

Expose no‑GIL readiness axis and add pyisolate doctor CLI#208
seanwevans merged 1 commit into
mainfrom
codex/make-no-gil-readiness-a-visible-axis

Conversation

@seanwevans
Copy link
Copy Markdown
Owner

Motivation

  • Make the runtime no‑GIL readiness a first‑class, visible release axis so deployments can distinguish “parallel cells” (true parallel subinterpreters) from “scheduled compartments” (serialized/scheduled execution) for compatibility and risk decisions.
  • Surface the presence and audit status of imported native extensions so CI/fleet tooling can detect when loaded modules block parallel‑cell guarantees.

Description

  • Add a new pyisolate/nogil.py module that detects whether CPython was built with --disable-gil, queries the process GIL state when available, enumerates imported native extension modules, accepts PYISOLATE_NOGIL_SAFE_MODULES to mark audited modules as no‑GIL safe, and produces a no_gil_readiness_report() with a parallel_cells vs scheduled_compartments axis.
  • Emit a runtime RuntimeWarning on free‑threaded builds when imported native extensions are present but not declared safe, with opt‑out via PYISOLATE_WARN_UNSAFE_NOGIL_EXTENSIONS.
  • Extend the doctor tool and provenance output by updating pyisolate/doctor.py, adding a top‑level pyisolate entrypoint in pyisolate/cli.py, and including no_gil in pyisolate/provenance.py so pyisolate-doctor/pyisolate doctor can report gil and extensions (human and --json) information.
  • Export no_gil_readiness_report and warn_if_unsafe_native_extensions from the package root and add short documentation to README.md, plus small test coverage additions in tests/test_provenance.py.

Testing

  • Ran python -m compileall -q pyisolate successfully.
  • Ran focused tests pytest -q tests/test_provenance.py tests/test_sandbox.py::test_spawn_returns_sandbox and observed the targeted tests pass.
  • Exercised the new CLI commands with python -m pyisolate.doctor gil and python -m pyisolate.doctor extensions --json and confirmed expected human and JSON output.
  • Attempted the full test suite (pytest -q), but the run fails in the current environment with an existing order‑dependent test/stub interaction where _StubBPFManager.load() was mutated earlier in the run and raises TypeError: _StubBPFManager.load() got an unexpected keyword argument 'mode', so full‑suite results are blocked by that unrelated test ordering issue.

Codex Task

@seanwevans seanwevans merged commit a5466ce into main May 13, 2026
9 of 19 checks passed
@seanwevans seanwevans deleted the codex/make-no-gil-readiness-a-visible-axis branch May 13, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant