Commit Graph

408 Commits

Author SHA1 Message Date
Grigorii Kirgizov efd22872a9 Handle case of invalidating stale discarding matches (MPSCR-35) 2020-02-05 12:29:33 +03:00
Grigorii Kirgizov 18fc4592f0 Modify logging methods of MatchJournal to return logged Chunks 2020-02-05 12:29:33 +03:00
Grigorii Kirgizov 7074112b7c Revert "Refine logic for finding activation Pos to correctly handle discarding rules"
This reverts commit 746c4808
2020-02-05 12:29:33 +03:00
Grigorii Kirgizov 3b0008ad22 Remove some unused code 2020-02-05 12:29:33 +03:00
Grigorii Kirgizov 840d02c9f7 Provide restricted version of MatchJournal.replay to utilize the descendants information of chunks
In some cases replay could 'overshoot' because the position replayed to was invalidated.
The natural way is to replay to the last descendant of such activated occurrence
and continue execution from here.
2020-02-05 12:29:33 +03:00
Grigorii Kirgizov ab3eb716ae Refactor ExecPos from ExecQueue to work with OccChunk instead of any Occurrence
This interface change it means that only Occurrences from previous session can be reexecuted.
2020-02-05 12:29:33 +03:00
Grigorii Kirgizov b909706a04 Refine logic for finding activation Pos to correctly handle discarding rules 2020-02-05 12:29:33 +03:00
Grigorii Kirgizov d7c2b7f977 Extend MatchJournal with replayUntil method 2020-02-05 12:29:33 +03:00
Grigorii Kirgizov b2cf46f813 Refactor a bit of logic responsible for finding appropriate place for inserting descendant chunk 2020-02-05 12:29:33 +03:00
Grigorii Kirgizov d69b7bff98 Fix incremental match insertion logic for corner case of rules of equal priority
Behavior was incorrect in the case of discarding rules.
Several discarding matches could appear on the same occurrence,
beacuase newer incremental matches were inserted before later one,
thus seeing their occurrence as still active and stored.
2020-02-05 12:29:33 +03:00
Grigorii Kirgizov a4b28509a8 Provide additional information about parent principal chunk to Feedback (MPSCR-32)
Allows to track connection between invalidated matches and reported feedback.
In future this Journal info can help in simplifying error reporting.
2020-02-05 12:29:33 +03:00
Grigorii Kirgizov e55e67bc08 Modify EvaluationResult to also return the set of tags of all invalidated rules (MPSCR-32) 2020-02-05 12:29:33 +03:00
Grigorii Kirgizov 79c31a44ba Handle journal reset for occurrences: upd their status (eg !alive). Add test for one error caused by it.
Occurrences which weren't yet activated (according to current journal position) can't be reactivated.
Test program is an example of such case.
2020-02-05 12:29:33 +03:00
Grigorii Kirgizov ba8d00c224 Handle incr exec of cases unhandled with introduced mem opt. Added test passes. 2020-02-05 12:29:33 +03:00
Grigorii Kirgizov 9aaf35561a Mem opt: store RuleMatchers only for principal rules between sessions. Add a test for incr processing.
The number of preserved matchers is around 4-10 times less.
The added test is an example of programs handled incorrectly with this opt. Fails now.
2020-02-05 12:29:33 +03:00
Fedor Isakov e763b0a3eb Fix maven source plugin's version 2020-01-20 19:43:56 +01:00
Fedor Isakov 8af582f9b2 Refactoring: simplify contract b/w controller and logical state. 2020-01-14 15:34:54 +01:00
Fedor Isakov d208e802b9 Remove unnecessary feature: StateFrameStack is no longer used.
StateFrameStack adds no functionality but requires too much processing.
Rename StateFrameStack -> LogicalState.
Rename ProcessingStateImpl -> ConstraintsProcessing.
Simplify occurrence's logical observer.
Introduce transient dependency on controller to LogicalState.
Keep logical state as part of session token, avoid re-initializing
all logical observers.
Make replaying of match journal independent of controller.
2020-01-10 13:51:07 +01:00
Fedor Isakov 01195cb1ac Drop unused methods from Rule interface. To be reinstated in RuleEx. 2020-01-02 17:20:13 +01:00
Grigorii Kirgizov ecc948c1fc Add, remove and merge observers on Logical always on their roots. Fixes MPSCR-28 2019-12-23 21:13:07 +03:00
Grigorii Kirgizov 1f69ff7d57 Reproduce MPSCR-28 with a test in Reactor 2019-12-23 18:14:41 +03:00
Fedor Isakov 271df160bb Optimize rete rule matcher for dropping occurrences.
Introduce a reactive scheme: alpha node has "dependent" nodes which
it can invalidate transitively. Drop block initiates invalidation,
intro block actually drops the nodes.
2019-12-08 17:48:01 +01:00
Fedor Isakov 2199905ea2 Enhance profiler to report actual time spent at probe locations.
Instead of just reporting the times each probe has been called,
collect and calculate the actual time taken by each probe location from
the whole backtrace pool.
2019-12-08 16:28:31 +01:00
Fedor Isakov 4eb93f20f9 Re-organize places in reactor to gather profiling information. 2019-12-08 15:44:36 +01:00
Fedor Isakov 5d63ec31e1 Remember probes for activated occurrences, optimize drop time.
Avoid searching for matching rules again when discarding occurrence.
2019-12-08 15:37:56 +01:00
Fedor Isakov 818d1a4dbc Fix linked list implementation. Fixes MPSCR-18
New implementation enables the previously failing tests to pass.
2019-11-26 23:07:42 +01:00
Fedor Isakov 65daa76c6b Remove droppedTrail. Optimize operation with consumed signatures. Restore test.
It appears the feature that tracks the occurrences that have been
dropped
requires too much memory.
2019-11-26 11:26:42 +01:00
Fedor Isakov 9fab2e9d34 Refactor and redesign ReteRuleMatcher for better memory footprint.
Drop layer prototype, make layer mutable.
Keep nodes in a layer in a linked list with fail-safe iterator.
Introduce update queue for update blocks.
Update blocks run incrementally unless reset.
Maintain trail of introduced and dropped occurrences.
Generation iterates over nodes in the last (final) layer incrementally,
unless reset.
Introduce new test.
2019-11-24 13:34:59 +01:00
Fedor Isakov 65f7b493be Revert "Add ReactivateBlock in Rete Matcher to correctly handle reactivation. Fixes MPSCR-17"
This reverts commit f96155496f.
I need to revert this commit to avoid merging problems. Going to reapply
it later if necessary.
2019-11-24 13:34:07 +01:00
Grigorii Kirgizov f96155496f Add ReactivateBlock in Rete Matcher to correctly handle reactivation. Fixes MPSCR-17 2019-11-19 15:43:15 +03:00
Grigorii Kirgizov 32a1ef77c9 Add test (fails now) for a new bug MPSCR-17 in Rete Matcher concerned with reactivation 2019-11-19 15:43:15 +03:00
Grigorii Kirgizov e7b374ce50 Fix calls to trace.reactivate (there were extra calls in some exec paths) 2019-11-19 15:43:15 +03:00
Grigorii Kirgizov 716e285c0c Small cleanup of EvaluationTrace usage 2019-11-07 17:14:40 +03:00
Grigorii Kirgizov f80371e148 MPSCR-14: Correctly trace incrementally reactivated occurrences. Fixes the bug. 2019-11-07 15:43:02 +03:00
Grigorii Kirgizov 45df4d845f Minor cleanup: remove DependentRulesSpec and its usages in RulesDiff
for historical documentation purposes, why it was needed:
It was used for specifying and handling rules which must be simply removed
without all related incremental invalidation machinery.
Long time ago some of these dependencies weren't captured
and such "simply dependent" rules must have been handled separately.
Currently it's handled by general invalidation case.
2019-11-06 19:10:29 +03:00
Grigorii Kirgizov 572a2cbfd5 Revert "Revert "MPSCR-4: Upd refs to new RuleIndex on Dispatcher construction in incremental case.""
This reverts commit a0b2af95
This together with preceding changes concerned with preserving Rules finally fixes MPSCR-4.
2019-11-06 19:10:29 +03:00
Grigorii Kirgizov 95214fcae9 Rename 'handlers' in Program to 'rulesLists' 2019-11-06 19:10:29 +03:00
Grigorii Kirgizov 87e9251242 Add RulesDiff.getPreserved() accessor to preserved rules 2019-11-06 19:10:29 +03:00
Grigorii Kirgizov f343ba0d3b Adjust to changes in SessionToken & RulesDiff interfaces 2019-11-06 19:10:29 +03:00
Grigorii Kirgizov bfcee33ec9 Modify SessionToken to preserve old rules instead of tags & RulesDiff to also distinguish preserved rules 2019-11-06 19:10:29 +03:00
Grigorii Kirgizov 3caeddcb63 Upd docs for StateFrame & add docs for StateFrameStack 2019-11-06 12:43:03 +03:00
Grigorii Kirgizov 510c3cd479 MPSCR-5: Clear all logicals from current StateFrameStack observer on incremental session teardown. 2019-11-06 12:16:11 +03:00
Fedor Isakov a0b2af95c9 Revert "MPSCR-4: Upd refs to new RuleIndex on Dispatcher construction in incremental case."
This reverts commit 0dd7f8c70f.
2019-11-04 15:58:54 +01:00
Grigorii Kirgizov 0dd7f8c70f MPSCR-4: Upd refs to new RuleIndex on Dispatcher construction in incremental case.
Slightly extend RuleMatcher interface.
Store RuleMatcher instances instead of RuleMatcherProbe in SessionToken.
2019-10-31 22:20:19 +03:00
Grigorii Kirgizov a095b2e222 Provide better (hopefully) name & explanation, undeprecate and provide missing impl for 'forgetSeen' method 2019-10-15 21:17:24 +03:00
Fedor Isakov 17f5bd64b0 Optimize Dispatcher: ensure allMatches are calculated lazily on request. 2019-10-08 13:20:40 +02:00
Fedor Isakov 445108da74 Fix RuleIndex returning too many matches for a constraint w/wildcard arg. 2019-10-08 13:16:56 +02:00
Fedor Isakov b283f657cf Fix a nasty bug in logical context.
A meta logical within a pattern was not properly initialized before the rule body is processed.
2019-10-02 13:54:11 +02:00
Fedor Isakov e69909f3be Some more optimizations in Rete rule matcher. 2019-10-01 16:25:12 +02:00
Fedor Isakov 31c95cd069 Bump up reactor version to 0.9.14. 2019-09-30 16:31:59 +02:00