Report whether a predict used the cached context or restored it (cache_outcome)

Fermée
#112 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@sunxiuguo y travaille déjà.

Depuis le 5/11/2026.

  • #115 par @sunxiuguo — ouverte

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
python
Domaine
api, backend

Piste de recherche

Read src/tabctx/serve/service.py and src/tabctx/engine.py to trace how restore counts reach the predict response, then check src/tabctx/client.py for the result model. Use tests/unit/test_standalone_service.py for the hit case and tests/unit/test_spill.py to find how to trigger a spill. Done when both outcomes are reported correctly and the unit suite passes.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area/api enhancement good first issue

A predict response says how long it took (latency_ms, timings_ms) but not whether the cached context was used as is, restored from the disk tier, or missing. Users can't see evictions, and slow restores look like slow predicts. (Item 3 of #46.)

What to do

  • Add cache_outcome: "hit" | "restored" to TabctxPredictResponse in src/tabctx/serve/service.py.
  • The engine already knows: TabctxEngine.predict counts restores with timing.count("restores") (src/tabctx/engine.py). Carry that through to the response; for coalesced requests the batch's outcome applies to all members.
  • Show it in PredictResult in src/tabctx/client.py (with a default, at the end).
  • Tests: tests/unit/test_standalone_service.py (a hit), and a spill test that restores (see tests/unit/test_spill.py for how to force a spill).

Done when

  • A predict right after a fit reports hit; one after the context was spilled reports restored.
  • uv run pytest tests/unit -n auto passes.
Langage dominant
Python
Étoiles
1
Forks
3
Merge moyen
6 h 16 min
PR mergées (30 j)
71

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de VectorInstitute/tabctx

Toutes les issues de VectorInstitute/tabctx

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.