Skip to content

Implement RFC #1: Standard RPC to replace Convenience and Performance RPCs #408

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

Merged
merged 13 commits into from
Dec 17, 2020

Conversation

0xFA11
Copy link
Contributor

@0xFA11 0xFA11 commented Dec 15, 2020

0xFA11 and others added 4 commits December 15, 2020 04:22
- Fixed an issue where on latest 21.1 you could not build ILPP without some PrivateCorelib issues

- Removed UTP package as it causes issues with burst and ILPP that needs to be resolved at some future point

- Updated Burst to latest 1.43 and Mono to 1.10.1-preview.1 (this is the legit package not the shim package)

All this is compat back to 2018.4
…d moved some core around to be more clean and consistent.
/// <summary>
/// XXHash implementation.
/// </summary>
internal static class XXHash
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need another hash method?

The MLAPI already has Fowler–Noll–Vo which it uses for everything internally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we don't need another hash method but we probably need xxHash instead of FNV.

xxHash is very efficient, well-known, highly-adopted non-cryptographic hashing algorithm.
You could see that over RPC RFC in the "Cross Compatibility" section but let me link those here too for you:
Section in the RFC: https://github.com/Unity-Technologies/com.unity.multiplayer.rfcs/blob/rfc/std-rpc-api/text/0000-std-rpc-api.md#cross-compatibility
xxHash website: https://cyan4973.github.io/xxHash/

Also we use xxHash in other places around Unity (e.g. DOTS Entities uses xxHash). I think xxHash excels in all aspects compared to our MLAPI implementation of FNV.

I'm happy to have another PR that replaces FNV with xxHash around the whole MLAPI codebase but for now I think I won't be doing that in this PR since xxHash will be used in the Editor only for now (other parts of hashing would touch runtime as well, so let's have a separate PR and discussion just for that).

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, if nothing else, let's put in some verbiage on how we made this choice as well as something like "xxHash is also used by DOTs, chore task to remove this when we can import from standard Unity, etc."

- 2020.1
- 2020.2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, this needs a little bit more of a discussion :)

@@ -64,8 +60,8 @@ internal static class MLAPIConstants
"",
"",
"",
"",
"",
"MLAPI_STD_SERVER_RPC",
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we wanted for sure these to be 30 & 31

ulong hash = 0;
switch (NetworkingManager.Singleton.NetworkConfig.RpcHashSize)
{
case HashSize.VarIntTwoBytes:
Copy link
Contributor

Choose a reason for hiding this comment

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

If you look at ILSpy, does this case statement get optimized out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, NetworkingManager.Singleton.NetworkConfig.RpcHashSize is not a compile-time constant so the check happens at runtime still.

@unity-cla-assistant
Copy link

unity-cla-assistant commented Dec 17, 2020

CLA assistant check
All committers have signed the CLA.

@0xFA11 0xFA11 merged commit 35935e8 into develop Dec 17, 2020
@0xFA11 0xFA11 deleted the feature/std-rpc-api branch March 5, 2021 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants