This commit is contained in:
2026-08-12 09:45:18 +08:00
parent 9331b4cbf6
commit 0910b73ea4
22 changed files with 439 additions and 98 deletions
@@ -129,8 +129,25 @@ TEST(renderable_task_graph_concurrency_test, runs_independent_internal_tasks_con
auto renderable = std::make_shared<Renderable_Task_Graph_Concurrency_Test_Renderable>(scene, active, maximum);
scene.attach_renderable(renderable);
scene.render();
while (active.load(std::memory_order_acquire) == 0)
std::this_thread::yield();
const auto running = scene.task_execution_snapshot();
EXPECT_EQ(running.state, Task_Execution_State::Running);
EXPECT_EQ(running.graph_node_count, 4u);
EXPECT_GT(running.running_count, 0u);
EXPECT_LT(running.completed_count, running.graph_node_count);
scene.wait_for_render();
EXPECT_GE(maximum.load(std::memory_order_acquire), 2);
const auto execution = scene.task_execution_snapshot();
EXPECT_EQ(execution.state, Task_Execution_State::Completed);
EXPECT_EQ(execution.worker_count, Scene_Base::task_executor_worker_count());
EXPECT_EQ(execution.graph_node_count, 4u);
EXPECT_EQ(execution.completed_count, execution.graph_node_count);
EXPECT_EQ(execution.running_count, 0u);
EXPECT_EQ(execution.pending_count, 0u);
EXPECT_GE(execution.peak_parallelism, 2u);
EXPECT_EQ(execution.failed_count, 0u);
EXPECT_GT(execution.duration_ns, 0u);
}
#endif
TEST(renderable_task_graph_test, rejects_tasks_from_different_graphs) {