Skip to content

Publish the v0.4.0 benchmark baseline - #16

Merged
lupppig merged 1 commit into
mainfrom
agent/publish-v0.4.0-benchmark-baseline
Jul 30, 2026
Merged

Publish the v0.4.0 benchmark baseline#16
lupppig merged 1 commit into
mainfrom
agent/publish-v0.4.0-benchmark-baseline

Conversation

@lupppig

@lupppig lupppig commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • publish versioned 1M and 10M full-pipeline benchmark reports with Git revision, container image, environment, and workload provenance
  • mark Phase 0 complete and update the README workload envelope to the committed v0.4.0 measurements
  • isolate scheduler CLI E2E tests from the user's persistent ~/.loafer/jobs.db

Why

Phase 0 implementation was complete, but its benchmark evidence was still described as working-tree-only. The release gate required rerunning the capped matrix from an immutable revision and committing the resulting artifacts. During final verification, the scheduler CLI tests also exposed an isolation defect by attempting to write to the user's real scheduler database.

Impact

The repository now contains an auditable public-alpha baseline:

  • 1M deterministic identity rows complete with exact row-count and SHA-256 equality in 13.36s at 1,310.1 MiB peak process-tree RSS
  • 10M rows safely terminate at the 2 GiB RSS limit after 19.54s without publishing final or temporary output
  • Phase 0 is explicitly marked complete, and Phase 1 is the documented next step
  • scheduler CLI E2E tests use a per-test temporary job store

Root cause

The earlier benchmark measurements were produced from a mutable working tree and benchmarks/results/ was ignored, so there was no versioned release artifact. Separately, the scheduler E2E tests invoked the real default Path.home() / ".loafer" store instead of overriding all scheduler paths for test isolation.

Validation

  • uv run pytest -q — 673 passed, 50 skipped
  • uv run pytest tests/unit/test_full_pipeline_benchmark.py -q — 4 passed
  • uv run pytest tests/e2e/test_cli_schedule.py -q — 5 passed
  • uv run ruff check tests/e2e/test_cli_schedule.py benchmarks/full_pipeline.py — clean
  • production v0.4.0 image smoke pipeline — passed
  • clean-room v0.4.0 wheel smoke pipeline — passed
  • pre-push ruff check . and ruff format --check . — passed

Summary by CodeRabbit

  • Documentation

    • Updated production-readiness guidance with verified v0.4.0 benchmark results and Phase 1 roadmap status.
    • Added benchmark reports for 1M and 10M row workloads, including performance, memory usage, and termination outcomes.
    • Documented benchmark provenance, environment details, and safety-limit behavior.
    • Updated the README with current memory benchmark figures and links to detailed reports.
  • Tests

    • Improved scheduled-job end-to-end test isolation to prevent changes to persistent local scheduler data.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changes commit v0.4.0 benchmark results and update readiness documentation, revise benchmark ignore rules, and isolate scheduler end-to-end test storage using per-test temporary directories.

Changes

Versioned benchmark baseline

