fix: resolve formatting, regression logic, and pytest defaults

- Run ruff format on all benchmark files (fixes CI lint job)
- Fix check_regression() substring ambiguity: ordered keyword matching
  so "latency_improvement_pct" is correctly classified as higher-is-better
- Update stale comments in conftest.py referencing wrong fixture
- Add pytest addopts to skip benchmark/slow/stress markers by default
This commit is contained in:
Igor Lins e Silva
2026-04-08 10:56:39 -03:00
parent 7e4db33061
commit ebc26f3960
12 changed files with 383 additions and 138 deletions
+20 -16
View File
@@ -61,14 +61,16 @@ def _populate_single_room(palace_path, n_drawers, n_needles=10):
drawer_id = f"drawer_single_room_{hashlib.md5(needle_id.encode()).hexdigest()[:16]}"
docs.append(content)
ids.append(drawer_id)
metas.append({
"wing": "concentrated",
"room": "single_room",
"source_file": f"needle_{i}.txt",
"chunk_index": 0,
"added_by": "threshold_bench",
"filed_at": datetime.now().isoformat(),
})
metas.append(
{
"wing": "concentrated",
"room": "single_room",
"source_file": f"needle_{i}.txt",
"chunk_index": 0,
"added_by": "threshold_bench",
"filed_at": datetime.now().isoformat(),
}
)
# Fill with noise — all in the SAME room
remaining = n_drawers - len(docs)
@@ -77,14 +79,16 @@ def _populate_single_room(palace_path, n_drawers, n_needles=10):
drawer_id = f"drawer_single_room_{hashlib.md5(f'noise_{i}'.encode()).hexdigest()[:16]}"
docs.append(content)
ids.append(drawer_id)
metas.append({
"wing": "concentrated",
"room": "single_room",
"source_file": f"noise_{i:06d}.txt",
"chunk_index": i % 10,
"added_by": "threshold_bench",
"filed_at": datetime.now().isoformat(),
})
metas.append(
{
"wing": "concentrated",
"room": "single_room",
"source_file": f"noise_{i:06d}.txt",
"chunk_index": i % 10,
"added_by": "threshold_bench",
"filed_at": datetime.now().isoformat(),
}
)
if len(docs) >= batch_size:
col.add(documents=docs, ids=ids, metadatas=metas)