本書は日本語を正本とし、英語は参照用の補助訳とする。 解釈に差異がある場合は日本語版を優先する。
This document uses Japanese as the authoritative version. The English text is provided as a supporting reference translation. If any discrepancy exists, the Japanese version takes precedence.
本書は CX_FRAMEWORK.md の読み方のルールに従う。
must: 必須要件should generally: 基本原則should: 推奨may later: 将来拡張
This document follows the reading conventions defined in CX_FRAMEWORK.md.
本書は ESTIMATION_SPEC.md の下位仕様であり、既存の benchmark result を再入力として推定をやり直す再推定フローを定義する。
This document is a lower-level specification under ESTIMATION_SPEC.md. It defines the re-estimation flow that reruns estimation using an existing benchmark result as input.
再推定の目的は、同じ benchmark result に対して推定方式、推定モデル、推定条件、将来システム仮定を変更しながら比較可能な推定結果を得ることである。
主な用途は以下である。
- 推定モデル更新後の再評価
- 推定条件変更後の再評価
- 軽量推定と詳細推定の比較
- 将来システム仮定を変えた比較
- AI 駆動最適化での評価関数更新後の再評価
The purpose of re-estimation is to obtain comparable estimation results for the same benchmark result while varying the estimation method, estimation model, estimation conditions, or future-system assumptions.
Typical use cases include:
- re-evaluation after updating an estimation model
- re-evaluation after changing estimation conditions
- comparison between lightweight and detailed estimation
- comparison under different future-system assumptions
- re-evaluation after updating an AI-driven optimization objective
再推定では、入力となる benchmark result を明示的に固定しなければならない。
この識別には、少なくとも result の UUID を用いることを基本とする。
再推定の利用者向け入口は estimate_result_uuid に統一する。BenchKit はその estimate が保持する source_result_uuid を内部的に解決し、元 result を辿る。
In re-estimation, the input benchmark result must be explicitly fixed.
The documented user-facing entrypoint is estimate_result_uuid.
BenchKit internally resolves the original benchmark result through the source_result_uuid stored in that estimate.
再推定結果は、元の benchmark result と結び付けられ、かつ複数の推定結果同士を比較できるようにしなければならない。
Re-estimation results must remain linked to the original benchmark result and must be comparable against other estimation results derived from the same input.
再推定は、推定方式の差し替え可能性を前提とする。 すなわち、同じ UUID に対して、軽量推定、詳細推定、外部モデル推定などを並存させられることが望ましい。
Re-estimation assumes replaceable estimation methods. For the same UUID, it should preferably support coexistence of lightweight estimation, detailed estimation, and external-model-based estimation.
再推定では、指定した推定方式に必要な入力が、元の benchmark result および関連データから取得可能かを判定できることが望ましい。
必要入力が不足する場合、再推定は少なくとも以下のいずれかとして扱わなければならない。
- 不適用
- フォールバック実行
- 再計測または追加準備待ち
不足した入力を暗黙に無視して成功扱いの推定結果を返してはならない。
Re-estimation should preferably be able to evaluate whether the required inputs for a requested estimation method are available from the original benchmark result and related data.
When required inputs are missing, re-estimation must treat the situation as at least one of the following:
- not applicable
- fallback execution
- waiting for re-measurement or additional preparation
It must not silently ignore missing inputs and still report a successful estimate.
BenchKit における再推定の典型フローは以下である。
- 利用者またはワークフローが
estimate_result_uuidを指定する - BenchKit は estimate JSON を取得し、そこから
source_result_uuidを解決する - BenchKit が対応する Result JSON を取得する
- 対象 app の
estimate.shを起動する Estimate JSONを生成する- 生成結果を保存し、ポータルで参照可能にする
The typical re-estimation flow in BenchKit is:
- a user or workflow specifies an
estimate_result_uuid - BenchKit fetches the estimate JSON and resolves
source_result_uuid - BenchKit fetches the corresponding Result JSON
- the app-specific
estimate.shis invoked - an
Estimate JSONis generated - the generated result is stored and made available through the portal
再推定では少なくとも以下を入力として扱う。
estimate_result_uuidcode
必要に応じて以下を追加で与えてよい。
- 推定方式識別子
- 将来システム識別子
- 推定条件
- 比較基準条件
- フォールバック方針
At minimum, re-estimation uses the following inputs:
estimate_result_uuidcode
Optionally, the following may also be supplied:
- estimation-method identifier
- future-system identifier
- estimation conditions
- baseline-selection conditions
- fallback policy
現行実装では、以下の要素が存在する。
scripts/estimation/run.shが app ごとのestimate.shを呼び出すscripts/result_server/send_estimate.shが推定結果を結果サーバに送信する- Estimate JSON には推定元 benchmark result の UUID を
estimate_metadata.source_result_uuidとして保持できる - Estimate JSON には保存対象としての推定結果自体の UUID / timestamp を
estimate_metadata.estimation_result_uuid/estimation_result_timestampとして保持できる requested_estimation_packageと実際に適用されたestimation_packageを区別できるapplicabilityを通じてapplicable、partially_applicable、fallback、not_applicableを最終状態として保持できる
In the current implementation, the following already exist:
scripts/estimation/run.shto invoke app-specificestimate.shscripts/result_server/send_estimate.shto send estimation results to the result server- the ability to retain the source benchmark-result UUID as
estimate_metadata.source_result_uuid - the ability to retain the estimate-result UUID / timestamp as
estimate_metadata.estimation_result_uuid/estimation_result_timestamp - a distinction between
requested_estimation_packageand the actually appliedestimation_package - final-state applicability recording through
applicable,partially_applicable,fallback, andnot_applicable
現時点では、re-estimation で
- source result JSON の再取得
- server 側に保存された detailed estimation-input artifact の復元
- 復元 artifact を用いた detailed 再推定 まで実装済みである。
ただし、artifact が server 側に存在しない場合は、
- artifact 不要な lightweight 再推定は成立しうる
- artifact を要求する detailed 再推定は
not_applicableで終わりうる
At present, re-estimation can:
- re-fetch the source result JSON
- restore stored detailed estimation-input artifacts
- execute detailed re-estimation using the restored artifacts
However, when those artifacts do not exist on the server:
- lightweight or artifact-free re-estimation may succeed
- detailed re-estimation that depends on missing artifacts may terminate as
not_applicable
再推定を estimate_result_uuid 起点で運用するには、少なくとも次の取得口が必要である。
- estimate result UUID で estimate JSON を返す取得 API
- estimate JSON に記録された
source_result_uuidに基づいて Result JSON を返す取得 API source_result_uuidに対応する estimation input artifact を返す取得 API
現時点では、再推定の shell フローと取得口自体は実装済みである。 一方で、取得 API の公開方針、認証条件、portal や compare UI からの見せ方は文書としてまだ十分に整理されていない。
したがって、以下を明確化する必要がある。
- UUID で Result JSON を返す取得 API
- 認証要否
- confidential 結果の扱い
- 取得失敗時の振る舞い
Re-estimation from estimate_result_uuid requires retrieval paths for:
- Estimate JSON by estimate-result UUID
- Result JSON through the resolved
source_result_uuid - estimation-input artifacts associated with that source result
At present, the shell-side re-estimation flow and these retrieval endpoints exist, but the exposure rules, authentication conditions, and portal-facing documentation are not yet fixed clearly enough in the documents.
The following therefore need to be clarified:
- the exposure policy of the retrieval APIs
- whether authentication is required
- how confidential results are handled
- behavior on retrieval failure
再推定結果には、少なくとも以下を含めることが望ましい。
- 元の benchmark result UUID
- 推定方式識別子
- 推定パッケージ識別子
- 推定実行時刻
- 保存対象としての推定結果 UUID / timestamp
- requested / applied package の識別
これにより、同じ benchmark result から複数回再推定した履歴を区別しやすくする。
Re-estimation results should preferably include at least:
- the UUID of the original benchmark result
- an estimation-method identifier
- an estimation-package identifier
- the estimation execution timestamp
- the estimate-result UUID / timestamp as a stored object
- a distinction between requested and applied package identities
This makes it easier to distinguish multiple re-estimations from the same benchmark result.
現時点では、推定結果一覧と基本メタデータ表示は存在するが、同じ benchmark result から派生した複数推定結果を比較する前提の表示仕様はまだ弱い。
At present, estimated results can be listed, but display semantics for comparing multiple estimation results derived from the same benchmark result are still weak.
現時点では、推定方式を変更した際に、その方式に必要な詳細カウンター、アノテーション区間時間、補助入力ファイルなどが不足していた場合の再推定 UI / 比較表示の扱いが十分に仕様化されていない。
少なくとも以下を明確化する必要がある。
- 不適用として終了する条件
- 軽量方式へフォールバックしてよい条件
- 再計測や追加準備を要求する条件
- その判定結果を Estimate JSON やポータルへどう残すか
At present, the handling of missing detailed counters, annotated interval timings, or auxiliary input files required by a changed estimation method is not specified well enough.
At least the following need to be clarified:
- conditions for terminating as not applicable
- conditions under which fallback to a lighter method is allowed
- conditions that require re-measurement or additional preparation
- how the decision should be recorded in Estimate JSON and the portal
BenchKit における再推定は、少なくとも以下を満たすことが望ましい。
estimate_result_uuid指定で benchmark result を再取得できること- app ごとの
estimate.shを同じ入力に対して繰り返し実行できること - 再推定結果に、元 benchmark result UUID を残せること
- 異なる推定方式を同じ benchmark result に対して併存させられること
- 軽量推定と詳細推定を同一の比較軸で扱えること
- 必要入力不足時に、不適用・フォールバック・再計測要求を明示できること
Re-estimation in BenchKit should preferably satisfy at least:
- the benchmark result can be re-fetched from
estimate_result_uuid - app-specific
estimate.shcan be run repeatedly for the same input - the re-estimation result can retain the original benchmark-result UUID
- different estimation methods can coexist for the same benchmark result
- lightweight and detailed estimation can be compared along the same comparison axis
- insufficient inputs can be reported explicitly as not applicable, fallback, or re-measurement required
- detailed re-estimation should be able to restore estimation-input artifacts associated with the source result
当面の再推定では、artifact 復元を次の流れで扱う。
estimate_result_uuidから開始し、estimate JSON からsource_result_uuidを解決する- source result JSON を取得する
received_estimation_inputs/<result-stem>/が存在する場合は、その内容をresults/estimation_inputs/に復元する- server 側に estimation input artifact が無い場合は、artifact 不要な推定のみを許可し、必要な推定は
not_applicableとする
Current restoration should follow this flow:
- if starting from
estimate_result_uuid, resolvesource_result_uuidfrom the estimate JSON - fetch the source result JSON
- if
received_estimation_inputs/<result-stem>/exists, restore its contents intoresults/estimation_inputs/ - if no stored estimation inputs exist, allow only methods that do not require them; otherwise terminate as
not_applicable
次に候補となる実装は以下である。
- 再推定向け取得 API の公開方針と認証条件を文書化する
- 同一
source_result_uuidを軸にした比較表示仕様を定義する reestimationブロックを portal / compare UI で活かす- portal から再推定を起動する要求フローを定義する
Candidate next steps include:
- document the exposure policy and authentication conditions of the re-estimation retrieval APIs
- define a display specification for comparing re-estimation results using
source_result_uuid - surface the
reestimationblock in portal / compare UI - define a portal-driven request flow for starting re-estimation
現時点の BenchKit では、再推定について次が成立している。
- 利用者向け入口として
estimate_result_uuidを使える estimate_result_uuidから stored estimate JSON を取得し、そこからsource_result_uuidを解決できる- source result JSON を結果サーバから再取得できる
received_estimation_inputs/<result-stem>/から detailed estimation input artifact を復元できる- 復元した artifact を使って detailed re-estimation を実行できる
- 保存済み estimate JSON に
reestimationブロックを持てる reestimationの既定値としてscope=bothとbaseline_policy=reuse-recorded-baselineを持てる
利用者向けの再推定入口は estimate_result_uuid に統一する。
- 既存の estimate を見て「これを再推定したい」という操作に最も自然である
- compare UI や portal からの起動とも整合しやすい
- どの estimate を起点にした再推定かを明示しやすい
再推定の入口として文書化するのは estimate_result_uuid のみとする。
GitLab trigger API を使う場合、再推定専用トリガでは少なくとも code と estimate_result_uuid を渡す。
curl -X POST --fail \
-F token=$TOKEN \
-F ref=develop \
-F "variables[code]=qws" \
-F "variables[estimate_result_uuid]=e9f72d1b-1a83-450e-bb46-4ee47e4e41e4" \
-F "variables[reestimation_reason]=package-update" \
https://gitlab.example.com/api/v4/projects/PROJECT_ID/trigger/pipeline