feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
"""Actor attachment and zero-copy job data-plane guarantees."""
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
feat(data-plane): add routed SPSC stream transport
Implement namespace-owned stream rendezvous with incarnation isolation, cancellation, recovery, bounded local byte rings, and host/child actor protocols.
Add a replaceable stream transport boundary plus an Iroh ALPN adapter with framed records, backpressure, reconnect handling, and terminal propagation.
Wire stream sources and sinks through Myelin job deployment and Python bindings, with guarantee coverage across blob, namespace, job, byte-ring, and transport paths.
Sanitize nested Cargo build context in xtask so lint, Nextest, doctest, and maturin invocations retain stable fingerprints.
2026-08-23 08:47:31 +00:00
|
|
|
import asyncio
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
import ctypes
|
2026-08-24 15:22:20 +00:00
|
|
|
import errno
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
import json
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
import os
|
|
|
|
|
import struct
|
|
|
|
|
import subprocess
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
import importlib
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
import sys
|
|
|
|
|
import tempfile
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
import swactor
|
|
|
|
|
|
|
|
|
|
ENV_ARENA = "SWACTOR_ARENA_FD"
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
_native = importlib.import_module("swactor.swactor")
|
|
|
|
|
ENV_ACTOR = "SWACTOR_DATA_PLANE_ACTOR"
|
|
|
|
|
ENV_CAPABILITY = "SWACTOR_JOB_CAPABILITY"
|
|
|
|
|
ENV_ENDPOINT = "SWACTOR_DATA_PLANE_ENDPOINT"
|
|
|
|
|
BOOTSTRAP_ENV = (ENV_ARENA, ENV_ACTOR, ENV_CAPABILITY, ENV_ENDPOINT)
|
|
|
|
|
OLD_WAKE_ENV = ("SWACTOR_WAKE_FD", "SWACTOR_HOST_WAKE_FD")
|
|
|
|
|
MAGIC = int.from_bytes(b"SWBS", "little")
|
|
|
|
|
VERSION = 2
|
|
|
|
|
HEADER_LEN = 64
|
|
|
|
|
ARENA_SIZE = 4096
|
|
|
|
|
PROBE = Path(__file__).parent / "probe.py"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PyBuffer(ctypes.Structure):
|
|
|
|
|
_fields_ = [
|
|
|
|
|
("buf", ctypes.c_void_p),
|
|
|
|
|
("obj", ctypes.c_void_p),
|
|
|
|
|
("len", ctypes.c_ssize_t),
|
|
|
|
|
("itemsize", ctypes.c_ssize_t),
|
|
|
|
|
("readonly", ctypes.c_int),
|
|
|
|
|
("ndim", ctypes.c_int),
|
|
|
|
|
("format", ctypes.c_char_p),
|
|
|
|
|
("shape", ctypes.POINTER(ctypes.c_ssize_t)),
|
|
|
|
|
("strides", ctypes.POINTER(ctypes.c_ssize_t)),
|
|
|
|
|
("suboffsets", ctypes.POINTER(ctypes.c_ssize_t)),
|
|
|
|
|
("internal", ctypes.c_void_p),
|
|
|
|
|
]
|
|
|
|
|
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
_PY_GET_BUFFER = ctypes.pythonapi.PyObject_GetBuffer
|
|
|
|
|
_PY_GET_BUFFER.argtypes = [ctypes.py_object, ctypes.POINTER(PyBuffer), ctypes.c_int]
|
|
|
|
|
_PY_GET_BUFFER.restype = ctypes.c_int
|
|
|
|
|
_PY_RELEASE_BUFFER = ctypes.pythonapi.PyBuffer_Release
|
|
|
|
|
_PY_RELEASE_BUFFER.argtypes = [ctypes.POINTER(PyBuffer)]
|
|
|
|
|
_PY_RELEASE_BUFFER.restype = None
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
@pytest.fixture
|
|
|
|
|
def host():
|
|
|
|
|
return _native._test_data_plane_host()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def install_host_env(monkeypatch, host) -> int:
|
|
|
|
|
env = dict(host.env())
|
|
|
|
|
inherited = os.dup(host.arena_fd())
|
|
|
|
|
env[ENV_ARENA] = str(inherited)
|
|
|
|
|
for name in BOOTSTRAP_ENV:
|
|
|
|
|
monkeypatch.setenv(name, env[name])
|
|
|
|
|
for name in OLD_WAKE_ENV:
|
|
|
|
|
monkeypatch.delenv(name, raising=False)
|
|
|
|
|
return inherited
|
|
|
|
|
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
def pack_header(
|
|
|
|
|
*,
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
magic: int = MAGIC,
|
|
|
|
|
version: int = VERSION,
|
|
|
|
|
arena_size: int = ARENA_SIZE,
|
|
|
|
|
generation: int = 1,
|
|
|
|
|
control_offset: int = 0,
|
|
|
|
|
control_length: int = 0,
|
|
|
|
|
reserved: tuple[int, int, int] = (0, 0, 0),
|
|
|
|
|
) -> bytes:
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
return struct.pack(
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
"<IHH7Q",
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
magic,
|
|
|
|
|
version,
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
0,
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
arena_size,
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
generation,
|
|
|
|
|
control_offset,
|
|
|
|
|
control_length,
|
|
|
|
|
*reserved,
|
|
|
|
|
)
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def make_arena(header: bytes, size: int = ARENA_SIZE) -> int:
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
fd, path = tempfile.mkstemp(prefix="python-bootstrap-test-")
|
|
|
|
|
os.unlink(path)
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
os.ftruncate(fd, size)
|
|
|
|
|
os.pwrite(fd, header, 0)
|
|
|
|
|
return fd
|
|
|
|
|
|
|
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
def set_arena(monkeypatch, fd: int) -> None:
|
|
|
|
|
monkeypatch.setenv(ENV_ARENA, str(fd))
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
def mapping_for_address(address: int) -> str:
|
|
|
|
|
for line in Path("/proc/self/maps").read_text().splitlines():
|
|
|
|
|
extent = line.split(maxsplit=1)[0]
|
|
|
|
|
start, end = (int(value, 16) for value in extent.split("-"))
|
|
|
|
|
if start <= address < end:
|
|
|
|
|
return line
|
|
|
|
|
raise AssertionError(f"no process mapping contains {address:#x}")
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
def test_run_attaches_before_main_and_maps_blob_buffer_directly(monkeypatch, host):
|
|
|
|
|
inherited = install_host_env(monkeypatch, host)
|
|
|
|
|
observed = {}
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
async def main(ctx):
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
assert isinstance(ctx, swactor.Context)
|
|
|
|
|
assert isinstance(ctx.data, swactor.DataPlane)
|
|
|
|
|
blob = await ctx.data.read_blob("/models/tiny-linear/weights")
|
|
|
|
|
assert isinstance(blob, swactor.Blob)
|
|
|
|
|
assert blob.length == 24
|
2026-08-22 17:16:56 +00:00
|
|
|
assert blob.digest is None
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
with blob.map() as mapped:
|
2026-08-22 17:16:56 +00:00
|
|
|
assert isinstance(mapped, swactor.BlobView)
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
assert struct.unpack_from("<6f", mapped) == pytest.approx(
|
|
|
|
|
(1.5, -2.0, 0.5, 4.0, 0.25, -0.75)
|
|
|
|
|
)
|
|
|
|
|
view = memoryview(mapped)
|
|
|
|
|
assert view.readonly
|
|
|
|
|
assert view.nbytes == 24
|
|
|
|
|
view.release()
|
|
|
|
|
|
|
|
|
|
with pytest.raises(BufferError, match="read-only"):
|
|
|
|
|
_PY_GET_BUFFER(mapped, ctypes.byref(PyBuffer()), 1)
|
|
|
|
|
|
|
|
|
|
exported = PyBuffer()
|
|
|
|
|
assert _PY_GET_BUFFER(mapped, ctypes.byref(exported), 0) == 0
|
|
|
|
|
try:
|
|
|
|
|
mapping = mapping_for_address(exported.buf)
|
|
|
|
|
assert "data-plane-arena" in mapping
|
|
|
|
|
assert exported.readonly == 1
|
|
|
|
|
assert exported.len == 24
|
|
|
|
|
finally:
|
|
|
|
|
_PY_RELEASE_BUFFER(ctypes.byref(exported))
|
|
|
|
|
|
|
|
|
|
public = {name for name in dir(ctx.data) if not name.startswith("_")}
|
2026-08-24 15:22:20 +00:00
|
|
|
assert {"open", "read_blob", "write_blob", "read_stream", "write_stream"} <= public
|
|
|
|
|
assert isinstance(swactor.O_RDONLY, int)
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
assert not public & {
|
|
|
|
|
"actor",
|
|
|
|
|
"actor_id",
|
|
|
|
|
"edge",
|
|
|
|
|
"edge_id",
|
|
|
|
|
"offset",
|
|
|
|
|
"peer",
|
|
|
|
|
"ring",
|
|
|
|
|
"socket",
|
|
|
|
|
}
|
|
|
|
|
observed["ran"] = True
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
swactor.run(main)
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
assert observed == {"ran": True}
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
with pytest.raises(OSError):
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
os.fstat(inherited)
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
def test_write_blob_seals_cleanly_and_exception_aborts(monkeypatch, host):
|
|
|
|
|
install_host_env(monkeypatch, host)
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
async def main(ctx):
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
async with ctx.data.write_blob(
|
|
|
|
|
"/runs/self/results/complete", length=6
|
|
|
|
|
) as blob:
|
|
|
|
|
assert blob.length == 6
|
|
|
|
|
with blob.map() as mapped:
|
|
|
|
|
struct.pack_into("6s", mapped, 0, b"result")
|
|
|
|
|
|
|
|
|
|
class AbortWrite(Exception):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
async with ctx.data.write_blob(
|
|
|
|
|
"/runs/self/results/aborted", length=4
|
|
|
|
|
) as blob:
|
|
|
|
|
with blob.map() as mapped:
|
|
|
|
|
struct.pack_into("4s", mapped, 0, b"nope")
|
|
|
|
|
raise AbortWrite
|
|
|
|
|
except AbortWrite:
|
|
|
|
|
pass
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
2026-08-22 17:16:56 +00:00
|
|
|
complete = await ctx.data.read_blob("/runs/self/results/complete")
|
|
|
|
|
with complete.map() as mapped:
|
|
|
|
|
assert bytes(mapped) == b"result"
|
|
|
|
|
with pytest.raises(swactor.DataPathError, match="not found"):
|
|
|
|
|
await ctx.data.read_blob("/runs/self/results/aborted")
|
|
|
|
|
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
swactor.run(main)
|
|
|
|
|
|
2026-08-24 15:22:20 +00:00
|
|
|
def test_raw_descriptor_blob_io_mapping_and_errno(monkeypatch, host):
|
|
|
|
|
install_host_env(monkeypatch, host)
|
|
|
|
|
|
|
|
|
|
async def main(ctx):
|
|
|
|
|
logical = "/runs/self/results/raw-python"
|
|
|
|
|
writer = await ctx.data.open(
|
|
|
|
|
logical,
|
|
|
|
|
swactor.O_WRONLY | swactor.O_CREAT | swactor.O_TRUNC,
|
|
|
|
|
length=8,
|
|
|
|
|
)
|
|
|
|
|
assert isinstance(writer, swactor.Descriptor)
|
|
|
|
|
assert writer.kind == "blob"
|
|
|
|
|
assert await writer.write(b"abc") == 3
|
|
|
|
|
assert await writer.writefrom(b"defgh") == 5
|
|
|
|
|
await writer.close()
|
|
|
|
|
with pytest.raises(OSError) as closed:
|
|
|
|
|
await writer.close()
|
|
|
|
|
assert closed.value.errno == errno.EBADF
|
|
|
|
|
|
|
|
|
|
reader = await ctx.data.open(logical, swactor.O_RDONLY)
|
|
|
|
|
destination = bytearray(b"\xa5" * 10)
|
|
|
|
|
assert await reader.readinto(memoryview(destination)[1:7]) == 6
|
|
|
|
|
assert destination == b"\xa5abcdef\xa5\xa5\xa5"
|
|
|
|
|
assert await reader.read(8) == b"gh"
|
|
|
|
|
assert await reader.read(8) == b""
|
|
|
|
|
with pytest.raises(OSError) as wrong_access:
|
|
|
|
|
await reader.write(b"x")
|
|
|
|
|
assert wrong_access.value.errno == errno.EBADF
|
|
|
|
|
|
|
|
|
|
mapping = await reader.map(length=8)
|
|
|
|
|
assert isinstance(mapping, swactor.DescriptorMapping)
|
|
|
|
|
exported = memoryview(mapping)
|
|
|
|
|
assert exported.readonly
|
|
|
|
|
await reader.close()
|
|
|
|
|
assert bytes(exported) == b"abcdefgh"
|
|
|
|
|
with pytest.raises(BufferError, match="active buffer exports"):
|
|
|
|
|
mapping.close()
|
|
|
|
|
exported.release()
|
|
|
|
|
mapping.close()
|
|
|
|
|
|
|
|
|
|
with pytest.raises(FileNotFoundError):
|
|
|
|
|
await ctx.data.open("/models/raw-missing", swactor.O_RDONLY)
|
|
|
|
|
with pytest.raises(OSError) as unsupported:
|
|
|
|
|
await ctx.data.open(logical, swactor.O_RDONLY | swactor.O_NONBLOCK)
|
|
|
|
|
assert unsupported.value.errno in {errno.ENOTSUP, errno.EOPNOTSUPP}
|
|
|
|
|
|
|
|
|
|
swactor.run(main)
|
|
|
|
|
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
def test_missing_path_and_authorization_are_typed(monkeypatch, host):
|
|
|
|
|
install_host_env(monkeypatch, host)
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
async def main(ctx):
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
with pytest.raises(swactor.DataPathError, match="not found"):
|
|
|
|
|
await ctx.data.read_blob("/models/missing")
|
|
|
|
|
with pytest.raises(PermissionError):
|
2026-08-22 17:16:56 +00:00
|
|
|
await ctx.data.read_blob("/runs/self/private")
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
swactor.run(main)
|
|
|
|
|
|
|
|
|
|
|
feat(data-plane): add routed SPSC stream transport
Implement namespace-owned stream rendezvous with incarnation isolation, cancellation, recovery, bounded local byte rings, and host/child actor protocols.
Add a replaceable stream transport boundary plus an Iroh ALPN adapter with framed records, backpressure, reconnect handling, and terminal propagation.
Wire stream sources and sinks through Myelin job deployment and Python bindings, with guarantee coverage across blob, namespace, job, byte-ring, and transport paths.
Sanitize nested Cargo build context in xtask so lint, Nextest, doctest, and maturin invocations retain stable fingerprints.
2026-08-23 08:47:31 +00:00
|
|
|
def test_native_stream_round_trip_has_ordered_eof(monkeypatch, host):
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
install_host_env(monkeypatch, host)
|
|
|
|
|
received = []
|
2026-08-24 15:22:20 +00:00
|
|
|
raw_received = []
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
async def main(ctx):
|
feat(data-plane): add routed SPSC stream transport
Implement namespace-owned stream rendezvous with incarnation isolation, cancellation, recovery, bounded local byte rings, and host/child actor protocols.
Add a replaceable stream transport boundary plus an Iroh ALPN adapter with framed records, backpressure, reconnect handling, and terminal propagation.
Wire stream sources and sinks through Myelin job deployment and Python bindings, with guarantee coverage across blob, namespace, job, byte-ring, and transport paths.
Sanitize nested Cargo build context in xtask so lint, Nextest, doctest, and maturin invocations retain stable fingerprints.
2026-08-23 08:47:31 +00:00
|
|
|
async def receive():
|
|
|
|
|
reader = await ctx.data.read_stream(
|
|
|
|
|
"/runs/self/results/predictions"
|
|
|
|
|
)
|
2026-08-24 15:22:20 +00:00
|
|
|
buffer = bytearray(3)
|
|
|
|
|
while (count := await reader.readinto(buffer)) != 0:
|
|
|
|
|
received.append(bytes(buffer[:count]))
|
feat(data-plane): add routed SPSC stream transport
Implement namespace-owned stream rendezvous with incarnation isolation, cancellation, recovery, bounded local byte rings, and host/child actor protocols.
Add a replaceable stream transport boundary plus an Iroh ALPN adapter with framed records, backpressure, reconnect handling, and terminal propagation.
Wire stream sources and sinks through Myelin job deployment and Python bindings, with guarantee coverage across blob, namespace, job, byte-ring, and transport paths.
Sanitize nested Cargo build context in xtask so lint, Nextest, doctest, and maturin invocations retain stable fingerprints.
2026-08-23 08:47:31 +00:00
|
|
|
|
|
|
|
|
receiver = asyncio.create_task(receive())
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
async with ctx.data.write_stream(
|
|
|
|
|
"/runs/self/results/predictions"
|
|
|
|
|
) as stream:
|
feat(data-plane): add routed SPSC stream transport
Implement namespace-owned stream rendezvous with incarnation isolation, cancellation, recovery, bounded local byte rings, and host/child actor protocols.
Add a replaceable stream transport boundary plus an Iroh ALPN adapter with framed records, backpressure, reconnect handling, and terminal propagation.
Wire stream sources and sinks through Myelin job deployment and Python bindings, with guarantee coverage across blob, namespace, job, byte-ring, and transport paths.
Sanitize nested Cargo build context in xtask so lint, Nextest, doctest, and maturin invocations retain stable fingerprints.
2026-08-23 08:47:31 +00:00
|
|
|
await stream.write(b"native-")
|
|
|
|
|
await stream.write(b"result")
|
|
|
|
|
await receiver
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
2026-08-24 15:22:20 +00:00
|
|
|
raw_reader, raw_writer = await asyncio.gather(
|
|
|
|
|
ctx.data.open("/runs/self/results/predictions", swactor.O_RDONLY),
|
|
|
|
|
ctx.data.open("/runs/self/results/predictions", swactor.O_WRONLY),
|
|
|
|
|
)
|
|
|
|
|
assert await raw_writer.write(b"raw-stream") == len(b"raw-stream")
|
|
|
|
|
await raw_writer.close()
|
|
|
|
|
buffer = bytearray(4)
|
|
|
|
|
while (count := await raw_reader.readinto(buffer)) != 0:
|
|
|
|
|
raw_received.append(bytes(buffer[:count]))
|
|
|
|
|
await raw_reader.close()
|
|
|
|
|
|
feat(data-plane): add routed SPSC stream transport
Implement namespace-owned stream rendezvous with incarnation isolation, cancellation, recovery, bounded local byte rings, and host/child actor protocols.
Add a replaceable stream transport boundary plus an Iroh ALPN adapter with framed records, backpressure, reconnect handling, and terminal propagation.
Wire stream sources and sinks through Myelin job deployment and Python bindings, with guarantee coverage across blob, namespace, job, byte-ring, and transport paths.
Sanitize nested Cargo build context in xtask so lint, Nextest, doctest, and maturin invocations retain stable fingerprints.
2026-08-23 08:47:31 +00:00
|
|
|
swactor.run(main)
|
|
|
|
|
assert b"".join(received) == b"native-result"
|
2026-08-24 15:22:20 +00:00
|
|
|
assert b"".join(raw_received) == b"raw-stream"
|
feat(data-plane): add routed SPSC stream transport
Implement namespace-owned stream rendezvous with incarnation isolation, cancellation, recovery, bounded local byte rings, and host/child actor protocols.
Add a replaceable stream transport boundary plus an Iroh ALPN adapter with framed records, backpressure, reconnect handling, and terminal propagation.
Wire stream sources and sinks through Myelin job deployment and Python bindings, with guarantee coverage across blob, namespace, job, byte-ring, and transport paths.
Sanitize nested Cargo build context in xtask so lint, Nextest, doctest, and maturin invocations retain stable fingerprints.
2026-08-23 08:47:31 +00:00
|
|
|
assert "SWACTOR_DATA_PLANE_OUTPUT" not in host.env()
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_invalid_capability_prevents_main(monkeypatch, host):
|
|
|
|
|
install_host_env(monkeypatch, host)
|
|
|
|
|
monkeypatch.setenv(ENV_CAPABILITY, "00" * 32)
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
calls = []
|
|
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
async def main(_ctx):
|
|
|
|
|
calls.append("ran")
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
with pytest.raises(swactor.SessionError, match="CapabilityRejected"):
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
swactor.run(main)
|
|
|
|
|
assert calls == []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
("header", "match"),
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
[
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
(pack_header(magic=MAGIC ^ 0xFF), "magic"),
|
|
|
|
|
(pack_header(version=VERSION + 1), "version"),
|
|
|
|
|
(pack_header(generation=0), "generation"),
|
|
|
|
|
(pack_header(arena_size=ARENA_SIZE + 1), "backing length"),
|
|
|
|
|
(pack_header(control_offset=64, control_length=0), "both offset and length"),
|
|
|
|
|
(pack_header(reserved=(0, 1, 0)), "reserved"),
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
],
|
|
|
|
|
)
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
def test_malformed_arena_fails_before_route_or_main(monkeypatch, host, header, match):
|
|
|
|
|
env = dict(host.env())
|
|
|
|
|
for name, value in env.items():
|
|
|
|
|
monkeypatch.setenv(name, value)
|
|
|
|
|
fd = make_arena(header)
|
|
|
|
|
set_arena(monkeypatch, fd)
|
|
|
|
|
calls = []
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
async def main(_ctx):
|
|
|
|
|
calls.append("ran")
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
try:
|
|
|
|
|
with pytest.raises(swactor.BootstrapError, match=match):
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
swactor.run(main)
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
assert calls == []
|
|
|
|
|
with pytest.raises(OSError):
|
|
|
|
|
os.fstat(fd)
|
|
|
|
|
finally:
|
|
|
|
|
try:
|
|
|
|
|
os.close(fd)
|
|
|
|
|
except OSError:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_missing_bootstrap_metadata_prevents_main(monkeypatch):
|
|
|
|
|
for name in (*BOOTSTRAP_ENV, *OLD_WAKE_ENV):
|
|
|
|
|
monkeypatch.delenv(name, raising=False)
|
|
|
|
|
calls = []
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
async def main(_ctx):
|
|
|
|
|
calls.append("ran")
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
with pytest.raises(swactor.BootstrapError, match=ENV_ARENA):
|
|
|
|
|
swactor.run(main)
|
|
|
|
|
assert calls == []
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
|
|
|
|
|
def test_handoff_uses_one_descriptor_and_no_wake_names(host):
|
|
|
|
|
env = dict(host.env())
|
|
|
|
|
assert set(env) == set(BOOTSTRAP_ENV)
|
|
|
|
|
assert all(name not in env for name in OLD_WAKE_ENV)
|
|
|
|
|
assert env[ENV_ARENA] == str(host.arena_fd())
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
|
|
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
def test_real_exec_attachment_and_blob_mapping(host):
|
|
|
|
|
env = {
|
|
|
|
|
key: value
|
|
|
|
|
for key, value in os.environ.items()
|
|
|
|
|
if key not in (*BOOTSTRAP_ENV, *OLD_WAKE_ENV)
|
|
|
|
|
}
|
|
|
|
|
env.update(dict(host.env()))
|
|
|
|
|
result = subprocess.run(
|
|
|
|
|
[sys.executable, str(PROBE)],
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
env=env,
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
pass_fds=(host.arena_fd(),),
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
text=True,
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
capture_output=True,
|
|
|
|
|
timeout=45,
|
|
|
|
|
check=False,
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
)
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
assert result.returncode == 0, result.stderr
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
facts = dict(
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
item.split("=", 1) for item in result.stdout.strip().split() if "=" in item
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
)
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
assert facts == {
|
|
|
|
|
"HAS_DATA": "1",
|
|
|
|
|
"LENGTH": "24",
|
|
|
|
|
"VALUES": "1.5,-2,0.5,4,0.25,-0.75",
|
|
|
|
|
"ARENA_OPEN": "0",
|
|
|
|
|
"IDENTITY_LEAKS": "0",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
|
|
|
not Path("/dev/nvidia0").exists(),
|
|
|
|
|
reason="CUDA device is unavailable",
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
)
|
feat(data-plane): add routed SPSC stream transport
Implement namespace-owned stream rendezvous with incarnation isolation, cancellation, recovery, bounded local byte rings, and host/child actor protocols.
Add a replaceable stream transport boundary plus an Iroh ALPN adapter with framed records, backpressure, reconnect handling, and terminal propagation.
Wire stream sources and sinks through Myelin job deployment and Python bindings, with guarantee coverage across blob, namespace, job, byte-ring, and transport paths.
Sanitize nested Cargo build context in xtask so lint, Nextest, doctest, and maturin invocations retain stable fingerprints.
2026-08-23 08:47:31 +00:00
|
|
|
def test_real_exec_tinygrad_cuda_scenario(host):
|
|
|
|
|
capture = host.capture_stream("/runs/self/results/inference")
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
env = {
|
|
|
|
|
key: value
|
|
|
|
|
for key, value in os.environ.items()
|
feat(data-plane): add routed SPSC stream transport
Implement namespace-owned stream rendezvous with incarnation isolation, cancellation, recovery, bounded local byte rings, and host/child actor protocols.
Add a replaceable stream transport boundary plus an Iroh ALPN adapter with framed records, backpressure, reconnect handling, and terminal propagation.
Wire stream sources and sinks through Myelin job deployment and Python bindings, with guarantee coverage across blob, namespace, job, byte-ring, and transport paths.
Sanitize nested Cargo build context in xtask so lint, Nextest, doctest, and maturin invocations retain stable fingerprints.
2026-08-23 08:47:31 +00:00
|
|
|
if key not in (*BOOTSTRAP_ENV, *OLD_WAKE_ENV, "SWACTOR_DATA_PLANE_OUTPUT")
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
}
|
|
|
|
|
env.update(dict(host.env()))
|
|
|
|
|
env.update(
|
|
|
|
|
{
|
|
|
|
|
"CUDA_PTX": "1",
|
|
|
|
|
"DEV": "CUDA",
|
|
|
|
|
}
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
)
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
script = (
|
|
|
|
|
Path(__file__).resolve().parents[4]
|
|
|
|
|
/ "apps"
|
|
|
|
|
/ "myelin"
|
|
|
|
|
/ "jobs"
|
|
|
|
|
/ "tiny_linear_inference.py"
|
feat(data-plane): add exec bootstrap ABI for job processes
Define the spawn-time handoff a job process consumes before any
application code runs: two inherited descriptors named by
SWACTOR_ARENA_FD and SWACTOR_WAKE_FD, and a fixed 48-byte little-endian
header at arena offset 0 naming one control-ring region.
- Canonical header layout, shared parser, and a host writer that leases
the header region and control ring disjointly under the arena's own
placement law, zeroes the ring, stamps its generation, and returns the
handoff (env map, inheritable arena and wake descriptors, host wake
eventfd) only after every write completes.
- Python binding gains swactor.run(main): map the arena read-only, take
ground truth from fstat, validate through the shared parser, arm
FD_CLOEXEC on the wake descriptor, close the arena descriptor after
mapping, and drive main on asyncio with Context.data carrying the
resolved state. Fail-fast BootstrapError before main on any defect.
- Rewrite jobs/tiny_linear_inference.py against the approved path API and
record the slice, invariants, and remaining bridge work in the handoff
doc.
Verified with 12 new data-plane bootstrap guarantee tests (parser defect
table, fuzzed pages, writer round-trip), 29 binding tests across
in-process and exec boundaries, and full data-plane and iroh-driver
suites with no regressions.
2026-08-20 16:43:44 +00:00
|
|
|
)
|
feat(data-plane): add routed SPSC stream transport
Implement namespace-owned stream rendezvous with incarnation isolation, cancellation, recovery, bounded local byte rings, and host/child actor protocols.
Add a replaceable stream transport boundary plus an Iroh ALPN adapter with framed records, backpressure, reconnect handling, and terminal propagation.
Wire stream sources and sinks through Myelin job deployment and Python bindings, with guarantee coverage across blob, namespace, job, byte-ring, and transport paths.
Sanitize nested Cargo build context in xtask so lint, Nextest, doctest, and maturin invocations retain stable fingerprints.
2026-08-23 08:47:31 +00:00
|
|
|
result = subprocess.run(
|
|
|
|
|
[sys.executable, str(script)],
|
|
|
|
|
env=env,
|
|
|
|
|
pass_fds=(host.arena_fd(),),
|
|
|
|
|
text=True,
|
|
|
|
|
capture_output=True,
|
|
|
|
|
timeout=45,
|
|
|
|
|
check=False,
|
|
|
|
|
)
|
|
|
|
|
assert result.returncode == 0, result.stderr
|
|
|
|
|
payload = json.loads(capture.result())
|
|
|
|
|
assert payload["device"].startswith("CUDA")
|
|
|
|
|
assert payload["output"] == pytest.approx([2.75, -8.75])
|