Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix endianness in +max, +min, +ravel #4

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

litlep-nibbyt
Copy link
Collaborator

@litlep-nibbyt litlep-nibbyt commented May 20, 2024

Corrected behavior:

> ar
[ meta=[shape=[10 1 ~] bloq=5 kind=%real prec=~]
  data=0x1.4105.d2cb.4078.65e5.3f17.12ad.c107.fcae.4158.4844.be97.1567.408d.eef3.c117.1665.c111.cbb5.c0a6.6743
]
> `(list @rs)`(ravel:la:la ar)
~[.-5.200105 .-9.112233 .-9.442967 .4.4354186 .-0.29508516 .13.517643 .-8.499189 .0.5901287 .3.8812191 .8.363963]
> `@rs`data:(max:la:la ar)
.13.517643
> `@rs`data:(min:la:la ar)
.-9.442967

@sigilante
Copy link
Collaborator

OK, so for instance we have a test like this:

++  test-set-item-2d  ^-  tang
  =/  input-meta  [shape=~[3 3] bloq=4 kind=%uint prec=~]
  =/  input-magic-3x3-4u  (magic:la input-meta)
  ;:  weld
    %+  expect-eq
      !>((en-ray:la input-meta ~[~[0xf 0x1 0x2] ~[0x3 0x4 0x5] ~[0x6 0x7 0x8]]))
      !>((set-item:la input-magic-3x3-4u ~[0 0] 0xf))
    %+  expect-eq
      !>((en-ray:la input-meta ~[~[0x0 0x1 0x2] ~[0x3 0xf 0x5] ~[0x6 0x7 0x8]]))
      !>((set-item:la input-magic-3x3-4u ~[1 1] 0xf))
    %+  expect-eq
      !>((en-ray:la input-meta ~[~[0x0 0x1 0x2] ~[0x3 0x4 0x5] ~[0x6 0xf 0x8]]))
      !>((set-item:la input-magic-3x3-4u ~[2 1] 0xf))
    %-  expect-fail
      |.((set-item:la input-magic-3x3-4u ~[3 3] 0xf))
  ==
>   test-set-item-1d: took ms/63.839
FAILED  /tests/lib/lagoon-array-utils/test-set-item-1d
  expected
[meta=[shape=~[8] bloq=3 kind=%uint fxp=~] data=0x1.0f01.0203.0405.0607]
  actual  
[meta=[shape=~[8] bloq=3 kind=%uint fxp=~] data=0x1.0001.0203.0405.060f]
  expected
[meta=[shape=~[8] bloq=3 kind=%uint fxp=~] data=0x1.0001.0203.0405.060f]
  actual  
[meta=[shape=~[8] bloq=3 kind=%uint fxp=~] data=0x1.0f01.0203.0405.0607]
  expected
[meta=[shape=~[8] bloq=3 kind=%uint fxp=~] data=0x1.0001.020f.0405.0607]
  actual  
[meta=[shape=~[8] bloq=3 kind=%uint fxp=~] data=0x1.0001.0203.0f05.0607]

@litlep-nibbyt litlep-nibbyt marked this pull request as draft May 20, 2024 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants