Skip to content

Commit e835a5d

Browse files
committed
benchmark: merge verify_results into the run check level
1 parent e389081 commit e835a5d

13 files changed

Lines changed: 27 additions & 54 deletions

File tree

jumper_extension/adapters/ai_reviewer/benchmark/checks.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@
1313
from jumper_extension.adapters.ai_reviewer.language import (
1414
RUN,
1515
VALIDATE_SYNTAX,
16-
VERIFY_RESULTS,
1716
LanguageAdapter,
1817
)
1918

2019
logger = logging.getLogger("extension")
2120

22-
_NAMES = ("validate_syntax", "verify_results", "run")
21+
_NAMES = ("validate_syntax", "run")
2322
_CAPABILITY = {
2423
"validate_syntax": VALIDATE_SYNTAX,
25-
"verify_results": VERIFY_RESULTS,
2624
"run": RUN,
2725
}
2826

@@ -37,15 +35,13 @@ class Decision:
3735
@dataclass
3836
class CheckPlan:
3937
validate_syntax: Decision
40-
verify_results: Decision
4138
run: Decision
4239

4340

4441
def all_active() -> CheckPlan:
4542
"""The default plan: every step on. Used when no plan is injected."""
4643
return CheckPlan(
4744
validate_syntax=Decision(True),
48-
verify_results=Decision(True),
4945
run=Decision(True),
5046
)
5147

