paneflow icon indicating copy to clipboard operation
paneflow copied to clipboard

Flaky on Linux: ghostty_spawn_resize_close_stress_has_no_residual_growth crosses its 5 % RSS budget by 100 to 200 KiB

Open arthjean opened this issue 3 weeks ago • 0 comments

I was certifying the CI hardening epic (EP-004 of tasks/prd-ci-hardening.md), and while reading a red libghostty Linux run on its pull request, I found that terminal::ghostty_stress::ghostty_spawn_resize_close_stress_has_no_residual_growth fails intermittently on its RSS budget.

What happens

Job "Native, release, package (x86_64)" of libghostty Linux, twice in five days, on pull requests that did not touch the terminal code:

Run Date Commit rss_start rss_end rss_limit Growth
42198286020 2026-11-06 fdf0158a4 19,795,968 20,889,600 20,785,766 5.5 %
42826685531 2026-11-10 567770a19 19,099,648 20,246,528 20,054,630 6.0 %
thread 'terminal::ghostty_stress::ghostty_spawn_resize_close_stress_has_no_residual_growth' panicked at src-app/src/terminal/ghostty_stress.rs:793:5:
scenario=cycles phase=resources handles_start=6 handles_end=6 rss_start=19099648 rss_end=20246528 handle_limit=6 rss_limit=20054630

Handles are stable (6 before, 6 after). Only RSS crosses the line, by 101 KiB and 187 KiB. Other runs of the same job pass on the same code.

Where

resource_limits in src-app/src/terminal/ghostty_stress.rs allows the baseline plus 5 % (baseline.rss / 20). On a 19 MiB process that is about 950 KiB of headroom for 200 cycles of 200 resizes, which is within what allocator retention alone can move.

Why it matters

libghostty validation is a required check. Each failure blocks a pull request or the release commit until a rerun, and a growth of 5.5 % to 6 % does not tell a leak from noise.

Options

  • Measure a trend, not two points: sample RSS across the cycles and fail on a slope, so a real leak (which keeps growing) is separated from a one-time plateau.
  • Give the budget an absolute floor (for example 2 MiB) under which a relative overshoot is ignored.
  • Move the RSS budget to the perf gates, which own budgets on one calibrated runner class, and keep the unit test on handles.

Before choosing, run the stress with 400 and 800 cycles: a leak scales with the cycle count, noise does not.

arthjean avatar Nov 11 '26 12:11 arthjean