[PR #7] [MERGED] feat: isolation serialization, CUDA IPC hardening, and CUDA wheel resolution (v0.9.2) #8

Closed
opened 2026-10-26 22:11:31 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/pyisolate/pull/7
Author: @pollockjj
Created: 3/12/2026
Status: ✅ Merged
Merged: 3/12/2026
Merged by: @pollockjj

Base: main ← Head: pr/0.9.2-isolation-support


📝 Commits (4)

  • 2641b45 feat(cuda-wheels): resolve runtime-matched CUDA wheels from custom indexes
  • 3bd5249 feat: isolation serialization improvements for custom node support
  • 62c8cfa test: unit tests for serialization registry, transport limits, and deserialization guard
  • 7e407d0 chore: bump version to 0.9.2

📊 Changes

18 files changed (+1223 additions, -140 deletions)

View changed files

📝 benchmarks/benchmark.py (+64 -57)
📝 benchmarks/benchmark_harness.py (+30 -45)
📝 benchmarks/memory_benchmark.py (+10 -15)
📝 benchmarks/simple_benchmark.py (+1 -0)
➕ pyisolate/_internal/cuda_wheels.py (+272 -0)
📝 pyisolate/_internal/environment.py (+58 -4)
📝 pyisolate/_internal/model_serialization.py (+7 -3)
📝 pyisolate/_internal/rpc_protocol.py (+2 -1)
📝 pyisolate/_internal/rpc_transports.py (+6 -1)
📝 pyisolate/_internal/serialization_registry.py (+23 -2)
📝 pyisolate/_internal/tensor_serializer.py (+9 -5)
📝 pyisolate/config.py (+22 -0)
📝 pyisolate/interfaces.py (+5 -0)
📝 pyproject.toml (+5 -2)
➕ tests/test_cuda_wheels.py (+317 -0)
➕ tests/test_model_serialization.py (+121 -0)
➕ tests/test_rpc_transports.py (+178 -0)
📝 tests/test_serialization_registry.py (+93 -5)

📄 Description

Summary

  • CUDA wheel resolution: Resolves runtime-matched CUDA wheels from custom indexes, ensuring isolated venvs get the correct torch build for the host GPU
  • Isolation serialization improvements: Extended serialization registry to support custom node types (File3D, PLY, NPZ, VIDEO) required for ComfyUI custom node isolation
  • CUDA IPC hardening: Fixed SIGABRT on process exit caused by purge_orphan_sender_shm_files racing the C++ RefcountedMapAllocator destructor — SIGKILL'd child peers leave the IPC refcount file at count > 1, so the host's C++ close() decrements but does not unlink; purge_orphan then unlinks the file while the C++ mmap is still open, causing a double-unlink → ENOENT → SIGABRT
  • Unit test coverage: Serialization registry, transport limits, and deserialization guard

Test plan

  • All unit tests pass: pytest tests/test_*.py --ignore=tests/test_sandbox_integration.py
  • CUDA IPC integration tests pass with no abort: pytest tests/integration_v2/test_tensors.py
  • Quality gates: ruff check, ruff format --check, mypy pyisolate
  • Full CI matrix validated (38/38 pass)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/pyisolate/pull/7 **Author:** [@pollockjj](https://github.com/pollockjj) **Created:** 3/12/2026 **Status:** ✅ Merged **Merged:** 3/12/2026 **Merged by:** [@pollockjj](https://github.com/pollockjj) **Base:** `main` ← **Head:** `pr/0.9.2-isolation-support` --- ### 📝 Commits (4) - [`2641b45`](https://github.com/Comfy-Org/pyisolate/commit/2641b4566ad36092019b9c6db395ec4cedd5bb2d) feat(cuda-wheels): resolve runtime-matched CUDA wheels from custom indexes - [`3bd5249`](https://github.com/Comfy-Org/pyisolate/commit/3bd5249c57900f03c27c0e84dbb26e85f6c0239b) feat: isolation serialization improvements for custom node support - [`62c8cfa`](https://github.com/Comfy-Org/pyisolate/commit/62c8cfaa59d4f4f775fe3060f366b60614d07a19) test: unit tests for serialization registry, transport limits, and deserialization guard - [`7e407d0`](https://github.com/Comfy-Org/pyisolate/commit/7e407d04653f5880e00093359ca99a2acd0c968c) chore: bump version to 0.9.2 ### 📊 Changes **18 files changed** (+1223 additions, -140 deletions) <details> <summary>View changed files</summary> 📝 `benchmarks/benchmark.py` (+64 -57) 📝 `benchmarks/benchmark_harness.py` (+30 -45) 📝 `benchmarks/memory_benchmark.py` (+10 -15) 📝 `benchmarks/simple_benchmark.py` (+1 -0) ➕ `pyisolate/_internal/cuda_wheels.py` (+272 -0) 📝 `pyisolate/_internal/environment.py` (+58 -4) 📝 `pyisolate/_internal/model_serialization.py` (+7 -3) 📝 `pyisolate/_internal/rpc_protocol.py` (+2 -1) 📝 `pyisolate/_internal/rpc_transports.py` (+6 -1) 📝 `pyisolate/_internal/serialization_registry.py` (+23 -2) 📝 `pyisolate/_internal/tensor_serializer.py` (+9 -5) 📝 `pyisolate/config.py` (+22 -0) 📝 `pyisolate/interfaces.py` (+5 -0) 📝 `pyproject.toml` (+5 -2) ➕ `tests/test_cuda_wheels.py` (+317 -0) ➕ `tests/test_model_serialization.py` (+121 -0) ➕ `tests/test_rpc_transports.py` (+178 -0) 📝 `tests/test_serialization_registry.py` (+93 -5) </details> ### 📄 Description ## Summary - **CUDA wheel resolution**: Resolves runtime-matched CUDA wheels from custom indexes, ensuring isolated venvs get the correct torch build for the host GPU - **Isolation serialization improvements**: Extended serialization registry to support custom node types (File3D, PLY, NPZ, VIDEO) required for ComfyUI custom node isolation - **CUDA IPC hardening**: Fixed SIGABRT on process exit caused by `purge_orphan_sender_shm_files` racing the C++ `RefcountedMapAllocator` destructor — SIGKILL'd child peers leave the IPC refcount file at count > 1, so the host's C++ `close()` decrements but does not unlink; `purge_orphan` then unlinks the file while the C++ mmap is still open, causing a double-unlink → ENOENT → SIGABRT - **Unit test coverage**: Serialization registry, transport limits, and deserialization guard ## Test plan - [x] All unit tests pass: `pytest tests/test_*.py --ignore=tests/test_sandbox_integration.py` - [x] CUDA IPC integration tests pass with no abort: `pytest tests/integration_v2/test_tensors.py` - [x] Quality gates: `ruff check`, `ruff format --check`, `mypy pyisolate` - [x] Full CI matrix validated (38/38 pass) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/pyisolate#8
No description provided.