[phobos] Unit tests broken again. Bad AAs?

Steve Schveighoffer schveiguy at yahoo.com
Mon Mar 22 07:55:27 PDT 2010


Any code that relies on AA's storing keys in the same order is broken.  A rehash can reorder keys at any time, I think even with the old implementation.

-Steve



----- Original Message ----
> From: Andrei Alexandrescu <andrei at erdani.com>
> To: Discuss the phobos library for D <phobos at puremagic.com>
> Sent: Mon, March 22, 2010 10:45:11 AM
> Subject: Re: [phobos] Unit tests broken again. Bad AAs?
> 
> Yes, I saw that too. Walter has changed the implementation of AAs, and the 
> relative ordering of keys has changed. The contents of the arrays involved in 
> the failure seems to be equal, so the bug is in the AA comparison 
> operator.

(I think what happens is that now the exact ordering of 
> elements depends on history, i.e. the order in which they were inserted. In the 
> previous implementation the ordering was 
> history-independent.)

Andrei

On 03/22/2010 08:58 AM, Don Clugston 
> wrote:
> It seems that one of the druntime commits after 270
> 
> (probably 271, "reduce memory consumption of small AA's") has broken
> the 
> Phobos unittests. json.d is now failing.
> 
> _______________________________________________
> phobos mailing 
> list
> 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com
> 
> http://lists.puremagic.com/mailman/listinfo/phobos
_______________________________________________
phobos 
> mailing list

> href="mailto:phobos at puremagic.com">phobos at puremagic.com

> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos


      


More information about the phobos mailing list