Skip to content

chore: LargeWorldCoordinate RelativeTo platform probe (do not merge) - #4254

Draft
NoelStephensUnity wants to merge 6 commits into
develop-3.x.xfrom
experiment/lwc-relativeto-platform-probe
Draft

NoelStephensUnity wants to merge 6 commits into
develop-3.x.xfrom
experiment/lwc-relativeto-platform-probe

Conversation

@NoelStephensUnity

Copy link
Copy Markdown
Member

Experiment. Do not merge. This PR is closed and its branch deleted once the results are in.

Purpose of this PR

Measures LargeWorldCoordinate.RelativeTo (unity/unity#138277) on the CPUs NGO's CI reaches: ARMv7 (Android), ARM64 (iOS, Apple Silicon), and the console x64 parts. Desktop x64 results are already measured; ARM and console are not.

LwcRelativeToProbeTests runs four forms of RelativeTo as Burst jobs, each under FloatMode.Strict and FloatMode.Fast. The forms copy the PR's arithmetic with int3 cells in place of the internal type:

Form What it is
Double The form #138277 ships: the difference computed in double, rounded to float once
TwoSum The previous float form with an error term
HalfCell Half the cell displacement folded into each offset
Naive Plain float subtraction

About 70,000 cases (cell-edge offsets plus random pairs, built from integer operations so every platform runs the same inputs) are checked against the exactly rounded difference computed with BigInteger. Each form and mode logs one LWCPROBE line with:

  • burst: whether the job ran Burst-compiled
  • inexact, collapsed, underHalfCellInexact, maxUlp
  • hash: FNV-1a of the result bits, to compare across platforms
  • nsPerElement: best of 5 timings over 4,096 pairs

The test fails only if a job did not run under Burst, or if the Double form collapses or is inexact for coordinates under half a cell apart.

How to run

Comment /ci lwc-probe. It runs the testproject standalone tests on 6000.7 for win and mac (il2cpp), android, ios-arm64, ps4, ps5, GameCoreXboxOne and GameCoreScarlett. On this branch the standalone test filters run only the probe.

Changes

  • Tests/Runtime/LwcProbe/LwcRelativeToProbeTests.cs, and Unity.Burst in the runtime test assembly references
  • .yamato/_triggers.yml: temporary lwc_relativeto_probe trigger
  • .yamato/{desktop,mobile,console}-standalone-test*.yml: test filter narrowed to Unity.Netcode.RuntimeTests.LwcProbe

Release Notes

None

🤖 Generated with Claude Code

Runs the double, TwoSum, half-cell and naive RelativeTo forms as Burst jobs
under FloatMode.Strict and FloatMode.Fast and reports exactness, a hash of the
result bits and the cost per element. Adds a temporary /ci lwc-probe trigger
and narrows the standalone test filters to the probe.
@NoelStephensUnity NoelStephensUnity changed the title test: LargeWorldCoordinate RelativeTo platform probe (do not merge) chore: LargeWorldCoordinate RelativeTo platform probe (do not merge) Nov 17, 2026
The 6000.7.0b10 ILPP Runner crashes intermittently building the Windows IL2CPP player (AccessViolation in exception dispatch). 6000.7.0b8 builds the probe.
@NoelStephensUnity

Copy link
Copy Markdown
Member Author

/ci lwc-probe

The probe's Burst jobs in Unity.Netcode.Runtime.Tests make the ILPP Runner crash
intermittently on 6000.7 b8 and b10. In an assembly that references only the test
runner, Burst and Mathematics it built 9/9 locally on b10, so the 6000.7.0b8 pin
is dropped.
@NoelStephensUnity

Copy link
Copy Markdown
Member Author

/ci lwc-probe

PlayStation players flush subnormals to zero, which shrank the case list there and failed the exact Double check on a flushed input. The main set now drops offsets below 2^-100 and dedupes by bits, so every platform runs the same 42,336 scalars; subnormal inputs run as a separate unasserted 'tiny' set.
@NoelStephensUnity

Copy link
Copy Markdown
Member Author

/ci lwc-probe

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant