Skip to content

xls/tests: Move Testbench worker runner into testbench.cc. - #5532

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1028291879
Draft

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1028291879

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

xls/tests: Move Testbench worker runner into testbench.cc.

Moves Testbench's non-templated worker lifecycle, range partitioning,
progress logging, and synchronization out of testbench.h into testbench.cc
and deletes testbench_thread.h (dropping its unused xls/ir dependency).

Replaces the TestbenchThread busy-spin loop and absl::CondVar wakeup
handshake with absl::BlockingCounter + absl::Notification over
xls::Thread, fixing two races in the old state machine (running_ started
false so an unstarted worker could look finished, and cleared before storing
status_) and keeping mutex_ held only while checking/updating started_
and num_threads_.

@copybara-service copybara-service Bot changed the title xls/tests: Run Testbench workers on llvm::DefaultThreadPool. xls/tests: Move Testbench worker runner into testbench.cc. Nov 23, 2026
@copybara-service copybara-service Bot changed the title xls/tests: Move Testbench worker runner into testbench.cc. xls/tests: Move Testbench worker runner into testbench.cc and use int64_t. Nov 23, 2026
@copybara-service copybara-service Bot changed the title xls/tests: Move Testbench worker runner into testbench.cc and use int64_t. xls/tests: Move Testbench worker runner into testbench.cc. Nov 23, 2026
Moves `Testbench`'s non-templated worker lifecycle, range partitioning,
progress logging, and synchronization out of `testbench.h` into `testbench.cc`
and deletes `testbench_thread.h` (dropping its unused `xls/ir` dependency).

Replaces the `TestbenchThread` busy-spin loop and `absl::CondVar` wakeup
handshake with `absl::BlockingCounter` + `absl::Notification` over
`xls::Thread`, fixing two races in the old state machine (`running_` started
`false` so an unstarted worker could look finished, and cleared before storing
`status_`) and keeping `mutex_` held only while checking/updating `started_`
and `num_threads_`.

PiperOrigin-RevId: 1028291879

This branch has not been deployed

No deployments
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