Skip to content

Fix cross-platform math determinism (Mac/Linux)#217

Draft
fbraz3 wants to merge 2 commits into
mainfrom
fix-mac-linux-math-determinism
Draft

Fix cross-platform math determinism (Mac/Linux)#217
fbraz3 wants to merge 2 commits into
mainfrom
fix-mac-linux-math-determinism

Conversation

@fbraz3

@fbraz3 fbraz3 commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Description

Fixes cross-platform math determinism between Mac (ARM64), Linux (x86_64) and Windows.
This addresses the math precision and ambiguity issues related to SqrtOrigin, Atan2Origin, and PowOrigin.

Changes

  • Added explicit float overloads for deterministic math wrappers in wwmath.h.
  • Added explicit (float) casts to resolve ambiguous math function calls (e.g. in AIPathfind.cpp).
  • Checked and validated integer casting after division to prevent Inf/NaN propagating into integers.
  • Synchronized logic between GeneralsMD and Generals to ensure backport parity.

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