Commit Graph

143 Commits

Author SHA1 Message Date
Fedor Isakov 4ce08f4b99 Refactor project structure and reduce the number of modules 2024-07-04 18:17:56 +02:00
Fedor Isakov a19d02b8ae Switch initialization to use ModuleActivator; drop unused imports 2024-06-16 16:11:38 +02:00
Fedor Isakov 87a1b413d1 Ensure ancestors of a changed node are in changeset
This fixes incremental update in some situations.
2023-10-13 18:13:08 +02:00
Fedor Isakov f3010743c1 Migration: FixExpandMacroTemplate 2023-10-13 18:13:08 +02:00
Fedor Isakov 3cf666e633 Apply migrations and make project 2023-07-31 12:57:24 +02:00
Fedor Isakov e5538bc39f A bunch of refactorings and cleanups in trace view
- cleanup the code, rename symbols for better readability
 - drop dead code
 - support for optionally showing empty template trace nodes
 - display node path for source nodes
2023-06-21 15:27:05 +02:00
Fedor Isakov 6a849f82f2 Apply migrations and rebuild project 2023-06-12 12:01:02 +02:00
Fedor Isakov 11a1037860 Minor refactoring and code cleanup 2023-06-12 12:01:02 +02:00
Fedor Isakov ad3ea9d63d Apply all migrations from 2022.2 2022-11-21 11:25:13 +01:00
Fedor Isakov 6030332107 Introduce profiling into program produce/evaluation steps 2022-09-02 15:49:30 +02:00
Fedor Isakov 33b472f560 Switch to using plain FQN strings to identify templates
SNodeReference are too unreliable to be used.
2022-07-28 10:30:38 +02:00
Fedor Isakov 4bd681f3ee Fix support for require/requireAll statements in queries, MPSCR-108 2022-07-15 19:46:32 +02:00
Fedor Isakov b6c190c35c Introduce ruleInput parameter to call macro
Accessing the rule input allows to track dependencies
necessary for correctly updating the feedback.
2022-05-09 17:02:12 +02:00
Fedor Isakov 1d54b8ffeb Fix NPE on first update of empty rules query 2022-02-17 17:05:41 +01:00
Fedor Isakov 98fef4c95d Fix NPE on newRules array being empty 2022-02-15 10:35:53 +01:00
Fedor Isakov b122872890 Refactor Result to be able to clear the cause 2021-09-21 17:54:51 +02:00
Fedor Isakov 2425fe933a Ensure dependency is tracked for nested expand macro applications
Expand macro passes the rule's input to nested macro calls.
This adds the macro input as the dependency of the rule's input.
As a result, incremental processing starts working in some cases.
2021-06-30 18:25:46 +02:00
Fedor Isakov 1d620cdd63 Drop obsolete unused features, cleanup the code 2021-05-18 12:32:03 +02:00
Fedor Isakov abed4bd3e1 Avoid failing on an error in template application, allow recover 2021-04-28 08:54:25 +02:00
Fedor Isakov cff18e7ca5 Optimize RulePlanHandler
Avoid iterating over LinkedHashMap (ineffective).
Do topo-sort only once on creating the object.
2021-04-21 10:40:51 +02:00
Fedor Isakov 394cb720c1 Optimize program producing: drop checking of constraints
Constraints arity is no longer checked.
Checking for null arguments to constraints is done
in AbstractConstraint's constructor.
2021-04-19 22:55:09 +02:00
Fedor Isakov ff6b5ec6ae Apply migrations and rebuild project 2021-04-14 13:19:50 +02:00
Fedor Isakov 93fd42365a Fix NodeWalker ignoring annotations 2021-04-13 22:57:06 +02:00
Fedor Isakov 49357ab87a Drop all usages of "principal store" and "preamble" feature 2021-04-13 22:57:06 +02:00
Fedor Isakov 077e1564b4 Refactor and optimize RulePlanHandler, drop obsolete contracts
RulePlanHandler does not rely anymore on fixed total order of
input nodes in a given rule template. An update constitutes a list
of rules/reqs generated for a pair template+input node.
All hacks that use sets of rule IDs removed.
Also, support for "new" and "dropped" rules removed, incremental algorithm
no longer supported.
2021-04-12 12:47:44 +02:00
Fedor Isakov 1d1db7cba5 Disable all preamble-related stuff 2021-04-12 12:47:44 +02:00
Fedor Isakov 28dd6c7a12 Implement feedback invalidation based on (in)validated rules
Refactor supervisor/feedback consumer to support feedback basis.
Track (in)validated rules tags in RulePlanHandler.
Both (in)- and validated rules cause associated feedback to be cleared.

Disable passing SessionToken in WatchingIncremental strategy;
this forces the correct journal recording but turns off incrementality.
2021-04-08 08:51:40 +02:00
Fedor Isakov 7c89dfdffd Refactoring in program producing: getting ready to drop incrementality
Optionally produce partial program in incremental mode.
A partial program includes all "static" rules plus the "required closure"
of all changed nodes.
Produce program for required nodes unconditionally.
Mark all rule updates as validated only if exlicitly asked for it.
2021-04-08 08:51:39 +02:00
Fedor Isakov 99e248c5b3 Fix incremental update of reported feedback
Correctly detect cache up-to-date.
Refactor feedback reporting, provide origin node as the key.
Drop invalidated feedback correctly.
Code cleanup.
2021-03-23 12:48:06 +01:00
Fedor Isakov 2977b4dd19 Extend expand macro operation with rule input parameter, fix tracking dependencies
Enable recording the dependencies while expanding macro.
Rename/refactor operations in UpdatesRecorder to reflect the intent
of adding the dependencies.
2021-03-23 12:48:06 +01:00
Fedor Isakov 89ae2d2003 Use UpdatesRecorder to control whether to apply templates
Invalidated and introduced nodes are collected by UpdatesRecorder.
If either set is not empty, a walk of the input is triggered.
Also, drop invalidated flag in RulesPlanHandler.
2021-01-18 10:58:58 +01:00
Fedor Isakov 397e1efc0c Fix dropped rules erroneously marked as validated 2021-01-13 17:32:21 +01:00
Fedor Isakov baae5c5bf0 Several interconnected changes to optimize performance in incremental mode
Introduce invalidated flag to program producer to control whether to
only process invalidated nodes in incremental mode.

