-
Notifications
You must be signed in to change notification settings - Fork 0
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
Grammar: make check gives different results on Mac and Linux #37
Comments
The failing test on Linux is: |
This is the result on Mac: |
Could it be that the speller package (lib-speller-something) is out of sync on Mac nightly and Linux nightly, since this is a difference in suggestions on a typo? |
|
on both machines |
git hash e101aba9 is the most recent version from 3 days ago... but I don't think anyone has touched suggestion sorting in ages. Are the weights of the mismatching suggestions exactly the same? If so it can easily happen that they end up in different order under circumstances including different oses data structures and sort algorithms... |
Does the test require the suggestions to be in a specific order? That seems like a receipt for bogus fails. What is relevant is whether the correct suggestion is in the list or not, and possibly the position of the correct suggestion (the higher the better). Other than that the order and amount of suggestions should not be considered at all. |
|
The weight on Linux is ~37.99, on Mac it is ~37,59 |
No, the test framework uses the output of divvun-checker, looking for the correct suggestion among the suggestions given by divvun-checker. |
The number of typo-suggestions from divvun-checker seems to be truncated to ten results |
Should they not be the same regardless of platform? (But hfst-ospell's last commit was in June, hfst's last was in September, so why did this only happen now?) |
I tested the smj.zhfst that I build on my Mac on my Linux machne. The weights are different (see the comment above), but the wordforms are the same.
vs the the smj.zhfst build on the Linux box:
|
This is the output of hfst-ospell on my Mac, with natively built .zhfst vs the one built on Linux: Mac-built
Linux-built
|
The weights depend on where they were built and the wanted suggestion is way further down the list on Linux than on Mac. |
I notice the weights on the Linux side is consistently |
Seems strange, I could've thought that there can be tiny variations in floating point math between operating systems and processors or so, but whole 0.4 is unexpected. I'd probably start with unzipping the zhfst files and diffing the |
After converting and a diffing the files, the differences seem to be massive:
manually ordered output
|
well error models seem same size, which is kind of unfortunate of course since the akseptor is the one that has 100 step build process. I don't know if there's any way to debug and bisect other than going through the process step by step and compare, maybe it diverges in some obvious step... I think since current hfst's also use openfst as library there can be than that version difference too between mac and linux |
There is no version difference. Linux and macOS builds both use external OpenFST and Foma, and same version of them. The OpenFST x86 and x86_64 Linux builds are with SSE math - without that, the HFST test suite failed. And it should actually keep things more consistent, as it forces 64 bit floating point math everywhere - it would use the 80 bit x87 FPU otherwise. And 0.5 is indeed a rather big difference. |
When building fsts, LC_ALL affects the weights. On my Mac, echo $LC_ALL gives an empty line When fsts are built using empty LC_ALL, hfst-ospell then gives this list:
When I set export LC_ALL=C, then compile the fsts, it gives is the list:
|
|
I could guess there's at least one step there that reads or writes weights as floats and uses decimal comma and other part that expects decimal dot or vice versa... |
there are tons of environment variables and probably other ways to change locale settings and possibly some utf8 locales might not have that in name, I'll try to experiment with some more minimal example if this can be reproduced under linux with , and . locales... |
looking at the process now, there's all the weighing in tools/spellers that uses a lot of coreutils, I could guess there's also many ways to diverge there as we know even sort and uniq don't agree between linux and macos and locales (I can't reproduce diffs between linux C.utf8 and fi-FI.utf8 though). |
On commit 83ba211 I get 6 fails on my Linux box and 5 fails on Mac
The file that fails on Linux, and not on Mac is: DEV-syn-pred-attr-PASS.yaml
The text was updated successfully, but these errors were encountered: