OutputSlot: consider how to integrate the proxy provider
...which still looks like a nasty task * the good part is, we have a working `BufferProxyAdaptor` now * yet this setup does not seem to fit into the `OutputSlot::AllocState` As an aside, several test definitions need to be relocated to the Vault, since the whole compound around `BufferProvider` migrated down
This commit is contained in:
parent
ea0ae5f78e
commit
9b6933b572
5 changed files with 57 additions and 31 deletions
|
|
@ -86,20 +86,21 @@ namespace mem {
|
|||
BuffAlloc
|
||||
provideBuffer (HashVal,size_t siz,LocalTag targetMarker) override
|
||||
{
|
||||
CONF::on_lock();
|
||||
return {asBuffer(targetMarker), siz, targetMarker};
|
||||
BuffAlloc storageSlot{asBuffer(targetMarker), siz, targetMarker};
|
||||
CONF::on_lock (storageSlot);
|
||||
return storageSlot;
|
||||
}
|
||||
|
||||
void
|
||||
mark_emitted (HashVal, BuffAlloc storageSlot) override
|
||||
{
|
||||
CONF::on_emit();
|
||||
CONF::on_emit (storageSlot);
|
||||
}
|
||||
|
||||
void
|
||||
detachBuffer (HashVal, BuffAlloc storageSlot) override
|
||||
{
|
||||
CONF::on_release();
|
||||
CONF::on_release (storageSlot);
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
@ -142,11 +143,18 @@ namespace mem {
|
|||
: proxyProvider_{Setup{move(policy)}}
|
||||
{ }
|
||||
|
||||
template<typename TAR>
|
||||
BuffDescr
|
||||
getDescriptorFor (TAR& dataBlock)
|
||||
{
|
||||
return proxyProvider_.registerBuffer(&dataBlock, sizeof(TAR));
|
||||
}
|
||||
|
||||
template<typename TAR>
|
||||
BuffHandle
|
||||
lockBuffer (TAR& dataBlock)
|
||||
{
|
||||
BuffDescr buffType = proxyProvider_.registerBuffer(&dataBlock, sizeof(TAR));
|
||||
BuffDescr buffType = getDescriptorFor<TAR> (dataBlock);
|
||||
ENSURE (buffType.isValid());
|
||||
return buffType.lockBuffer();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ return: 0
|
|||
END
|
||||
|
||||
|
||||
PLANNED "Proxy Buffer-provider" BufferProxyProvider_test <<END
|
||||
TEST "Proxy Buffer-provider" BufferProxyAdaptor_test <<END
|
||||
return: 0
|
||||
END
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
OutputProxyProvider(Test) - verify accessing an output sink via BufferProvider protocol
|
||||
BufferProxyAdaptor(Test) - verify accessing an output sink via BufferProvider protocol
|
||||
|
||||
Copyright (C)
|
||||
2024, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
* *****************************************************************/
|
||||
|
||||
/** @file output-proxy-provider-test.cpp
|
||||
** unit test \ref OutputProxyProvider_test
|
||||
/** @file buffer-proxy-adaptorr-test.cpp
|
||||
** unit test \ref BufferProxyAdaptor_test
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -37,12 +37,16 @@ namespace test {
|
|||
|
||||
|
||||
/***************************************************************//**
|
||||
* @test verify the design of OutputSlot and BufferProvider by
|
||||
* implementing a delegating BufferProvider to expose
|
||||
* output data buffers provided from _some implementation._
|
||||
* @todo 2/2026 now using this setup for prototyping /////////////////////////////////////////////////TICKET #1415 : explore this design idea through prototyping
|
||||
* @test demonstrate a configuration of the BufferProvider implementation,
|
||||
* rigged such that a pre-existing given buffer (address) can be
|
||||
* passed through and exposed as BuffHandle.
|
||||
* @remark while this looks like a rather convoluted implementation setup,
|
||||
* this feature is crucial to make the »Output Slot Protocol«
|
||||
* mesh up well ([1415]) with the »Buffer Provider Protocol«,
|
||||
* used internally within the Render Engine
|
||||
* [1415]: https://issues.lumiera.org/ticket/1415]
|
||||
*/
|
||||
class OutputProxyProvider_test : public Test
|
||||
class BufferProxyAdaptor_test : public Test
|
||||
{
|
||||
virtual void
|
||||
run (Arg)
|
||||
|
|
@ -51,9 +55,9 @@ namespace test {
|
|||
|
||||
// setup with notification callback
|
||||
BufferProxyAdaptor proxPro{PropBuilder()
|
||||
.define (PROP_FIELD(on_lock), [&]{ state = LOCKED; })
|
||||
.define (PROP_FIELD(on_emit), [&]{ state = EMITTED;})
|
||||
.define (PROP_FIELD(on_release),[&]{ state = FREE; })
|
||||
.define (PROP_FIELD(on_lock), [&](BuffAlloc){ state = LOCKED; })
|
||||
.define (PROP_FIELD(on_emit), [&](BuffAlloc){ state = EMITTED;})
|
||||
.define (PROP_FIELD(on_release),[&](BuffAlloc){ state = FREE; })
|
||||
};
|
||||
|
||||
// Assuming some data block is »given«
|
||||
|
|
@ -90,7 +94,7 @@ namespace test {
|
|||
|
||||
|
||||
/** Register this test class... */
|
||||
LAUNCHER (OutputProxyProvider_test, "unit play");
|
||||
LAUNCHER (BufferProxyAdaptor_test, "unit play");
|
||||
|
||||
|
||||
|
||||
|
|
@ -115054,7 +115054,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
<node COLOR="#338800" CREATED="1773604361248" ID="ID_720105604" MODIFIED="1773604407072" TEXT="in das BufferStore-API und Implementierungen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#c8c0b6" COLOR="#435e98" CREATED="1773604377214" FOLDED="true" ID="ID_200162330" MODIFIED="1773700514964" TEXT="muß die Size-Info in die Metadaten weitergeben">
|
||||
<node BACKGROUND_COLOR="#c8c0b6" COLOR="#435e98" CREATED="1773604377214" ID="ID_200162330" MODIFIED="1773704036391" TEXT="muß die Size-Info in die Metadaten weitergeben">
|
||||
<linktarget COLOR="#1c07d0" DESTINATION="ID_200162330" ENDARROW="Default" ENDINCLINATION="-77;817;" ID="Arrow_ID_1474651143" SOURCE="ID_49953306" STARTARROW="None" STARTINCLINATION="1030;40;"/>
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1773606726737" ID="ID_1617991320" MODIFIED="1773606747708" TEXT="die BufferMetadata::markLocked() muß eine abweichende BufferSize speichern"/>
|
||||
|
|
@ -115179,8 +115179,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
Und damit spielt sich das System dann irgendwann auf einen festen Pool von Buffer-»Slots« ein, die permanent im Speicher bleiben. Allerdings bedeutet das dann für die Metadaten ein <b>Cartesisches Produkt</b>  zwischen der Zahl der Memory-Slots und der Zahl der verschiedenen Buffer-Typen....
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1773684209259" ID="ID_1502362582" MODIFIED="1773685168035" TEXT="zur Beurteilung dessen brauchen wir aber Praxiserfahrung">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
|
|
@ -115190,8 +115189,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
Ob das also gefährlich wird, oder eine etwas ausufernde Metadaten-Storage durchaus überkompensiert wird von dem Wegfall der permanenten Allokation/Deallokation (und Hashtable-Pflege), kann nicht auf theoretischer Ebene abgehandelt werden. Mehr noch: es ist sogar zweifelhaft, ob sich <i>diese Frage überhaupt zuverlässig beantworten läßt, auch empirisch!</i> Dazu müßte man einen Weg finden, um die <i>Stabilität</i> des Verhaltens zu beurteilen, über verschieden Nutzszenarien hinweg
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1773684267099" ID="ID_223570720" MODIFIED="1773685274668" TEXT="und dann möglicherweise einen Garbage-sweep">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
|
|
@ -115201,8 +115199,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
Allerdings, wenn man sich darauf einläßt, Speicher nicht wegzuräumen, dann muß man explizit den Fall betrachten, daß der Speicher volläuft. In dem Fall bräuchte es einen »Sweep«, der über die Metadaten-Tabelle iteriert und alle Einträge pauschal löscht, die als FREE markiert sind. <i>The usual trade-offs apply.</i>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -115214,8 +115211,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
Einsicht: nicht re-Locking sondern das <font face="Monospaced" color="#684e4e"><b>onlyNew</b></font> ist hier redundant
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="idea"/>
|
||||
<node CREATED="1773686546507" ID="ID_1896242135" MODIFIED="1773686555542" TEXT="das ist so ein pseudo-Konsistenzcheck"/>
|
||||
<node CREATED="1773686569345" ID="ID_811960003" MODIFIED="1773686579555" TEXT="dabei haben wir ohnehin eine State-Machine"/>
|
||||
|
|
@ -137523,8 +137519,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
fragwürdig ist im Besonderen der hierarchische Ansatz, der die konkreten Storage-Metadaten als Spezialisierung eines Typ-Eintrags behandelt.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1773685436937" ID="ID_1194997795" MODIFIED="1773685524347" TEXT="Buffer-Metadaten werden mutmaßlich auch vom Storage-Backend mitverwendet">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
|
|
@ -137534,8 +137529,10 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
Im Besonderen stehen dort all die relevanten Infos, die jeder Memory-Allocator benötigt: die konkrete Adresse und die Size (möglicherweise sogar ein MRU-counter, oder ähnliche technische Informationen)
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<node CREATED="1773703954354" ID="ID_1415408255" MODIFIED="1773703991156" TEXT="möglicherweise will man gemeinsame Metadaten-Tabellen">
|
||||
<linktarget COLOR="#76516c" DESTINATION="ID_1415408255" ENDARROW="Default" ENDINCLINATION="779;39;" ID="Arrow_ID_1408352744" SOURCE="ID_340628735" STARTARROW="None" STARTINCLINATION="468;17;"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1773686351857" ID="ID_867612305" MODIFIED="1773686475190" TEXT="Performance und Zusammenspiel mit dem Betriebszustand?">
|
||||
<linktarget COLOR="#794397" DESTINATION="ID_867612305" ENDARROW="Default" ENDINCLINATION="-1231;58;" ID="Arrow_ID_535246973" SOURCE="ID_339106431" STARTARROW="None" STARTINCLINATION="-148;960;"/>
|
||||
|
|
@ -138021,6 +138018,23 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
|
|||
<linktarget COLOR="#4b1ec1" DESTINATION="ID_49953306" ENDARROW="Default" ENDINCLINATION="-1107;45;" ID="Arrow_ID_474360109" SOURCE="ID_497122958" STARTARROW="None" STARTINCLINATION="687;22;"/>
|
||||
<linktarget COLOR="#5a22df" DESTINATION="ID_49953306" ENDARROW="Default" ENDINCLINATION="770;-33;" ID="Arrow_ID_886780269" SOURCE="ID_1831855764" STARTARROW="None" STARTINCLINATION="751;0;"/>
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1773703618287" HGAP="62" ID="ID_914494536" MODIFIED="1773703647578" TEXT="muß BufferProxyAdaptor in OutputSlot::Allocstate integrieren" VSHIFT="33">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node CREATED="1773703751137" ID="ID_340628735" MODIFIED="1773703998020" TEXT="Überlegung am Rande: längerfristig wollen wir einen globalen Metadaten-Store">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
In der aktuellen Konfiguration hat jeder BufferProvider seine eigenes BufferStage-Implementierung, und darin eingebettet eine eigene Metadaten-Hashtable. Im Falle des BufferProxyAdaptors bedeutet das, für jede Allokation eines OutputSlot erneut eine Metadaten-Verwaltung zu konstruieren, die dann aber nur für wenige Buffer-Einträge genutzt wird. Da Output-Slots durchaus längerfristig leben, stellt das kein Performance-Problem da, aber könnte letztlich schon zu einigem Bloat führen
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<arrowlink COLOR="#76516c" DESTINATION="ID_1415408255" ENDARROW="Default" ENDINCLINATION="779;39;" ID="Arrow_ID_1408352744" STARTARROW="None" STARTINCLINATION="468;17;"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1773456815562" ID="ID_1123444875" MODIFIED="1773589752521" TEXT="Doku">
|
||||
|
|
|
|||
Loading…
Reference in a new issue