BlackMamba 1.0

Discussion about chess-playing software (engines, hosts, opening books, platforms, etc...)
Post Reply
Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

BlackMamba 1.0

Post by Jeremy Bernstein » Wed Apr 11, 2012 3:27 pm

https://sites.google.com/site/mdannib/home

Anyone know anything about this one?

I don't think this is a hex-edited anything, but I assume that it's probably an Ippo. 'strings' didn't reveal anything obvious.

jb

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: BlackMamba 1.0

Post by User923005 » Wed Apr 11, 2012 7:27 pm

Black Mamba is definitely an Ivanhoe clone.
It even has this table embedded in it:
char BENCHMARK_POS[16][128]=
{"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
"rnbqkb1r/pppp1ppp/4pn2/8/2PP4/2N5/PP2PPPP/R1BQKBNR b KQkq - 1 3",
"rnbqkb1r/pp2pppp/1n1p4/8/2PP4/8/PP3PPP/RNBQKBNR w KQkq - 0 6",
"r1bq1rk1/pppp1ppp/5n2/4n3/2P5/1PN3P1/P2PPKBP/R1BQ3R b - - 0 8",
"r4rk1/ppqbbppp/2nppn2/8/4PP2/1NN1B3/PPP1B1PP/R2Q1RK1 w - - 1 11",
"r2q1rk1/1pp2ppp/p1pbb3/4P3/4NB2/8/PPP2PPP/R2QR1K1 b - - 0 13",
"r4rk1/3np1bp/pq1p2p1/2pP3n/6P1/2N1Bp2/PPQ1BPP1/R4RK1 w - - 0 16",
"rnb2r2/p1p2pk1/1p1pqn1p/P7/Q1PPp1pP/2P3P1/4PPB1/1RB1K1NR b K - 3 18",
"4rk1r/1b2pNbp/pq2Bn1p/1ppP4/P1p2Q2/2N4P/1P3PP1/R3K2R w KQ - 8 21",
"r3r1k1/2p1np1p/1p2p1pB/p1q1P3/P1P1Q3/3R3P/1P3PP1/5RK1 b - - 2 23",
"r2q1r1k/6np/1p1p1pp1/pNpPn3/P1P1P1P1/1PB1Q2P/5R2/5R1K w - - 0 26",
"2kn4/ppN1R3/3p4/6rp/2NP3n/2P5/PP5r/4KR2 b - - 4 28",
"r1br2k1/pp4p1/4p1Bp/4P3/2Rp3N/4n1P1/PP2P2P/R5K1 w - - 8 31",
"6k1/1p3pp1/p2p4/3P1P2/P1Bpn3/1P2q3/2P4P/5Q1K b - - 0 33",
"4q3/r4pkp/1p1P4/2n1P1p1/2Q2b2/7P/2R1B1P1/5R1K w - - 0 36",
"3rr1k1/p4pbp/2bN1p2/8/2B3P1/2P3Bn/P2N4/3R1K2 b - - 1 38"};

See:
http://ivanhoebuilds.googlecode.com/svn ... enchmark.c

To see for yourself, just run strings.exe against the blackmamba binary. It's at the end.

To be fair, he does mention Fire, Ivanhoe and Robbolito in his page:
https://sites.google.com/site/mdannib/ringraziamenti
And Ivanhoe was released as public domain.
So, you get what you pay for.

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: BlackMamba 1.0

Post by Jeremy Bernstein » Wed Apr 11, 2012 7:43 pm

User923005 wrote:Black Mamba is definitely an Ivanhoe clone.
It even has this table embedded in it:
char BENCHMARK_POS[16][128]=
{"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
"rnbqkb1r/pppp1ppp/4pn2/8/2PP4/2N5/PP2PPPP/R1BQKBNR b KQkq - 1 3",
"rnbqkb1r/pp2pppp/1n1p4/8/2PP4/8/PP3PPP/RNBQKBNR w KQkq - 0 6",
"r1bq1rk1/pppp1ppp/5n2/4n3/2P5/1PN3P1/P2PPKBP/R1BQ3R b - - 0 8",
"r4rk1/ppqbbppp/2nppn2/8/4PP2/1NN1B3/PPP1B1PP/R2Q1RK1 w - - 1 11",
"r2q1rk1/1pp2ppp/p1pbb3/4P3/4NB2/8/PPP2PPP/R2QR1K1 b - - 0 13",
"r4rk1/3np1bp/pq1p2p1/2pP3n/6P1/2N1Bp2/PPQ1BPP1/R4RK1 w - - 0 16",
"rnb2r2/p1p2pk1/1p1pqn1p/P7/Q1PPp1pP/2P3P1/4PPB1/1RB1K1NR b K - 3 18",
"4rk1r/1b2pNbp/pq2Bn1p/1ppP4/P1p2Q2/2N4P/1P3PP1/R3K2R w KQ - 8 21",
"r3r1k1/2p1np1p/1p2p1pB/p1q1P3/P1P1Q3/3R3P/1P3PP1/5RK1 b - - 2 23",
"r2q1r1k/6np/1p1p1pp1/pNpPn3/P1P1P1P1/1PB1Q2P/5R2/5R1K w - - 0 26",
"2kn4/ppN1R3/3p4/6rp/2NP3n/2P5/PP5r/4KR2 b - - 4 28",
"r1br2k1/pp4p1/4p1Bp/4P3/2Rp3N/4n1P1/PP2P2P/R5K1 w - - 8 31",
"6k1/1p3pp1/p2p4/3P1P2/P1Bpn3/1P2q3/2P4P/5Q1K b - - 0 33",
"4q3/r4pkp/1p1P4/2n1P1p1/2Q2b2/7P/2R1B1P1/5R1K w - - 0 36",
"3rr1k1/p4pbp/2bN1p2/8/2B3P1/2P3Bn/P2N4/3R1K2 b - - 1 38"};

See:
http://ivanhoebuilds.googlecode.com/svn ... enchmark.c

To see for yourself, just run strings.exe against the blackmamba binary. It's at the end.

To be fair, he does mention Fire, Ivanhoe and Robbolito in his page:
https://sites.google.com/site/mdannib/ringraziamenti
And Ivanhoe was released as public domain.
So, you get what you pay for.
Good find -- I thought those FEN strings would turn something up -- I checked against the benchmark positions in Critter and Stockfish before I stopped looking. No surprise. Nice that he made an OSX version.

jb

User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Re: BlackMamba 1.0

Post by kingliveson » Thu Apr 12, 2012 5:57 am

There's an appropriate way of giving attribution if it turns out to be a derivative...
PAWN : Knight >> Bishop >> Rook >>Queen

mdannib
Posts: 7
Joined: Thu Aug 19, 2010 12:20 pm
Real Name: Matteo

Re: BlackMamba 1.0

Post by mdannib » Thu Apr 12, 2012 9:41 am

Jeremy Bernstein wrote:
Good find -- I thought those FEN strings would turn something up -- I checked against the benchmark positions in Critter and Stockfish before I stopped looking. No surprise. Nice that he made an OSX version.

jb
The strings are used with the command "benchmark x" (x is the selectep depth) from the uci interface; this is used only for the PGO compile as Stockfish does.
The idea is from Stockfish (benchmark.cpp) and the position mainly from ivanhoe.

This code is never used in other ways.

The actual beta used more positions just because there are other areas in the eval that i want to optimized.

This is the new table.....yes, i'm the author....
char BenchmarkPositions[34][128] = {
"fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
"fen rnbqkb1r/pppp1ppp/4pn2/8/2PP4/2N5/PP2PPPP/R1BQKBNR b KQkq - 1 3",
"fen rnbqkb1r/pp2pppp/1n1p4/8/2PP4/8/PP3PPP/RNBQKBNR w KQkq - 0 6",
"fen r1bq1rk1/pppp1ppp/5n2/4n3/2P5/1PN3P1/P2PPKBP/R1BQ3R b - - 0 8",
"fen r4rk1/ppqbbppp/2nppn2/8/4PP2/1NN1B3/PPP1B1PP/R2Q1RK1 w - - 1 11",
"fen r2q1rk1/1pp2ppp/p1pbb3/4P3/4NB2/8/PPP2PPP/R2QR1K1 b - - 0 13",
"fen r4rk1/3np1bp/pq1p2p1/2pP3n/6P1/2N1Bp2/PPQ1BPP1/R4RK1 w - - 0 16",
"fen rnb2r2/p1p2pk1/1p1pqn1p/P7/Q1PPp1pP/2P3P1/4PPB1/1RB1K1NR b K - 3 18",
"fen 4rk1r/1b2pNbp/pq2Bn1p/1ppP4/P1p2Q2/2N4P/1P3PP1/R3K2R w KQ - 8 21",
"fen r3r1k1/2p1np1p/1p2p1pB/p1q1P3/P1P1Q3/3R3P/1P3PP1/5RK1 b - - 2 23",
"fen r2q1r1k/6np/1p1p1pp1/pNpPn3/P1P1P1P1/1PB1Q2P/5R2/5R1K w - - 0 26",
"fen 2kn4/ppN1R3/3p4/6rp/2NP3n/2P5/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/p5pp/bpp1pp2/8/q1PP1P2/b3P3/P2NQRPP/1R2B1K1 b - - 6 22",
"fen r1q2rk1/2p1bppp/2Pp4/p6b/Q1PNp3/4B3/PP1R1PPP/2K4R w - - 2 18",
"fen 4k2r/1pb2ppp/1p2p3/1R1p4/3P4/2r1PN2/P4PPP/1R4K1 b - - 3 22",
"fen 3q2k1/pb3p1p/4pbp1/2r5/PpN2N2/1P2P2P/5PP1/Q2R2K1 b - - 4 26",
"fen 3B4/1r2p3/r2p1p2/bkp1P1p1/1p1P1PPp/p1P4P/PP1K4/3B4 w - - 0 1",
"fen 2r4k/1b1q3n/3p1ppN/1p1Pp1Bp/1P2P3/7P/2B1QPP1/R5K1 b - - 0 26"
};