@@ -65,13 +61,6 @@ def resolve_checks(
6561

6662
decisions = {name: _decide(name, enabled[name], adapter) for name in _NAMES}
6763

68-
# Verifying results means fingerprinting what an execution produced; with no
69-
# timed run there is nothing to fingerprint, so it cannot stand on its own.
70-
if decisions["verify_results"].active and not decisions["run"].active:
71-
decisions["verify_results"] = Decision(
72-
False, "requires the timed run, which is not running"
73-
)
74-
7564
_log_plan(adapter, decisions)
7665
return CheckPlan(**decisions)
7766

jumper_extension/adapters/ai_reviewer/benchmark/runner.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import pandas as pd
1818

1919
from jumper_extension.adapters.ai_reviewer.benchmark import fingerprint
20-
from jumper_extension.adapters.ai_reviewer.benchmark.checks import CheckPlan, all_active
2120
from jumper_extension.adapters.ai_reviewer.benchmark.models import FAILED, OK, TIMEOUT, RunOutcome
2221
from jumper_extension.adapters.ai_reviewer.context.collector import ContextCollector
2322
from jumper_extension.adapters.ai_reviewer.language import (
@@ -45,7 +44,6 @@ def __init__(
4544
level: str = "process",
4645
work_dir: str | None = None,
4746
adapter: LanguageAdapter | None = None,
48-
checks: CheckPlan | None = None,
4947
):
5048
self.prefix_cells = prefix_cells
5149
self.interval = interval
@@ -54,8 +52,6 @@ def __init__(
5452
# The target cell's language decides how a replay is built and launched;
5553
# defaults to Python so direct constructors keep their old behaviour.
5654
self.adapter = adapter or get_adapter("python")
57-
# Defaults to every step on; controls whether results are fingerprinted.
58-
self.checks = checks or all_active()
5955

6056
@property
6157
def work_dir(self) -> str:
@@ -65,9 +61,9 @@ def run_once(self, code: str, tag: str, timeout: float | None = None) -> RunOutc
6561
"""Replay the prefix plus *code* once, timing the last cell."""
6662
session_path = os.path.join(self._work_dir, f"{tag}_session.zip")
6763
fingerprint_path = os.path.join(self._work_dir, f"{tag}_fingerprint.json")
68-
# Only fingerprint outputs when results are being verified; otherwise the
69-
# replay captures nothing and correctness comes back UNVERIFIED.
70-
output_names = self.adapter.output_names(code) if self.checks.verify_results.active else []
64+
# A timed run always fingerprints its outputs: verification rides along
65+
# with the replay (the two are one check level) and is cheap beside it.
66+
output_names = self.adapter.output_names(code)
7167
artifact = self.adapter.render_replay(
7268
ReplayRequest(
7369
prefix_cells=self.prefix_cells,

jumper_extension/adapters/ai_reviewer/language/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from jumper_extension.adapters.ai_reviewer.language.base import (
88
RUN,
99
VALIDATE_SYNTAX,
10-
VERIFY_RESULTS,
1110
CapabilityNotSupported,
1211
LanguageAdapter,
1312
ReplayArtifact,
@@ -33,7 +32,6 @@
3332
__all__ = [
3433
"RUN",
3534
"VALIDATE_SYNTAX",
36-
"VERIFY_RESULTS",
3735
"CapabilityNotSupported",
3836
"LanguageAdapter",
3937
"ReplayArtifact",

jumper_extension/adapters/ai_reviewer/language/base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
from abc import ABC, abstractmethod
1515
from dataclasses import dataclass
1616

17-
# The three benchmark steps an adapter may implement, matching the configurable
17+
# The two benchmark steps an adapter may implement, matching the configurable
1818
# check levels (ai.benchmark.checks). A step whose capability is absent is
19-
# skipped with a warning unless the user turned it off deliberately.
19+
# skipped with a warning unless the user turned it off deliberately. RUN covers
20+
# the timed replay and the result fingerprinting together: there is nothing to
21+
# fingerprint without an execution, and capturing it is cheap next to the run.
2022
VALIDATE_SYNTAX = "validate_syntax"
21-
VERIFY_RESULTS = "verify_results"
2223
RUN = "run"
2324

2425

@@ -68,7 +69,7 @@ class LanguageAdapter(ABC):
6869
6970
Concrete adapters set ``language`` (matched case-insensitively against the
7071
``language`` recorded on each cell) and ``caps`` (the subset of
71-
``VALIDATE_SYNTAX`` / ``VERIFY_RESULTS`` / ``RUN`` they actually implement).
72+
``VALIDATE_SYNTAX`` / ``RUN`` they actually implement).
7273
"""
7374
language: str = ""
7475
caps: frozenset[str] = frozenset()

jumper_extension/adapters/ai_reviewer/language/python_adapter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from jumper_extension.adapters.ai_reviewer.language.base import (
1414
RUN,
1515
VALIDATE_SYNTAX,
16-
VERIFY_RESULTS,
1716
LanguageAdapter,
1817
ReplayArtifact,
1918
ReplayRequest,
@@ -24,7 +23,7 @@
2423
class PythonAdapter(LanguageAdapter):
2524
"""Python cells: full support for every benchmark step."""
2625
language = "python"
27-
caps = frozenset({VALIDATE_SYNTAX, VERIFY_RESULTS, RUN})
26+
caps = frozenset({VALIDATE_SYNTAX, RUN})
2827

2928
def validate_syntax(self, code: str) -> SyntaxResult:
3029
try:

jumper_extension/adapters/ai_reviewer/reviewer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ def build_orchestrator(self, state, fix_fn, target_index: int):
153153
interval=defaults.interval,
154154
level=state["level"],
155155
adapter=adapter,
156-
checks=checks,
157156
)
158157
logger.info(
159158
f"[JUmPER]: benchmarking {len(state['suggestions'])} suggestion(s) against cell "

jumper_extension/config/ai/default.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ benchmark:
2929
# --skip-check / --check.
3030
checks:
3131
validate_syntax: true # static parse gate before any replay
32-
verify_results: true # fingerprint + compare results vs baseline (needs run)
33-
run: true # the timed replay itself
32+
run: true # timed replay + fingerprint/compare results vs baseline
3433

3534
context:
3635
strategy: faster

jumper_extension/config/models.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,9 @@ class AIBenchmarkChecksConfig(BaseModel):
129129
"""
130130
# Static parse check gating a suggestion before any replay.
131131
validate_syntax: bool = True
132-
# Fingerprint + compare a variant's results against the baseline's. Needs
133-
# ``run`` (there is nothing to fingerprint without an execution).
134-
verify_results: bool = True
135-
# The timed replay itself - the measurement the benchmark exists for.
132+
# The timed replay, plus fingerprinting and comparing each variant's results
133+
# against the baseline's. The two are one step: there is nothing to
134+
# fingerprint without an execution, and capturing it is cheap next to the run.
136135
run: bool = True
137136

138137

jumper_extension/core/parsers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def build_ai_review_parser() -> argparse.ArgumentParser:
126126
metavar="N",
127127
help="Repair rounds before a failing suggestion is reported as failed",
128128
)
129-
_CHECK_NAMES = ("validate_syntax", "verify_results", "run")
129+
_CHECK_NAMES = ("validate_syntax", "run")
130130
parser.add_argument(
131131
"--check",
132132
action="append",

jumper_extension/core/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ def _check_overrides(args) -> dict:
10001000
skip = getattr(args, "skip_check", None)
10011001
overrides: dict = {}
10021002
if check:
1003-
for name in ("validate_syntax", "verify_results", "run"):
1003+
for name in ("validate_syntax", "run"):
10041004
overrides[name] = name in check
10051005
for name in skip or []:
10061006
overrides[name] = False

0 commit comments

Comments
 (0)