buggnubg - Bugs: bug #28421, Position key generation and...

 
 

bug #28421: Position key generation and decoding is no longer portable

Submitted by:  Mark Calderbank <markc>
Submitted on:  Mon 28 Dec 2009 12:33:28 AM UTC  
 
Originator Name: Mark CalderbankItem Group: Other bug
Category: OtherRelease: 0.90-devel
Privacy: PublicOperating System: All
OS Type: AnyProcessor Type: Any
Severity: 3 - NormalOpen/Closed: Closed
Assigned to: NonePriority: 5 - Normal
Status: Please Upgrade

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 01 Aug 2011 10:30:35 PM UTC, comment #3:

This is no longer relevant. We use a new, faster key internally for move generation that is indifferent to endianess.
The old position key is still used for exporting/cutting/pasting positions, but for that the older portable code is good enough.

Philippe Michel <plm>
Project Member
Sun 06 Mar 2011 05:57:48 PM UTC, comment #2:

I have committed a workaround for this (tested on PS3/Yellow Dog Linux).

The preprocessor check may be gcc/clang specific and may need refining for Intel or MS compilers. At least it fails safely, resorting to the portable code.

Philippe Michel <plm>
Project Member
Fri 16 Jul 2010 12:28:15 PM UTC, comment #1:

Probably it should be a configure option to use the old code (The new code is faster). I'll take a look.

Christian Anthon <c_anthon>
Project Administrator
Mon 28 Dec 2009 12:33:28 AM UTC, original submission:

The functions PositionKey and PositionFromKey in positionid.c have been re-written in a way which assumes certain features of the system (little-endianism, 4-byte ints, 2-byte shorts, and nice behaviour when casting an arbitrary char* to int*).

Even on systems that meet these requirements, the code is not strictly correct because an int pointer is dereferenced which hangs over the edge of the 10-byte array.

From a quick look at CVS history, the changes made in version 1.44 on 2009-06-14 appear to be responsible.

By implementing a byte-by-byte system along the same lines as the current code (patch attached), I have managed to get the CVS code running correctly on a big-endian system. I patched the code before realising that a recent change was to blame - reverting to the old code might be easier.

Mark Calderbank <markc>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #19378:  gnubg.patch added by markc (2KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by plm (Posted a comment)
  • -unavailable- added by c_anthon (Posted a comment)
  • -unavailable- added by markc (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 01 Aug 2011 10:30:35 PM UTCplmOperating SystemOther=>All
      OS TypeNone=>Any
      Processor TypeNone=>Any
      Open/ClosedOpen=>Closed
      Assigned toc_anthon=>None
      StatusIn Progress=>Please Upgrade
    Fri 16 Jul 2010 12:28:15 PM UTCc_anthonAssigned toNone=>c_anthon
      StatusNone=>In Progress
    Mon 28 Dec 2009 12:33:28 AM UTCmarkcAttached File-=>Added gnubg.patch, #19378

    Back to the top


    Powered by Savane 3.1-cleanup1