Skip to content

ci: run Go test packages serially (fix Windows throughput failure) - #5

Closed
ChromaBeast wants to merge 21 commits into
mainfrom
fix/ci-serial-packages
Closed

ChromaBeast wants to merge 21 commits into
mainfrom
fix/ci-serial-packages

Conversation

@ChromaBeast

Copy link
Copy Markdown
Owner

Why

TestEngineSystemWorkloadBenchmark (fixed 1000 ops/s floor) fails on windows-latest in the full suite. Diagnosed with temporary A/B runs on the same Windows runner:

Run Throughput (ops/s)
Test alone, base / group-commit / WAL barrier / main head ~2500-3000 at every commit
Full suite, head, default package parallelism 314-327 (fails)
Full suite, head, without cmd/beastbench 314-328 (fails)
Full suite, head, -p 1 1646-1826 (passes)
Full suite, old base, default parallelism 924-1318 (borderline)

So the engine is not slower in isolation and beastbench is not the cause; the benchmark is fsync-bound and loses to other packages hitting the disk in parallel.

Change

CI runs go test -p 1; AGENTS.md note updated. The floor is unchanged.

Not explained

Head degrades more under contention than the old base did (~320 vs ~900-1300). Isolation shows no regression, so this PR treats the symptom; the sensitivity itself is still worth a look.

🤖 Generated with Claude Code

ChromaBeast and others added 21 commits October 28, 2026 23:06
Values up to 2 MiB, page-slot reuse, and WAL frame cap
Hand-written text exposition (no new deps). Authenticated by admin session or
bearer token (--api-token / BEASTDB_METRICS_TOKEN); no loopback bypass.
Adds buffer-pool hit/miss counters and checkpoint timestamps, gRPC metrics
interceptors, runbook docs with scrape config and alert rules.
WAL gains Append (assign LSN, no fsync), WaitDurable/Sync with a shared
syncedLSN so one fsync covers all appended records, and a sticky fsync error.
Write keeps its signature and durability but now group-commits too.

Engine writes (Put/PutIfAbsent/PutIf/Delete/DeleteIf/BatchWrite[If] and
replicated apply) go through a commit queue: a committer goroutine runs a
group of writes under the engine lock (append + apply), issues one fsync,
notifies the observer in LSN order, then releases the lock and acks writers.
Reads and replication never see a write before it is durable. A failed
fsync halts the engine and fails every write in the group.

Concurrent Put benchmark: 7.82 ms/op -> 0.51 ms/op (~15x).
Group commit applies writes to pages before the group's fsync, so the buffer
pool could flush a page ahead of its WAL records. Add a WAL barrier
(WAL.EnsureDurable) called before eviction, FlushPage and FlushAll; a failing
barrier blocks the page write. Adds regression tests and the upgrade spec.
Resolved conflicts in engine.go and buffer_pool.go by keeping both the
group-commit/WAL-barrier fields and the metrics counters.
… the 200-line limit

No behaviour change: functions moved verbatim into wal_sync.go,
wal_lifecycle.go, buffer_pool_wal.go, buffer_pool_stats.go,
runner_load.go and runner_run.go.
…guideline

About 400 lines is a prompt to ask whether a file does more than one thing,
not a gate. Generated code, tests and data are exempt. Updates GEMINI.md
(Antigravity), CONTRIBUTING.md and demo.ps1, and adds AGENTS.md (Codex) and
CLAUDE.md (imports AGENTS.md).
…erformance-3d83f3

Group commit, gRPC roles, /metrics, beastbench and security policy
…, and new sign-in

- Adopt the Figma dark palette; replace the top header with a sidebar
  (Overview, Table Editor, Operations, API Keys & Roles)
- Overview: buffer-pool occupancy map and WAL head with LSN flash
- Table Editor: 64-bit key bit matrix per row; flatter cards and tables
- Sign-in: brand-led layout with page-grid backdrop
- Rebuild the embedded static bundle
…s it

DiskFreeBytes is unix-only, so TestMetricsAuthAndFormat failed on Windows CI
with a missing beastdb_disk_free_bytes line. Require the gauge only when
DiskFreeBytes reports support.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Instead of waking a dedicated committer goroutine for every write, the writer
that finds no commit in progress runs the queued group on its own goroutine;
if more writers queued meanwhile, a drain goroutine serves them. Group commit
semantics are unchanged (one fsync per group, lock held across it, observer
in LSN order). Aims to remove a cross-goroutine wake-up per uncontended
write, which can cost up to a timer tick on Windows. Not yet verified on
Windows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fix Windows CI after #2: metrics test, single-writer commit path
… quiet disk

On windows-latest the full-suite run measured TestEngineSystemWorkloadBenchmark at
~315 ops/s with default package parallelism, ~1650-1830 with -p 1, and the same
test run alone is ~2500-3000 at every commit since before the upgrade work.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T13:43:28.573080Z 2323574 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ChromaBeast

Copy link
Copy Markdown
Owner Author

Superseded by #6, which fixes the root cause (per-page fsyncs during eviction slowing parallel test packages) instead of serializing packages with -p 1.

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