tractor/ai/conc-anal
Gud Boi e143539b1c Add `subint_forkserver` PEP 684 audit-plan doc
Follow-up tracker companion to the module-docstring TODO
added in `372a0f32`. Catalogs why `_subint_forkserver`'s
two "non-trio thread" constraints
(`fork_from_worker_thread()` +
`run_subint_in_worker_thread()` both allocating dedicated
`threading.Thread`s; test helper named
`run_fork_in_non_trio_thread`) exist today, and which of
them would dissolve once msgspec PEP 684 support ships
(`msgspec#563`) and tractor flips to isolated-mode subints.

Deats,
- three reasons enumerated for the current constraints:
  - class-A GIL-starvation — **fixed** by isolated mode:
    subints don't share main's GIL so abandoned-thread
    contention disappears
  - destroy race / tstate-recycling from `subint_proc` —
    **unclear**: `_PyXI_Enter` + `_PyXI_Exit` are
    cross-mode, so isolated doesn't obviously fix it;
    needs empirical retest on py3.14 + isolated API
  - fork-from-main-interp-tstate (the CPython-level
    `_PyInterpreterState_DeleteExceptMain` gate) — the
    narrow reason for using a dedicated thread; **probably
    fixed** IF the destroy-race also resolves (bc trio's
    cache threads never drove subints → clean main-interp
    tstate)
- TL;DR table of which constraints unwind under each
  resolution branch
- four-step audit plan for when `msgspec#563` lands:
  - flip `_subint` to isolated mode
  - empirical destroy-race retest
  - audit `_subint_forkserver.py` — drop `non_trio`
    qualifier / maybe inline primitives
  - doc fallout — close the three `subint_*_issue.md`
    siblings w/ post-mortem notes

Also, cross-refs the three sibling `conc-anal/` docs, PEPs
684 + 734, `msgspec#563`, and `tractor#379` (the overall
subint spawn-backend tracking issue).

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code

(cherry picked from commit cf2e71d87f)
2026-06-24 19:54:25 -04:00
..
fork_thread_semantics_execution_vs_memory.md Add posix-multithreaded-`fork()` explainer doc 2026-06-17 13:45:31 -04:00
spawn_time_boot_death_dup_name_issue.md Add boot-race conc-anal, widen `xfail` to `n_dups=8` 2026-06-17 17:39:44 -04:00
subint_cancel_delivery_hang_issue.md Doc `subint` backend hang classes + arm `dump_on_hang` 2026-06-24 19:54:25 -04:00
subint_fork_blocked_by_cpython_post_fork_issue.md Doc `subint_fork` as blocked by CPython post-fork 2026-06-24 19:54:25 -04:00
subint_fork_from_main_thread_smoketest.py Add trio-parent tests for `_subint_forkserver` 2026-06-24 19:54:25 -04:00
subint_forkserver_thread_constraints_on_pep684_issue.md Add `subint_forkserver` PEP 684 audit-plan doc 2026-06-24 19:54:25 -04:00
subint_sigint_starvation_issue.md Expand `subint` sigint-starvation hang catalog 2026-06-24 19:54:25 -04:00
test_register_duplicate_name_daemon_connect_race_issue.md Add `test_register_duplicate_name` race analysis 2026-06-17 13:45:31 -04:00
trio_033_cancel_cascade_slowdown_depth3_issue.md Bump trio depth=3 cancel timeout 6→12s 2026-06-17 17:39:44 -04:00
trio_wakeup_socketpair_busy_loop_under_fork_issue.md Add `tractor.trionics.patches` subpkg + first fix 2026-06-17 17:39:44 -04:00