Shift bug in latest beta

19 views
Skip to first unread message

Joshua Y

unread,
Sep 29, 2026, 8:33:07 PM (4 days ago) Sep 29
to forum
When using Shift (|.!.f) at higher dimensions, when shifting one of the trailing axes by the length of the axis, it appears to be a no-op.

   0 2 |.!._ i. 3 3    NB. Ok
2 _ _
5 _ _
8 _ _
   0 3 |.!._ i. 3 3    NB. Not Ok
0 1 2
3 4 5
6 7 8

Shifting a matrix by rows is not affected

   3 0 |.!._ i. 3 3
_ _ _
_ _ _
_ _ _

But at higher dimensions, it appears to affect all trailing axes, eg. both these do nothing
0 0 3 |.!._ i. 3 3 3
0 3 0 |.!._ i. 3 3 3

I think this may only be affecting the latest beta, as I can only replicate this locally, not on Juno or the Playground.

   JVERSION
Engine: j9.8.0-beta9/j64avx2/linux
Build: commercial/2026-09-25T13:24:43/clang-14-0-0/SLEEF=1
Library: 9.8.3
Platform: Linux 64
Installer: j9.8 install

Joshua Y

unread,
Sep 29, 2026, 8:45:47 PM (4 days ago) Sep 29
to forum, Joshua Y
Hmm, I can also replicate on my VPS running 9.7-beta8, so I though it might be a Linux issue, but then I also replicated it on Windows.

Replicated on the following versions

Engine: j9.7.0-beta14/j64avx2/linux
Build: commercial/2026-03-25T22:10:33/clang-14-0-0/SLEEF=1
Library: 9.7.2
Platform: Linux 64


Engine: j9.7.0-beta8/j64avx2/windows

Build: commercial/2025-09-14T23:43:58/clang-19-1-5/SLEEF=1

Library: 9.7.8

Qt IDE: 2.6.1/6.10.1(6.10.1)

OS Ver: Windows 11 Version 25H2 10.0.26200

Platform: Win 64

Joshua Y

unread,
Sep 29, 2026, 8:51:03 PM (4 days ago) Sep 29
to forum, Joshua Y
To be clear, I think the WASM build is the only one that has the correct behavior.

If I had to guess, I'd say an overzealous optimization on Rotate might be to blame (where making `0 3 |. i. 3 3` a no-op makes perfect sense), but the behavior of Shift exhibited above is objectively wrong.

Igor Zhuravlov

unread,
Sep 30, 2026, 1:30:16 AM (4 days ago) Sep 30
to fo...@jsoftware.com
On Wednesday, 30 September 2026 at 10:33:07 UTC+10 Joshua Y wrote:
> When using Shift (|.!.f) at higher dimensions, when shifting one of the
> trailing axes by the length of the axis, it appears to be a no-op.
>
> 0 2 |.!._ i. 3 3 NB. Ok
> 2 _ _
> 5 _ _
> 8 _ _
> 0 3 |.!._ i. 3 3 NB. Not Ok
> 0 1 2
> 3 4 5
> 6 7 8

Interesting thing is that the negative shift works:
0 _3 |.!._ i. 3 3
_ _ _
_ _ _
_ _ _

--
Regards,
Igor


Henry Rich

unread,
Sep 30, 2026, 11:22:37 AM (3 days ago) Sep 30
to fo...@jsoftware.com
I have fixed this for the next beta.  The bug was introduced in release 9.7.

The bug afflicts shift (|.!.f) when the shift amount of an axis after
the first is >= the axis length, and the block can be rotated in-place
and has extra space after the end of the block but no extra space before
the block.

Workaround: Use (2&(|.!.f"1)) instead of (0 2&(|.!.f))

Henry Rich
> To unsubscribe from this group and stop receiving emails from it, send
> an email to forum+un...@jsoftware.com.

Reply all
Reply to author
Forward
0 new messages