Proof of Concept

Rating: No reviews yet
Downloads: 303
Change Set: 113
Released: Aug 27, 2010
Updated: Jan 3, 2012 by tuplelister
Dev status: Alpha Help Icon

Recommended Download

Application Proof of Concept
application, 63K, uploaded Aug 28, 2010 - 102 downloads

Other Available Downloads

Documentation Release Notes
documentation, 30K, uploaded Dec 2, 2011 - 23 downloads
Application TULIP - A Technical Overview
application, 872K, uploaded Jan 3, 2012 - 178 downloads

Release Notes

The Proof of Concept includes the Tulip Engine and a hand-crafted implementation of the classic Miss Manners rule set.

Miss Manners is often used for comparative benchmark testing. However, it does not represent a real-world implementation. It was written, many years ago, by Daniel Miranker as part of a small suite of test rule sets to aid comparison between different implementations of OPS5. It solves a very simple constraint problem. Given a pool of potential guests, find a seating arrangement for a given number of seats in which gender alternates around the table (male/female) and where each guest shares at least one hobby with the person next to them on each side.

The test contains eight rules. It is small and easy to implement. However, solving this constraint problem is trivial and an engine can complete this for hundreds (maybe thousands) of seats in a fraction of a second with even fewer rules. Miranker et al. deliberately wrote the rules to take a highly inefficient approach to solving the problem. Solving the seating problem is not the point of this test. Its aim is to give the engine a huge amount of work to do with just a few rules.

Manners is generally run for 16, 32, 64 and 128 seats. Over the years we have seen engines improve to the point where Manners 128 has reduced from many minutes or even hours on older engines to a few seconds. The very fastest engines can currently complete Manners 128 in two seconds or less on current hardware. This is, of course, partly accounted for by the huge increase in CPU power over the last two decades. However, it is also in great measure due to ever improving engine design.

This version of the test was written as a proof of concept, and used to undertake preliminary optimization of the engine. It is handcrafted. It represents a set of fact types, represented as .NET types, together with the contents of the MissMannersExecutor class. The executor represents the kind of code that will, when the engine is complete, be generated by a translator over an abstract lower-level relational model of data and dataflow. That model, in turn, will be generated from a higher-level rule model which, in effect, will be the rule language. The remaining work to be undertaken for this engine for the first release is now mainly a matter of implementing models, parsers and code generators.

The MannersTest application is a console application. It includes a set of data files. The application will display a console. You can run various versions of the test for 4, 8, 16, 32, 64 and 128 seats. In an homage to CLIPS and Jess (two well-known engines), you run these tests by entering the following command and press Enter:

(batch n)

...where n is the number of seats. These commands are hard-coded. This is not a real shell!

Run the Miss Manners test several times in a row. It is only on about the third run that the JiT compiler completes most of its work. You will see that the first run is significantly slower. .NET and Java engines generally suffer badly on the first hit. We may consider providing an NGen build of the final release, depending on performance characteristics. Also, be aware that rule engine performance generally decays across hundreds or thousands of runs due to heap fragmentation issues. This is a wide-spread problem. .NET and Java engines tend to fare better than non-managed code because they have more sophisticated memory management, but they still suffer.

Enjoy!

TupleLister, 2010

PS. Before anyone asks, great care was taken to ensure that this is a true implementation of classic Miss Manners. All rules and conditions are implemented. Logical expressions are placed in the correct order. Nothing has been added or removed. No shortcuts have been taken. The rule set depends on a declarative depth-first CR strategy. Please let's try to avoid all the normal heat Miss Manners seems to produce :-)

Reviews for this release

No reviews yet for this release.