diff --git a/src/lib/symbol.hpp b/src/lib/symbol.hpp index c0e254bb2..3754d7a6c 100644 --- a/src/lib/symbol.hpp +++ b/src/lib/symbol.hpp @@ -148,7 +148,7 @@ namespace lib { Symbol& operator= (Symbol &&) = default; explicit operator bool() const { return not empty(); } - bool empty() const { return *this == BOTTOM; } + bool empty() const { return *this == BOTTOM or *this == EMPTY; } size_t length() const diff --git a/src/lib/time/grid.hpp b/src/lib/time/grid.hpp index fa9f18f7b..a154d52e9 100644 --- a/src/lib/time/grid.hpp +++ b/src/lib/time/grid.hpp @@ -76,7 +76,7 @@ namespace time { virtual TimeValue timeOf (FSecs gridTime, int=0) const =0; }; - typedef std::shared_ptr PGrid; + using PGrid = std::shared_ptr; diff --git a/src/lib/time/time.cpp b/src/lib/time/time.cpp index 14d80367b..f4bea5855 100644 --- a/src/lib/time/time.cpp +++ b/src/lib/time/time.cpp @@ -252,6 +252,7 @@ namespace time { /** predefined constant for PAL framerate */ const FrameRate FrameRate::PAL (25); const FrameRate FrameRate::NTSC (30000,1001); + const FrameRate FrameRate::STEP (1); const FrameRate FrameRate::HALTED (1,std::numeric_limits::max()); diff --git a/src/lib/time/timevalue.hpp b/src/lib/time/timevalue.hpp index acbb17e39..065101877 100644 --- a/src/lib/time/timevalue.hpp +++ b/src/lib/time/timevalue.hpp @@ -679,6 +679,7 @@ namespace time { static const FrameRate PAL; static const FrameRate NTSC; + static const FrameRate STEP; ///< 1 frame per second static const FrameRate HALTED; diff --git a/src/steam/asset/meta/time-grid.cpp b/src/steam/asset/meta/time-grid.cpp index 60ba3df21..3975dfe4b 100644 --- a/src/steam/asset/meta/time-grid.cpp +++ b/src/steam/asset/meta/time-grid.cpp @@ -88,7 +88,7 @@ namespace meta { { PGrid gridImplementation = AssetManager::instance().wrap (newGrid); PQuant quantiser (dynamic_pointer_cast(gridImplementation)); - Literal bindingID (cStr(newGrid.ident.name)); + Literal bindingID (cStr(newGrid.ident.name)); //////////////TODO 2023 shouldn't that be a lib::Symbol? advice::Provision(bindingID).setAdvice(gridImplementation); advice::Provision(bindingID).setAdvice(quantiser); @@ -157,16 +157,23 @@ namespace meta { } GridID nameID (id); - return publishWrapped (*new SimpleTimeGrid(origin, fps, nameID)); + // build new Meta-Asset, registered with AssetManager, and publish into Advice-System + return publishWrapped (*new SimpleTimeGrid(origin, fps, nameID)); ///////////////////////////TICKET #840 currently this replaces an existing Registration. What do we actually want here? } /* === TimeGrid shortcut builder functions === */ PGrid - TimeGrid::build (Symbol gridID, FrameRate frames_per_second) + TimeGrid::build (FrameRate frames_per_second) ///< automatically generates a generic grid name { - return build (gridID,frames_per_second, Time(0,0)); + return build (Symbol::EMPTY,frames_per_second); + } + + PGrid + TimeGrid::build (Symbol gridID, FrameRate frames_per_second) ///< grid origin is at Time::ZERO + { + return build (gridID,frames_per_second, Time::ZERO); } diff --git a/src/steam/asset/meta/time-grid.hpp b/src/steam/asset/meta/time-grid.hpp index 66aa71b8d..ee92243fc 100644 --- a/src/steam/asset/meta/time-grid.hpp +++ b/src/steam/asset/meta/time-grid.hpp @@ -90,6 +90,7 @@ namespace meta { public: /* === shortcut builder functions === */ + static PGrid build (FrameRate frames_per_second); static PGrid build (Symbol gridID, FrameRate frames_per_second); static PGrid build (Symbol gridID, FrameRate frames_per_second, Time origin); diff --git a/tests/basics/time/time-formats-test.cpp b/tests/basics/time/time-formats-test.cpp index 4802e6bae..97e1b6e3e 100644 --- a/tests/basics/time/time-formats-test.cpp +++ b/tests/basics/time/time-formats-test.cpp @@ -105,11 +105,11 @@ namespace test{ void checkTimecodeUsageCycle () { - string quellCode = generateRandomFrameNr(); - PQuant refScale = Quantiser::retrieve("pal0"); + string srcCode = generateRandomFrameNr(); + PQuant refScale = Quantiser::retrieve("pal0"); // get internal (raw) time value - TimeValue t1 = format::Frames::parse(quellCode, *refScale); + TimeValue t1 = format::Frames::parse (srcCode, *refScale); ENSURE (0 != t1); // manipulating @@ -134,8 +134,8 @@ namespace test{ q2.accept (Mutation::changeTime(v1)); CHECK (30 == q2.formatAs() - frames1); // q2 == v1 == t1 + (6*5)/(5*5)sec - CHECK (quellCode == string(frames1)); - CHECK (quellCode != string(frames2)); + CHECK (srcCode == string(frames1)); + CHECK (srcCode != string(frames2)); showTimeCode (frames1); showTimeCode (frames2); diff --git a/tests/basics/time/time-quantisation-test.cpp b/tests/basics/time/time-quantisation-test.cpp index 96b9383e4..5f21579f5 100644 --- a/tests/basics/time/time-quantisation-test.cpp +++ b/tests/basics/time/time-quantisation-test.cpp @@ -94,7 +94,7 @@ namespace test{ int n = count; // frame count, accessible as plain number CHECK (Time(FSecs(n-1, 25)) <= org); // verify quantisation: the original time - CHECK (org < Time(FSecs(n+1, 25))); // is properly bracketed by (n-1, n+2) + CHECK (org < Time(FSecs(n+1, 25))); // is properly bracketed by (n-1, n+1) } diff --git a/tests/core/steam/asset/meta/time-grid-basics-test.cpp b/tests/core/steam/asset/meta/time-grid-basics-test.cpp index 63e8fd52b..778576155 100644 --- a/tests/core/steam/asset/meta/time-grid-basics-test.cpp +++ b/tests/core/steam/asset/meta/time-grid-basics-test.cpp @@ -116,7 +116,7 @@ namespace test { void createGrid_simplified() { - PGrid simplePALGrid = TimeGrid::build ("", FrameRate::PAL); + PGrid simplePALGrid = TimeGrid::build (FrameRate::PAL); CHECK (simplePALGrid); CHECK (!util::isnil (simplePALGrid->ident.name)); // note: name-ID filled in automatically cout << "simple PAL Grid: " << simplePALGrid->ident << endl; diff --git a/tests/library/symbol-test.cpp b/tests/library/symbol-test.cpp index bcce23d7d..27e9e1fcd 100644 --- a/tests/library/symbol-test.cpp +++ b/tests/library/symbol-test.cpp @@ -47,12 +47,16 @@ namespace lib { namespace test{ - /******************************************************//** - * @test properties of Symbol data type. Currently this is - * just a thin wrapper for a const char * - * @todo this test is very much WIP, as the implementation - * of a real symbol type and symbol table remains - * to be done. ///////////////////////////Ticket #157 + /***********************************************************//** + * @test properties of Literal and Symbol data types. + * - a lib::Literal is just a thin wrapper for a `const char *` + * - lib::Symbol uses the same implementation, but relies on + * character string constants _interned_ into a symbol table. + * @todo 2023 this test is very much in preliminary shape, as the + * implementation of a real symbol table remains was lacking. + * At some point, a simplistic implementation of »interned strings« + * was added (TICKET #157) — yet still the actual relevance of + * unique Symbols remains nebulous */ class Symbol_test : public Test { @@ -133,6 +137,17 @@ namespace test{ CHECK (sy3.c() == Symbol{"⟂"}.c()); CHECK (Symbol{}.c() == Symbol{"⟂"}.c()); + // EMPTY and BOTTOM are distinct Symbols, yet both count as "empty" + CHECK (Symbol::EMPTY == Symbol{""}); + CHECK (Symbol::BOTTOM == Symbol{"⟂"}); + CHECK (Symbol::EMPTY != Symbol::BOTTOM); + CHECK (Symbol{nullptr} == Symbol::BOTTOM); + CHECK (Symbol::EMPTY.empty()); + CHECK (Symbol::BOTTOM.empty()); + CHECK (not Symbol::FAILURE.empty()); + CHECK (isnil (Symbol{"⟂"})); + CHECK (isnil (Symbol{""})); + // re-assignment sy3 = Symbol{l1}; CHECK (!isnil(sy3)); diff --git a/tests/vault/gear/test-chain-load-test.cpp b/tests/vault/gear/test-chain-load-test.cpp index 9c21915aa..d72ef9f1c 100644 --- a/tests/vault/gear/test-chain-load-test.cpp +++ b/tests/vault/gear/test-chain-load-test.cpp @@ -30,10 +30,12 @@ #include "test-chain-load.hpp" //#include "vault/real-clock.hpp" //#include "lib/time/timevalue.hpp" +#include "vault/gear/job.h" #include "lib/format-cout.hpp" ////////////////////////////////////TODO Moo-oh #include "lib/test/diagnostic-output.hpp"//////////////////////////TODO TOD-oh #include "lib/util.hpp" +#include //using lib::time::Time; //using lib::time::FSecs; @@ -42,6 +44,7 @@ using util::isnil; using util::isSameObject; //using lib::test::randStr; //using lib::test::randTime; +using std::array; namespace vault{ @@ -82,8 +85,7 @@ namespace test { showcase_PruneChains(); showcase_StablePattern(); verify_reseed_recalculate(); - - witch_gate(); + verify_scheduling_setup(); } @@ -927,13 +929,58 @@ namespace test { - /** @test TODO diagnostic blah - * @todo WIP 11/23 🔁 define ⟶ implement + /** @test TODO setup for running a chain-load as scheduled task + * - running an isolated Node recalculation + * - dispatch of this recalculation packaged as render job + * + * @todo WIP 12/23 🔁 define ⟶ implement */ void - witch_gate() + verify_scheduling_setup() { - UNIMPLEMENTED ("witch gate"); + array nodes; + auto& [s,p1,p2,e] = nodes; + s.addSucc(p1) + .addSucc(p2); + e.addPred(p1) + .addPred(p2); + s.level = 0; + p1.level = p2.level = 1; + e.level = 2; + CHECK (e.hash == 0); + for (Node& n : nodes) + n.calculate(); + CHECK (e.hash == 0x6A5924BA3389D7C); + + + // now do the same invoked as »render job« + for (Node& n : nodes) + n.hash = 0; + s.level = 0; + p1.level = 1; + p2.level = 1; + e.level = 2; + + RandomChainCalcFunctor<32,16> chainJob{nodes[0]}; + Job job0{chainJob + ,chainJob.encodeNodeID(0) + ,chainJob.encodeLevel(0)}; + Job job1{chainJob + ,chainJob.encodeNodeID(1) + ,chainJob.encodeLevel(1)}; + Job job2{chainJob + ,chainJob.encodeNodeID(2) + ,chainJob.encodeLevel(1)}; + Job job3{chainJob + ,chainJob.encodeNodeID(3) + ,chainJob.encodeLevel(2)}; + + CHECK (e.hash == 0); + job0.triggerJob(); + job2.triggerJob(); + job1.triggerJob(); + job3.triggerJob(); + CHECK (e.hash == 0x6A5924BA3389D7C); } }; diff --git a/tests/vault/gear/test-chain-load.hpp b/tests/vault/gear/test-chain-load.hpp index 6d18c1356..7c9b06a09 100644 --- a/tests/vault/gear/test-chain-load.hpp +++ b/tests/vault/gear/test-chain-load.hpp @@ -83,13 +83,14 @@ #include "vault/common.hpp" #include "lib/test/transiently.hpp" -//#include "vault/gear/job.h" +#include "vault/gear/job.h" //#include "vault/gear/activity.hpp" -//#include "vault/gear/nop-job-functor.hpp" -//#include "lib/time/timevalue.hpp" +#include "vault/gear/nop-job-functor.hpp" +#include "lib/time/timevalue.hpp" //#include "lib/meta/variadic-helper.hpp" //#include "lib/meta/function.hpp" //#include "lib/wrapper.hpp" +#include "lib/time/quantiser.hpp" #include "lib/iter-explorer.hpp" #include "lib/format-string.hpp" #include "lib/format-cout.hpp" @@ -115,7 +116,7 @@ namespace test { using std::string; // using std::function; // using lib::time::TimeValue; -// using lib::time::Time; + using lib::time::Time; // using lib::time::FSecs; // using lib::time::Offset; // using lib::meta::RebindVariadic; @@ -995,5 +996,54 @@ namespace test { + + + /* ========= Render Job generation and Scheduling ========= */ + + template + class RandomChainCalcFunctor + : public NopJobFunctor + { + using Node = typename TestChainLoad::Node; + + public: + RandomChainCalcFunctor(Node& startNode) + { } + + + /** rigged special implementation of job invocation + */ + void + invokeJobOperation (JobParameter param) override + { + UNIMPLEMENTED ("unpack parameters and dispatch into TestChainLoad-Node"); + } + + string diagnostic() const override + { + return "ChainCalc-TODoh"; + } + + /** package the node-index to invoke. + * @note per convention for this test, this info will be + * packaged into the lower word of the InvocationInstanceID + */ + static auto + encodeNodeID (size_t idx) + { + InvocationInstanceID invoKey; + invoKey.code.w1 = idx; + return invoKey; + }; + + static Time + encodeLevel (size_t level) + { + UNIMPLEMENTED ("setup a FixedFrameQuantiser with 1FPS"); + } + }; + + + }}} // namespace vault::gear::test #endif /*VAULT_GEAR_TEST_TEST_CHAIN_LOAD_H*/ diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index b1b0fac2d..ddaf8016f 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -79709,7 +79709,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + @@ -79718,13 +79718,88 @@ Date:   Thu Apr 20 18:53:17 2023 +0200

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

+ ⟹ man könnte Argumente encodieren +

+ +
+ + + + + + + + + + + + + + + + + + + + + +

+ denn damit wäre nicht nur die Segmentation zu erhalten, sondern auch der Play-Prozess-Translator-Record — solange bis kein Job mehr „anrufen“ kann +

+ +
+
+
+ + + + + + + + + + + + + +

+ Fazit: nein und YAGNI +

+ +
+ + + + + +
+
+
@@ -79751,7 +79826,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + @@ -100268,6 +100343,298 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + + + + +

+ Stand: noch nicht volltändig umgesetzt +

+ +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + +

+ für den eigentlichen Aufruf genügt ein Node* +

+ +
+ +
+ + + + + + + + +

+ ....und das hängt vom Template-Parameter der TestChainLoad ab (size_t maxFan) +

+ +
+
+ + + + + + + + + + + + + + + + + + +

+ weiß ja noch nicht, wie das für ProcNode implementiert wird +

+ +
+
+
+
+ + + + + + + + + + +

+ formal-Logisch entspräche der Node-Index dem srcRef-Parameter +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ also nicht um den gesamten Playback-Prozeß. Es müssen keinerlei Deadline-Planungen gemacht werden; das kommt alles Fix per Test-Setup +

+ +
+
+
+ + + + + + +

+ das könnten Varianten des Test-Setup sein; weiß noch nicht was hier gebraucht wird. Rein intuitiv würde ich erst mal nur nach dem Level vorgehen +

+ +
+
+ + + + + + +

+ das paßt doch hervorragend; LevelNr ≡ nominal time +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ wir wissen, daß es keine concurrent Aufrufe geben wird, und auch Allokation stellt kein Problem dar; wir können einfach State im »Test-Rahmen« liegen lassen +

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + @@ -110762,8 +111129,7 @@ class Something Da alignof(char) ≡ 1, ist es gradezu eine »Steilvorlage« für Probleme, wenn man einen Allocation-Buffer per char[] deklariert. GCC macht das nicht (er fängt Allokationen immer an 64bit-Grenzen an), aber grundsätzlich dürfte ein Compiler ein char[] anfangen, wo er grad' lustig ist. Besonders gefährlich, wenn das Array in ein anderes Objekt eingebettet wird. Nur den zuletzt genannten Fall habe ich 2019 abgeklärt; gegen alle sonstigen Schnaps-Ideen gibt es keinen Schutz — es sei denn, man hält sich an die Sprachmittel

- - +
@@ -110775,6 +111141,7 @@ class Something +