Layer / File(s) Summary
Benchmark results and provenance
.gitignore, benchmarks/results/*
Adds successful 1M and RSS-limited 10M benchmark records, documents their provenance and expected outcomes, and keeps the results directory committed.
Readiness and roadmap updates
PRODUCTION_READINESS.md, README.md
Updates Phase 0 metrics, v0.4.0 benchmark measurements, memory results, provenance links, and Phase 1 roadmap wording.

Scheduler test isolation

Layer / File(s) Summary
Temporary scheduler test storage
tests/e2e/test_cli_schedule.py
Adds an autouse pytest fixture that redirects scheduler databases, logs, and run-state files into per-test temporary storage.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: publishing the v0.4.0 benchmark baseline and reports.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/publish-v0.4.0-benchmark-baseline

Comment @coderabbitai help to get the list of available commands.

@lupppig
lupppig marked this pull request as ready for review July 30, 2026 08:06
@lupppig
lupppig merged commit f85061f into main Jul 30, 2026
3 of 4 checks passed
@lupppig
lupppig deleted the agent/publish-v0.4.0-benchmark-baseline branch July 30, 2026 08:08

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/e2e/test_cli_schedule.py`:
- Around line 20-29: Convert _isolated_scheduler_store into a yield fixture and,
in a finally block, identify handlers added during the test, remove them from
the logger, and close them. Preserve the existing temporary scheduler path
monkeypatches while ensuring each test cleans up its file handlers and
associated resources.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e01c685-958b-4b50-ba2f-571f7c625617

📥 Commits

Reviewing files that changed from the base of the PR and between 9007746 and 31ea739.

📒 Files selected for processing (7)
  • .gitignore
  • PRODUCTION_READINESS.md
  • README.md
  • benchmarks/results/10m.json
  • benchmarks/results/1m.json
  • benchmarks/results/README.md
  • tests/e2e/test_cli_schedule.py

Comment on lines +20 to +29
@pytest.fixture(autouse=True)
def _isolated_scheduler_store(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""Keep CLI schedule tests out of the user's persistent job store."""
import loafer.scheduler as scheduler

loafer_dir = tmp_path / ".loafer"
monkeypatch.setattr(scheduler, "_LOAFER_DIR", loafer_dir)
monkeypatch.setattr(scheduler, "_DB_PATH", loafer_dir / "jobs.db")
monkeypatch.setattr(scheduler, "_LOG_PATH", loafer_dir / "scheduler.log")
monkeypatch.setattr(scheduler, "_RUN_STATE_PATH", loafer_dir / "run_state.json")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Close temporary log handlers after each test.

configure_file_logging() retains handlers globally, but this fixture creates a unique _LOG_PATH for every test. Its path-based deduplication therefore adds another FileHandler on each test, leaving open descriptors and duplicate writes to removed temporary files. Convert the fixture to a yield fixture and remove/close handlers added during the test in finally.

Proposed cleanup
+from collections.abc import Iterator
+
 `@pytest.fixture`(autouse=True)
-def _isolated_scheduler_store(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+def _isolated_scheduler_store(
+    tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> Iterator[None]:
     """Keep CLI schedule tests out of the user's persistent job store."""
     import loafer.scheduler as scheduler
 
+    handlers_before = list(scheduler.logger.handlers)
     loafer_dir = tmp_path / ".loafer"
     monkeypatch.setattr(scheduler, "_LOAFER_DIR", loafer_dir)
     monkeypatch.setattr(scheduler, "_DB_PATH", loafer_dir / "jobs.db")
     monkeypatch.setattr(scheduler, "_LOG_PATH", loafer_dir / "scheduler.log")
     monkeypatch.setattr(scheduler, "_RUN_STATE_PATH", loafer_dir / "run_state.json")
 
+    try:
+        yield
+    finally:
+        for handler in list(scheduler.logger.handlers):
+            if handler not in handlers_before:
+                scheduler.logger.removeHandler(handler)
+                handler.close()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@pytest.fixture(autouse=True)
def _isolated_scheduler_store(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""Keep CLI schedule tests out of the user's persistent job store."""
import loafer.scheduler as scheduler
loafer_dir = tmp_path / ".loafer"
monkeypatch.setattr(scheduler, "_LOAFER_DIR", loafer_dir)
monkeypatch.setattr(scheduler, "_DB_PATH", loafer_dir / "jobs.db")
monkeypatch.setattr(scheduler, "_LOG_PATH", loafer_dir / "scheduler.log")
monkeypatch.setattr(scheduler, "_RUN_STATE_PATH", loafer_dir / "run_state.json")
from collections.abc import Iterator
`@pytest.fixture`(autouse=True)
def _isolated_scheduler_store(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> Iterator[None]:
"""Keep CLI schedule tests out of the user's persistent job store."""
import loafer.scheduler as scheduler
handlers_before = list(scheduler.logger.handlers)
loafer_dir = tmp_path / ".loafer"
monkeypatch.setattr(scheduler, "_LOAFER_DIR", loafer_dir)
monkeypatch.setattr(scheduler, "_DB_PATH", loafer_dir / "jobs.db")
monkeypatch.setattr(scheduler, "_LOG_PATH", loafer_dir / "scheduler.log")
monkeypatch.setattr(scheduler, "_RUN_STATE_PATH", loafer_dir / "run_state.json")
try:
yield
finally:
for handler in list(scheduler.logger.handlers):
if handler not in handlers_before:
scheduler.logger.removeHandler(handler)
handler.close()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/e2e/test_cli_schedule.py` around lines 20 - 29, Convert
_isolated_scheduler_store into a yield fixture and, in a finally block, identify
handlers added during the test, remove them from the logger, and close them.
Preserve the existing temporary scheduler path monkeypatches while ensuring each
test cleans up its file handlers and associated resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant