Re: [Cython] NumPy test failures in Py2.4

2012-03-26 Thread mark florisson
On 24 March 2012 22:24, mark florisson  wrote:
> On 23 March 2012 19:40, Stefan Behnel  wrote:
>> Hi,
>>
>> after re-enabling the NumPy tests, I'm getting two NumPy (1.6.1) test
>> failure in Py2.4 (2.7 is ok):
>>
>> https://sage.math.washington.edu:8091/hudson/job/cython-devel-tests/BACKEND=c,PYVERSION=py24-ext/224/testReport/junit/doctest/DocTestCase/Doctest__numpy_test/
>>
>> """
>> File ".../run/c/numpy_test.so", line 207, in numpy_test
>> Failed example:
>>    print(test_partially_packed_align(np.zeros((1,), dtype=np.dtype([('a',
>> 'b'), ('b', 'i'), ('sub', np.dtype('b,i')), ('c', 'i')], align=True
>> Exception raised:
>>    Traceback (most recent call last):
>>      File "numpy_test.pyx", line 451, in
>> numpy_test.test_partially_packed_align (numpy_test.c:7967)
>>    ValueError: Buffer dtype mismatch; next field is at offset 13 but 16
>> expected
>> --
>> File ".../run/c/numpy_test.so", line 211, in numpy_test
>> Failed example:
>>    print(test_partially_packed_align_2(np.zeros((1,),
>> dtype=np.dtype([('a', 'b'), ('b', 'i'), ('c', 'b'), ('sub', np.dtype('b,i',
>> align=True))]
>> Exception raised:
>>      File "numpy_test.pyx", line 459, in
>> numpy_test.test_partially_packed_align_2 (numpy_test.c:8186)
>>    ValueError: Buffer dtype mismatch; next field is at offset 7 but 10
>> expected
>> """
>>
>> Does anyone know what to make of this?
>
> That's probably a regression from my changes to the buffer format
> parser. It should be aligning on the second integer in the substruct,
> for which the entire struct is aligned and the first character padded.
> I'll look into it, thanks.

No, there is no regression, the buffer format parser has always been
wrong in this regard. The tests have just always passed because the
buffer was obtained through numpy.pxd's __getbuffer__, which flattens
the structs. Since numpy supports the buffer interface now, it tries
to parse the actual format string but fails.

Basically the problem is that with aligned structs inside padded
structs the format parser needs to start aligning in isolation from
the actual offset. E.g. it still needs to isolate an int on a 4-byte
boundary, but in relation to the start of the aligned struct, which
may in itself not be aligned. This is not a regression so I'm leaving
it as is, as the fix is complicated and I'm rather preoccupied.
Basically I think the buffer format parser should be rewritten to use
a single stack (and so does Dag), which would make things a lot less
complicated, but that's not a trivial task.

>> Stefan
>> ___
>> cython-devel mailing list
>> cython-devel@python.org
>> http://mail.python.org/mailman/listinfo/cython-devel
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] NumPy test failures in Py2.4

2012-03-26 Thread Stefan Behnel
mark florisson, 26.03.2012 14:13:
>> On 23 March 2012 19:40, Stefan Behnel wrote:
>>> after re-enabling the NumPy tests, I'm getting two NumPy (1.6.1) test
>>> failure in Py2.4 (2.7 is ok):
>>> [...]
> Basically the problem is that with aligned structs inside padded
> structs the format parser needs to start aligning in isolation from
> the actual offset. E.g. it still needs to isolate an int on a 4-byte
> boundary, but in relation to the start of the aligned struct, which
> may in itself not be aligned. This is not a regression so I'm leaving
> it as is, as the fix is complicated and I'm rather preoccupied.
> Basically I think the buffer format parser should be rewritten to use
> a single stack (and so does Dag), which would make things a lot less
> complicated, but that's not a trivial task.

Ok, so how do we deal with this for the time being? Disable the test in
CPython versions where it fails? (that would be 2.4 and 2.5, I guess?)

BTW, maybe we should start using a decorator for the tests that compile
correctly on a given Python version but fail when being run. That would
allow us to handle cases like this more easily, i.e. to keep tests in one
test file even though some of them are being ignored in a specific environment.

Stefan
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] NumPy test failures in Py2.4

2012-03-26 Thread mark florisson
On 26 March 2012 14:12, Stefan Behnel  wrote:
> mark florisson, 26.03.2012 14:13:
>>> On 23 March 2012 19:40, Stefan Behnel wrote:
 after re-enabling the NumPy tests, I'm getting two NumPy (1.6.1) test
 failure in Py2.4 (2.7 is ok):
 [...]
>> Basically the problem is that with aligned structs inside padded
>> structs the format parser needs to start aligning in isolation from
>> the actual offset. E.g. it still needs to isolate an int on a 4-byte
>> boundary, but in relation to the start of the aligned struct, which
>> may in itself not be aligned. This is not a regression so I'm leaving
>> it as is, as the fix is complicated and I'm rather preoccupied.
>> Basically I think the buffer format parser should be rewritten to use
>> a single stack (and so does Dag), which would make things a lot less
>> complicated, but that's not a trivial task.
>
> Ok, so how do we deal with this for the time being? Disable the test in
> CPython versions where it fails? (that would be 2.4 and 2.5, I guess?)

Yes I disabled the tests. I also added some code to clear exceptions
in case the releasebuffer of getbuffer capsules weren't found. Hudson
is now blue, so I'd like to test Dag's pull request for the numpy API
changes and merge that and then do another beta release. Improved
fused type dispatching can then wait until 0.16.1.

> BTW, maybe we should start using a decorator for the tests that compile
> correctly on a given Python version but fail when being run. That would
> allow us to handle cases like this more easily, i.e. to keep tests in one
> test file even though some of them are being ignored in a specific 
> environment.
>
> Stefan
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] funding (Re: sage.math problems?)

2012-03-26 Thread mark florisson
On 23 March 2012 14:24, Stefan Behnel  wrote:
> mark florisson, 23.03.2012 15:09:
>> I also changed the cython-sdist to pull from the release0.16 branch,
>> to make sure things work in the release.
>
> There are dedicated cython-release jobs for that. Not sure in what state
> they are (haven't been used for a while), but they were supposed to work on
> the "release" branch. If you had named the branch plain "release", they
> would have done the right thing.

Apparently something is wrong with the py31 and py32 release jobs:
/levi/scratch/hudson/tmp/hudson738187841750656805.sh: line 17:
/levi/scratch/robertwb/hudson/hudson/jobs/cython-release-tests/workspace/BACKEND/c/PYVERSION/py31-ext/python/bin/python:
No such file or directory (see
https://sage.math.washington.edu:8091/hudson/view/release/job/cython-release-tests/BACKEND=c,PYVERSION=py31-ext/5/console).
The originating problem is: ln: accessing
`/levi/scratch/robertwb/hudson/hudson/jobs/py31-ext-hg/lastStable/archive/python31-bin.tar.gz':
No such file or directory

> Cutting away cython-devel-sdist means that we loose the testing for the
> master (which I am using for the pull request merges right now) and also
> loose the coherent build history.
>
> Stefan
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel