unable to translate due to isinstance call

Hi, my translation run fails with: -> assert s_value.contains(self.bindings[arg]) where s_value = SomeBool(knowntypedata={}) and self.bindings[arg] is SomeBool(const=True, knowntypedata={}). The cause is this: if isinstance(self.functions[0], CPPFunction): where the s_value above is op.result coming the isinstance() call. With moving things around, the problem comes and goes (hence I thought I had it fixed already, but it came back ...). Checking other calls to isinstance() in other modules, I can't see why it would not be allowed here? Also, what would be the difference between a const and a non-const bool? Any hints to get around this one are much appreciated! Thanks, Wim -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net

Hi Maciej,
Can you give me the exact branch and revision so I can try? It depends a bit on the full traceback.
current reflex-support branch. Although as said, it comes and goes: I'll re-run a few times and post the traceback when it occurs again. Thanks, Wim -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net

Hi Majiec,
Can you give me the exact branch and revision so I can try? It depends a bit on the full traceback.
full stack trace below. One way out seems to be to @jit.elidable_promote(), which is fine, although seems superfluous (the functions[] list is already declared to be immutable). Thanks, Wim [translation:ERROR] Error: [translation:ERROR] Traceback (most recent call last): [translation:ERROR] File "translate.py", line 303, in main [translation:ERROR] drv.proceed(goals) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/translator/driver.py", line 771, in proceed [translation:ERROR] return self._execute(goals, task_skip = self._maybe_skip()) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/translator/tool/taskengine.py", line 116, in _execute [translation:ERROR] res = self._do(goal, taskcallable, *args, **kwds) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/translator/driver.py", line 283, in _do [translation:ERROR] res = func() [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/translator/driver.py", line 319, in task_annotate [translation:ERROR] s = annotator.build_types(self.entry_point, self.inputtypes) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 89, in build_types [translation:ERROR] return self.build_graph_types(flowgraph, inputcells, complete_now=complete_now) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 142, in build_graph_types [translation:ERROR] self.complete() [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 195, in complete [translation:ERROR] self.processblock(graph, block) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 340, in processblock [translation:ERROR] self.flowin(graph, block) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 399, in flowin [translation:ERROR] self.consider_op(block, i) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 605, in consider_op [translation:ERROR] self.setbinding(op.result, resultcell) # bind resultcell to op.result [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 247, in setbinding [translation:ERROR] assert s_value.contains(self.bindings[arg]) [translation:ERROR] AssertionError [translation:ERROR] Processing block: [translation:ERROR] block@6 is a <class 'pypy.objspace.flow.flowcontext.SpamBlock'> [translation:ERROR] in (pypy.module.cppyy.interp_cppyy:425)W_CPPOverload.is_static [translation:ERROR] containing the following operations: [translation:ERROR] v585 = getattr(self_79, ('functions')) [translation:ERROR] v586 = getitem(v585, (0)) [translation:ERROR] v587 = simple_call((builtin_function isinstance), v586, (type CPPFunction)) [translation:ERROR] v588 = is_true(v587) [translation:ERROR] --end-- -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net

Re-hi, On Sat, Oct 27, 2012 at 10:30 AM, Armin Rigo <arigo@tunes.org> wrote:
Indeed, that's how it crashes. The issue comes from the fact that "knowntypedata={}" should not be attached to SomeBools, a fact that we overlooked when refactoring builtin_isinstance(). Fixed by introducing a cleaner interface in 28ae0f0e0b79. A bientôt, Armin.

Hi Maciej,
Can you give me the exact branch and revision so I can try? It depends a bit on the full traceback.
current reflex-support branch. Although as said, it comes and goes: I'll re-run a few times and post the traceback when it occurs again. Thanks, Wim -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net

Hi Majiec,
Can you give me the exact branch and revision so I can try? It depends a bit on the full traceback.
full stack trace below. One way out seems to be to @jit.elidable_promote(), which is fine, although seems superfluous (the functions[] list is already declared to be immutable). Thanks, Wim [translation:ERROR] Error: [translation:ERROR] Traceback (most recent call last): [translation:ERROR] File "translate.py", line 303, in main [translation:ERROR] drv.proceed(goals) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/translator/driver.py", line 771, in proceed [translation:ERROR] return self._execute(goals, task_skip = self._maybe_skip()) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/translator/tool/taskengine.py", line 116, in _execute [translation:ERROR] res = self._do(goal, taskcallable, *args, **kwds) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/translator/driver.py", line 283, in _do [translation:ERROR] res = func() [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/translator/driver.py", line 319, in task_annotate [translation:ERROR] s = annotator.build_types(self.entry_point, self.inputtypes) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 89, in build_types [translation:ERROR] return self.build_graph_types(flowgraph, inputcells, complete_now=complete_now) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 142, in build_graph_types [translation:ERROR] self.complete() [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 195, in complete [translation:ERROR] self.processblock(graph, block) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 340, in processblock [translation:ERROR] self.flowin(graph, block) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 399, in flowin [translation:ERROR] self.consider_op(block, i) [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 605, in consider_op [translation:ERROR] self.setbinding(op.result, resultcell) # bind resultcell to op.result [translation:ERROR] File "/home/wlav/pypy-dev/pypy/pypy/annotation/annrpython.py", line 247, in setbinding [translation:ERROR] assert s_value.contains(self.bindings[arg]) [translation:ERROR] AssertionError [translation:ERROR] Processing block: [translation:ERROR] block@6 is a <class 'pypy.objspace.flow.flowcontext.SpamBlock'> [translation:ERROR] in (pypy.module.cppyy.interp_cppyy:425)W_CPPOverload.is_static [translation:ERROR] containing the following operations: [translation:ERROR] v585 = getattr(self_79, ('functions')) [translation:ERROR] v586 = getitem(v585, (0)) [translation:ERROR] v587 = simple_call((builtin_function isinstance), v586, (type CPPFunction)) [translation:ERROR] v588 = is_true(v587) [translation:ERROR] --end-- -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net

Re-hi, On Sat, Oct 27, 2012 at 10:30 AM, Armin Rigo <arigo@tunes.org> wrote:
Indeed, that's how it crashes. The issue comes from the fact that "knowntypedata={}" should not be attached to SomeBools, a fact that we overlooked when refactoring builtin_isinstance(). Fixed by introducing a cleaner interface in 28ae0f0e0b79. A bientôt, Armin.
participants (3)
-
Armin Rigo
-
Maciej Fijalkowski
-
wlavrijsen@lbl.gov