Lozza 1.16

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

op12no2
Posts: 560
Joined: Tue Feb 04, 2014 12:25 pm
Location: Gower, Wales
Full name: Colin Jenkins

Re: Lozza 1.16

Post by op12no2 »

Hi Max,

Thanks for having a play with Lozza and for the feedback; it is appreciated.

The node counts are sent back every 500ms so there will be that error margin when you kill the analyse. I've tweaked it to update the node counts when the PV is updated to help the situation. The new code announces itself as 1.16a and you may need to hit F5 a few times in your browser before you see it.

The /34 /35 is more confusing. It's not a parallel algorithm, so those figures should be the same regardless of Javascript engine. What that figure actually is, is the max ply reached, including Q search. I don't have an explanation at the moment other than the rather worrying possibility that different Javascript engines interpret a part of the code such that algorithmic changes emerge; I'll keep thinking.

Thanks again...

PS: Over the weekend I did a one line tweak that beats 1.16 by a ~60% game score :) currently tuning it and will release very shortly.
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Lozza 1.16

Post by Max »

op12no2 wrote:The node counts are sent back every 500ms so there will be that error margin when you kill the analyse. I've tweaked it to update the node counts when the PV is updated to help the situation. The new code announces itself as 1.16a and you may need to hit F5 a few times in your browser before you see it.
Hi Colin!

Sorry, I was a bit unclear.
The issue is, that Lozza@Safari searched about 215 mn (mega nodes) to solve this position, but with Firefox & Chrome Lozza needed only 175 mn!

- Max
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk
op12no2
Posts: 560
Joined: Tue Feb 04, 2014 12:25 pm
Location: Gower, Wales
Full name: Colin Jenkins

Re: Lozza 1.16

Post by op12no2 »

Max wrote: Sorry, I was a bit unclear.
The issue is, that Lozza@Safari searched about 215 mn (mega nodes) to solve this position, but with Firefox & Chrome Lozza needed only 175 mn! - Max
You were clear :) I too-quickly assumed the +/- 500ms error margin would account for it, but of course it doesn't.

I just checked MS Explorer too - that is the same as Chrome and FF - all 3 take ~1.7Mn and show the same PV trace and the same TT usage.

I'll download a copy of Safari and see if I can figure out why it's the odd one out; thanks again...
User avatar
hgm
Posts: 28505
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Lozza 1.16

Post by hgm »

op12no2 wrote:I've released Lozza 1.16. Lozza is an "exotic" in that it's written in Javascript - the browser scripting language (not to be confused with Java).
As such performance is dependent on your browser's Javascript engine.
I have a general question (well, a lot, actually):

I am new to JavaScript, but recently I have been writing a script to implement an 'interactive Chess diagram' (a general Chess-variants GUI, really), and generate the HTML front end for it based on a small game description that is contained in the HTML page source between tags with id="diagram". (Where the resulting Chess board then also goes.) See http://www.talkchess.com/forum/viewtopic.php?t=58167 .

I already have rigged it as a turn-based server. But it would be cool if it would also contain some code to actually play the described variant as an AI. It doesn't have to be strong at all; it should just not play as a complete idiot.

So how does Lozza work? Is it based on a mailbox board? Is it very dependent on the board being 8x8, or would the board dimensions be easily adaptable? Would it be easy to adapt Lozza for other variants (even if only on 8x8 boards)? I already wrote a move generator (for highlighting moves in the interactive diagram), and designed the system for describing moves in principle such that this could be done quite efficiently, for mailbox board ( http://www.talkchess.com/forum/viewtopic.php?t=58078 ). Is it feasible to use hash tables in JavaScript run through a browser, or does this get infinitely slow when you try to use realistic hash sizes?
op12no2
Posts: 560
Joined: Tue Feb 04, 2014 12:25 pm
Location: Gower, Wales
Full name: Colin Jenkins

Re: Lozza 1.16

Post by op12no2 »

hgm wrote:
I have a general question (well, a lot, actually):
Hi Hans,

Lozza is primitive :) It's a 12x12 mailbox. I've been lazy internally and there is code like sq+12 but if it was all replaced by constants I think it could be generalised fairly easily - pieces slide until the square contains EDGE.

Search-wise it's a simple PVS arrangement calling eval() at each node.

Move ordering is based on history and killers etc - no SEE.

Given it's basic nature, I'm actually surprised the NPS it gets - being compiled and optimised in real time. All credit to modern Javascript engines, which are getting better and better.

For the TT, Javascript "Typed arrays" are contiguous but the max size varies per implementation, so I used N of them, each one being 2^24 in size. I waste a of of space but it could be compacted with some clever bit twiddling.

As you've probably noticed, Javascript doesn't have 64 bit INTs which is a major PITA. I've begged the developers for them to no avail :)

Have a browse of the source (ignore the wodge of stuff that's there to get repeatable random numbers) - scroll down to "constants". You'll see it's all very straightforward and please do feel free to use it.

http://op12no2.me/toys/lozza/lozza.js

PS: An alternative is to auto transpile C/C++ into Javascript. More than one person has done it for Stockfish. You just need to add a comms harness by hand afterwards. Check out Emscripten and asm.js etc. The Javascript could fall out of the the build file.
op12no2
Posts: 560
Joined: Tue Feb 04, 2014 12:25 pm
Location: Gower, Wales
Full name: Colin Jenkins

Re: Lozza 1.16

Post by op12no2 »

op12no2 wrote: I'll download a copy of Safari...
Ah, Apple don't make it available to Windows any more.

Max, if you fire up the development console (no idea how I'm afraid) does it display any errors while doing that analysis?
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Lozza 1.16

Post by Max »

op12no2 wrote:Max, if you fire up the development console (no idea how I'm afraid) does it display any errors while doing that analysis?
No errors while doing the analysis. Only 3 warnings after opening the web page:

Code: Select all

Unexpected CSS token: :   bootstrap.min.css:9:42863
Unexpected CSS token: :   bootstrap.min.css:9:86825
Unexpected CSS token: :   bootstrap.min.css:9:87396
- Max
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk
op12no2
Posts: 560
Joined: Tue Feb 04, 2014 12:25 pm
Location: Gower, Wales
Full name: Colin Jenkins

Re: Lozza 1.16

Post by op12no2 »

Max wrote: No errors while doing the analysis. Only 3 warnings after opening the web page
Thanks. It's a mystery then. My son has a Mac. I'll borrow it for a day and see if I can figure it out.
Jamal Bubker
Posts: 328
Joined: Mon May 24, 2010 4:32 pm

Re: Lozza 1.16

Post by Jamal Bubker »

Thank you Colin for this new release :D