Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

benaadams
Copy link
Member


// in InvariantMode we support all range and not only the ascii characters.
char maxChar = (char) (GlobalizationMode.Invariant ? 0xFFFF : 0x80);
char maxChar = (char) (GlobalizationMode.Invariant ? 0xFFFF : 0x7f);
Copy link
Member Author

@benaadams benaadams Feb 24, 2018

Choose a reason for hiding this comment

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

Is GlobalizationMode.Invariant initrinsicish to the Jit? (like readonly static) and will it branch eliminate?

Copy link
Member

Choose a reason for hiding this comment

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

should use _invariantMode and not GlobalizationMode.Invariant

Choose a reason for hiding this comment

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

nit: Change 0x7f to 0x7F (all capital) to be consistent.

// _invariantMode is defined for the perf reason as accessing the instance field is faster than access the static property GlobalizationMode.Invariant
// s_invariantMode is defined for the perf reason as accessing the field is faster than access the static property GlobalizationMode.Invariant
[NonSerialized]
private readonly bool _invariantMode = GlobalizationMode.Invariant;
Copy link
Member

Choose a reason for hiding this comment

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

GlobalizationMode.Invariat is a readonly static already. We do not need to duplicate it.

Copy link
Member

Choose a reason for hiding this comment

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

This is cached in a instance field because instance field access is faster (in crossgened code in particular - and CoreLib is pretty much always crossgened).

Copy link
Member

Choose a reason for hiding this comment

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

right, we just need to replace GlobalizationMode.Invariant with _invariantMode in CompareInfo code.

Copy link
Member Author

Choose a reason for hiding this comment

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

All the instance methods already use it; other ones are static

{
{
// s_invariantMode is defined for the perf reason as accessing the field is faster than access the static property GlobalizationMode.Invariant
private static readonly bool s_invariantMode = GlobalizationMode.Invariant;

Choose a reason for hiding this comment

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

See: #16379 (comment)

This cache does not make sense. GlobalizationMode.Invariant property should have the exact same perf as you local cache.

@ahsonkhan
Copy link

ahsonkhan commented Feb 24, 2018

Can you also please update this comment?

//This will not work in case-insensitive mode for any character greater than 0x80.

Thanks for fixing this.

@benaadams
Copy link
Member Author

Addressed feedback

@tarekgh
Copy link
Member

tarekgh commented Feb 24, 2018

Thanks @benaadams

@benaadams
Copy link
Member Author

@dotnet-bot Tizen armel Cross Checked Innerloop Build and Test

@benaadams
Copy link
Member Author

Won't let me rerun the Tizen


// in InvariantMode we support all range and not only the ascii characters.
char maxChar = (char) (GlobalizationMode.Invariant ? 0xFFFF : 0x80);
char maxChar = (char) (GlobalizationMode.Invariant ? 0xFFFF : 0x7F);
Copy link
Member

@danmoseley danmoseley Feb 24, 2018

Choose a reason for hiding this comment

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

Could this be computed just once in a static ctor? It's cheap, but this code is called a lot. (I can't see the context right now so this may be off.)

Choose a reason for hiding this comment

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

@benaadams, thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

@jkotas pointed out it already is #16535 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

I was referring to the value, not GlobalizationMode. Ie put either 0xFFFF or 0x7F in a readonly static field. But seems unlikely that would be any faster than a conditional check each time here.

@ahsonkhan
Copy link

@dotnet-bot test Tizen armel Cross Checked Innerloop Build and Test

@ahsonkhan
Copy link

Won't let me rerun the Tizen

Must have been some temporary issue.

@stephentoub
Copy link
Member

Sounds like we're also missing a test in corefx?

@benaadams
Copy link
Member Author

@dotnet-bot test Windows_NT x64 Checked corefx_baseline
@dotnet-bot test Ubuntu x64 Checked corefx_baseline

@benaadams
Copy link
Member Author

Path failures

d7295605\_\fx\src\System.Runtime.Extensions\tests\System\IO\PathTests.cs(759,0): at System.IO.Tests.PathTests.GetFullPath_Windows_NotSupportedExceptionPaths(String path)
06:02:23      System.IO.Tests.PathTests.GetFullPath_Windows_UNC_Valid(expected: \"\\\\\\\\LOCALHOST\\\\share\\\\test.txt.~SS\", input: \"\\\\\\\\LOCALHOST\\\\share\\\\test.txt.~SS\") [FAIL]
06:02:23         Assert.Equal() Failure
06:02:23                                          � (pos 30)
06:02:23         Expected: úúúT\share\test.txt.~SS
06:02:23         Actual:   úúúT\share\test.txt.~SS\0
06:02:23                                          � (pos 30)

@ahsonkhan
Copy link

From Tizen armel Cross Checked Innerloop:
https://ci.dot.net/job/dotnet_coreclr/job/master/job/armel_cross_checked_tizen_innerloop_prtest/1065/consoleFull#9887747564b7730ef-150b-4be7-a00f-82ba6c50792b

23:06:07 FAILED   - JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b29068/b29068/b29068.sh
23:06:07                BEGIN EXECUTION
23:06:07                /home/coreclr/bin/tests/Windows_NT.x64.Checked/Tests/coreoverlay/corerun b29068.exe
23:06:07                qemu: Unsupported syscall: 389
23:06:07 
               ./b29068.sh: line 243:   905 Segmentation fault      (core dumped) $_DebuggerFullPath "$CORE_ROOT/corerun" $ExePath $CLRTestExecutionArguments
23:06:07                Expected: 100
23:06:07                Actual: 139
23:06:07                END EXECUTION - FAILED

cc @AndyAyersMS

@benaadams
Copy link
Member Author

qemu: Unsupported syscall is https://github.com/dotnet/coreclr/issues/12972

@ahsonkhan
Copy link

ahsonkhan commented Feb 24, 2018

Path failures

@JeremyKuhne, @danmosemsft
I think this test failure is caused by the recent changes to to PathHelper.Normalize here: #16478 / https://github.com/dotnet/coreclr/pull/16512/files#diff-8ba815a999fa742edfe2266080bb7804

As an aside, this issue within the comments has been closed. Should it be removed?
https://github.com/dotnet/corefx/blob/92afa6ec21817739ebf45cd66b4569a03b54d4c0/src/System.Runtime.Extensions/tests/System/IO/PathTests.cs#L928

@ahsonkhan
Copy link

Sounds like we're also missing a test in corefx?

Yes, I think so, We may be missing a test case on the boundary between 0x7F and 0x80 where we aren't calling into the OS when we should. I wonder if the results are any different though.

@AndyAyersMS
Copy link
Member

I though the plan was to decommission the Tizen tests as they are flaky. @RussKeldorph ??

@JeremyKuhne
Copy link
Member

JeremyKuhne commented Feb 24, 2018

@ahsonkhan, @benaadams Go ahead and disable the path test against me and I'll fix it asap- only ~ paths go down this code path. If you see any failures without a ~ in the path let me know. (Note that for some reason the PathTests class isn't executing correctly, which is why I missed this. It appears that after a certain number of test methods tests get skipped silently. Full investigation is ongoing.)

@RussKeldorph
Copy link

RussKeldorph commented Feb 26, 2018

Re: Tizen: The plan is to remove the emulator-based Tizen testing from default PR-triggers, due to the aforementioned flakiness, after we have reliable hardware-based ARM Linux testing in PR, which @BruceForstall is working on.

@ahsonkhan
Copy link

Go ahead and disable the path test against me and I'll fix it asap- only ~ paths go down this code path. If you see any failures without a ~ in the path let me know. (Note that for some reason the PathTests class isn't executing correctly, which is why I missed this. It appears that after a certain number of test methods tests get skipped silently. Full investigation is ongoing.)

@JeremyKuhne, does this PR resolve the failing tests were are seeing here, or do we still need to disable some tests?
dotnet/corefx#27449

@ahsonkhan
Copy link

@dotnet-bot test Windows_NT x64 Checked corefx_baseline

@ahsonkhan
Copy link

CI is passing (modulo Tizen), is this good to merge?

@ahsonkhan ahsonkhan merged commit 47c39ed into dotnet:master Feb 27, 2018
dotnet-bot pushed a commit to dotnet/corefx that referenced this pull request Feb 27, 2018
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
dotnet-bot pushed a commit to dotnet/corert that referenced this pull request Feb 27, 2018
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
jkotas pushed a commit to dotnet/corefx that referenced this pull request Feb 27, 2018
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
jkotas pushed a commit to dotnet/corert that referenced this pull request Feb 27, 2018
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
kbaladurin pushed a commit to kbaladurin/corert that referenced this pull request Mar 15, 2018
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants