Skip to content

fix(math): align deterministic Bezier operations - #255

Draft
arazmj wants to merge 1 commit into
fbraz3:mainfrom
arazmj:fix/deterministic-bezier-order
Draft

fix(math): align deterministic Bezier operations#255
arazmj wants to merge 1 commit into
fbraz3:mainfrom
arazmj:fix/deterministic-bezier-order

Conversation

@arazmj

@arazmj arazmj commented Aug 15, 2026

Copy link
Copy Markdown

Description

Keep deterministic Bezier trajectories bit-identical between the GLM and D3DX paths.

The GLM path delegated matrix transforms and dot products to GLM, whose evaluation order differs from the explicitly ordered scalar operations used by the deterministic D3DX path. In a cross-platform multiplayer match, this first diverged on a ScorpionTankShell: both clients matched through frame 17500, then produced slightly different projectile coordinates and CRCs at frame 17600.

Changes

  • Evaluate GLM Bezier transforms in the same scalar operation order as D3DX.
  • Evaluate GLM Bezier dot products in the same scalar operation order as D3DX.
  • Preserve native GLM operations when deterministic math is disabled.
  • Apply through shared Core code for both Generals and Zero Hour.

Validation

  • Built the macOS z_generals and g_generals targets with deterministic math enabled.
  • Built the MSVC x86 Zero Hour target with deterministic GameMath enabled.
  • Verified the Windows artifact remains PE32 Intel 80386 and contains the fdlibm GameMath objects.

@arazmj

arazmj commented Aug 15, 2026

Copy link
Copy Markdown
Author

Additional real-world validation: completed another multiplayer game with two macOS GeneralsX clients and one deterministic Windows client. Map loading, shared tunnel exits, sound, and synchronization all remained working with no reported problems.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arazmj
arazmj force-pushed the fix/deterministic-bezier-order branch from 0f73258 to 7874c42 Compare August 16, 2026 14:26
@arazmj

arazmj commented Aug 16, 2026

Copy link
Copy Markdown
Author

Proactive update: this branch has been rebased onto current main; conflicts are resolved and GitHub reports it mergeable. The prior base-Generals macOS failure was an external FreeType download HTTP 504, not a compile or replay regression; the same macOS build and replay matrix passed in the latest CI run on PR #253.

@fbraz3
fbraz3 marked this pull request as draft August 17, 2026 04:25
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