feat(timing): time garbage-collection pauses in the frame stats (#722)

A GcMonitor in src/common/frame_timing.py, installed once per process from gc.callbacks by the display manager (and render_bench), counts collections and seconds per generation, the longest, and those of 20 ms or more. A long one tags the next presented frame 'gc' in record(), so frame_soak shows its late rate under 'after work'; the stats file gains an additive 'gc' block printed as a 'Garbage collection' line; and a Render stall dump says when a long collection ran inside the stall. Diagnostic only: nothing tunes, freezes or disables the collector.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-10-01 21:29:08 -04:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 85be4bf25d
commit 5aa7a63127
7 changed files with 288 additions and 4 deletions
+14
View File
@@ -19,6 +19,20 @@ accepts both, but the store flags the old spelling as deprecated
## Unreleased
### Garbage-collection pauses in the frame stats
- The display now times every Python garbage collection
(`src.common.frame_timing.GcMonitor`, installed once per process from
`gc.callbacks`). The collector stops every thread while it runs, and a
long one looked like any other render stall. A collection of 20 ms or more
tags the next presented frame `gc`, so `scripts/frame_soak.py` shows its
late rate under *after work*; the stats file gains an additive `gc` block
(collections and seconds per generation, the longest, the long ones),
which the soak report prints as a "Garbage collection" line; and a
`Render stall` dump says when a long collection ran inside the stall.
`scripts/render_bench.py` records the same. Diagnostic only: nothing tunes,
freezes or disables the collector.
### Outlined text: one rasterization
- New `draw_text_outlined(draw, xy, text, font, fill, outline_color=(0, 0,