Skip to content

perf(devtools): bound pytest memory pressure and daemon memory observability #2170

Closed

Description

@Sinity

Problem

Recent local evidence shows Polylogue verification can still produce excessive memory pressure in broad pytest lanes, and daemon memory can be hard to reason about without dropping to ps.

Observed from .cache/verify/runs on 2026-06-19:

  • devtools verify --seed-testmon --skip-slow selected about 11.5k tests with -n 4, peaked at about 3.1 GiB PSS, and wrote about 3.0 GiB of pytest basetemp data.
  • A default devtools verify run selected about 11.3k tests with -n 0, sat in a single Python process at about 2.8 GiB PSS, and hit the 45 minute supervisor timeout.
  • Focused devtools test ... runs stay around 100-140 MiB RSS, so the problem is broad-run harness behavior rather than the ordinary inner loop.
  • The current live installed polylogued process was about 485 MiB RSS. Existing live-ingest attempts record RSS/cgroup fields, but idle/current daemon memory should be easier to inspect when diagnosing pressure.

Scope

Make the verification harness more reliable under broad affected/full runs:

  • avoid retaining or writing unbounded selected/deselected node ID lists in the pytest progress plugin;
  • ensure managed pytest basetemps are cleaned after supervised runs and that cleanup is recorded in run metadata;
  • avoid routing effectively full-suite affected runs through a single Python process by default;
  • keep focused devtools test runs single-process by default;
  • preserve existing process-tree RSS/PSS/resource sampling artifacts.

Investigate daemon memory separately if measurements show a concrete daemon-side retention path beyond normal Python/SQLite/cache residency.

Acceptance Criteria

  • Broad pytest lanes have bounded selection artifacts while preserving exact selected/deselected counts.
  • Default devtools verify no longer uses -n 0 for broad affected-test execution.
  • Verify run metadata records pytest basetemp cleanup outcome.
  • Tests cover the harness behavior rather than asserting rename/absence trivia.
  • PR body reports before/after measurements from the existing run artifacts and focused verification.

Activity

  1. added
    type:perf
    area:devtools
    area:daemon
    theme:verifiability
    on Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:daemonarea:devtoolstheme:verifiabilitytype:perf

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions