Announcing the availability of ChessCore

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
trojanfoe
Posts: 65
Joined: Sun Jul 31, 2011 11:57 am
Location: Waterlooville, Hampshire, UK

Announcing the availability of ChessCore

Post by trojanfoe »

I'd like to announce the availability of a new open-source chess library, implemented in C++, called ChessCore.

ChessCore was written to support an up-coming commercial Mac Chess User Interface and I have open sourced the library for a couple of reasons:
  • 1. I'd like some help adding features and fixing bugs.
    2. I have implemented a new binary chess database format, which others might like to adopt, and wanted to provide a reference implementation.
"Why yet another chess database format?" I hear you groan. Well my user interface needed a fast, compact chess database format that was searchable. While PGN is an excellent format for interchange of chess games, it's not suitable as a working database format, without the implementation of lots of meta data files. One alternative is scidb's si4 file format, which looks excellent, however I could not find any documentation on the format and it's reference implementation is GPL'd, making it unusable in a commercial product.

I therefore decided to implement my own format and document it (actually that's still in progress) and make an unencumbered reference implementation using the MIT license. This means ChessCore can be used in commercial and open source projects alike, without restriction.

CFDB uses sqlite3 as its basic storage mechanism, making searching for players, events, sites, etc very quick and it stores game data using a binary format, which unfortunately isn't possible to search. I cannot say that am 100% satisfied with the current implementation, but the format does allow for changes in implementation to be managed, so if better solutions show themselves it's possible to implement them in future versions while maintaining backwards compatibility.

Please have a look at the source code, fork the repo and have a play.

All contributions are welcome.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Announcing the availability of ChessCore

Post by Don »

trojanfoe wrote:I'd like to announce the availability of a new open-source chess library, implemented in C++, called ChessCore.

ChessCore was written to support an up-coming commercial Mac Chess User Interface and I have open sourced the library for a couple of reasons:
  • 1. I'd like some help adding features and fixing bugs.
    2. I have implemented a new binary chess database format, which others might like to adopt, and wanted to provide a reference implementation.
"Why yet another chess database format?" I hear you groan. Well my user interface needed a fast, compact chess database format that was searchable. While PGN is an excellent format for interchange of chess games, it's not suitable as a working database format, without the implementation of lots of meta data files. One alternative is scidb's si4 file format, which looks excellent, however I could not find any documentation on the format and it's reference implementation is GPL'd, making it unusable in a commercial product.

I therefore decided to implement my own format and document it (actually that's still in progress) and make an unencumbered reference implementation using the MIT license. This means ChessCore can be used in commercial and open source projects alike, without restriction.

CFDB uses sqlite3 as its basic storage mechanism, making searching for players, events, sites, etc very quick and it stores game data using a binary format, which unfortunately isn't possible to search. I cannot say that am 100% satisfied with the current implementation, but the format does allow for changes in implementation to be managed, so if better solutions show themselves it's possible to implement them in future versions while maintaining backwards compatibility.

Please have a look at the source code, fork the repo and have a play.

All contributions are welcome.
sqlite3 was an excellent choice. It's open source, fast, compact and idea for something like this.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
User avatar
trojanfoe
Posts: 65
Joined: Sun Jul 31, 2011 11:57 am
Location: Waterlooville, Hampshire, UK

Re: Announcing the availability of ChessCore

Post by trojanfoe »

Don wrote:sqlite3 was an excellent choice. It's open source, fast, compact and idea for something like this.
Indeed, however it's a bit slow for inserts. I have turned some safety features off in order to get anywhere near acceptable performance, however this could be made optional for the more safety-concious.

The CFDB schema should translate, with little modification, to MySQL or the like, making it potentially very useful for chess websites.
mar
Posts: 2672
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Announcing the availability of ChessCore

Post by mar »

trojanfoe wrote:Indeed, however it's a bit slow for inserts. I have turned some safety features off in order to get anywhere near acceptable performance, however this could be made optional for the more safety-concious.
If you do multiple inserts, you can use transaction + commit when you're done (unless you already do it).
Don't remember exactly but it worked well (some years ago :)
User avatar
trojanfoe
Posts: 65
Joined: Sun Jul 31, 2011 11:57 am
Location: Waterlooville, Hampshire, UK

Re: Announcing the availability of ChessCore

Post by trojanfoe »

mar wrote:If you do multiple inserts, you can use transaction + commit when you're done (unless you already do it).
Don't remember exactly but it worked well (some years ago :)
Yeah there is a transaction outside of the entire write game insert/update operation, so that if one fails, they all fail.

The "hacks" I've used to increase performance are:

Code: Select all

PRAGMA synchronous = OFF
and

Code: Select all

PRAGMA journal_mode = MEMORY