Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/module/pypyjit/test_pypy_c/test_array.py::TestArray::()::test_array_intimg

self = <pypy.module.pypyjit.test_pypy_c.test_array.TestArray object at 0x0ca6d7d0>

    def test_array_intimg(self):
        def main():
            from array import array
            img = array('i', range(3)) * (350 * 480)
            intimg = array('i', (0,)) * (640 * 480)
            l, i = 0, 640
            while i < 640 * 480:
                assert len(img) == 3*350*480
                assert len(intimg) == 640*480
                l = l + img[i]
                intimg[i] = (intimg[i-640] + l)
                i += 1
            return intimg[i - 1]
        #
        log = self.run(main, [])
        assert log.result == 73574560
        loop, = log.loops_by_filename(self.filepath)
    
        if sys.maxint == 2 ** 31 - 1:
>           assert loop.match("""
                    i13 = int_lt(i8, 307200)
                    guard_true(i13, descr=...)
                    guard_not_invalidated(descr=...)
                # the bound check guard on img has been killed (thanks to the asserts)
                    i14 = getarrayitem_raw_i(i10, i8, descr=<ArrayS .>)
                    i15 = int_add_ovf(i9, i14)
                    guard_no_overflow(descr=...)
                    i17 = int_add(i8, -640)
                # the bound check guard on intimg has been killed (thanks to the asserts)
                    i18 = getarrayitem_raw_i(i11, i17, descr=<ArrayS .>)
                    i19 = int_add_ovf(i18, i15)
                    guard_no_overflow(descr=...)
                    setarrayitem_raw(i11, i8, _, descr=<ArrayS .>)
                    i28 = int_add(i8, 1)
                    --TICK--
                    jump(..., descr=...)

pypy/module/pypyjit/test_pypy_c/test_array.py:72: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pypy/module/pypyjit/test_pypy_c/model.py:177: in match
    return matcher.match(expected_src, **kwds)
pypy/module/pypyjit/test_pypy_c/model.py:524: in match
    self.match_loop(expected_ops, ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:500: in match_loop
    self.match_op(op, exp_op)
pypy/module/pypyjit/test_pypy_c/model.py:409: in match_op
    self._assert(op.name == exp_opname, "operation mismatch")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x0cbf7090>
cond = False, message = 'operation mismatch'

    def _assert(self, cond, message):
        if not cond:
>           raise InvalidMatch(message, frame=sys._getframe(1))
E           InvalidMatch: operation mismatch

pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
---------- Captured stdout call ----------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = None
('operation mismatch',)
<could not determine information>

Ignore ops: []
Got:

	===== HERE =====
    guard_not_invalidated(descr=<Guard0xf48a6c90>)
    i64 = int_lt(i58, 307200)
    guard_true(i64, descr=<Guard0xf4538748>)
    i65 = getarrayitem_raw_i(i46, i58, descr=<ArrayS 4>)
    i66 = int_add_ovf(i49, i65)
    guard_no_overflow(descr=<Guard0xf4538764>)
    i68 = int_add(i58, -640)
    i69 = getarrayitem_raw_i(i54, i68, descr=<ArrayS 4>)
    i70 = int_add_ovf(i69, i66)
    guard_no_overflow(descr=<Guard0xf4538780>)
    setarrayitem_raw(i54, i58, i70, descr=<ArrayS 4>)
    i72 = int_add(i58, 1)
    i74 = getfield_raw_i(-135066496, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i76 = int_lt(i74, 0)
    guard_false(i76, descr=<Guard0xf48a6cb8>)
    jump(p0, p1, p8, p10, p12, i72, i66, p24, i46, i54, descr=TargetToken(-191820616))

Expected:
    
    i13 = int_lt(i8, 307200)
    guard_true(i13, descr=...)
    guard_not_invalidated(descr=...)
                # the bound check guard on img has been killed (thanks to the asserts)
    i14 = getarrayitem_raw_i(i10, i8, descr=<ArrayS .>)
    i15 = int_add_ovf(i9, i14)
    guard_no_overflow(descr=...)
    i17 = int_add(i8, -640)
                # the bound check guard on intimg has been killed (thanks to the asserts)
    i18 = getarrayitem_raw_i(i11, i17, descr=<ArrayS .>)
    i19 = int_add_ovf(i18, i15)
    guard_no_overflow(descr=...)
    setarrayitem_raw(i11, i8, _, descr=<ArrayS .>)
    i28 = int_add(i8, 1)
    
                guard_not_invalidated?
                ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
                ticker_cond0 = int_lt(ticker0, 0)
                guard_false(ticker_cond0, descr=...)
    
                    jump(..., descr=...)
builder: pypy-c-jit-linux-x86-32 build #8482+
test: pypy/module/pypyjit/test_pypy_c/test_array.py::TestArray::()::test_array_intimg