Skip to content

Feature: mid-run checkpoint + adaptive downgrade to hybrid touches during analyze #164

Description

@stephenc222

Motivation

Follow-up from #163 (spike on predicting analyze --per-function-touches runtime ahead of time). Discussed there: a pre-flight runtime estimate is one way to avoid timeout crashes on large repos (see golang/go failing hotspots-cloud's 900s budget at 445MB — under its 500MB size-based cutoff for hybrid-touches routing).

This ticket tracks a different, complementary approach that doesn't depend on getting a predictive model right: make analyze self-correcting at runtime instead of requiring callers to predict cost upfront.

Proposal

While running --per-function-touches, track progress (functions processed / total, elapsed time) and expose a way to auto-downgrade to hybrid touches mid-run if the observed processing rate projects past a caller-supplied budget (e.g. --budget-seconds). This avoids:

Notes

  • This is a concrete feature, not research — no spike needed before scoping it, though it pairs well with whatever comes out of Spike: predict analyze runtime ahead of time to avoid timeout crashes on large repos #163 (a rough pre-flight estimate could set a smarter default budget, but isn't required for this to work).
  • Callers like hotspots-cloud currently guess the touch mode upfront from size_kb and hope the fixed external wall-clock timeout doesn't fire; a --budget-seconds + adaptive downgrade would let hotspots itself gracefully degrade instead of being killed from outside.

Related

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions