bugGNU Octave - Bugs: bug #65057, Byte-code interpreter is not...

 
 

bug #65057: Byte-code interpreter is not compatible with the pythonic package

Submitter:  Hendrik K <koerhen>
Submitted:  Wed 20 Dec 2023 02:35:07 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  10.1.0 (current default) Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 08 Feb 2024 05:12:58 AM UTC, comment #11: 

Marking bug as Fixed and closing report.

Rik <rik5>
Group administrator
Tue 09 Jan 2024 09:31:08 AM UTC, comment #10: 

Yes, it does as already mentioned below to Philip.

The byte code warnings (not according to standards and inability to turn off) I think is a separate issue, so this one is fine.

Hendrik K <koerhen>
Mon 08 Jan 2024 02:11:13 AM UTC, comment #9: 

The fix for bud #65029 has been pushed. Does that solve this problem as well?

Arun Giridhar <arungiridhar>
Group Member
Wed 27 Dec 2023 01:46:44 AM UTC, comment #8: 

@Philip-

the patch for bug #65029 seems to solve the core dump issue. Nice catch and my function calling python code now runs through with the byte code interpreter enabled.


@Petter-
with regards to the warning: I do no seem to be able to turn off the warning:

warning("off", "auto-compilation of pyobject failed with message classdef constructors are not supported by the VM yet")

does not work. I guess that this may be related to the message id not being set.

See https://docs.octave.org/latest/Issuing-Warnings.html.

Hendrik K <koerhen>
Tue 26 Dec 2023 12:10:15 PM UTC, comment #7: 


> Interesting is, that if the array size is smaller (e.g. 100x100), octave does not crash with the byte code interpreter.

See bug #65029 for that. pls try the fix there.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 26 Dec 2023 08:00:31 AM UTC, comment #6: 

But if one starts really using pythonic with actual (large) data, it seems not to work in certain cases.
 
Sample below produces a core dump.


function ret = test2();
  pkg load pythonic;
  py.sys.path.insert (int32 (0), pwd());

  x = py.numpy.sqrt(py.numpy.arange(1000000));
  x = py.numpy.reshape(x, pyeval("(1000,1000)"));
  y = reshape(double(py.array.array("d", py.numpy.ndarray.flatten(x,order="F"))),size(x));
  disp("Test2 execution finished.");
  disp(__vm_is_executing__);
endfunction




__vm_enable__(0);
test2()

Test2 execution finished.
0


__vm_enable__(1);
>> test2()
warning: auto-compilation of pyobject failed with message classdef constructors are not supported by the VM yet
warning: called from
    subsref at line 53 column 7
    test2 at line 3 column 3

--> core dump


Interesting is, that if the array size is smaller (e.g. 100x100), octave does not crash with the byte code interpreter.

Hendrik K <koerhen>
Tue 26 Dec 2023 05:17:24 AM UTC, comment #5: 

Thanks. I checked "__vm_is_executing__" and it seems to work, i.e. it returns true.


Would it be possible to change the warning so that it follows the octave naming convention, though ?

"Side note: The byte-code interpreter warning(s) should follow the octave warning naming convention (https://docs.octave.org/v8.4.0/Issuing-Warnings.html):

"Note that warning IDs are in the format "NAMESPACE:WARNING-NAME". The namespace "Octave" is used for Octave’s own warnings""



Anonymous
Mon 25 Dec 2023 03:37:21 PM UTC, comment #4: 

You can call __vm_is_executing__ to check if the bytecode interpreter is executing the current function or not.

As said the warning is just a notice that there is no proper support for classes in the bytecode interpreter. However, they should run fine anyways.

Petter <petter>
Wed 20 Dec 2023 01:02:32 PM UTC, comment #3: 

Besides: The (internal) C++ status of the function test2 is not compiled (ufn->is_compiled() is false!) after executing.

So while the function is executed as I mentioned in the bug report, I am not sure that the byte code interpreter is executing it ...


Hendrik K <koerhen>
Wed 20 Dec 2023 12:56:01 PM UTC, comment #2: 

My entered bug classification was and is "Feature request" :-)


Hendrik K <koerhen>
Wed 20 Dec 2023 12:50:49 PM UTC, comment #1: 

There is no incompatibility, the VM is currently unable to compile classdef code (but will still execute the code). You will see this warning with any classdef code

A.R. Burgers <arb>
Wed 20 Dec 2023 02:35:07 AM UTC, original submission:  

The byte-code interpreter is not compatible with the octave-pythonic package:


pkg install https://gitlab.com/gnu-octave/octave-pythonic/-/archive/master/octave-pythonic-master.tar.gz

function ret = test2();
  pkg load pythonic;
  py.sys.path.insert (int32 (0), pwd());
  disp("Test2 execution finished.");
endfunction


When now executing test2() with the vm_active, a warning is thrown and test2 is not compiled (but executed though).


__vm_enable__(1);
test2();

warning: auto-compilation of pyobject failed with message classdef constructors are not supported by the VM yet
warning: called from
    subsref at line 53 column 7
    test2 at line 3 column 3

Test2 execution finished.



Side note: The byte-code interpreter warning(s) should follow the octave warning naming convention (https://docs.octave.org/v8.4.0/Issuing-Warnings.html):

"Note that warning IDs are in the format "NAMESPACE:WARNING-NAME". The namespace "Octave" is used for Octave’s own warnings"

Hendrik K <koerhen>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by arungiridhar (Posted a comment)
  • -email is unavailable- added by petter (Posted a comment)
  • -email is unavailable- added by arb (Posted a comment)
  • -email is unavailable- added by koerhen (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-02-08 rik5 Fixed ReleaseNone 10.1.0 (current default)
    2024-02-08 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2023-12-28 philipnienhuis Dependencies- Depends on bugs #65029

    Back to the top

    Powered by Savane 3.13-d8a5.
    Corresponding source code