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

Trying to fix the endian issue #68

Merged
merged 10 commits into from
Jan 4, 2024
Merged

Trying to fix the endian issue #68

merged 10 commits into from
Jan 4, 2024

Conversation

royvanrijn
Copy link
Contributor

@royvanrijn royvanrijn commented Jan 3, 2024

@gunnarmorling Can you check this works? I've tried to fix the endianness issue, as usual "it works on my machine"

It is currently running in ~2.9 seconds on my MacBook Pro, would love to see the server results, it's been a while 💯


// Force little endian:
bb.order(ByteOrder.LITTLE_ENDIAN);
Copy link
Contributor Author

@royvanrijn royvanrijn Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that "forcing" doesn't work if the underlying datastructure (files) isn't something simple like a byte[].

I've written some tests locally that call these methods with BIG and LITTLE endian byte[] buffers to test, they both seem to work fine now. (fingers crossed!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a problem still arises, perhaps @gunnarmorling could run the "runTests()" method and see if something fails there... there shouldn't be any output.

@gunnarmorling
Copy link
Owner

@royvanrijn, could you please take a look at the test failures reported by

./test.sh royvanrijn

And remove the "test failure" label once done? It's a test suite we've added today to catch some corner cases. Thx!

@royvanrijn
Copy link
Contributor Author

royvanrijn commented Jan 4, 2024

@gunnarmorling I'd love to remove the label, but I have no idea how haha; the code is fixed...

@gunnarmorling
Copy link
Owner

@royvanrijn, something still seems wrong:

Validating calculate_average_royvanrijn.sh -- src/test/resources/samples/measurements-10.txt
./calculate_average_royvanrijn.sh: line 18: sdk: command not found

real	0m0.311s
user	0m0.694s
sys	0m0.168s
Validating calculate_average_royvanrijn.sh -- src/test/resources/samples/measurements-1.txt
./calculate_average_royvanrijn.sh: line 18: sdk: command not found

real	0m0.162s
user	0m0.358s
sys	0m0.100s
1c1
< {=19.8/19.8/19.8, Kunming=19.8/19.8/19.8, g=19.8/19.8/19.8, ing=19.8/19.8/19.8, ming=19.8/19.8/19.8, ng=19.8/19.8/19.8, nming=19.8/19.8/19.8}
---
> {Kunming=19.8/19.8/19.8}
Validating calculate_average_royvanrijn.sh -- src/test/resources/samples/measurements-20.txt
./calculate_average_royvanrijn.sh: line 18: sdk: command not found

real	0m0.163s
user	0m0.344s
sys	0m0.080s
Validating calculate_average_royvanrijn.sh -- src/test/resources/samples/measurements-2.txt
./calculate_average_royvanrijn.sh: line 18: sdk: command not found

real	0m0.149s
user	0m0.361s
sys	0m0.076s
1c1
< {-Kamchatsky=9.5/9.5/9.5, Bosaso=19.2/19.2/19.2, Petropavlovsk-Kamchatsky=9.5/9.5/9.5, hatsky=9.5/9.5/9.5, lovsk-Kamchatsky=9.5/9.5/9.5, y=9.5/9.5/9.5}
---
> {Bosaso=19.2/19.2/19.2, Petropavlovsk-Kamchatsky=9.5/9.5/9.5}
Validating calculate_average_royvanrijn.sh -- src/test/resources/samples/measurements-3.txt
./calculate_average_royvanrijn.sh: line 18: sdk: command not found

real	0m0.152s
user	0m0.366s
sys	0m0.077s
1c1
< {Bosaso=-15.0/1.3/20.0, Kamchatsky=-9.5/-9.5/-9.5, Petropavlovsk-Kamchatsky=-9.5/0.0/9.5, chatsky=9.5/9.5/9.5}
---
> {Bosaso=-15.0/1.3/20.0, Petropavlovsk-Kamchatsky=-9.5/0.0/9.5}
Validating calculate_average_royvanrijn.sh -- src/test/resources/samples/measurements-boundaries.txt
./calculate_average_royvanrijn.sh: line 18: sdk: command not found

real	0m0.143s
user	0m0.336s
sys	0m0.087s
1c1
< {Bosaso=-99.9/-99.9/-99.9, Petropavlovsk-Kamchatsky=99.9/99.9/99.9, chatsky=99.9/99.9/99.9, k-Kamchatsky=99.9/99.9/99.9, ky=99.9/99.9/99.9, vlovsk-Kamchatsky=99.9/99.9/99.9}
---
> {Bosaso=-99.9/-99.9/-99.9, Petropavlovsk-Kamchatsky=99.9/99.9/99.9}

@gunnarmorling
Copy link
Owner

(ignore the sdk not found stuff)

@gunnarmorling
Copy link
Owner

YES! All passing now and LGTM. 00:12.685, close 2nd after @spullara! Merging.

I couldn't quite pay attention yesterday, were tere more things discussed in your first PR which still could bring some improvements?

@gunnarmorling gunnarmorling merged commit 1c74049 into gunnarmorling:main Jan 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants