[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #64704] VM error with chained indexing express
From: |
Arun Giridhar |
Subject: |
[Octave-bug-tracker] [bug #64704] VM error with chained indexing expression |
Date: |
Thu, 21 Sep 2023 08:47:56 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?64704>
Summary: VM error with chained indexing expression
Group: GNU Octave
Submitter: arungiridhar
Submitted: Thu 21 Sep 2023 08:47:54 AM EDT
Category: JIT Acceleration
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Unexpected Error or Warning
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: dev
Discussion Lock: Any
Operating System: GNU/Linux
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Thu 21 Sep 2023 08:47:54 AM EDT By: Arun Giridhar <arungiridhar>
The VM has some difficulty with evaluating chained indexing expressions as in
the last line of this example. This minimum reproducer was distilled from
production code where this kind of indexing was happening.
lst = rand (285, 16);
areas = rand (285, 1);
ii = true (285, 1);
ii([18 33 34 38 45 57 74 91 130 154 176 213 246 279]) = 0;
areas(ii) = lst(ii,:) = [];
The VM gives a size mismatch error, and only one of the arrays has been
reduced. The other is still untouched, and the error message indicates that it
interpreted "= []" as an array assignment instead of a deletion.
octave:1> echo on
octave:2> testvm
+ ## test VM
+
+ lst = rand (285, 16);
+ areas = rand (285, 1);
+ ii = true (285, 1);
+ ii([18 33 34 38 45 57 74 91 130 154 176 213 246 279]) = 0;
+ areas(ii) = lst(ii,:) = [];
error: =: nonconformant arguments (op1 is 271x1, op2 is 0x0)
error: called from
testvm at line 5 column 4
octave:3>
octave:3> whos
Variables visible from the current scope:
variables in scope: top scope
Attr Name Size Bytes Class
==== ==== ==== ===== =====
areas 285x1 2280 double
ii 285x1 285 logical
lst 14x16 1792 double
Total is 794 elements using 4357 bytes
Without the VM, the code evaluates as intended:
octave:4> clear all
octave:5> __enable_vm_eval__ (0)
octave:6>
octave:6> testvm
+ ## test VM
+
+ lst = rand (285, 16);
+ areas = rand (285, 1);
+ ii = true (285, 1);
+ ii([18 33 34 38 45 57 74 91 130 154 176 213 246 279]) = 0;
+ areas(ii) = lst(ii,:) = [];
+
+
octave:7> whos
Variables visible from the current scope:
variables in scope: top scope
Attr Name Size Bytes Class
==== ==== ==== ===== =====
areas 14x1 112 double
ii 285x1 285 logical
lst 14x16 1792 double
Total is 523 elements using 2189 bytes
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64704>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #64704] VM error with chained indexing expression,
Arun Giridhar <=