Skip to content

fix: apply the base of a late half float base sync - #4251

Open
NoelStephensUnity wants to merge 3 commits into
develop-2.0.0from
fix/half-float-late-base-sync
Open

NoelStephensUnity wants to merge 3 commits into
develop-2.0.0from
fix/half-float-late-base-sync

Conversation

@NoelStephensUnity

@NoelStephensUnity NoelStephensUnity commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Purpose of this PR

Fixes a non-authority NetworkTransform being drawn about 2 m off for up to a second when UseHalfFloatPrecision and UseUnreliableDeltas are both enabled.

When a half float delta reaches MaxDeltaBeforeAdjustment, it is collapsed into a new base position and that state is sent reliably, while the deltas after it are sent unreliably. Under jitter or packet loss a newer delta can arrive first, and the base update was then dropped as out of order. The non-authority kept the old base and decoded every later delta against it until the next frame synchronization.

A late base update is still ignored for its position, but its base is now applied, so later deltas decode against the right base. Reliable states stay in order among themselves, so a late base update is never older than the base it replaces. Deltas that arrived before the late base update are not corrected.

Fixes #4248.

Jira ticket

N/A

Changelog

  • Fixed: Issue where a non-authority NetworkTransform using both UseHalfFloatPrecision and UseUnreliableDeltas could be drawn about 2 meters off until the next frame synchronization when a base position update arrived after the position deltas that followed it.

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

New NetworkTransformHalfFloatLateBaseTests (Host, DAHost) delivers a delta, then the older base update, then a newer delta to the non-authority instance and checks its position. Without the fix it fails (non-authority at x = 1.0, authority at x = 3.5); with it, the PlayMode NetworkTransform tests pass 3950/3950.

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

Up-port

#4252

Backports

N/A

With UseHalfFloatPrecision and UseUnreliableDeltas, the base sync goes reliably
and the deltas after it unreliably. A base sync that arrived after a newer delta
was dropped as out of order, so every later delta decoded against the old base.

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Harness Review

Needs changes

The focused fix and regression test cover the reported arrival order, but base replacement needs a stronger ordering safeguard.

Reviewed commit c5fe7c1

🤖 Helpful? 👍/👎

@codecov-github-com

codecov-github-com Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

@@              Coverage Diff               @@
##           develop-2.0.0    #4251   +/-   ##
==============================================
  Coverage          74.78%   74.78%           
==============================================
  Files                172      172           
  Lines              28400    28408    +8     
==============================================
+ Hits               21239    21246    +7     
- Misses              7161     7162    +1     
Flag Coverage Δ
NGOv2_project_testproject_ubuntu 74.45% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...gameobjects/Runtime/Components/NetworkTransform.cs 89.44% <100.00%> (+0.12%) ⬆️

... and 1 file with indirect coverage changes

Components Coverage Δ
com.unity.netcode.gameobjects 74.78% <100.00%> (+<0.01%) ⬆️

ℹ️ Need help interpreting these results?

A base sync from a former owner can reach a non-authority after the new owner's
teleport; it must not replace the newer base.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant