Commit graph

72 commits

Author SHA1 Message Date
bcd2b3d632 PlaybackVerticalSlice: design analysis for Frame Dispatcher and Scheduler
- decision: the Monad-style iteration framework will be abandoned
- the job-planning will be recast in terms of the iter-tree-explorer
- job-planning and frame dispatch will be disentangled
- the Scheduler will deliberately offer a high-level interface
- on this high-level, Scheduler will support dependency management
- the low-level implementation of the Scheduler will be based on Activity verbs
2023-04-14 04:43:39 +02:00
acb674a9d2 Project: update and clean-up Doxygen configuration
...in an attempt to clarify why numerous cross links are not generated.
In the end, this attempt was not very successful, yet I could find some breadcrumbs...

- file comments generally seem to have a problem with auto link generation;
  only fully qualified names seem to work reliably

- cross links to entities within a namespace do not work,
  if the corresponding namespace is not documented in Doxygen

- documentation for entities within anonymous namespaces
  must be explicitly enabled. Of course this makes only sense
  for detailed documentation (but we do generate detailed
  documentation here, including implementation notes)

- and the notorious problem: each file needs a valid @file comment

- the hierarchy of Markdown headings must be consistent within each
  documentation section. This entails also to individual documented
  entities. Basically, there must be a level-one heading (prefix "#"),
  otherwise all headings will just disappear...

- sometimes the doc/devel/doxygen-warnings.txt gives further clues
2021-01-24 19:35:45 +01:00
bdf3351f55 ClipDisplay: basic implementation of ViewHook helper 2019-11-08 20:49:37 +01:00
767156e912 TreeExplorer: unit test coverage for injected custom layer 2018-09-16 01:07:23 +02:00
df7a9492b7 TreeExplorer: helper function so support ChainSearch::clearFilter()
build a special feature into the Explorer component of TreeExplorer,
causing it to "lock into" the current child sequence and discard
all previous sequences from the stack of child explorations
2018-09-14 21:06:15 +02:00
7cdd680e78 TreeExplorer: clean-up after refactoring
So we have now a reworked version of the internals of TreeExplorer in place.
It should be easier to debug template instantation traces now, since most
of the redundancy on the type parameters could be remove. Moreover, existing
pipelines can now be re-assigned with similarily built pipelines in many cases,
since the concrete type of the functor is now erased.

The price tag for this refactoring is that we have now to perform a call
through a function pointer on each functor invocation (due to the type erasure).
And seemingly the bloat in the debugging information has been increased slightly
(this overhead is removed by stripping the binary)
2018-09-14 21:06:15 +02:00
36d79be8b2 TreeExplorer: refactor Filter in a similar way 2018-09-14 21:06:15 +02:00
1e657acbff TreeExplorer: refactor Transformer to employ the improved wrapping style
...step by step switch over to the new usage pattern.
Transformer should be the blueprint for all other functor usages.


The reworked solutions behaves as expected;
we see two functor invocations; the outer functor, which does
the argument adaptation, is allocated in heap memory
2018-09-14 21:06:15 +02:00
e3ca8548a4 TreeExplorer: allow for a disabled filter
...considered as one of the building blocks to resolve Problems in the Design of ChainSearch
2018-09-14 21:06:15 +02:00
4988153e15 Library: prevent implicit bool conversion on iterator-like objects
...it should have been this way all the time.
Generic code might otherwise be ill guided to assume a conversion
from the Iterator to its value type, while in fact an explicit dereferentiation is necessary
2018-09-14 21:06:14 +02:00
433543a2c7 DOC: some doxygen fixes 2018-09-14 21:06:14 +02:00
604ffbf73c TreeExplorer: fix a bug and finish the feature
we did an unnecessary copy of the argument, which was uncovered
by the test case manipulating the state core.


Whew.
Now we have a beautiful new overengineered solution
2018-09-14 21:06:14 +02:00
be7f47d5b7 TreeExplorer: rework the solution to allow for arbitrary functor types
outift the Filter base class with the most generic form of the Functor
wrapper, and rather wrap each functor argument individually. This allows
then to combine various kinds of functors
2018-09-14 21:06:14 +02:00
90c0f43cfd TreeExplorer: code all the combination cases
...this solution works, but has a shortcoming:
the type of the passed lambdas is effectively pinned to conform
with the signature of the first lambda used initially when building the filter.

Well, this is the standard use case, but it kind of turns all the
tricky warpping and re-binding into a nonsense excercise; in this form
the filter can only be used in the monadic case (value -> bool).

