karenina.benchmark.verification.extension¶
extension
¶
Extend a prior verification run along three axes: judges, answerers, replicates.
Mirrors the error-analysis facade pattern: result-set-in, result-set-out. A
ReplayStore built from the prior results serves the answering stage for
triples already covered; new answerers or replicates miss and run live.
VerificationConfig.skip_triples tells the batch runner to drop tasks
already present in prior_results so those rows pass through verbatim.
This module also hosts :func:extend_rubric_run, a sibling facade for
attaching a new rubric to a prior run. Unlike the judge/answerer/replicate
extension, rubric extension enriches prior rows in-place: answering is
replayed, template parsing and verification are skipped
(evaluation_mode="rubric_only"), and the resulting rubric scores are
merged trait-by-trait onto the prior rows. Shape and row count are
preserved; same-name trait collisions raise.
Classes¶
Functions¶
extend_rubric_run
¶
extend_rubric_run(
benchmark: Benchmark,
prior_results: VerificationResultSet,
config: VerificationConfig,
*,
run_name: str | None = None,
question_ids: list[str] | None = None,
async_enabled: bool | None = None,
progress_callback: Callable[[float, str], None]
| None = None,
sink: Any = None,
) -> VerificationResultSet
Attach a new rubric to an existing verification run.
The caller sets the new rubric on benchmark (global and/or
per-question) before invoking this helper. A replay store built
from prior_results serves the answering stage, the pipeline
runs in evaluation_mode="rubric_only" (template verification
skipped), and the resulting rubric scores are merged
trait-by-trait onto copies of the prior rows. Row count is
preserved: the merged set has exactly len(prior_results.results)
entries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Benchmark
|
The :class: |
required |
|
VerificationResultSet
|
Result set from an earlier |
required |
|
VerificationConfig
|
Verification configuration describing the same shape
as |
required |
|
str | None
|
Optional override for the merged run name. Defaults
to the run name carried by |
None
|
|
list[str] | None
|
Optional subset of question IDs. Defaults to every
question present in |
None
|
|
bool | None
|
Forwarded to |
None
|
|
Callable[[float, str], None] | None
|
Forwarded to |
None
|
|
Any
|
Optional :class: |
None
|
Returns:
| Type | Description |
|---|---|
VerificationResultSet
|
|
VerificationResultSet
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
On any input validation failure (empty prior set,
shape mismatch, pre-populated |
Source code in src/karenina/benchmark/verification/extension.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | |
extend_template_run
¶
extend_template_run(
benchmark: Benchmark,
prior_results: VerificationResultSet,
config: VerificationConfig,
*,
run_name: str | None = None,
question_ids: list[str] | None = None,
async_enabled: bool | None = None,
progress_callback: Callable[[float, str], None]
| None = None,
sink: Any = None,
) -> VerificationResultSet
Extend a prior verification run along any combination of three axes.
The axes, all optional and composable in a single call:
- Parsing models (judges): new judge(s) in
config.parsing_models. - Answering models: new answerer(s) in
config.answering_models. - Replicates: higher
config.replicate_countthan the prior fan-out.
A :class:~karenina.replay.ReplayStore is built from prior_results so
that prior (question, answerer, replicate) combinations serve the
answering stage from replay. New answerers, new replicates, or any
combination thereof miss the store and run answering live. Parsing
always runs live. Triples already covered by prior_results are
filtered out of the task queue so prior rows pass through the merge
verbatim. The returned set matches the shape of a joint run with the
full (answerers × judges × replicates) matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Benchmark
|
The :class: |
required |
|
VerificationResultSet
|
Result set from an earlier |
required |
|
VerificationConfig
|
Verification configuration for the extension. Must describe the final state (full union, not deltas):
|
required |
|
str | None
|
Optional override for the merged run name. Defaults to the
run name carried by |
None
|
|
list[str] | None
|
Optional subset of question IDs to re-judge. Defaults
to every question in |
None
|
|
bool | None
|
Forwarded to |
None
|
|
Callable[[float, str], None] | None
|
Forwarded to |
None
|
|
Any
|
Optional :class: |
None
|
Returns:
| Type | Description |
|---|---|
VerificationResultSet
|
Merged |
VerificationResultSet
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
On any input validation failure (empty prior set, missing
parsing models, answering identity mismatch, replicate count
mismatch, pre-populated |
Source code in src/karenina/benchmark/verification/extension.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |