Skip to content

Commit 4e5837f

Browse files
fix: baseline test recorded a platform dependent quaternion
NetworkTransformStateSerializationBaseline failed on both Ubuntu jobs, on Mono and on IL2CPP, with the same two mismatches and the same actual hashes: QuaternionSync.Full and QuaternionSync.Teleport. Byte length was unchanged in both, so it was the payload and not the format. Those two are the only cases that put an uncompressed quaternion on the wire, and the fixture built it with Quaternion.Euler. That is native trig, and Linux lands a ULP away from Windows where the baseline was recorded. Compressed and half float quaternion quantize the difference away, and the euler cases write the RotAngle literals, which is why the other 23 agreed. Not the serializer: FullPrecision.AllAxes writes nine raw floats and passed, so float serialization is byte identical on both platforms. Rotation is now literal components, so every input to the matrix is a literal or a managed function of one. Re-recorded the four QuaternionSync signatures; the lengths are unchanged and the other 21 are untouched.
1 parent e37263e commit 4e5837f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformStateBaselineTests.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ internal class NetworkTransformStateBaselineTests
4242
"FullPrecision.Teleport.Parented|30|0167D4EA",
4343
"FullPrecision.TrackByStateId|23|7109AC47",
4444
"FullPrecision.InLocalSpace|18|FE97B9BF",
45-
"QuaternionSync.Full|22|BBBF5D70",
46-
"QuaternionSync.Compressed|10|61D0C0A0",
47-
"QuaternionSync.HalfFloat|14|492F1FBC",
48-
"QuaternionSync.Teleport|22|603F0025",
45+
"QuaternionSync.Full|22|EB89F8E7",
46+
"QuaternionSync.Compressed|10|A86AAC6C",
47+
"QuaternionSync.HalfFloat|14|2629A22E",
48+
"QuaternionSync.Teleport|22|51DF412A",
4949
"HalfFloat.AllAxes|24|56C94289",
5050
"HalfFloat.PositionOnly|12|E0EB69C7",
5151
"HalfFloat.PositionXZ|10|270908C3",
@@ -75,7 +75,11 @@ private static NetworkTransformState CreateBaseState()
7575
RotAngleX = 33.75f,
7676
RotAngleY = 190.5f,
7777
RotAngleZ = 271.25f,
78-
Rotation = Quaternion.Euler(33.75f, 190.5f, 271.25f),
78+
// Literal components rather than Quaternion.Euler of the angles above: Euler goes through
79+
// native trig, which lands a ULP apart on Linux against Windows, and the uncompressed
80+
// quaternion cases put those bytes on the wire verbatim. (1, 2, 2, 4) / 5 is unit length and
81+
// has a unique largest component for the smallest three compression path.
82+
Rotation = new Quaternion(0.2f, 0.4f, 0.4f, 0.8f),
7983
ScaleX = 2.5f,
8084
ScaleY = 0.75f,
8185
ScaleZ = 4.0f,

0 commit comments

Comments
 (0)