You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "mdproctor (via GitHub)" <gi...@apache.org> on 2026/05/21 22:25:07 UTC
[I] vol2: ReteEngine — incremental Rete evaluation engine to replace BruteForceCompiledEngine [incubator-kie-drools]
mdproctor opened a new issue, #6712:
URL: https://github.com/apache/incubator-kie-drools/issues/6712
## Summary
Build `ReteEngine` — the real incremental Rete evaluation engine for vol2.
Replaces `BruteForceCompiledEngine` (explicitly temporary stub) as the default engine returned by `EvaluationEngine`.
## Context
`BruteForceCompiledEngine` re-reads `RuleDescriptor` sources/filters/heads directly at `createUnit()` time rather than traversing the Rete network. It was written explicitly to keep tests green while the real engine was designed. The design is now complete (see DESIGN-NOTES.md, 2026-05-07).
## Design (from DESIGN-NOTES.md)
**Two-phase lifecycle:**
1. `compile(finalizedRuleBase)` — called once per rulebase change. Traverses the finalized Rete network using `isAssociatedWith(rule)`. For each rule, resolves its JoinNode chain and slot assignments. Creates stateless `UnitProcessor` instances (`JoinLeftInlet`, `JoinRightInlet`, filter wrappers, `Action1`/`Fn1` heads). Pre-compiles fan-out where multiple rules share a slot (via `FanOutUnitProcessor`). Returns a `CompiledEngine`.
2. `CompiledEngine.createUnit(ctx)` — called per unit instance. Allocates per-unit state (`NodeMemories`, `Agenda`, `ContextPojoDS`). Subscribes the pre-compiled `UnitProcessor`s to the Router. Zero traversal, zero allocation of new processors.
**UnitProcessor instances are stateless → shared across unit instances.**
Same processor objects created in `compile()` serve all unit instances of the same compiled rulebase. `createUnit()` is just reference subscription.
**Router is shared, configured in `compile()`** — not per unit as in BruteForceCompiledEngine.
## Scope
- `ReteEngine implements EvaluationEngine` — `compile()` traverses finalized Rete, builds shared Router + stateless `UnitProcessor` chain
- `ReteCompiledEngine implements CompiledEngine` — holds shared Router + pre-compiled processors; `createUnit()` appends context to Router, returns `UnitInstance`
- Wire up `RuleBase` to use `ReteEngine` by default
- All existing tests must pass against the real engine
## Parent epics
#6684, #6639
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] vol2: ReteEngine — incremental Rete evaluation engine to replace BruteForceCompiledEngine [incubator-kie-drools]
Posted by "mdproctor (via GitHub)" <gi...@apache.org>.
mdproctor commented on issue #6712:
URL: https://github.com/apache/incubator-kie-drools/issues/6712#issuecomment-4522585122
Implemented on branch `issue-6712-rete-engine`:
- `ReteEngine` + `ReteCompiledEngine` fully implemented
- `UnitDescriptor` defaults to `new ReteEngine<>()` — brute-force is now opt-in only
- All 137 vol2 tests pass against the real engine
- `BodyAnalyzer` extracted to decouple `ReteEngine` from `BruteForceCompiledEngine` (deletion of BruteForce is a follow-up)
Related open: #6715 (disposeUnit adapter cleanup), #6724 (ChangeSet delta), #6723 (findHead multi-head)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] vol2: ReteEngine — incremental Rete evaluation engine to replace BruteForceCompiledEngine [incubator-kie-drools]
Posted by "mdproctor (via GitHub)" <gi...@apache.org>.
mdproctor closed issue #6712: vol2: ReteEngine — incremental Rete evaluation engine to replace BruteForceCompiledEngine
URL: https://github.com/apache/incubator-kie-drools/issues/6712
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org