Keep the ablation arms inside the line budget the repo enforces
copy_store() moved into bench/scratch.py: systems.py had reached 512 lines and bench/filesize_check fails anything over 500. The move is behaviour identical, so the scale reports keep the commit stamp they were generated against — the code they describe is complete at that commit.
This commit is contained in:
1 parent
c4a8c36416
commit
6cc5640856
6 files changed
+33
-19
No files matched your search
@@ -21,7 +21,8 @@ import numpy as np
|
||||
from bench.query_set import load_queries, scale_probes
|
||||
from bench.report import git_commit
|
||||
from bench.run import latency
|
||||
from bench.systems import DENSE_MODEL, MODELS, copy_store, machine_facts
|
||||
from bench.scratch import copy_store
|
||||
from bench.systems import DENSE_MODEL, MODELS, machine_facts
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ely_eye.db import Database
|
||||
|
||||
+2
-1
@@ -25,7 +25,8 @@ from bench.metrics import aggregate, score_query
|
||||
from bench.query_set import load_queries, scale_probes
|
||||
from bench.report import git_commit
|
||||
from bench.run import latency
|
||||
from bench.systems import copy_store, machine_facts
|
||||
from bench.scratch import copy_store
|
||||
from bench.systems import machine_facts
|
||||
|
||||
DEFAULT_HOME = Path("bench/runs/dense_scale")
|
||||
DEFAULT_SCRATCH = Path("bench/runs/leg_check")
|
||||
|
||||
@@ -17,7 +17,8 @@ from typing import Any
|
||||
from bench.query_set import load_queries, scale_probes
|
||||
from bench.report import git_commit
|
||||
from bench.run import latency
|
||||
from bench.systems import copy_store, machine_facts
|
||||
from bench.scratch import copy_store
|
||||
from bench.systems import machine_facts
|
||||
|
||||
DEFAULT_HOME = Path("bench/runs/baseline")
|
||||
DEFAULT_SCRATCH = Path("bench/runs/scale")
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
"""Every harness measures a copy. The frozen baseline store is cited evidence, and the product
|
||||
migrates whatever database it opens."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import shutil
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def copy_store(home: Path, scratch: Path) -> tuple[Path, float]:
|
||||
"""Work on a copy: the baseline store is frozen evidence and must not be migrated in place."""
|
||||
source = home / "data" / "ely_eye.sqlite"
|
||||
if not source.is_file():
|
||||
raise SystemExit(
|
||||
f"{source}: no product database, build it with python -m bench.ingest_baseline"
|
||||
)
|
||||
data = scratch / "data"
|
||||
data.mkdir(parents=True, exist_ok=True)
|
||||
began = time.perf_counter()
|
||||
for suffix in ("", "-wal", "-shm"):
|
||||
if (path := Path(str(source) + suffix)).is_file():
|
||||
shutil.copyfile(path, data / (source.name + suffix))
|
||||
return scratch, time.perf_counter() - began
|
||||
+1
-15
@@ -13,7 +13,6 @@ import json
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
import sqlite3
|
||||
import time
|
||||
from collections.abc import Sequence
|
||||
@@ -24,6 +23,7 @@ from typing import TYPE_CHECKING, Any
|
||||
import numpy as np
|
||||
|
||||
from bench.ingest_baseline import source_map
|
||||
from bench.scratch import copy_store
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ely_eye.db import Database
|
||||
@@ -446,20 +446,6 @@ def _corpus_ids(database: Database) -> dict[str, str]:
|
||||
return ids
|
||||
|
||||
|
||||
def copy_store(home: Path, scratch: Path) -> tuple[Path, float]:
|
||||
"""Work on a copy: the baseline store is frozen evidence and must not be migrated in place."""
|
||||
source = home / "data" / "ely_eye.sqlite"
|
||||
if not source.is_file():
|
||||
raise SystemExit(f"{source}: no product database, build it with python -m bench.ingest_baseline")
|
||||
data = scratch / "data"
|
||||
data.mkdir(parents=True, exist_ok=True)
|
||||
began = time.perf_counter()
|
||||
for suffix in ("", "-wal", "-shm"):
|
||||
if (path := Path(str(source) + suffix)).is_file():
|
||||
shutil.copyfile(path, data / (source.name + suffix))
|
||||
return scratch, time.perf_counter() - began
|
||||
|
||||
|
||||
def live_product_rankings(
|
||||
db_home: Path,
|
||||
queries: Sequence[str],
|
||||
|
||||
+2
-1
@@ -20,7 +20,8 @@ from bench.metrics import aggregate, score_query
|
||||
from bench.query_set import load_queries, scale_probes
|
||||
from bench.report import git_commit
|
||||
from bench.run import latency
|
||||
from bench.systems import copy_store, live_product_rankings, machine_facts
|
||||
from bench.scratch import copy_store
|
||||
from bench.systems import live_product_rankings, machine_facts
|
||||
|
||||
FRACTIONS = [0.20, 0.10, 0.05, 0.02, 0.01, 0.005]
|
||||
TOP_K = 10
|
||||
|
||||
Reference in new issue
Block a user