[PR #3992] [CLOSED] [GUI] show the MTP draft acceptance per request (MTP ACC column) #4868

Closed
opened 2026-11-07 16:30:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3992
Author: @thisisspartan
Created: 10/24/2026
Status: ❌ Closed

Base: main ← Head: monitor/mtp-acc


📝 Commits (1)

  • 6743eec monitor: show the MTP draft acceptance per request (MTP ACC column)

📊 Changes

4 files changed (+54 additions, -6 deletions)

View changed files

📝 serve/server.py (+5 -1)
📝 serve/test_monitor.py (+42 -1)
📝 serve/web/app.js (+5 -2)
📝 serve/web/index.html (+2 -2)

📄 Description

Problem and result

The engine already reports accepted and offered speculative drafts for each request (the DONE line; drafts_accepted and drafts_offered are stored since #457). The Recent requests table does not show the acceptance rate.
Before: no figure. After: an "MTP ACC" column with accepted / offered as a percentage; the tooltip gives the two counts. A dash when the engine reported no drafts, so an unused draft path is never shown as 0%.

none (additive column and field; no default changed)

Approach

  • serve/server.py: mtp_acc is computed once per request from drafts_accepted / drafts_offered * 100, rounded to one decimal. It is None unless offered > 0 and the engine reported accepted. It is stored in the history record, which /metrics already returns, so the field appears in /metrics requests too.
  • serve/web/app.js: one cell between Output and Prefill t/s; the empty-row colspan goes from 9 to 10.
  • serve/web/index.html: the header cell; the empty-row colspan goes from 9 to 10.
  • Compatibility: one new key in the history and /metrics request records. Existing keys are unchanged.

Validation

Passed:

  • python3 -m unittest serve.test_monitor on a branch built from upstream main 7dd5cf18: 12 tests OK (the 10 existing plus 2 new: MtpAcceptance.test_accepted_share_of_offered_drafts, where 218 of 280 gives 77.9; and MtpAcceptance.test_no_drafts_is_a_dash_not_zero).
  • The same patch applied with git am to a fresh clone of Niko1221/Strata (no other patch): test_monitor 12 OK.
  • node --check serve/web/app.js: exit 0. serve/server.py parses.

Failed:

  • Before the change, both new tests fail with KeyError: 'mtp_acc'.
  • Full suite in CI form (python3 -m unittest discover -s serve -p 'test_*.py', 1036 tests): the failing set changes between runs and includes timing-sensitive tests (test_keepawake, test_lifeline, test_responses NoLeakedSampler, test_queue_wait_and_loading_are_attributed_separately, test_parallel_yield). The same kind of run on clean upstream also failed (test_lifeline, test_queue_wait_…, test_an_admission_…). test_queue_wait_and_loading_are_attributed_separately also fails intermittently on clean upstream: 1 failing run in 8 on 7dd5cf18, 1 in 8 on the patched branch. When run alone, test_keepawake passed 3 of 3 runs on both trees; test_lifeline and test_responses NoLeakedSampler fail alone on clean upstream too.

Not run: rendering of the column in a browser; native builds (CUDA, HIP, SYCL, Metal). The change touches only Python and web files.

Limits

Shows the acceptance the engine reports. The figure exists only when the engine reports drafts (#457).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3992 **Author:** [@thisisspartan](https://github.com/thisisspartan) **Created:** 10/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `monitor/mtp-acc` --- ### 📝 Commits (1) - [`6743eec`](https://github.com/Niko1221/Strata/commit/6743eecf8bf640b86f01b271531cd88ae5410b05) monitor: show the MTP draft acceptance per request (MTP ACC column) ### 📊 Changes **4 files changed** (+54 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+5 -1) 📝 `serve/test_monitor.py` (+42 -1) 📝 `serve/web/app.js` (+5 -2) 📝 `serve/web/index.html` (+2 -2) </details> ### 📄 Description ## Problem and result The engine already reports accepted and offered speculative drafts for each request (the DONE line; `drafts_accepted` and `drafts_offered` are stored since #457). The Recent requests table does not show the acceptance rate. Before: no figure. After: an "MTP ACC" column with accepted / offered as a percentage; the tooltip gives the two counts. A dash when the engine reported no drafts, so an unused draft path is never shown as 0%. ## Related discussion none (additive column and field; no default changed) ## Approach - `serve/server.py`: `mtp_acc` is computed once per request from `drafts_accepted / drafts_offered * 100`, rounded to one decimal. It is `None` unless offered > 0 and the engine reported accepted. It is stored in the history record, which `/metrics` already returns, so the field appears in `/metrics` `requests` too. - `serve/web/app.js`: one cell between Output and Prefill t/s; the empty-row `colspan` goes from 9 to 10. - `serve/web/index.html`: the header cell; the empty-row `colspan` goes from 9 to 10. - Compatibility: one new key in the history and `/metrics` request records. Existing keys are unchanged. ## Validation **Passed:** - `python3 -m unittest serve.test_monitor` on a branch built from upstream main `7dd5cf18`: 12 tests OK (the 10 existing plus 2 new: `MtpAcceptance.test_accepted_share_of_offered_drafts`, where 218 of 280 gives 77.9; and `MtpAcceptance.test_no_drafts_is_a_dash_not_zero`). - The same patch applied with `git am` to a fresh clone of `Niko1221/Strata` (no other patch): `test_monitor` 12 OK. - `node --check serve/web/app.js`: exit 0. `serve/server.py` parses. **Failed:** - Before the change, both new tests fail with `KeyError: 'mtp_acc'`. - Full suite in CI form (`python3 -m unittest discover -s serve -p 'test_*.py'`, 1036 tests): the failing set changes between runs and includes timing-sensitive tests (`test_keepawake`, `test_lifeline`, `test_responses` NoLeakedSampler, `test_queue_wait_and_loading_are_attributed_separately`, `test_parallel_yield`). The same kind of run on clean upstream also failed (`test_lifeline`, `test_queue_wait_…`, `test_an_admission_…`). `test_queue_wait_and_loading_are_attributed_separately` also fails intermittently on clean upstream: 1 failing run in 8 on `7dd5cf18`, 1 in 8 on the patched branch. When run alone, `test_keepawake` passed 3 of 3 runs on both trees; `test_lifeline` and `test_responses` NoLeakedSampler fail alone on clean upstream too. **Not run:** rendering of the column in a browser; native builds (CUDA, HIP, SYCL, Metal). The change touches only Python and web files. ## Limits Shows the acceptance the engine reports. The figure exists only when the engine reports drafts (#457). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:30:58 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4868
No description provided.