-
Notifications
You must be signed in to change notification settings - Fork 235
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
transpile
: Rewrite fn compare_src_locs
implementation to have a total order
#1128
base: master
Are you sure you want to change the base?
Conversation
This implementation is simplified compared to the previous one. It is also almost twice as slow in the exhaustive test (15 vs 25 seconds) in immunant#1126 (comment) However, in real sort usage the impact should be significantly less. Fixes immunant#1126
compare_src_locs
implementation to have a total ordertranspile
: Rewrite fn compare_src_locs
implementation to have a total order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks a lot better, and the better comments help a lot as well.
Is there a test we can add to make sure this is working as intended (correctly sorted, no panics)?
I've added a test for the total order, based on a reduced test case from the issue (apparently creduce can reduce any text file). |
Not sure what my IDE did to the imports but I'll fix it, I'll also fix your other suggestions. But it will have to wait until after the weekend |
No problem, no rush. |
b562165
to
12f7571
Compare
@kkysen I've included your suggestions. Is there anything else that needs to change? |
Also included some code suggestions by Khyber. Co-authored-by: Khyber Sen <[email protected]>
12f7571
to
d499998
Compare
Added your last suggestion |
CI seems to be failing, only on Darwin, for some reason: /Users/runner/work/1/s/tests/statics/src/thread_locals.c:4:17: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static __thread gsti = 37;
~~~~~~~~~~~~~~~ ^
int
/Users/runner/work/1/s/tests/statics/src/thread_locals.c:5:17: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
extern __thread geti;
~~~~~~~~~~~~~~~ ^
int
/Users/runner/work/1/s/tests/statics/src/thread_locals.c:12:21: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static __thread fsti = 59;
~~~~~~~~~~~~~~~ ^
int
/Users/runner/work/1/s/tests/statics/src/thread_locals.c:13:21: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
extern __thread feti;
~~~~~~~~~~~~~~~ ^
int This doesn't seem to be related to the changes, here, though, so I'm not sure what's happening. |
Maybe the darwin image got updated or something? I really don't see how this change can cause this |
Could you try triggering the CI on the last commit in master? See if it has the same failure |
This implementation is simplified compared to the previous one. It is also almost twice as slow in the exhaustive test (15 vs 25 seconds).
However, in real sort usage the impact should be significantly less.
SrcLoc
sorting is non-transitive and a false total order and equality (panics in 1.81) #1126