#355 dog creates 0 dim piddle which squeezes to 1 dim.

critical
open
nobody
None
5
3 days ago
2014-05-23
Diab Jerius
No

Something happened in dog between 2.006 and 2.007 which led it to
create 0 dim piddles which when squeezed go up to 1 dim piddles:

2.006:
% perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
0
0
0

2.007:

% perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
0
1
0

The behavior changed with this commit:

47ec8f062578e262f2959b946c7a88da02f1d404 is the first bad commit
commit 47ec8f062578e262f2959b946c7a88da02f1d404
Author: Craig DeForest <zowie@Clio-4.local>
Date:   Thu Sep 12 23:46:09 2013 -0600

migrate nnslice to replace nslice and slice.  move slice to oslice.
New documentation, some new tests to handle slightly different error
messages and regularized behavior in some odd corner cases.

Related

Bugs: #355

Discussion

  • Chris Marshall
    Chris Marshall
    2014-05-23

    The promotion from 0-D to 1-D happens because of squeeze.
    dog is not needed as this pdl2 session shows:

    pdl> $a = pdl(3); # scalar
    piddle

    pdl> p
    $a->info

    PDL: Double D []
    pdl> p
    $a->squeeze->info

    PDL: Double D [1]

    On Thu, May 22, 2014 at 10:53 PM, Diab Jerius djerius@users.sf.net wrote:


    Status: open
    Group: critical
    Created: Fri May 23, 2014 02:53 AM UTC by Diab Jerius
    Last Updated: Fri May 23, 2014 02:53 AM UTC
    Owner: nobody

    Something happened in dog between 2.006 and 2.007 which led it to
    create 0 dim piddles which when squeezed go up to 1 dim piddles:

    2.006:
    % perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say
    $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
    0
    0
    0

    2.007:

    % perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say
    $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
    0
    1
    0

    The behavior changed with this commit:

    47ec8f062578e262f2959b946c7a88da02f1d404 is the first bad commitcommit 47ec8f062578e262f2959b946c7a88da02f1d404Author: Craig DeForest zowie@Clio-4.localDate: Thu Sep 12 23:46:09 2013 -0600
    migrate nnslice to replace nslice and slice. move slice to oslice.New documentation, some new tests to handle slightly different errormessages and regularized behavior in some odd corner cases.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/pdl/bugs/355/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #355

  • Diab Jerius
    Diab Jerius
    2014-05-23

    Chris,

    Thanks for the cleaner example. (And I thought I'd tried that one...)

    Diab

     
    • Craig DeForest
      Craig DeForest
      2014-05-23

      :-)

      It's actually in reshape:

      pdl> $a = pdl(1);
      pdl> help $a; help $a->reshape(-1);
      This variable is Double D [] P 0.01KB
      This variable is Double D [1] -C 0.00KB

      On May 23, 2014, at 7:54 AM, Diab Jerius djerius@users.sf.net wrote:

      Chris,

      Thanks for the cleaner example. (And I thought I'd tried that one...)

      Diab

      [bugs:#355] dog creates 0 dim piddle which squeezes to 1 dim.

      Status: open
      Group: critical
      Created: Fri May 23, 2014 02:53 AM UTC by Diab Jerius
      Last Updated: Fri May 23, 2014 02:53 AM UTC
      Owner: nobody

      Something happened in dog between 2.006 and 2.007 which led it to
      create 0 dim piddles which when squeezed go up to 1 dim piddles:

      2.006:
      % perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
      0
      0
      0

      2.007:

      % perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
      0
      1
      0

      The behavior changed with this commit:

      47ec8f062578e262f2959b946c7a88da02f1d404 is the first bad commit
      commit 47ec8f062578e262f2959b946c7a88da02f1d404
      Author: Craig DeForest zowie@Clio-4.local
      Date: Thu Sep 12 23:46:09 2013 -0600

      migrate nnslice to replace nslice and slice. move slice to oslice.
      New documentation, some new tests to handle slightly different error
      messages and regularized behavior in some odd corner cases.
      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/pdl/bugs/355/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #355

      Attachments
      • Diab Jerius
        Diab Jerius
        2014-05-23

        And down the rabbit hole we go...

         
      • Craig DeForest
        Craig DeForest
        2014-05-23

        Even better! It's an edge case in slice.

        reshape(-1) constructs a special slice string. If reshape(-1) gets a
        dimensionless PDL, it constructs the empty string to feed to slice.
        The newer version of slice (formerly nnslice) interprets an empty string
        differently from complete lack of an argument.

        pdl> $a = pdl(1);
        pdl> help $a; help $a->slice(); help $a->slice('');
        This variable is Double D [] P 0.01KB
        This variable is Double D [] -C 0.00KB
        This variable is Double D [1] -C 0.00KB

        This is documented behavior -- the empty string explicitly keeps an
        entire dimension and is therefore equivalent to ':'. With permissive
        slicing a missing dimension is treated the same as a dimension of size
        1, so:

        • squeeze issues a reshape(-1) call.
        • reshape(-1) issues a slice('') call.
        • slice('') is the same, now, as slice(':')
        • permissive slicing forces the existence of a single dim of size 1.

        Rather than modify slice again, I suggest changing the reshape(-1) logic.
        It will run faster anyway if it issues a new-style slice call instead of
        constructing an old-style parameter string.

        Chris, I've been under a rock for a couple of months. What's the best
        branch to check that into?

        On May 23, 2014, at 8:08 AM, Craig DeForest craig@deforest.org wrote:

        :-)

        It's actually in reshape:

        pdl> $a = pdl(1);
        pdl> help $a; help $a->reshape(-1);
        This variable is Double D [] P 0.01KB
        This variable is Double D [1] -C 0.00KB

        On May 23, 2014, at 7:54 AM, Diab Jerius djerius@users.sf.net wrote:

        Chris,

        Thanks for the cleaner example. (And I thought I'd tried that one...)

        Diab

        [bugs:#355] dog creates 0 dim piddle which squeezes to 1 dim.

        Status: open
        Group: critical
        Created: Fri May 23, 2014 02:53 AM UTC by Diab Jerius
        Last Updated: Fri May 23, 2014 02:53 AM UTC
        Owner: nobody

        Something happened in dog between 2.006 and 2.007 which led it to
        create 0 dim piddles which when squeezed go up to 1 dim piddles:

        2.006:
        % perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
        0
        0
        0

        2.007:

        % perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
        0
        1
        0

        The behavior changed with this commit:

        47ec8f062578e262f2959b946c7a88da02f1d404 is the first bad commit
        commit 47ec8f062578e262f2959b946c7a88da02f1d404
        Author: Craig DeForest zowie@Clio-4.local
        Date: Thu Sep 12 23:46:09 2013 -0600

        migrate nnslice to replace nslice and slice. move slice to oslice.
        New documentation, some new tests to handle slightly different error
        messages and regularized behavior in some odd corner cases.
        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/pdl/bugs/355/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         

        Related

        Bugs: #355

        Attachments
        • Chris Marshall
          Chris Marshall
          2014-05-23

          Probably master since I'm stuck in finishing the
          64bit support in core-cleanup. Got some segfaults
          and working on cygwin/windows I don't have the
          tools to easily debug things.

          I'm hoping to set up a linux environment to fix
          things but you know how time availability goes...

          --Chris

          On Fri, May 23, 2014 at 10:43 AM, Craig DeForest zowie@users.sf.net wrote:

          Even better! It's an edge case in slice.

          reshape(-1) constructs a special slice string. If reshape(-1) gets a
          dimensionless PDL, it constructs the empty string to feed to slice.
          The newer version of slice (formerly nnslice) interprets an empty string
          differently from complete lack of an argument.

          pdl> $a = pdl(1);
          pdl> help $a; help $a->slice(); help $a->slice('');

          This variable is Double D [] P 0.01KB
          This variable is Double D [] -C 0.00KB

          This variable is Double D [1] -C 0.00KB

          This is documented behavior -- the empty string explicitly keeps an
          entire dimension and is therefore equivalent to ':'. With permissive
          slicing a missing dimension is treated the same as a dimension of size
          1, so:

          • squeeze issues a reshape(-1) call.
          • reshape(-1) issues a slice('') call.
          • slice('') is the same, now, as slice(':')
          • permissive slicing forces the existence of a single dim of size 1.

          Rather than modify slice again, I suggest changing the reshape(-1) logic.
          It will run faster anyway if it issues a new-style slice call instead of
          constructing an old-style parameter string.

          Chris, I've been under a rock for a couple of months. What's the best
          branch to check that into?

          On May 23, 2014, at 8:08 AM, Craig DeForest craig@deforest.org wrote:

          :-)

          It's actually in reshape:

          pdl> $a = pdl(1);
          pdl> help $a; help $a->reshape(-1);
          This variable is Double D [] P 0.01KB
          This variable is Double D [1] -C 0.00KB

          On May 23, 2014, at 7:54 AM, Diab Jerius djerius@users.sf.net wrote:

          Chris,

          Thanks for the cleaner example. (And I thought I'd tried that one...)

          Diab

          [bugs:#355] http://sourceforge.net/p/pdl/bugs/355/ dog creates 0 dim
          piddle which squeezes to 1 dim.

          Status: open
          Group: critical
          Created: Fri May 23, 2014 02:53 AM UTC by Diab Jerius
          Last Updated: Fri May 23, 2014 02:53 AM UTC
          Owner: nobody

          Something happened in dog between 2.006 and 2.007 which led it to
          create 0 dim piddles which when squeezed go up to 1 dim piddles:

          2.006:
          % perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say
          $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
          0
          0
          0

          2.007:

          % perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say
          $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
          0
          1
          0

          The behavior changed with this commit:

          47ec8f062578e262f2959b946c7a88da02f1d404 is the first bad commit
          commit 47ec8f062578e262f2959b946c7a88da02f1d404
          Author: Craig DeForest zowie@Clio-4.local
          Date: Thu Sep 12 23:46:09 2013 -0600

          migrate nnslice to replace nslice and slice. move slice to oslice.
          New documentation, some new tests to handle slightly different error
          messages and regularized behavior in some odd corner cases.
          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/pdl/bugs/355/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/


          Status: open
          Group: critical
          Created: Fri May 23, 2014 02:53 AM UTC by Diab Jerius
          Last Updated: Fri May 23, 2014 01:54 PM UTC
          Owner: nobody

          Something happened in dog between 2.006 and 2.007 which led it to
          create 0 dim piddles which when squeezed go up to 1 dim piddles:

          2.006:
          % perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say
          $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
          0
          0
          0

          2.007:

          % perl -MPDL -E '$x = (pdl(1,2)->dog)[0]; say $x->ndims; say
          $x->squeeze->ndims; say $x->squeeze->squeeze->ndims'
          0
          1
          0

          The behavior changed with this commit:

          47ec8f062578e262f2959b946c7a88da02f1d404 is the first bad commitcommit 47ec8f062578e262f2959b946c7a88da02f1d404Author: Craig DeForest zowie@Clio-4.localDate: Thu Sep 12 23:46:09 2013 -0600
          migrate nnslice to replace nslice and slice. move slice to oslice.New documentation, some new tests to handle slightly different errormessages and regularized behavior in some odd corner cases.


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/pdl/bugs/355/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           

          Related

          Bugs: #355