Improvements to CQL and Composite Search in Chess Assistant 9

CQL and Composite Search were first introduced in version 8 of Chess Assistant. The implementation was amazingly good, considering the complexity of CQL and the short timeline for its implementation. In Chess Assistant 9, CQL and Composite search have been improved even further, and all CQL users are adviced to upgrade to the new version.
More flexible CQL search options
When doing a CQL search in Chess Assistant 8 users were only given the option to load a query from a file, without getting a chance to preview it, and then execute it. This process is greatly improved in Chess Assistant 9. Now users can:
- Load a query from a file and execute it, just like in Chess Assistant 8, except that in version 9 users get to preview the query.
- Load a query from a file, modify it and then execute it
- Load a query from a file, modify it, save it to the same or a different file and then execute it. This is great for experimenting while developing a new query or modifying an old one.
- Type in a new query from scratch and then execute it (with or without saving it first). This provides users with a really quick way of doing simple ad hoc CQL queries all from within Chess Assistant.
Instead of the simple Open file dialog displayed in Chess Assistant 8, Chess Assistant 9 opens a more advanced dialog with a text area where the query is always displayed before it is run. So, instead of just seeing the filename where the query is stored and having to guess what it really does, users can actually view the query and even modify it before running it.
Saving results to EPD file
Some CQL queries can produce really interesting results. In some cases only the particular positions that match the query are of interest, but not the whole game as such. Chess Assistant 9 adds the ability to save the matching positions to EPD files in such cases. There are many practical uses conceivable for the resulting collections such as quickly producing example diagrams from an EPD file for use as training material. The EPD positions can also be used as testsets to compare the performance of different chess engines. Chess program authors might also find practical uses for this feature. Let's say that a chess program author wants to convince himself that checkmate detection works correctly in his program. He could run the following query and save the the matching positions to an EPD file:
The query only takes a few minutes to go through all 3 million games in
HugeBase and the resulting EPD file contains over 100.000 checkmate positions! That should be sufficient to weed out any bugs that might be present in a chess program with regard to checkmates. The positions in the EPD file can be used to test the chess engine and also for quick regression testing before every new release of the program. Many other types of positions (stalemate comes to mind) might be useful for similar purposes.
Subsections added to Composite Search
Composite Search allows you to organize a large collection of CQL queries into a neat hierarchical structure, so you can quickly find any query you may be looking for. Each query is identified by a description so this is similar to a table of contents in a book. In Chess Assistant 8 there were only two levels in the Composite Search hierarchy: Sections and queries. This was a little restrictive and Chess Assistant 9 adds a third level, subsections. This is a welcome addition. The screenshot shows how users can take advantage of this by using Tim Krabbé´s chess records as an example. The first nine section come standard with Chess Assistant 9, but I have added section 10, "Chess Records". Below that subsections have been defined for each type of record: "Moves", "Captures", "Checks", "Promotion", "Pieces" and "Position". Subsection 10.3 has been expanded so the list of CQL queries in the subsection are displayed.

As this screenshot shows, results of Composite Search can be written to an EPD file, just like in CQL search.
Helpful error messages
The original implementation of CQL in Chess Assistant wasn't very user friendly when it came to error reporting. If there was an error in a query it would simply refuse to run or exit the search, without producing any kind of indication about the problem. Chess Assistant 9 is different. When there is an error in a query an error message is displayed describing the error and the corresponding linenumber in the query. Here is a simple example:
(match
(position :checkmate)
)
Here is what happens when we try to feed this query to Chess Assistant 9:

This is an error that might be hard to spot without such a detailed error message (at least if the query was more complicated). It tells you not only in which line the error can be found, but also that the keyword ":checkmate" is unknown. It should be enough to remind anyone that the correct keyword is actually ":mate". Error messages can't get much clearer than this!
Number of games found
CQL is a powerful query language and can be used to create complex queries that take a long time to run. Even for many simple queries each position in every game has to be examined to see if it matches the query. This means that a CQL query can be expected to take at least a few minutes to finish when run against a large database like
HugeBase, which contains over 3 million games in Chess Assistant 9. Therefore it can be a bit annoying to discover only when a search is finished that there was a mistake in the query so it didn't return any games, or perhaps it returned 1.000.000 games when only a few hundred were to be expected. In Chess Assistant 8 there was no way to monitor the number of games found while a CQL search was in progress. This is changed in Chess Assistant 9 as shown below:

In many cases seeing the number of games found as the search progresses can be a good indication if the query is working as expected. If it isn't the search can be aborted, the query modified and run again.
Improved quality
Overall, the quality of the CQL implementation itself in Chess Assistant has improved in version 9 without any sacrifices in speed. Actually, considering how complicated CQL is, Convekta can be proud of how fast the searches are. Although the overall quality of the CQL implementation in Chess Assistant 8 was very good, there were a few advanced features that did not work as intended under certain circumstances. My tests show that all such problems that were known to me have been fixed in Chess Assistant 9. As a matter of fact there are at least a couple of cases where Chess Assistant seems to implement CQL more correctly than the official implementation.
If you are planning on using CQL and Composite Search I strongly recommend an upgrade to Chess Assistant 9. Many queries published on this site will not work correctly in earlier versions.
Conclusion
Convekta's commitment to CQL should be clear. It was already a huge commitment to decide to implement CQL in Chess Assistant 8 in just a few months. The improvements in Chess Assistant 9 show that Convekta is just as convinced as before that CQL is the future for chess database searching. The quality of the implementation shows that Convekta has some very smart people working on this project. They should be congratulated!
There are 3109 comments on this page. [Display comments]