/Matteo

velmarin
Posts: 39
Joined: Thu Mar 17, 2011 11:31 am
Real Name: Jose Mº Velasco

Re: BlackMamba 1.0

Post by velmarin » Thu Apr 12, 2012 11:06 am

compared to program Similarity_3,

60% with Ivanhoe and Fire


http://i35.fastpic.ru/big/2012/0411/12/ ... 527012.png

mdannib
Posts: 7
Joined: Thu Aug 19, 2010 12:20 pm
Real Name: Matteo

Re: BlackMamba 1.0

Post by mdannib » Thu Apr 12, 2012 11:43 am

velmarin wrote:compared to program Similarity_3,

60% with Ivanhoe and Fire


http://i35.fastpic.ru/big/2012/0411/12/ ... 527012.png
Velmarim, i m just saying that the fen used for the optimization fase during the compile is not a "concrete evidence".
This is the piece of code that retrieve the material value during the eval....it's almost identical to Ippolit, IvanHoe, Robbolito and Fire.

Code: Select all

    w_undeveloped = b_undeveloped = 0;
    dev_val = 0;
    DYNAMIC->threat = 0;
    DYNAMIC->eval_hash_hit = 0;
    index = (DYNAMIC->material >> 8) & 0x7ffff;
    SIGN = MATERIAL[index].sign;
    DYNAMIC->flags = MATERIAL[index].flags;
    if (!(DYNAMIC->material & 0x80000000)) {
                Material_value = MATERIAL[index].value;
                Material_value *= (int)((MATERIAL_WEIGHTING << 10) / 100);
                Material_value >>= 10;
        }
    else
    {
        if (POPCNT_M15(bWq) > 1
                || POPCNT_M15(bBq) > 1
                || POPCNT_M15(bWr) > 2
                || POPCNT_M15(bBr) > 2
                || POPCNT_M15(bWl) > 1
                || POPCNT_M15(bBl) > 1
                || POPCNT_M15(bWd) > 1
                || POPCNT_M15(bBd) > 1
                || POPCNT_M15(bWn) > 2
                || POPCNT_M15(bBn) > 2)
        {
            SIGN = 128;
            Material_value = value_material();
            DYNAMIC->flags = 0;
            if (bWq | bWr | bWb | bWn)
                DYNAMIC->flags |= 2;
            if (bBq | bBr | bBb | bBn)
                DYNAMIC->flags |= 1;
        }
        else
        {
            Material_value = MATERIAL[index].value;
            DYNAMIC->material &= 0x7fffffff;
        }
    }
But there are a lot more different things in the eval

Code: Select all

        
        /////////////////////
        // Eternal Knight 
        /////////////////////
    U = bWn;
    while (U)
    {
        b = LSB(U);
        bit_free(b, U); 
                if ((b == D5 || b == E5) 
                        && !(attacked_by_black_knight & U)
                        && !(attacked_by_black_bishop & U))
                        value += eternal_knight;
        }
    U = bBn;
    while (U)
    {
        b = LSB(U);
        bit_free(b, U); 
                if ((b == D5 || b == E5) 
                        && !(attacked_by_white_knight & U)
                        && !(attacked_by_white_bishop & U))
                        value -= eternal_knight;
        }
...and another one...

Code: Select all

                // controllo se e' un pedone che puo attaccare il re nemico
                if (rank >= R4) {
                        f_bk = FILE(black_king_square);
                        if ((rank == R4) && (file == f_bk || file == (f_bk + 1) || file == (f_bk -1)))
                                value += pawn_storm_R4;
                        else if ((rank == R5) && (file == f_bk || file == (f_bk + 1) || file == (f_bk -1)))
                                value += pawn_storm_R5;
                        else if ((rank == R6) && (file == f_bk || file == (f_bk + 1) || file == (f_bk -1)))
                                value += pawn_storm_R6;
                }
...and another one...

Code: Select all

        /////////////////////
        // Interaction 
        /////////////////////
        // WHITE
        // two minors
        U = ((interaction_wn_1 | interaction_wn_2) & interaction_wb) | (interaction_wn_1 & interaction_wn_2);
        U &= (~bitboard_occupied_white);
        if (U) {
                if (U & bBk)
                        value += 5 * POPCNT(U)* two_minors;
                else
                        value += POPCNT(U)* two_minors;
        }
        // minor and rook
        U = interaction_wr & ((interaction_wn_1 | interaction_wn_2) | interaction_wb);
        U &= (~bitboard_occupied_white);
        if (U) {
                if (U & bBk)
                        value += 5 * POPCNT(U)* minor_and_rook;
                else
                        value += POPCNT(U)* minor_and_rook;
        }

velmarin
Posts: 39
Joined: Thu Mar 17, 2011 11:31 am
Real Name: Jose Mº Velasco

Re: BlackMamba 1.0

Post by velmarin » Thu Apr 12, 2012 12:34 pm

Sorry, I understood that you were the author.

The engine is free, I do not question its legality.
On the contrary, I congratulate you.
As is so, I'm available if something needs.

Greetings.

Post Reply