From 848bb6fb862d43cb56ae42d83681f5145572e8dc Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 19 Jun 2023 18:28:01 +0200 Subject: [PATCH] Job-Planning: implement handling of deadlines for prerequisites ...simple implementation ...decide *not* to cache the deadlines for now (possibly quadratic!) ...Test GREEN --- src/steam/engine/job-planning.hpp | 18 ++-- tests/47engine.tests | 5 +- tests/core/steam/engine/job-planning-test.cpp | 44 +-------- wiki/thinkPad.ichthyo.mm | 93 ++++++++++++------- 4 files changed, 73 insertions(+), 87 deletions(-) diff --git a/src/steam/engine/job-planning.hpp b/src/steam/engine/job-planning.hpp index 79bda1161..6fee7ea05 100644 --- a/src/steam/engine/job-planning.hpp +++ b/src/steam/engine/job-planning.hpp @@ -56,8 +56,6 @@ ** the stack level above). See the [IterExplorer unit test](\ref lib::IterTreeExplorer_test::verify_expandOperation) ** to understand this recursive on-demand processing in greater detail. ** - ** @warning as of 4/2023 a complete rework of the Dispatcher is underway ///////////////////////////////////////////TICKET #1275 - ** ** @see JobPlanning_test ** @see JobTicket ** @see Dispatcher @@ -78,7 +76,6 @@ #include "lib/time/timevalue.hpp" #include "lib/itertools.hpp" #include "lib/nocopy.hpp" -#include "lib/util.hpp" @@ -91,8 +88,6 @@ namespace engine { using play::Timings; using lib::time::Time; using lib::time::Duration; - using util::unConst; - using util::isnil; @@ -108,8 +103,6 @@ namespace engine { * persisted (other then in the job to be created). The implementation draws * on a recursive exploration of the corresponding JobTicket, which acts as * a general blueprint for creating jobs within this segment of the timeline. - * - * @todo WIP-WIP 6/2023 reworking the job-planning pipeline for »PlaybackVerticalSlice« */ class JobPlanning : util::MoveOnly @@ -159,8 +152,7 @@ namespace engine { return Time::ANYTIME; case play::TIMEBOUND: - return timings.getTimeDue(frameNr_) - - totalLatency(timings); + return doCalcDeadline (timings); } NOTREACHED ("unexpected playbackUrgency"); } @@ -229,6 +221,14 @@ namespace engine { + timings.outputLatency; } + Time + doCalcDeadline(Timings const& timings) + { + Time anchor = isTopLevel()? timings.getTimeDue(frameNr_) + : dependentPlan_->determineDeadline (timings); ////////////////////TICKET #1310 : quadratic in the depth of the dependency chain + return anchor + - totalLatency(timings); + } #if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1276 :: to be refactored... /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1301 : likely to become obsolete diff --git a/tests/47engine.tests b/tests/47engine.tests index aed9f01ec..6bcae4155 100644 --- a/tests/47engine.tests +++ b/tests/47engine.tests @@ -49,11 +49,14 @@ return: 0 END -PLANNED "Render job planning calculation" JobPlanning_test < -//#include #include using test::Test; -//using util::isnil; -//using util::last; -//using std::vector; -//using std::function; -//using std::rand; using std::move; +using util::isSameObject; namespace steam { @@ -61,29 +44,9 @@ namespace engine{ namespace test { using lib::time::FrameRate; -// using lib::time::Duration; using lib::time::Offset; -// using lib::time::TimeVar; using lib::time::Time; -// using mobject::ModelPort; using play::Timings; - using util::isSameObject; - - namespace { // used internally - - -// ModelPort -// getTestPort() -// { -// return mockDispatcher().provideMockModelPort(); -// } - - - } // (End) internal defs -#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1301 -#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1301 - - @@ -92,7 +55,6 @@ namespace test { /***************************************************************//** * @test document and verify the data aggregation and the calculations * necessary to prepare render jobs for scheduling. - * @todo WIP-WIP 6/2023 */ class JobPlanning_test : public Test { @@ -194,7 +156,7 @@ namespace test { JobTicket& ticket = dispatcher.getJobTicketFor(portIDX, nominalTime); JobTicket& prereq = *(ticket.getPrerequisites()); // pick up the (only) prerequisite - JobPlanning masterPlan{ticket,nominalTime,frameNr}; + JobPlanning masterPlan{ticket,nominalTime,frameNr}; // the job plan for the master frame calculation JobPlanning prereqPlan{move(*(masterPlan.buildDependencyPlanning() ))}; // build a plan for calculating the prerequisite CHECK (isSameObject(ticket, masterPlan.ticket())); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 45265f889..5ad837074 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -75720,20 +75720,20 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - - + + + + - - + + - - + + - - + + @@ -75751,12 +75751,12 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + - - - + + + @@ -75766,8 +75766,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + +
@@ -75809,18 +75809,18 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- +
- - - + + + - + @@ -76190,32 +76190,49 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - + + +

- ...denn sonst würde es genau zu rekursiven kaskadierenden (exponentiell aufwendigen) Aufrufen der Deadline-Berechnungs-Logik kommen; um das Caching zu steuern, kann ich einen Marker-Wert Time::NEVER verwenden + ...denn sonst würde es genau zu rekursiven kaskadierenden (quadratisch aufwendigen) Aufrufen der Deadline-Berechnungs-Logik kommen; um das Caching zu steuern, kann ich einen Marker-Wert Time::NEVER verwenden

+ + + + - - + + + + + + +

+ Ich kann mir nicht vorstellen, daß die große Mehrheit der Jobs mehr als eine Prerequisite bekommt...  der Aufwand ist n/2 * (n+1), das bringt uns erst mal solange nicht um (bis es uns nachweislich umbringt...) +

+ +
+
+
+ +
- - + + @@ -76301,8 +76318,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + @@ -76747,14 +76764,14 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + - - + + @@ -86847,7 +86864,7 @@ class Something - + @@ -86859,6 +86876,10 @@ class Something + + + +