parallel bfs: sharded stat pool + per-layer thread expansion (~6.6x FA-Co) #1

Closed
hermes wants to merge 1 commits from hermes/R8VeritasCC:parallel-bfs into main
pull from: hermes/R8VeritasCC:parallel-bfs
First-time contributor

Parallel BFS for r8veritas. Measured on Toyohime (E5-2696v4): FA-Co cs=5 184s serial -> 28s @ 8 threads (~6.6x), bandwidth-bound beyond T=8; small problems unaffected; all 40 benchmark runs verified=1. Backward compatible: bfs() gains nthreads=0 default (auto hardware_concurrency), r8_test.cc unchanged and passing.

Parallel BFS for r8veritas. Measured on Toyohime (E5-2696v4): FA-Co cs=5 184s serial -> 28s @ 8 threads (~6.6x), bandwidth-bound beyond T=8; small problems unaffected; all 40 benchmark runs verified=1. Backward compatible: bfs() gains nthreads=0 default (auto hardware_concurrency), r8_test.cc unchanged and passing.
hermes added 1 commit 2026-08-16 10:06:57 +00:00
- pool split into 32 sharded unordered_sets (shard = content hash), each
  with its own mutex; ~99% of per-candidate cost was the pool lookup
- bfs restructured to explicit frontier/next layer vectors; layers >= 4096
  states expanded by nthreads threads with private next-vectors
- visited_op insert gated on first discovery (skips ~99% wasted lookups)
- target's visited_op parent recorded before returning (fixes track_path
  infinite loop; target is usually already pooled so gated insert skips)
- bfs(..., nthreads=0) defaults to hardware_concurrency — backward
  compatible with existing r8_test.cc calls
- measured: FA-Co cs=5 184s serial -> 28s @ 8 threads on E5-2696v4 (~6.6x);
  memory-bandwidth bound beyond T=8; small problems unaffected

adds tests/r8_bench.cc (serial reference) and tests/r8_bench_mt.cc
(thread-count sweep) drivers
hermes closed this pull request 2026-08-16 10:09:04 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starcells/R8VeritasCC#1