Skip to content

test(parallel): verify 1000-session fan-out and extend scaling bench#2120

Merged
chaliy merged 4 commits into
mainfrom
claude/keen-gates-eyp5hv
Jun 23, 2026
Merged

test(parallel): verify 1000-session fan-out and extend scaling bench#2120
chaliy merged 4 commits into
mainfrom
claude/keen-gates-eyp5hv

Conversation

@chaliy

@chaliy chaliy commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What

  • New parallel_sessions_tests integration suite proving a 1000-session parallel fan-out actually does real work (each session asserts correct per-session output and exit 0), plus a 500-session check that sessions sharing one Arc<dyn FileSystem> don't cross-contaminate.
  • Extended the parallel_execution bench SESSION_COUNTS to 500 and 1000, and fixed scripts/bench-parallel.sh to emit a speedup row for every measured session count (was hardcoded to 10/50/100/200).
  • Saved 4-core baseline result snapshots under crates/bashkit/benches/results/ (timestamped, never overwritten — they accumulate for historical comparison).
  • Spec note in parallel-execution.md tying the bench to the new correctness test.

Why

The bench used let _ = bash.exec(...), ignoring results — so a fan-out where every session errored instantly would look fast while doing nothing. These tests close that gap and confirm bashkit scales to 1000 concurrent sessions (sessions are heap objects + tokio tasks, no per-session OS process/thread).

How / Findings

  • Scaling stays linear out to 1000 sessions (parallel ~98 ms for 1000 medium-workload sessions on a 4-core VM); ~3.5–3.8× parallel speedup, core-bound as expected for CPU work.
  • Surfaced one structural finding: shared-Arc-FS throughput inverts above ~500 sessions (140 ms vs 98 ms per-session at 1000) due to RwLock contention on the single shared VFS.

Tests

  • parallel_sessions_tests::thousand_parallel_sessions_do_real_work
  • parallel_sessions_tests::parallel_sessions_shared_fs_no_cross_contamination
  • cargo fmt --check, cargo clippy --tests --benches -p bashkit --features http_client,ssh,sqlite -- -D warnings clean.

No production code changed — test/bench/tooling only.

chaliy added 4 commits June 23, 2026 01:50
Captures parallel-vs-sequential, parallel scaling (10/50/100/200
sessions), and shared-Arc-FS results so future runs have a diff baseline.

Claude-Session: https://claude.ai/code/session_01D2S512buFBwmYnDzBykbA3
Adds parallel_sessions_tests integration tests proving a 1000-session
fan-out actually does real work (correct per-session output, exit 0) and
that 500 sessions sharing one Arc<FileSystem> don't cross-contaminate —
guarding against the case where sessions error out instantly and the run
only looks fast.

Extends parallel_execution bench SESSION_COUNTS to 500/1000 and fixes the
speedup-summary generator to emit every measured session count instead of
a hardcoded list. Refreshes the saved 4-core baseline with the full curve.

Claude-Session: https://claude.ai/code/session_01D2S512buFBwmYnDzBykbA3
Keep the first 4-core vm run (200-session cap) alongside the full
10-1000 curve so historical comparisons have every data point. Each run
is a distinct timestamped file and is never overwritten.

Claude-Session: https://claude.ai/code/session_01D2S512buFBwmYnDzBykbA3
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 275ed71 Commit Preview URL

Branch Preview URL
Jun 23 2026, 01:52 AM

@chaliy chaliy merged commit 14780b7 into main Jun 23, 2026
25 checks passed
@chaliy chaliy deleted the claude/keen-gates-eyp5hv branch June 23, 2026 02:03
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