Update validated flag in RulesPlanHandler to reflect the finalized
state, after the plan has been built.

Refactor ProgramProducer/Factory to avoid enumerating the source
root in case no changes have been detected (in incremental mode).

Avoid relaunching program in case the producer did nothing.
2021-01-12 22:55:42 +01:00
Fedor Isakov 62e8e7d013 Switch to MPS 2020.3 release. 2021-01-08 11:00:02 +01:00
Fedor Isakov abb76e68b5 Refactor changes tracking in UpdatesRecorder, use model instead of a ref
Using a model reference require resolving via a repository, which
is unnecessary in case model objects are stored directly.
2021-01-07 13:31:37 +01:00
Fedor Isakov 77b02a4e0e Drop tracking unit cache, rely on UpdatesRecorder to provide incrementality
The idea to use "tracking" cache to save on typechecking operations is obsolete.
There is conflict of responsibilities with UpdatesRecorder,
which is to be solely relied upon for all things related to tracking changes.
2021-01-07 13:31:37 +01:00
Fedor Isakov 37486d4484 Avoid NPE during template application, provide appropriate reporting 2020-12-27 16:04:06 +01:00
Fedor Isakov 64b33d1a88 Refactor RulesPlanHandler to not depend on AspectClique 2020-12-27 10:36:04 +01:00
Fedor Isakov 43ad19494b Refactor rule processing: straightforward dependencies, simplify code
Enable rule index to be updated during rules application.
Make RuleProcessingSession depend on AspectClique.
Enable updating of rule/macro/query indices.
2020-12-27 10:36:00 +01:00
Grigorii Kirgizov 27ed01c447 refactoring: Adjust uniqueTag usages for Rule.Tag refactoring
Fix rule basetag generation to coincide with templateName

Needed for PrincipalStore (occurrence cache) which uses
info about occurrence source rule template name.
2020-12-15 17:59:09 +03:00
Grigorii Kirgizov 3eccaf81a1 Introduce occurrence store as cache for their reuse in Queries strategy
It's important that program that uses occurrences from cache
shouldn't include rules that could produce their duplicates.
So implementation of occurence cache includes 2 parts:
on reactor level & in ProrgramFactory.

When RuleBuilders are produced, cache is queried whether
there're already  occurrences associated with the rule template
in question. If so -- then those RuleBuilders are not included
into the program (as well as all RuleBuilders required by it).
2020-12-15 17:59:05 +03:00
Grigorii Kirgizov f051e6bf19 Avoid null nodes in UpdatesRecorder. Caused erroneous invalidation of null-origin rules. 2020-12-15 17:51:27 +03:00
Fedor Isakov 03be7f19b5 Optimize processing of static rules
Avoid evaluating templates and producing rules on null
input and all required closure of this input, which effectively
constitutes the static collection of rules that are only
dependent on chosen aspect clique.
2020-12-13 22:09:31 +01:00
Fedor Isakov 159de90e6f Exclude free floating nodes from required set
Required nodes w/o a model, or "free floating" nodes
are excluded from the required set.
Instead all their valid references are processed.
2020-12-12 13:48:15 +01:00
Fedor Isakov 5813704d9e Optimize application of rule templates via RulesPlanHandlder.
Avoid calling template's code if cached evaluation results are
not invalidated.
Keep information on required nodes (dependencies) together with
the list of produced rule ids.
2020-12-11 12:03:16 +01:00
Fedor Isakov c7eaa1dbf3 Clean up ProgramEvaluator API. Straighten up passing of session token. Drop RulesDiff usages. 2020-12-08 22:57:36 +01:00
Fedor Isakov e026674fb2 Introduce a means to clear invalidated rules in RulesPlanHandler.
In incremental mode all rules need to be moved to validated set
after all invalidated rules have been dropped.
2020-12-08 22:57:35 +01:00
Fedor Isakov 0ff05e39e7 Fix UpdatesRecorder to construct the transitive changes closure.
The changed set is processed transitively using "required"
association. (TODO: rename to dependency).
2020-12-08 12:52:13 +01:00
Fedor Isakov 8918b0afd8 Refactor RulesPlanHandler, introduce RulesPlan. Drop unused class.
Refactor the rules producing line to run via newly introduced RulesPlan.

Correctly process new and dropped rules.
2020-12-08 12:52:13 +01:00
Fedor Isakov 59db13bf41 Simplify UpdatesRecorder implementation. Fix input processing by ProgramFactory.
Move invalidation logic inside UpdatesRecorder from elsewhere.
Drop type parameters.
Avoid recording dependencies for null input.

ProgramFactory: always process input, not only the first time
2020-12-08 12:50:36 +01:00