serve: STRATA_SPEC_DEPTH=1 prints the MTP drafts tested and accepted by depth for each request
The per-request totals (drafts accepted / offered) hide where a window ends. With STRATA_SPEC_DEPTH=1 the serve loop counts, for the windows drafted by the MTP layer, how many times draft 0, 1, 2 ... was tested (every earlier draft was kept) and how many of those were kept, and prints one stderr line per request. Off by default; nothing else changes.
This commit is contained in:
1 parent
efe7839905
commit
0ab663fc20
1 file changed
+8
@@ -9048,6 +9048,7 @@ int main(int argc, char** argv) {
|
||||
int64_t produced_n = 0, sfx_windows = 0, sfx_drafts = 0, sfx_ok = 0;
|
||||
int64_t chain_windows = 0, chain_drafts = 0, chain_ok = 0; // --lookup-chain's own counts
|
||||
int64_t t2_rej[8] = {}, t2_hit[8] = {}; // STRATA_MTP_TOP2: rejections inside the MTP drafts by depth, runner-up hits
|
||||
int64_t dp_tested[8] = {}, dp_ok[8] = {}; // STRATA_SPEC_DEPTH=1: MTP drafts tested / accepted by depth
|
||||
std::vector<int32_t> cbuf((size_t) S, 0), ctail;
|
||||
strata::spec::PromptLookupSource lookup_src(sfx);
|
||||
static const bool chain_fixed = std::getenv("STRATA_LOOKUP_CHAIN_FIXED") != nullptr; // no policy gate
|
||||
@@ -9749,6 +9750,8 @@ int main(int argc, char** argv) {
|
||||
while (a < T - 1 && window[(size_t) a + 1] == outv[(size_t) a]) ++a;
|
||||
if (from_sfx) { ++sfx_windows; sfx_drafts += T - 1; sfx_ok += a; }
|
||||
if (chain_n > 0) { ++chain_windows; chain_drafts += chain_n; chain_ok += std::max(0, a - (T_mtp - 1)); }
|
||||
if (!from_sfx && !first_window)
|
||||
for (int d = 0; d < T_mtp - 1 && d < 8 && d <= a; ++d) { ++dp_tested[d]; dp_ok[d] += d < a; }
|
||||
if (strata::core::MtpDrafter::top2_env() && !from_sfx && !first_window && a < T_mtp - 1 && a < 8) {
|
||||
++t2_rej[a];
|
||||
if (mtp.top2(a) == outv[(size_t) a]) ++t2_hit[a];
|
||||
@@ -10107,6 +10110,11 @@ int main(int argc, char** argv) {
|
||||
if (o.lookup_chain > 0)
|
||||
std::fprintf(stderr, "strata serve: lookup chain: %lld of %lld windows, %lld of %lld chained drafts accepted\n",
|
||||
(long long) chain_windows, (long long) dec_windows, (long long) chain_ok, (long long) chain_drafts);
|
||||
if (std::getenv("STRATA_SPEC_DEPTH") != nullptr)
|
||||
std::fprintf(stderr, "strata serve: spec depth: accepted/tested %lld/%lld %lld/%lld %lld/%lld %lld/%lld %lld/%lld\n",
|
||||
(long long) dp_ok[0], (long long) dp_tested[0], (long long) dp_ok[1], (long long) dp_tested[1],
|
||||
(long long) dp_ok[2], (long long) dp_tested[2], (long long) dp_ok[3], (long long) dp_tested[3],
|
||||
(long long) dp_ok[4], (long long) dp_tested[4]);
|
||||
if (strata::core::MtpDrafter::top2_env())
|
||||
std::fprintf(stderr, "strata serve: mtp top2: rejected/runner-up by depth %lld/%lld %lld/%lld %lld/%lld %lld/%lld "
|
||||
"of %lld windows\n", (long long) t2_rej[0], (long long) t2_hit[0], (long long) t2_rej[1],
|
||||
|
||||
Reference in new issue
Block a user