Skip to content

build(windows): restore deterministic x86 build - #253

Open
arazmj wants to merge 7 commits into
fbraz3:mainfrom
arazmj:fix/windows-deterministic-x86
Open

build(windows): restore deterministic x86 build#253
arazmj wants to merge 7 commits into
fbraz3:mainfrom
arazmj:fix/windows-deterministic-x86

Conversation

@arazmj

@arazmj arazmj commented Aug 15, 2026

Copy link
Copy Markdown

Description

Restore the experimental native MSVC x86 Zero Hour build and enable the same
fdlibm-backed deterministic math path used by Linux and macOS.

The previous modern Windows path referenced moved Win32 sources, exposed POSIX
compatibility headers ahead of Windows SDK headers, omitted native runtime
implementations, and did not link the native D3DX library. This prevented the
placeholder workflow from producing a usable executable.

Changes

  • restore native Win32, DirectInput, DirectX 8, Miles, Bink, and VFW sources
  • isolate POSIX compatibility headers from native Windows builds
  • repair modern MSVC include, Winsock, COM, and release-warning failures
  • enable deterministic GameMath with /fp:precise for Windows x86
  • add Windows build and replay jobs to the main CI workflow
  • validate all Linux- and macOS-recorded replay captures on Windows
  • use a protected cross-OS asset cache so fork PRs never receive asset secrets
  • standardize new replay wide characters on retail UTF-16 while reading legacy Unix UTF-32 captures
  • package only generalszh.exe, symbols, and zlib1.dll for distribution
  • keep generated Miles/Bink stubs confined to the CI-only replay artifact
  • preserve the licensed installation's retail mss32.dll and binkw32.dll

Validation

  • built the complete Release target with MSVC 2022 x86
  • verified the executable is PE32 Intel 80386 and contains the fdlibm GameMath object code
  • passed the full Linux, macOS, and Windows build/replay matrix in CI run 31956737144
  • played all six Linux/macOS replay captures successfully on the Windows runner
  • built the Generals and Zero Hour macOS recorder targets locally
  • launched successfully from a Steam Zero Hour installation
  • completed a real macOS ARM64 and Windows x86 multiplayer match without a synchronization error
  • confirmed Windows audio works when retaining the installation's retail Miles and Bink DLLs

@fbraz3

fbraz3 commented Aug 15, 2026

Copy link
Copy Markdown
Owner

hey @arazmj do you have a discord account so we can talk about the implementation? thanks!

@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.

@fbraz3

fbraz3 commented Aug 16, 2026

Copy link
Copy Markdown
Owner

A Windows build seems to be a good idea, could you please:

  • Resolve branch conflicts
  • Add windows build to CI process, validating both mac and linux replays under windows environment.

Thanks!

arazmj and others added 2 commits August 16, 2026 09:22
Repair the native MSVC path and package only the executable, symbols, and zlib runtime so licensed installations retain their functional Miles and Bink DLLs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Run the native x86 executable against both Linux and macOS replay captures and keep test-only audio and video stubs out of the distributable runtime artifact.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arazmj
arazmj force-pushed the fix/windows-deterministic-x86 branch from d57224e to c91b0de Compare August 16, 2026 14:26
arazmj and others added 5 commits August 16, 2026 09:41
Populate a cross-OS cache from the existing Linux replay job before Windows starts, allowing fork pull requests to validate replays without exposing the encrypted asset key.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the same repository-relative cache path on Linux and Windows so cross-OS extraction does not preserve a platform-specific home directory.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arazmj

arazmj commented Aug 16, 2026

Copy link
Copy Markdown
Author

Addressed both requests: the branch is rebased onto current main and mergeable, and CI now builds MSVC x86 Zero Hour then plays every Linux- and macOS-recorded replay on Windows. Implementing the matrix exposed and fixed a real replay-format issue: Unix had serialized wchar_t as UTF-32 while Windows expected retail UTF-16; new captures now use fixed UTF-16 and older Unix captures are detected and read compatibly. Fork PR assets are transferred through a protected cross-OS cache without exposing secrets, and CI-only Miles/Bink stubs remain separate from distributable artifacts. Full matrix is green: https://github.com/fbraz3/GeneralsX/actions/runs/31956737144

@fbraz3

fbraz3 commented Aug 16, 2026

Copy link
Copy Markdown
Owner

thanks for adress the issues.

Just a few more questions.

  • Is there any particular reason to split the windows replay test in a different file?
  • I saw 2 artifacts being generated for windows, which one is the correct?
    • generalsxzh-windows-x86-ci | 2.86 MB
    • generalsxzh-windows-x86 | 19 MB

I'm also found a diference on windows replay tests, if you refer to linux or mac replay tests you will find lines like this at end of logs for all replay files:

Simulating Replay "/home/runner/.local/share/GeneralsX/GeneralsZH/Replays/linux_2p_custom_map.rep"
[GeneralsX] Replay map resolved via CRC fallback: CRC=0x43396DD8 size=162490 -> '/home/runner/.var/app/com.fbraz3.generalsxzh/data/generalsx/generalszh/maps/[rank] arctic arena zh v1/[rank] arctic arena zh v1.map'
INFO: OSDisplaySetBusyState(false, true) - Linux stub
[INI] load('/home/runner/.var/app/com.fbraz3.generalsxzh/data/generalsx/generalszh/maps/[rank] arctic arena zh v1\map.ini') START
[INI] load - calling prepFile('/home/runner/.var/app/com.fbraz3.generalsxzh/data/generalsx/generalszh/maps/[rank] arctic arena zh v1\map.ini') START
[INI] load - prepFile completed
[INI] load - processed total 17 lines
[INI] load('/home/runner/.var/app/com.fbraz3.generalsxzh/data/generalsx/generalszh/maps/[rank] arctic arena zh v1\map.ini') END
INFO: OSDisplaySetBusyState(false, true) - Linux stub
Elapsed Time: 00:00 Game Time: 07:10/07:10

But on windows headless replay test the log ends early, so it seems the replay test itself is not running.

[INI] load('c:\users\runneradmin\documents\command and conquer generals zero hour data\maps\[rank] arctic arena zh v1\map.ini') START
[INI] load - calling prepFile('c:\users\runneradmin\documents\command and conquer generals zero hour data\maps\[rank] arctic arena zh v1\map.ini') START
[INI] load - prepFile completed
[INI] load - processed total 17 lines
[INI] load('c:\users\runneradmin\documents\command and conquer generals zero hour data\maps\[rank] arctic arena zh v1\map.ini') END

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.

2 participants