diff --git a/tests/vault/gear/scheduler-stress-test.cpp b/tests/vault/gear/scheduler-stress-test.cpp index 8a3d39cb6..974672ab7 100644 --- a/tests/vault/gear/scheduler-stress-test.cpp +++ b/tests/vault/gear/scheduler-stress-test.cpp @@ -291,74 +291,23 @@ SHOW_EXPR(micros); search_breaking_point() { MARK_TEST_FUN - TestChainLoad testLoad{64}; - testLoad.configureShape_chain_loadBursts() - .buildTopology() -// .printTopologyDOT() -// .printTopologyStatistics() - ; - // Adapted Schedule---------- - TRANSIENTLY(work::Config::COMPUTATION_CAPACITY) = 4; - auto LOAD_BASE = 500us; - uint concurrency = 4; - - // Build-Performance-test-setup-------- - BlockFlowAlloc bFlow; - EngineObserver watch; - Scheduler scheduler{bFlow, watch}; - - auto testSetup = - testLoad.setupSchedule(scheduler) - .withLoadTimeBase(LOAD_BASE) - .withJobDeadline(50ms) - .withUpfrontPlanning(); - - auto sqr = [](auto n){ return n*n; }; - _Fmt pointFmt{"....·%-2d: t=%4.1f %s Δ=%4.1f %s"}; - _Fmt rowFmt {"%4.2f| : ∅=%4.1f ±%4.2f ∅Δ=%4.1f %%%3.1f -- expect:%4.1fms"}; - double refTime = testLoad.calcRuntimeReference(LOAD_BASE); -SHOW_EXPR(refTime); - const uint REPETITIONS{30}; - for (double stress=0.2; stress < 0.7; stress+=0.03) - { - testSetup.withAdaptedSchedule(stress, concurrency); - array runTime; - array delta; - for (uint i=0; i 2000) - ++misses; - cout << pointFmt % i % (runTime[i]/1000) % (runTime[i]>avg?"+":"-") % (delta[i]/1000) % (delta[i] > 2000? "●":"○") <{64}.configureShape_chain_loadBursts(); } }; - auto [stress,delta,time] = StressRig::with().searchBreakingPoint(); -///////////////////////////////////////////////////////////////////////////////////////////////////WIP : draft for testbench-DSL + auto [stress,delta,time] = StressRig::with().searchBreakingPoint(); + SHOW_EXPR(stress) SHOW_EXPR(delta) SHOW_EXPR(time) + CHECK (delta > 4.0); + CHECK (0.55 > stress and stress > 0.4); } diff --git a/tests/vault/gear/stress-test-rig.hpp b/tests/vault/gear/stress-test-rig.hpp index dc693ecc5..707bff22a 100644 --- a/tests/vault/gear/stress-test-rig.hpp +++ b/tests/vault/gear/stress-test-rig.hpp @@ -159,13 +159,14 @@ namespace test { REQUIRE (lower <= upper); while ((upper-lower) >= epsilon) { - PAR div = (upper-lower) / 2; + PAR div = lower + (upper-lower) / 2; results.emplace_back (fun(div)); bool hit = results.back().first; if (hit) upper = div; else lower = div; +cout<<"##################LOOP lower="<avg? % fail? + _Fmt fmtRun_ {"....·%-2d: Δ=%4.1f t=%4.1f %s %s"}; // i % Δ % t % t>avg? % fail? _Fmt fmtStep_{ "%4.2f| : ∅Δ=%4.1f±%-4.2f ∅t=%4.1f %%%3.1f -- expect:%4.1fms"}; // stress % ∅Δ % σ % ∅t % fail % t-expect _Fmt fmtResSDv_{"%9s= %5.2f ±%4.2f%s"}; _Fmt fmtResVal_{"%9s: %5.2f%s"}; @@ -328,14 +330,14 @@ namespace test { { cout << fmtResVal_ % "stresFac" % res.stressFac % "" <