Skip to content

Commit 5513111

Browse files
authored
Merge pull request #400 from thisisthepy/feat/ft-315-docs
Docs: first 3.15t desktop CI run; 3.15.0 changes to brc and the GC gate (#158)
2 parents bc9a2e3 + 7c39eba commit 5513111

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎docs/investigations/gc-scheduling-investigation.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ return and that the refcount did not move).
6060

6161
## 2. Free-threading: biased reference counting, and the queue only the eval loop drains
6262

63+
> **Update for 3.15.0 (2026-11-13, #398).** This section describes 3.14.7. In CPython 3.15.0,
64+
> `_Py_brc_queue_object` gained a second path (`Python/brc.c:118`, `_PyThreadState_TrySuspendDetached`):
65+
> when the owning thread is detached, the queuing thread merges the owner's queue on its behalf and frees
66+
> what reaches zero. An embedder's thread is detached between `withGIL` scopes, so on 3.15t a cleaner's
67+
> releases can be reclaimed without the owner reaching the eval loop. `EvalCheckpointTest` asserts the
68+
> 3.15.0 behaviour. Whether this lowers the need for `autoDrainInterval` (ROADMAP 9.1) is not measured.
69+
6370
On a free-threaded build `Py_DECREF` branches on whether the thread owns the object (`ob_tid`):
6471
owner decrements `ob_ref_local` and may `tp_dealloc` at once; a non-owner decrements
6572
`ob_ref_shared` atomically, and if that takes it to zero the object is queued to its owner by
@@ -188,6 +195,12 @@ the finding.
188195

189196
### 8d. Answered: the checkpoint is fine, the collector asks a second question
190197

198+
> **Update for 3.15.0 (2026-11-13, #398).** The table below is v3.14.7. In v3.15.0 the process-memory gate
199+
> is gone (`gc_should_collect_mem_usage`, `get_process_mem_usage`, `last_mem` and `deferred_count` were
200+
> removed): `gc_should_collect` (`Python/gc_free_threading.c:1996`) checks only the young threshold,
201+
> `old[0].threshold == 0` (`:2004`) and `long_lived_total / 4` (`:2009`). `FreeThreadedGCGateTest` asserts
202+
> that process footprint no longer moves the gate. The 8a to 8c measurements were not repeated on 3.15t.
203+
191204
Source-confirmed asymmetry (v3.14.7):
192205

193206
| | GIL (`gc.c`) | free-threaded (`gc_free_threading.c`) |

‎docs/roadmap/ROADMAP.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,13 @@ Desktop (JVM, `macosArm64`, `linuxX64`) embeds the free-threaded CPython 3.15t a
165165
kept as an option. Baseline is CPython 3.15t"; leader, 2026-11-13: "flip the desktop default to 3.15t
166166
now, before the #377 alpha03 release"). `-PpythonFreeThreaded` is removed; the build fails if it is
167167
passed. Android and iOS still embed the GIL 3.15 (9.2), wasm GIL (#175); the per-platform fact is
168-
`embedsFreeThreadedPython` (SPEC T-1). The 3.15t default has not yet been observed running the desktop
169-
suite; the last recorded free-threaded run is 3.14t as an opt-in: 236 tests, 0 failures, 1 skipped, the
170-
same count as the GIL build (table at `4ed98143:docs/roadmap/ROADMAP.md`:1013; SPEC T-2). Deferred deallocation is
168+
`embedsFreeThreadedPython` (SPEC T-1). The 3.15t default first ran the suites in CI on 2026-11-13: Desktop CI
169+
run 43306301208 counted `desktopTest` 647 tests, 3 failed, 1 skipped, and `linuxX64Test` 497 tests, 3 failed.
170+
All six failures were tests asserting GIL-build or 3.14t behaviour (a `sys.getrefcount` that includes the
171+
deferred-refcount bias, 3.15.0's detached-owner merge in `brc.c`, the removed GC memory gate, a probe
172+
reading `ob_tid` as the refcount). They were corrected in #398 with no product change, and run 43329515729
173+
passed (Gradle prints no count on success). The earlier free-threaded record is 3.14t as an opt-in: 236
174+
tests, 0 failures, 1 skipped (table at `4ed98143:docs/roadmap/ROADMAP.md`:1013; SPEC T-2). Deferred deallocation is
171175
drained by the eval-loop checkpoint (`PM/commonTest/.../ref/EvalCheckpointTest.kt`,
172176
`docs/investigations/gc-scheduling-investigation.md`); `FreeThreadedGCGateTest` guards the GC probe.
173177
The 3.15 migration (`PyWeakref_GetRef`, the two removed functions) is done

0 commit comments

Comments
 (0)