Especially this rules out all the advanced usages, where the filter
collaborates with the internals of the source.
2018-09-14 21:06:14 +02:00
e29d9ae19e TreeExplorer: better package this very specific code as subclass
while this is basically just code code cosmetics,
at least it marks this as a very distinct special case,
and keeps the API for the standard Filter layer clean.
2018-09-14 21:06:14 +02:00
8f70b4e902 TreeExplorer: prototype for the extracted boilerplate helper
a quite convoluted construct built from several nested generic lambdas.
When investigated in the debugger, the observed addresses and the
invoked code looks sane and as expected.
2018-09-14 21:06:14 +02:00
94da0f627f TreeExplorer: draft ability to remould the filter
The intention is to switch from the itertools-based filter
to the filter available in the TreeExplorer framework.
Thus "basically" we just need to copy the solution over,
since both are conceptually equivalent.

However...... :-(
The TreeExplorer framework is designed to be way more generic
and accepts basically everything as argument and tries to adapt apropriately.

This means we have to use a lot of intricate boilerplate code,
just to get the same effect that was possible in Itertools with
a simple and elegant in-place lambda assignment
2018-09-14 21:06:14 +02:00
757258fb3a TreeExplorer: fix bug in Filter layer
Fillter needs to be re-evaluated, when an downstream entity requests
expandChildren() onto an upstream source. And obviously the ordering
of the chained calls was wrong here.

As it turns out, I had discovered that necessity to re-evaluate with
the Transformer layer. There is a dedicated test case for that, but
I cut short on verifying the filter in that situation as well, so
that piece of broken copy-n-paste code went through undetected.

This is in fact a rather esoteric corner case, because it is only
triggered when the expandChildren() call is passed through the filter.
When otoh the filter sits /after/ the entity generating the expandChildren()
calls, everything works as intended. And the latter is the typical standard
usage situation of an recursive evalutation algorithm: the filter is here
used as final part to drive the evaluation ahead and pick the solutions.
2018-09-14 21:06:14 +02:00
3fc5a94b87 TreeExplorer: investigate the backtracking abilities
There is a bug or shortcoming in the existing ErrorLog matcher implementation.
It is not really difficult to fix, however doing so would require us to intersperse
yet another helper facility into the log matcher. And it occurred to me, that
this helper would effectively re-implement the stack based backtracking ability,
which is already present in TreeExplorer (and was created precisely to support
this kind of recursive evaluation strategies).

Thus I intend to switch the implementation of the EventLog matcher from the
old IterTool framework to the newer TreeExplorer framework. And this intention
made me re-read the code, fixing several comments and re-thinking the design
2018-09-14 21:06:14 +02:00
89d93a13e4 Modernise Unknown Exception handler and Exception messages 2018-04-02 01:48:51 +02:00
d2bbe9c61b TreeExplorer: define behaviour of new "delayed expansion" feature
...we need yet another feature to build the path matching for the Navigator
2018-01-01 17:43:49 +01:00
d5ae52e558 UI-Coordinates: design implementation of the patch matching algorithm
...which indicates that we need some additional functionality from TreeExplorer
2017-12-31 21:05:15 +01:00
2ea2d38cb2 Navigator: build iterator front-end based on the new TreeExploer capabilities
...but not yet switched into the main LocationQuery interface,
because that would also break the existing implementation;
recasting this implementation is the next step to do....
2017-12-24 04:48:07 +01:00
d653937465 TreeExplorer: allow to call through an IterSource based API for child-expansion
...which basically allows us to return any suitable implementation
for the child iterator, even to switch the concrete iteration on each level.
We need this flexibility when implementing navigation through a concrete UI
2017-12-24 03:28:40 +01:00
f05b3f56c0 Library/IterSource: allow for mix-in extension of the IterSource interface
...at least when using a wrapped Lumiera Iterator as source.
Generally speaking, this is a tricky problem, since real mix-in interfaces
would require the base interface (IterSource) to be declared virtual.

Which incurres a performance penalty on each and every user of IterSource,
even without any mix-in additions. The tricky part with this is to quantify
the relevance of such a performance penalty, since IterSource is meant
to be a generic library facility and is a fundamental building block
on several component interfaces within the architecture.
2017-12-23 18:55:26 +01:00
64ba7bf372 TreeExplorer: now able to pick up and wrap an IterSource 2017-12-23 18:32:25 +01:00
147aeb4049 TreeExplorer: draft immediate IterSource adaptor
This is just a temporary solution, until IterSource is properly refactored (#1125)
After that, IterSource is /basically a state core/ and the adaptor will be more or less trivial
2017-12-23 02:29:19 +01:00
95b5786798 Navigator: consider to work around problems with adapting IterSource
- as it stands currently, IterSource has a design problem, (see #1125)
- and due to common problems in C++ with mix-ins and extended super interfaces,
  it is surprisingly tricky to build on an extension of IterSource
- thus the idea is to draft a new solution "in green field"
  by allowing TreeExplorer to adapt IterSource automatically
- the new sholution should be templated on the concrete sub interface
  and ideally even resolve the mix-in-problem by re-linearising the
  inheritance line, i.e. replace WrappedLumieraIter by something
  able to wrap its source, in a similar vein as TreeExplorer does
2017-12-23 01:59:31 +01:00
1fdeb08f19 TreeExplorer: finished and unit test PASS
several extensions and convenience features are conceivable,
but I'll postpone all of them for later, when actual need arises

Note especially there is one recurring design challenge, when creating
such a demand-driven tree evaluation: more often than not it turns out
that "downstream" will need some information about the nested tree structure,
even while, on the surfice, it looks as if the evaluation could be working
completely "linearised". Often, such a need arises from diagnostic features,
and sometimes we want to invoke another API, which in turn could benefit
from knowing something about the original tree structure, even if just
abstracted.

I have no real solution for this problem, but implementing this pipeline builder
leads to a pragmatic workaround: since the iterator already exposes a expandChildren(),
it may as well expose a depth() call, even while keeping anything beyond that
opaque. This is not the clean solution you'd like, but it comes without any
overhead and does not really break the abstraction.
2017-12-17 03:02:00 +01:00
7ed1948a89 TreeExplorer: refactor to make depth() reflect the logical expansion depth
...so sad.
The existing implementation was way more elegant,
just it discarded an exahusted parent element right while in expansion,
so effectively the child sequence took its place. Resolved that by
decomposing the iterNext() operation. And to keep it still readable,
I make the invariant of this class explicit and check it (which
caught yet another undsicovered bug. Yay!)
2017-12-16 19:21:22 +01:00
add5046c6e TreeExplorer: maybe pragmatic workaround for the remaining design problem
instead of building a very specific collaboration,
rather just pass the tree depth information over the extended iterator API.
This way, "downstream" clients *can* possibly react on nested scope exploration
2017-12-16 06:18:44 +01:00
53efdf6e2b TreeExplorer: investigate logical contradiction in this design
We get conflicting goals here:
 - either the child expansion happens within the opaque source data
   and is thus abstracted away
 - or the actual algorithm evaluation becomes aware of the tree structure
   and is thus able to work with nested evaluation contexts and a local stack
2017-12-15 00:32:30 +01:00
30775b2b32 TreeExplorer: draft demonstration example for a search algorithm
...build on top of the core features of TreeExplorer
- completely encapsulate and abstract the source data structure
- build an backtracking evaluation based on layered evaluation
  of this abstracted expandable data source

NOTE: test passes compilation, but doesn't work yet
2017-12-14 03:06:19 +01:00
46287dac0e TreeExplorer: Monads are of limited usefulnes
...and there is a point where to stop with the mere technicalities,
and return to a design in accordance with the inner nature of things.

Monads are a mere technology, without explicatory power as a concept or pattern

For that reason
 - discard the second expansion pattern implemented yesterday,
   since it just raises the complexity level for no given reason
 - write a summary of my findings while investigating the abilities
   of Monads during this design excercise.
 - the goal remains to abandon IterExplorer and use the now complete
   IterTreeEplorer in its place. Which also defines roughly the extent
   to wich monadic techniques can be useful for real world applications
2017-12-11 02:21:32 +01:00
4ef1801a6f TreeExplorer: draft how depth-first-to-leafs might be implemented
...it can sensibly only be done within the Expander itself.
Question: is this nice-to-have-feature worth the additional complexity
of essentially loading two quite distinct code paths into a single
implementation object?

As it stands, this looks totally confusing to me...
2017-12-11 02:20:15 +01:00
13d32916ee TreeExplorer: implement simple auto-expansion
...just expand children instead of normal iteration;
works out of the box, since expansion itself performs a iteration step.
2017-12-10 00:24:36 +01:00
fd5d44f6ca TreeExplorer: draft next case -- auto-expand children
this leads to either unfolding the full tree depth-first,
or, when expanding eagerly, to delve into each sub-branch down to the leaf nodes

Both patterns should be simple to implement on top of what we've built already...
2017-12-09 19:42:22 +01:00
e242053620 TreeExplorer: document wrapping into IterSource 2017-12-09 18:41:35 +01:00
c7e37c29e6 TreeExplorer / IterSource: document design mismatch (-> Ticket #1125)
IterSource should be refactored to have an iteration control API similar to IterStateWrapper.
This would resolve the need to pass that pos-pointer over the abstraction barrier,
which is the root cause for all the problems and complexities incurred here
2017-12-09 06:24:57 +01:00
f300545232 TreeExplorer: investigate wrong behaviour in test
turns out that -- again -- we miss some kind of refresh after expanding children.
But this case is more tricky; it indicates a design mismatch in IterSource:
we (ab)use the pos-pointer to communicate iteration state. While this might be
a clever trick for iterating a real container, it is more than dangerous when
applied to an opaque source state as in this case. After expanding children,
the pos-pointer still points into the cache buffer of the last transformer.
In fact, we miss an actualisation call, but the IterSource interface does not
support such a call (since it tries to get away with state hidden in the pos pointer)
2017-12-09 03:49:59 +01:00
7f6bfc1e45 TreeExplorer: implement wrapping opaquely into an IterSource 2017-12-09 01:17:50 +01:00
681cfbfd8c TreeExplorer: add warning due to the moving builder operations
this was a design decision, but now I myself run into that obvious mistake;
thus not sure if this is a good design, or if we need a dedicated operation
to finish the builder and retrieve the iterable result.
2017-12-08 05:34:28 +01:00
ce1ee71955 TreeExplorer: clarify base initialisation
as it turned out, when "inheriting" ctors, C++14 removes the base classes' copy ctors.
C++17 will rectify that. Thus for now we need to define explicitly that
we'll accept the base for initialising the derived. But we need do so
only on one location, namely the most down in the chain.
2017-12-08 05:32:04 +01:00
aa008d6d4a TreeExplorer: draft my requirements for packaging a TreeExplorer pipeline as IterSource
Since this now requires to import iter-adapter-stl.hpp and iter-source.hpp
at the same time, I decided to drop the convenience imports of the STL adapters
into namespace lib. There is no reason to prefer the IterSource-based adapters
over the iter-adapter-stl.hpp variants of the same functionality.
Thus better always import them explicitly at usage site.


...actual implementation of the planned IterSource packaging is only stubbed.
But I needed to redeclare a lot of ctors, which doesn't seem logical
And I get a bad function invocation from another test case which worked correct beforehand.
2017-12-07 05:48:36 +01:00
9b9dcb2b78 TreeExplorer: add yet another convoluted example
Yay!
...and all of this works flawless right away
2017-12-07 03:11:11 +01:00
160a5e5465 TreeExplorer: cover further flavours of predicate definition 2017-12-07 02:19:19 +01:00
2eacde7f2c TreeExplorer: draft the filter operation
should be low hanging fruit now....
2017-12-06 02:33:32 +01:00
085b304a38 TreeExplorer: finish test coverage of expand+transform 2017-12-06 02:02:22 +01:00
52edf7d930 Refactoring: switch IterStateWrapper to member function based API
Considering the fact that we are bound to introduce yet another iteration control function,
because there is literally no other way to cause a refresh within the IterTreeExplorer-Layers,
it is indicated to reconsider the way how IterStateWrapper attaches to the
iteration control API.

As it turns out, we'll never need an ADL-free function here;
and it seems fully adequate to require all "state core" objects to expose
the API as argument less member function. Because these reflect precisely
the contract of a "state core", so why not have them as member functions.
And as a nice extra, the implementation becomes way more concise in
all the cases refactored with this changeset!

Yet still, we stick to the basic design, *not* relying on virtual functions.
So this is a typical example of a Type Class (or "Concept" in C++ terminology)
2017-12-05 03:28:00 +01:00
81c6136509 TreeExplorer: define interaction between expand and transform-operation
good news: it (almost) works out-of-the-box as expected.

There is only one problem: expandChildren() alters the content of the
data source, yet downstream decorators aren't aware of that fact and
continue to present cached evaluations, until the next iterate() call
is issued. Yet unfortunately this iterate already consumes the first
of the expanded children, which thus gets shadowed by the cached
outcome of parent node already consumed and expanded at that point

See the first example:

"10-8-expand-8-4-2-6-4-2"
should be 6 ^^^
2017-12-04 06:11:08 +01:00