-
Notifications
You must be signed in to change notification settings - Fork 148
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
GitHub CI: Add GHC 9.12 to the matrix #754
Conversation
The testsuite has this failure with GHC 9.12.1, due to dictionary definitions being reordered in a test that compares expected ISyntax:
Both Ubuntu and macOS VMs have this same behavior. It would be worth investigating how this order is generated, and whether BSC could be doing something to enforce a canonical order (or if it is, and there's a bug in GHC 9.12.1). Alternatively, the test could be adjusted to not care about this order, but it'd still be worth understanding why the order changed, first. |
The testcase dumps the "internal" stage (with In fact, the definitions are in the correct order prior to "internal". For example, here are the defs dumped by the immediately prior stage ("simplified"):
I would guess that the re-ordering happens from the use of |
It's the graph argument to
showing that
The dependency list comes from calling The If we want, we could sort the graph dependencies in alphabetical order, which would give the defs a canonical order in the linearized output. This isn't a concern for users -- we sort defs in the final Verilog output, for example -- this would only make things easier for developers or the testsuite, to be able to expect a canonical order of internal dumps. So maybe we just do the alternative, which is to update the test to not care about the order of the defs. |
The discrepancy is created during compilation of the Prelude -- different numbers end up being used for variable names, which means that the I have not identified why this discrepancy shows up. But name reordering seems to first show up in the |
When making the symbol table ( Inside Somehow, with GHC 9.12.1, the items in
but the result of
and that's presumably because the strings were created in that swapped order. If I force evaluation of the The making of the symbol table is a recursive process, so I'm unable to insert traces to get a better idea of why this order is happening. I don't know if it's an issue that should be reported to the GHC team, or maybe it's an intended optimization -- although it's hard to see why. Also, this alone doesn't seem to be responsible for all of the I'm unsure what's the best way to proceed for the testsuite. I'm not sure how to make the test look for only a portion of the ISyntax dump; I think that comparing the full ISyntax dump is safest, but then we need to enforce a canonical order for the defs in the ISyntax. We could do that by wrapping the tsort nodes in typecheck to give them an |
The 'compare_file' procedure could be updated to check whether the 'expected' argument is a list, but in the meantime, this adds a new 'compare_file_list' procedure that takes a list argument and passes if any one in the list matches. This is used in one test where BSC built with GHC 9.12.1 has _tcdict defs in a different order. The test now compares against both possible outputs.
Offline, we discussed how to update the test to allow for this difference. While we could add a flag to force a canonical order to the defs, we didn't want to add overhead for users and we wanted to avoid a flag that is only used during testing (because then we wouldn't be testing what users see); so we opted to make the test accept multiple legal outputs. We chose to have two expected files, and update the compare function to pass if either one matches. It's possible to have one expected file and just mask out the lines that could be in either order (since they're not crucial to the test), but having two expected files seemed more robust. The test could have selected one expected files based on the GHC version, but trying both files in all cases is again more robust, to future versions of GHC and to changes in flags GHC -- for example, it remains to be seen whether changing the optimization flags to GHC can cause a change in this order. I have pushed a commit that adds a second expected file and a new |
No description provided.