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

Preliminary support for ARM #25318

Merged
merged 5 commits into from
Jun 30, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ snakeyaml = 1.15
# When updating log4j, please update also docs/java-api/index.asciidoc
log4j = 2.8.2
slf4j = 1.6.2
jna = 4.4.0
jna = 4.4.0-1

# test dependencies
randomizedrunner = 2.5.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public void testSearchWithMatrixStats() throws IOException {
assertEquals(5, matrixStats.getFieldCount("num2"));
assertEquals(29d, matrixStats.getMean("num2"), 0d);
assertEquals(330d, matrixStats.getVariance("num2"), 0d);
assertEquals(-0.13568039346585542, matrixStats.getSkewness("num2"), 0d);
assertEquals(-0.13568039346585542, matrixStats.getSkewness("num2"), 1.0e-16);
Copy link
Member

Choose a reason for hiding this comment

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

What's happening here? If this is correct now for x64, and needs to be changed for ARM (why?) how is this not going to turn around and break on x64?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For whatever reason only getSkewness() has less precision on aarch64:

amd64:   -0.13568039346585542
aarch64: -0.1356803934658554

It still passes on Intel, because the delta is still valid. It makes the assertion slightly more permissive, not less. I scratched my head over this one as well, curious why only this assertion needed a delta. I asked @jpountz about it. 😄

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, it's puzzling!

Copy link
Member

Choose a reason for hiding this comment

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

And yes, I misread the assertion at first but the puzzle why a change is needed only here remains! 😄

Choose a reason for hiding this comment

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

The matrixStats PR is here - #18300 - with code from @nknize et al.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is puzzling indeed. It could be a bug, but it could also be due to differences in the JVM/hardware that causes the documents to be stored in a different order in the index. Then at search time, aggs collect documents in a different order as well and we get different rounding errors?

assertEquals(1.3517561983471074, matrixStats.getKurtosis("num2"), 0d);
assertEquals(-767.5, matrixStats.getCovariance("num", "num2"), 0d);
assertEquals(-0.9876336291667923, matrixStats.getCorrelation("num", "num2"), 0d);
Expand Down
1 change: 1 addition & 0 deletions core/licenses/jna-4.4.0-1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c9dfcec6f07ee4b1d7a6c09a7eaa9dd4fb6d2c79
1 change: 0 additions & 1 deletion core/licenses/jna-4.4.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ static class Arch {
Map<String,Arch> m = new HashMap<>();
m.put("amd64", new Arch(0xC000003E, 0x3FFFFFFF, 57, 58, 59, 322, 317));
m.put("i386", new Arch(0x40000003, 0xFFFFFFFF, 2, 190, 11, 358, 354));
// 64-bit only!
m.put("aarch64", new Arch(0xC00000B7, 0xFFFFFFFF, 1079, 1071, 221, 281, 277));
Copy link
Member

Choose a reason for hiding this comment

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

These make sense. I haven't checked the system call numbers but I trust that they are right. I will double check before final review.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used some code from @rmuir to double-check.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Maybe change the comment to "arm is 64 bit only" so it doesn't get confused with the line above it supporting 32 bit intel.

ARCHITECTURES = Collections.unmodifiableMap(m);
}

Expand Down