From ae7c9e78894a6c5f2be4a194817de289746b9514 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 27 May 2026 17:08:23 +0200 Subject: [PATCH] BufferProvider: in preparation for a load test To verify integration of this new engine-level facility, it seems prudent to build a load test (without going into extended stress- and performance testing). For that we need - random buffer demand - a computational load that actually uses the buffer. As part of the ''scheduler stress testing'', a self-calibrating `ComputationalLoad` was developed, which even implements both a merely computational load, but also a memory accessing computation. This can be extended to optionally use an external buffer, instead of allocating a precisely dimensioned memory block directly from heap. Obviously this extension is ''dangerous'', since there is no way to verify that the storage passed in can accommodated the storage required based on the current calibration of the `ComputationalLoad` As an aside: identified a timing check in `SchedulerService_test` that showed the tendency to fail when invoked immediately after a build. --- tests/vault/gear/scheduler-service-test.cpp | 2 +- tests/vault/gear/scheduler-usage-test.cpp | 2 +- tests/vault/gear/test-chain-load.hpp | 25 ++++++++++++++------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/tests/vault/gear/scheduler-service-test.cpp b/tests/vault/gear/scheduler-service-test.cpp index 14c4f977a..80b3d406f 100644 --- a/tests/vault/gear/scheduler-service-test.cpp +++ b/tests/vault/gear/scheduler-service-test.cpp @@ -401,7 +401,7 @@ namespace test { CHECK (activity::PASS == res); // instruction to check back once pullWork(); CHECK (activity::WAIT == res); // but next call will send this thread to sleep right away - CHECK (delay_us < 40); + CHECK (delay_us < 50); cout << "follow-up with some distance => follow-up delay"< + allocNeeded (uint scaleStep) const { auto cnt = roundsNeeded(scaleStep); auto siz = max (scaleStep * sizeBase, 1u); @@ -1401,13 +1408,15 @@ namespace test { causeMemProcessLoad (uint scaleStep) { auto [siz,round] = allocNeeded (scaleStep); - lib::UninitialisedDynBlock memBlock{siz}; + lib::UninitialisedDynBlock memBlock; + size_t* mem = externalBuff? externalBuff + : memBlock.allocate (siz); Sink sink; - *memBlock.front() = sink+1; + *mem = sink+1; for ( ; 0 < round; --round) - for (size_t i=0; i