Bench features in task-bench with --tasks features, from the folder the config names as bench-tasks
CI / tests (pull_request) Has been cancelled
CI / tests (pull_request) Has been cancelled
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""`task-bench --record-figures`: a bench's figures over every bug, appended to the comprehension history from the bench's digest. The entry is a report beside the panel's: its heading names no `<what> at <commit>`, so nothing that reads the history's rulings and scoring runs takes it for one."""
|
||||
"""`task-bench --record-figures`: a bench's figures over every task, appended to the comprehension history from the bench's digest. The entry is a report beside the panel's: its heading names no `<what> at <commit>`, so nothing that reads the history's rulings and scoring runs takes it for one."""
|
||||
import pathlib
|
||||
import re
|
||||
import typing
|
||||
@@ -14,9 +14,11 @@ from text_files.utc_stamp import utc
|
||||
|
||||
# The digest's line that names the commits, as task_bench.digest.digest writes it.
|
||||
SIDES = re.compile(r"^Base ([0-9a-f]{7,40}), head ([0-9a-f]{7,40})\.", re.M)
|
||||
# How the table's three rows over every bug open, as task_bench.figures.table writes them: the base, the head and the head's change.
|
||||
# How the table's three rows over every task open, as task_bench.figures.table writes them: the base, the head and the head's change.
|
||||
OVER_ALL = "| All |"
|
||||
COMMIT_LENGTH = 8
|
||||
# How the table's header opens in a bench of features, as task_bench.figures.table writes it.
|
||||
OF_FEATURES = "| Feature |"
|
||||
|
||||
|
||||
def recorded_bench(run: typing.Callable[[], list[str] | Failure], folder: pathlib.Path, git: Git, home: pathlib.Path, now: typing.Callable[[], float]) -> list[str] | Failure:
|
||||
@@ -57,7 +59,7 @@ def bench_appended(history: RecordStore, held: Held, name: str, entry: str) -> s
|
||||
|
||||
|
||||
def bench_entry(digest: str, branch: str, now: float) -> tuple[str, str] | None:
|
||||
"""A bench's name in the history and its entry there, stamped with now: the digest's table header and its three rows over every bug. branch is the branch the bench ran on. None where digest is no task-bench digest."""
|
||||
"""A bench's name in the history and its entry there, stamped with now: the digest's table header and its three rows over every task. The name says where the bench built features, so the history holds it beside a bench of bugs at the same commits. branch is the branch the bench ran on. None where digest is no task-bench digest."""
|
||||
sides = SIDES.search(digest)
|
||||
table = [line for line in digest.splitlines() if line.startswith("|")]
|
||||
rows = [line for line in table if line.startswith(OVER_ALL)]
|
||||
@@ -65,5 +67,5 @@ def bench_entry(digest: str, branch: str, now: float) -> tuple[str, str] | None:
|
||||
return None
|
||||
base, head = (commit[:COMMIT_LENGTH] for commit in sides.groups())
|
||||
# A panel of three readers, seated as the README's audience, picked this wording on 2026-11-23. Two of the three wanted the bench's name before the commits.
|
||||
name = f"task-bench of {branch}: head {head} against base {base}"
|
||||
name = f"task-bench{' features' if table[0].startswith(OF_FEATURES) else ''} of {branch}: head {head} against base {base}"
|
||||
return name, "\n".join([f"## {utc(now)}, {name}", "", *table[:2], *rows]) + "\n"
|
||||
|
||||
Reference in New Issue
Block a user