Skip to content

bench: drafting.serve says which of four states it is in, so a lost log cannot read as "did not draft" (#1237) - #1238

Merged
bong-water-water-bong merged 2 commits into
mainfrom
1bit/hyperloom-draft-observed
Nov 6, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
1bit/hyperloom-draft-observed

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Closes #1237.

Root cause

drafting_observed() (the drafting.serve half of #1063) returned None for three different states: the server stated there was no spec implementation, the log carried nothing either way, and the log could not be read. The first is a measured claim ("this arm did not draft"), the third is the absence of one ("nobody knows"). Inside the artifact they were the same value.

Measured before/after

Real arm, this box, 2026-11-05 22:53 — ~/hyperloom-ws/window-20261105/arm_74_longctx_mtp0_repeat.json: 27B UD-Q4_K_XL, 20,480 ctx, HL_MTP_MAX=0, 7.7571 tok/s decode at 18,762 ctx, gate PASS (KLD 0, texts identical). Its serve.log says, verbatim:

0.48.901.174 I spec common_specu: no implementations specified for speculative decoding

and the artifact recorded drafting: {"requested": {"HL_MTP_MAX": "0"}, "serve": null} — the same null an unreadable log produces. That row is the non-drafting half of this lane's headline comparison (drafting-off mean 7.889 vs drafting-on mean 12.75 = +61 % at 18.8k), so the number a reader would quote for "the drafting head is worth +61 %" could not itself prove it had not drafted.

Reproducer, against the real logs, before the fix:

drafting ON (baseline arm)  -> {'spec_type': 'draft-mtp', 'recipe': 'qwen35-mtp-max-3', …, 'accept_rate_last': 0.6746}
HL_MTP_MAX=0 arm            -> None
serve.log missing           -> None      <- equal to the row above

After the fix, same real logs:

drafting ON       -> status=drafted     (+ spec_type/recipe/acceptance keys unchanged)
HL_MTP_MAX=0 arm  -> status=not-drafted
serve.log missing -> status=unreadable
silent log        -> status=no-evidence

What changed

drafting.serve always carries a status — drafted, not-drafted, no-evidence, unreadable — and the drafting evidence keys are unchanged wherever drafting was observed. not-drafted is read from serve's own positive line (no implementations specified for speculative decoding) instead of from an absence; unreadable replaces the silent None that "nobody knows" used to share with "measured as off". README's HL_MTP_MAX row documents the four states.

Verification

  • python3 tests/hyperloom_benchmark_test.py → hyperloom_benchmark_test: OK rc=0.
  • The test fails on the unfixed file (KeyError: 'status', line 344) and passes here — checked by stashing benchmark.py and re-running.
  • It asserts the four statuses are mutually distinct, i.e. not-drafted != unreadable specifically, which is the assertion that did not exist before.
  • python3 tools/copyright.py --check → rc=0.
  • Device-free: no GPU claim, no measurement, no lever touched, 3 files +43/−8.

Not in scope

drafting.observed vs drafting_identity() merging: drafting_identity() still returns {} when no drafter file was named, which is correct (the pin drafts with the model's own head, so "no file named" is not "no drafting") — serve.status is now the field that answers the drafting question, and requested answers the lever question.

… log cannot read as "did not draft"

`drafting_observed()` returned `None` for three different things: a serve.log the
server filled with drafting evidence, a log that carried nothing either way, and
a log that could not be read at all. Two of those are opposite claims and one is
the absence of a claim.

Measured on this box 2026-11-05 22:53 (27B UD-Q4_K_XL, 20,480 ctx, HL_MTP_MAX=0,
window-20261105/arm_74_longctx_mtp0_repeat.json, 7.7571 tok/s decode at 18,762
ctx): that arm's serve.log says `spec common_specu: no implementations specified
for speculative decoding` -- the server stating drafting was off -- and the
artifact recorded `drafting.serve: null`, identical to what an unreadable log
produced. The box's own non-drafting long-context row was therefore
indistinguishable, inside the artifact, from a row whose log was lost; the only
way to tell them apart was to read serve.log by hand. Same class as #1062 (an
unrecorded drafting default) one level down: the record cannot say what it
measured.

Reproducer, before the fix, against the real logs:

  drafting ON (baseline arm)  -> {'spec_type': 'draft-mtp', …, 'accept_rate_last': 0.6746}
  HL_MTP_MAX=0 arm            -> None
  serve.log missing           -> None      <- equal to the row above

Fix: the return value always carries a `status` of `drafted` / `not-drafted` /
`no-evidence` / `unreadable`. `not-drafted` is read from serve's own positive line
rather than from an absence, `unreadable` replaces the silent `None` that "nobody
knows" used to share with "measured as off", and the evidence keys are unchanged
whenever drafting was observed. After the fix, on the same real logs:

  drafting ON      -> status=drafted     (+ spec_type/recipe/acceptance unchanged)
  HL_MTP_MAX=0 arm -> status=not-drafted
  serve.log missing-> status=unreadable
  silent log       -> status=no-evidence

The test asserts the four statuses are distinct and that `not-drafted` !=
`unreadable` specifically; it fails on the unfixed file (`KeyError: 'status'`,
line 344) and passes here.

Device-free: no GPU, no measurement, no lever touched.

Closes #1237
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

#1238 ready for review at bdaccda — one file of logic, its test, one README row. Reproducer is a real artifact from this box (arm_74_longctx_mtp0_repeat.json); the test fails on the unfixed file and passes here. Device-free, no lever touched, closes #1237.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY at bdaccdab.

The four states are four states — driven with my own fixtures through drafting_observed() on this tree (not the
committed test's):

drafted (acceptance + spec line)     -> {'status': 'drafted', 'spec_type': 'draft-mtp', 'recipe': 'x', 'recipe_args': 'y',
                                        'tasks_reporting': 1, 'accept_rate_last': 0.67, 'accepted_last': 100, …}
not-drafted (the server says so)     -> {'status': 'not-drafted'}
no-evidence (log read, carries nothing) -> {'status': 'no-evidence'}
unreadable (missing file)            -> {'status': 'unreadable'}

That is the whole point of the PR: the row that reads "did not draft" and the row whose log was lost used to serialise as
the same null, and now the first is a claim the server makes and the second is explicitly "nobody knows". python3 tests/hyperloom_benchmark_test.py -> hyperloom_benchmark_test: OK, rc 0.

The mechanism is the right one to have picked: not-drafted is keyed on the server's own sentence
(no implementations specified for speculative decoding, matched case-insensitively) rather than on the absence of
evidence, so a quieter build degrades to no-evidence instead of claiming a non-drafting measurement. And the README's
lever table (custom/README.md:150) documents all four names, so the schema is written where the lever is described, not
only in the code.

One thing to know before the first cycle that mixes artifacts: this changes the field's shape, null -> an object with
a status key. Nothing in this tree tests drafting["serve"] is None (grepped tools/ and tests/), so nothing breaks
here, but every artifact from before this PR still carries null — a reader that consumes a mixed directory has two shapes
to handle, and the README sentence "its status says which of the four cases the row is in" is true only for rows written
from now on. One clause there ("rows written before c30 carry null") would close it.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

1237 - Partially compliant

Compliant requirements:

  • The drafting.serve field now distinguishes between the three states: drafted, not-drafted, no-evidence, and unreadable.
  • The artifact can now differentiate between a lost log and a log that explicitly states drafting is off.
  • The fix ensures that "unknown" is no longer serialized as a measurement.

Non-compliant requirements:

  • None

Requires further human verification:

  • None
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect Status Handling

The function drafting_observed previously returned None for multiple states, making it impossible to distinguish between a log that explicitly states drafting is off and one that could not be read. This has been fixed by introducing a status field with specific values (drafted, not-drafted, no-evidence, unreadable) to accurately reflect the state of the serve log.

    return {"status": "unreadable"}
accs = [(float(a), int(acc), int(gen), float(ln))
        for a, acc, gen, ln in DRAFT_ACC_RE.findall(text)]
spec, recipe = DRAFT_SPEC_RE.search(text), DRAFT_RECIPE_RE.search(text)
if not accs and not spec and not recipe:
    return {"status": "not-drafted" if DRAFT_NONE_RE.search(text) else "no-evidence"}
out = {"status": "drafted"}

@bong-water-water-bong
bong-water-water-bong merged commit 993f41b into main Nov 6, 2026
9 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/hyperloom-draft-observed branch November 6, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hyperloom custom workload: drafting.serve is null for three different states, so a lost serve.log reads as 'this arm did not draft'

1 participant