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

クローズ
#112 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@sunxiuguo がすでに取り組んでいます。

2026年11月5日 から。

  • #115 @sunxiuguo による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
api, backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Python
スター
1
フォーク
1
平均マージ
6時間 16分
マージ済み PR(30日)
71

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

VectorInstitute/tabctx のほかの issue

VectorInstitute/tabctx の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。