Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: benoitc/erlang-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: workers-runtime-gaps
Choose a base ref
...
head repository: benoitc/erlang-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 19 commits
  • 92 files changed
  • 1 contributor

Commits on Aug 15, 2026

  1. Merge pull request #70 from benoitc/workers-runtime-gaps

    Add interrupts, memory caps, async streaming, ETF callback results
    benoitc authored Aug 15, 2026
    Configuration menu
    Copy the full SHA
    88f594c View commit details
    Browse the repository at this point in the history
  2. Release 4.0.0

    Bump vsn to 4.0.0 and date the CHANGELOG entry. Major release: callback
    results returning an Erlang string now arrive in Python as a list of
    integers, matching call arguments, and nothing raises on upgrade.
    benoitc committed Aug 15, 2026
    Configuration menu
    Copy the full SHA
    47e1c7e View commit details
    Browse the repository at this point in the history
  3. Add worker loops: run and drive an ErlangEventLoop inside a context

    py_context:start_loop/stop_loop/loop_ref/submit/submit_await and the
    erlang.server helper let Erlang run N owngil workers that serve TCP/UDP
    on a socket Erlang bound (py:dup_fd per worker) or adopt accepted fds,
    and inject coroutines into the running loop.
    
    Fixes: owngil contexts had no ErlangEventLoop and returned the main loop
    from context_get_event_loop; owngil dispatch blocked on a dirty scheduler
    with a 30 s cap; transports closed fds still in the poll set; READ re-arm
    from the loop thread crashed in enif_select; recycled call_soon handles
    cancelled by their previous owner; task start failures dropped silently.
    benoitc authored Aug 15, 2026
    Configuration menu
    Copy the full SHA
    e4f3b61 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2026

  1. Add isolated context mode: CPython in a child OS process

    A mode where Python code cannot take the node down or run forever:
    one child process per context over a Unix socket, signals with
    SIGKILL as backstop, rlimits and cgroups, restart on crash. Same
    public API; the context process is a gen_statem serving one caller
    at a time. Validated on macOS and FreeBSD. Version 4.2.0.
    benoitc committed Aug 29, 2026
    Configuration menu
    Copy the full SHA
    78eba7a View commit details
    Browse the repository at this point in the history
  2. Merge pull request #72 from benoitc/isolated-mode

    Add isolated context mode: CPython in a child OS process
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    2c759dd View commit details
    Browse the repository at this point in the history
  3. Add shared memory regions and shared buffers over iommap

    Bulk data between Erlang and Python contexts no longer has to cross the
    socket: py_shm regions are files mapped MAP_SHARED on both sides (no copy
    on the Erlang side, one copy when Erlang writes), usable as plain terms in
    any context mode, and py_buffer:new(#{shared => true}) is a streaming
    input buffer over such a region with ring backpressure, so wsgi.input
    works in isolated contexts. iommap is an optional dependency. Read-only
    handles keep a callee from writing into a region.
    benoitc committed Aug 29, 2026
    Configuration menu
    Copy the full SHA
    bdfb81a View commit details
    Browse the repository at this point in the history
  4. Merge pull request #73 from benoitc/shared-memory

    Add shared memory regions and shared buffers over iommap
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    b8e5cbf View commit details
    Browse the repository at this point in the history
  5. Add architecture, code map and glossary

    A map of the code: processes and threads, the life of a call in each
    context mode, the paths Python uses to call Erlang, which code is live and
    which is legacy, and one meaning per overloaded word (worker, context,
    pool). The stale file list in the NIF headers now points at these pages.
    Also completes the 4.2.0 changelog.
    benoitc committed Aug 29, 2026
    Configuration menu
    Copy the full SHA
    c8f77f0 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #74 from benoitc/docs-architecture

    Add architecture, code map and glossary
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    72128fe View commit details
    Browse the repository at this point in the history
  7. Remove the legacy worker API and its executor (#75)

    Contexts are the only execution path; the per-worker NIFs, the single
    executor thread they ran on, the deprecated async worker NIFs, the unused
    worker pool, the cancel aliases and the unreachable inline executor
    branches of the context NIFs are gone (about 3,000 lines). This removes
    public NIF functions, so the open release becomes 5.0.0. memory_stats and
    gc run under the GIL on the calling scheduler. The generator example uses
    py:stream.
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    50a7610 View commit details
    Browse the repository at this point in the history
  8. Document lock and ownership contracts on the shared structs (#76)

    The py_context_t header still described dirty-scheduler execution
    over a shared-GIL pool. It now says which thread owns each field
    group, what each mutex guards, the lock order, and why a stuck
    context is leaked rather than freed. The event loop struct gets the
    same treatment, and the Erlang modules that own a resource state in
    three lines what they own, who they talk to and what they never do.
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    20705f7 View commit details
    Browse the repository at this point in the history
  9. Add the protocols and state machines pages (#77)

    Every message, frame and status code now has one page saying who
    sends it, what answers it and which files must change together,
    and every long-lived process and thread has its states, triggers
    and timers written down next to the invariants a change must keep.
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    6aafcf6 View commit details
    Browse the repository at this point in the history
  10. Wait on callback pipes with poll, not select (#78)

    select() is undefined for a descriptor above FD_SETSIZE, so a VM
    with more than 1024 open files could not bring up a thread worker
    and every thread callback after that failed with "Failed to spawn
    thread handler". The ready-wait also releases the GIL, and the
    coordinator logs a failed ready signal instead of leaving Python
    to time out.
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    ca7f8a7 View commit details
    Browse the repository at this point in the history
  11. Add the contributing guide (#79)

    Build, test, the FreeBSD VM, and one recipe per kind of change
    (a NIF, an erlang.* function, a context option, a suite, a guide)
    listing every file that change touches, so a contributor can
    finish a change without reading the whole tree first.
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    8e42d42 View commit details
    Browse the repository at this point in the history
  12. Add the decision records (#81)

    Eight records, one per design decision that shapes the code today,
    each with the situation, what was decided, what it costs and where
    the code is, so a change that reverses one is made knowingly.
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    1fb8714 View commit details
    Browse the repository at this point in the history
  13. Collapse the dispatch paths and split the large modules (#82)

    One dispatcher for every context request in C, one NIF table entry
    list per area, one process body module per mode on the Erlang side,
    and a py facade that delegates streaming, venvs and shared dicts to
    their own modules. The thread functions and flags are named for
    what they are rather than for the worker mode they came from. No
    public API changes.
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    e44a0aa View commit details
    Browse the repository at this point in the history
  14. Check the code map against the tree (#83)

    A script, run by make and CI, that fails when a source file is
    missing from docs/code-map.md, an Erlang module has no moduledoc,
    or a module has no row in the new Modules table of the coverage
    audit. Running it once found two modules, seven headers and two
    Python files the map had missed.
    benoitc authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    9458981 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2026

  1. Grant an isolated child what it may reach (#84)

    Isolated mode bounded what Python could consume but nothing it could
    reach: the child held every authority the node's user held. The caps
    option names its directories, environment and addresses, and refuses
    the rest. The model and its vocabulary come from erlang_wasm's WASI
    implementation, so a grant means the same thing in both.
    
    It is a cooperative policy over Python, not a boundary: built on an
    audit hook, it binds Python and not a C extension, and covers only
    what CPython announces. The guide says what holds and what does not,
    and names the kernel work that would change the answer.
    benoitc authored Sep 1, 2026
    Configuration menu
    Copy the full SHA
    58f0d11 View commit details
    Browse the repository at this point in the history
  2. Revert the capability set, and say what isolated mode bounds (#85)

    Enforcing what a child may reach from inside CPython does not
    work: an audit hook never sees a C extension, and the open event
    does not say which directory a relative path resolves against, so
    the containment could be walked around with documented calls. The
    tree returns to 5.0.0 and the guides say plainly that the child
    holds every authority the node's user holds, with the operating
    system mechanisms that do bound it.
    benoitc authored Sep 1, 2026
    Configuration menu
    Copy the full SHA
    581f3fa View commit details
    Browse the repository at this point in the history
Loading