Bug J9.7-beta 3: ^: prematurely stopping

34 views
Skip to first unread message

Jan-Pieter Jacobs

unread,
May 1, 2025, 3:15:09 AM5/1/25
to fo...@jsoftware.com
I think I ran into another bug in J 9.7-beta3: basically, the last item of u^:a: is not (always) the same as u^:_  . This example runs correctly in J9.6.3.

1.ijs
mem =: [: (# _1}:@,@:,.~i.@>.@-:@#) "."0
ind =: _1 (i.&1 , i:&0)@:= ]
upd =: (ind (|.@:{)`[`]}^:(</@[) ])

session log:

   load'~temp/1.ijs'
   JVERSION
Engine: j9.7.0-beta3/j64arm/android
Build: commercial/2025-04-16T14:35:35/clang-14-0-7/SLEEF=1
Library: 9.7.1
J Android: 1.4.88/14/34
Platform: Android 64 (arm64-v8a)
Installer: unknown
InstallPath: /storage/emulated/0/Android/data/com.jsoftware.j.beta.android/files
Contact: www.jsoftware.com
   ]t=:mem '12345'
0 _1 _1 1 1 1 _1 _1 _1 _1 2 2 2 2 2
   upd^:a: t
0 _1 _1 1 1 1 _1 _1 _1 _1  2  2  2  2  2
0  2 _1 1 1 1 _1 _1 _1 _1  2  2  2  2 _1
0  2  2 1 1 1 _1 _1 _1 _1  2  2  2 _1 _1
0  2  2 1 1 1  2 _1 _1 _1  2  2 _1 _1 _1
0  2  2 1 1 1  2  2 _1 _1  2 _1 _1 _1 _1
0  2  2 1 1 1  2  2  2 _1 _1 _1 _1 _1 _1
   upd^:_ t
0 2 2 1 1 1 _1 _1 _1 _1 2 2 2 _1 _1
   (upd^:_ -: [: {: upd^:a:) t
0


Best regards,

Jan-Pieter

Henry Rich

unread,
May 1, 2025, 9:16:43 AM5/1/25
to fo...@jsoftware.com
Fixed for next beta, which should be soon.  The gerund} was executed in place but it shouldn't have been.  The best workaround I can see is to replace

`]}

with

`(>@<@])}

Thank goodness you're running the betas!

Henry Rich

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

R.E. Boss

unread,
May 24, 2025, 7:06:42 AM5/24/25
to fo...@jsoftware.com

JVERSION

Engine: j9.7.0-beta4/j64avx2/windows

Build: commercial/2025-05-05T13:15:47/clang-18-1-8/SLEEF=1

Library: 9.7.1

Qt IDE: 2.5.11/6.8.3(6.8.3)

OS Ver: Windows 10 Version 22H2 10.0.19045

Platform: Win 64

Installer: j9.7 install

InstallPath: c:/program files/j9.7

Contact: www.jsoftware.com

 

   JVERSION

Engine: j9.6.0-beta22/j64avx2/windows

Build: commercial/2024-10-10T20:22:53/clang-18-1-8/SLEEF=1

Library: 9.6.14

Qt IDE: 2.5.6/6.5.3(6.5.3)

OS Ver: Windows 10 Version 22H2 10.0.19045

Platform: Win 64

Installer: j9.6 install

InstallPath: c:/program files/j9.6

Contact: www.jsoftware.com

 

Let t be such that

   |:"2 t

1  1  1  1 1  1 1  1  1  1 1  1  1  1  1  1  1  1  1  1  2 _2

2 _2  2 _2 2 _2 2 _2  2 _2 2 _2  2 _2  2 _2  2 _2  2 _2 _1 _1

 

2 _2 _2  2 2 _2 2 _1 _1 _2 2 _2 _2  2 _2 _1 _1  2 _2  2  2 _2

1  1 _1 _1 1  1 1 _2  2  1 1  1 _1 _1 _1 _2  2 _1 _1 _1  1  1

   $@:~."2 t

4 2

6 2

 

   i.~"2 t                NB. Which is wrong

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 20 21

0 1 2 3 0 1 0 7 8 1 0 1 2 3 2 7 8 3 2 3  0  1

 

   (~. i. ])"2 t        NB. Which seems to be right

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2 3

0 1 2 3 0 1 0 4 5 1 0 1 2 3 2 4 5 3 2 3 0 1

 

R.E. Boss

Marcin Żołek

unread,
May 24, 2025, 7:48:49 AM5/24/25
to fo...@jsoftware.com
Is the following the correct definition of t (shape 2 22 2)?

t =: |:"2 ] 2 2 22 $ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 _2 2 _2 2 _2 2 _2 2 _2 2 _2 2 _2 2 _2 2 _2 2 _2 2 _2 _1 _1 2 _2 _2 2 2 _2 2 _1 _1 _2 2 _2 _2 2 _2 _1 _1 2 _2 2 2 _2 1 1 _1 _1 1 1 1 _2 2 1 1 1 _1 _1 _1 _2 2 _1 _1 _1 1 1

I used Dissect tool to analyze i.~"2 t

load 'debug/dissect’
dissect 'i.~"2 t'

Clicking on a row in the output field highlights the part of the input data from which that row was created. What is wrong with the output?

Marcin

Henry Rich

unread,
May 24, 2025, 8:33:55 AM5/24/25
to fo...@jsoftware.com
The result looks right to me.


   |:"2 t
1  1  1  1 1  1 1  1  1  1 1  1  1  1  1  1  1  1  1  1  2 _2
2 _2  2 _2 2 _2 2 _2  2 _2 2 _2  2 _2  2 _2  2 _2  2 _2 _1 _1

2 _2 _2  2 2 _2 2 _1 _1 _2 2 _2 _2  2 _2 _1 _1  2 _2  2  2 _2
1  1 _1 _1 1  1 1 _2  2  1 1  1 _1 _1 _1 _2  2 _1 _1 _1  1  1

     i.~"2 t

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 20 21
0 1 2 3 0 1 0 7 8 1 0 1 2 3 2 7 8 3 2 3  0  1

As a check,

    t -: ((i.~"2)   {"1 2   ]) t
1

i.~ returns not the index in the nub, but the index in y itself.

Henry Rich

R.E. Boss

unread,
May 24, 2025, 9:16:16 AM5/24/25
to fo...@jsoftware.com

Thanks.
I knew what i.~ does, but did not realize it.

 

R.E. Boss

Reply all
Reply to author
Forward
0 new messages