Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

369 KB
Raw Blame

Windows impact of the port

Every change the macOS/Linux port made that a Windows build compiles, links or runs, with the risk if it is wrong and how far it has been verified on Windows. It covers code inside #ifdef _WIN32, MSVC flags in CMakeLists.txt, shared headers, and call sites whose Windows branch changed. Reviewers of the port can use it as a checklist; PORTING.md has the overview.

For most of the port no Windows machine was available, so each change was recorded here as it was made, with what it would take to check it. A Windows x64 VM (MSVC 19.44) and, later, a Windows ARM64 VM then worked through the list. The How to verify cell of each row starts with what a Windows run has shown.

How to add a row

Add a row when you change anything a Windows build compiles, links or runs. If you are unsure whether your change qualifies, it qualifies.

Be specific about Risk. "Might break" helps nobody. "If MSVC's char16_t and wchar_t overload resolution differs here, this call binds to the wrong overload and the string is empty" is a thing somebody can check in ninety seconds.

Severity

  • high — would break the Windows build, or change what the simulation computes
  • medium — would break a Windows-only feature at runtime
  • low — cosmetic, a warning, or a flag that moved without changing the command line

Windows verification (2026-09-27)

Rows are counted from 1 in table order, as the cells cite them. The counts below are as of 2026-09-27; rows added after that carry their own status.

Mark Rows Meaning
VERIFIED 162 The row's own check was done on Windows, or a stronger one. The cell names the evidence.
PARTLY VERIFIED 63 Some of the row's checks were done; the cell says which are left.
OPEN 101 None of the row's own checks has been done on Windows.
nothing to verify 5 The row says no Windows check applies (comments only, or a POSIX-only file).
argued, not run 1 No run can show it; the row's argument is the evidence.

The evidence the cells name:

  • CI: a Windows CI run (windows-ci.ps1) on 2026-09-27, before upstream 843bf76b's gameplay data was merged, so its E1 CRCs are the pins of that time (the current ones are in PORTING.md). On Windows (MSVC 19.44, x64, Release) it ran:
    • build.bat Release;
    • ctest, 47 of 47 in session 0 (no audio or video tests), plus dx9_smoke, dx9_smoke_msaa and test_dx11device in the desktop session;
    • E1 with seed 0 at 1200 frames (0x0177BEF6), seed 0 at 12000 (0x5273770F) and seed 1 at 12000 (0x830467DB). Each run played back to the same CRC, the data folder was unchanged, and Linux x86_64 gave the same three CRCs at the same commit.
    • "E1" in a cell means those runs.
  • VM check: read-only checks of that CI run's Windows tree. The build fingerprint is 0xD883D7C9 over 3736 files on Windows, macOS and Linux alike. The checks:
    • ctest's registration (--show-only=json-v1);
    • the Release .vcxproj settings;
    • dumpbin /dependents generals.exe;
    • the objects built;
    • the VM's time zone;
    • the tree's git status;
    • an E1 run's own logs;
    • MSVC's <thread>;
    • test_gameengine -V.
  • probe: one file, compiled by cl 19.44 on the VM, by clang on macOS and by GCC on Linux. It prints Random3Class's tables and first draws, and compile-time facts (_MAX_PATH, TCHAR, bool.h).
  • dx9_smoke on the VM: its output, read in the desktop session. The VM's CPU is GenuineIntel.
  • W2: measurements made during the first MSVC build of the port (work item W2), each at the commit it names.
  • sized-delete run: a Windows CI run of the change that added the sized and nothrow operators, which recompiled GameMemory.cpp.

What is left, by what it needs. This is the Windows risk that remains. Every PARTLY VERIFIED and OPEN row is in exactly one line:

Needs Rows Which
A Debug build: one exists since 2026-09-29 (the standing item below), but these rows' own checks have not been run in it 8 124, 145, 146, 158, 160, 204, 274, 280
Another build configuration or a configure-time experiment 8 13, 39, 46, 64, 67, 103, 126, 179
Disassembly, timing or log comparisons against an older build 12 22, 27, 40, 41, 48, 49, 65, 71, 74, 81, 90, 203
A small value check nobody has written yet, or a grep 6 5, 25, 28, 52, 54, 251
The Direct3D 11 renderer, or both renderers, by eye 7 236, 237, 238, 239, 240, 241, 247
Someone at a Windows screen: menus, text, input, visuals, crash boxes (every run here is headless) 56 55, 57, 58, 59, 73, 118, 134, 135, 136, 140, 143, 144, 148, 149, 150, 151, 153, 154, 155, 156, 157, 168, 171, 175, 176, 177, 178, 182, 183, 186, 187, 189, 191, 192, 193, 212, 216, 228, 229, 230, 231, 233, 242, 246, 249, 254, 256, 257, 259, 260, 261, 262, 263, 264, 269, 270
A network game: two Windows machines, or Windows and a Mac 9 131, 137, 142, 198, 206, 207, 219, 266, 268
GameSpy, whose service is gone 9 132, 138, 152, 159, 190, 194, 195, 196, 271
Sound or video, which the workers never play 4 108, 109, 227, 232
Old data: replays or saves from before a change, a retail install, an older working tree, WorldBuilder 12 107, 113, 121, 166, 197, 205, 209, 224, 234, 244, 250, 275
An AMD Windows machine 2 75, 78

Three things the checks found:

  • A Debug build did not compile on Windows. Since 2026-09-29 an x64 Debug build does, and passes ctest and E1 (the standing item, updated below).
  • Row 15's expected figure was wrong. The row expected -1163104121; the value is -1163302777, on every compiler. The code was right.
  • The Preloading memory log lines print garbage on a machine with more than 2 GB free (row 147). They pass size_t through %d, as the MEMORYSTATUS fields did before the change. Latent and log only.

Ledger

Date Task Files What changed Risk if wrong Severity How to verify
2026-09-22 A2 follow-up Libraries/Source/Compression/ZLib/zutil.h (vendored, not tracked) vendor.sh narrows zlib's #if defined(MACOS) || defined(TARGET_OS_MAC) at zutil.h:113 to also require !defined(__APPLE__), so Darwin falls through to zutil.h's own #define OS_CODE 0x03 /* assume Unix */ and keeps the real fdopen. Measured before and after: OS_CODE 0x07 -> 0x03, fdopen macro -> not a macro. Neither MACOS nor TARGET_OS_MAC is ever defined on Windows, so that branch was already dead there and the added condition is never evaluated. Windows keeps OS_CODE 0x0b from the WIN32 branch above it. The risk is that this reasoning is wrong about some MSVC configuration that does define one of them - in which case Windows would move from 0x07 to 0x0b and gain a working fdopen, which is a fix, not a regression. low Windows: VERIFIED (VM check: the compression target defines neither MACOS nor TARGET_OS_MAC; CI: it builds.) grep -rn MACOS the Windows build's command lines; confirm neither name is defined. Then build compression.
2026-09-22 persistfactory WWSaveLoad/persistfactory.h SimplePersistFactoryClass::Save writes the object-identity token as PersistClass * at sizeof(objptr) instead of (uint32)obj at sizeof(uint32). Load is unchanged - it already read sizeof(T *). On Win64 the chunk payload goes from 4 bytes to 8. This CHANGES what a Windows build writes into that chunk, so it is a format change on the one platform nobody here can run. The reason it is safe is that the format it replaces cannot be read by the build that writes it: ChunkLoadClass::Read refuses a read that overruns the chunk and returns 0 without touching the buffer, so Win64 Load has always left old_obj at NULL and registered every object under the key NULL. Measured with the real ChunkSaveClass/ChunkLoadClass and the real template: payload 4, Read returns 0, Register_Pointer receives NULL; after the fix, payload 8, Read returns 8, correct address. There is no working Win64 save of this shape to be compatible with. A Win32 build stays symmetric at 4 bytes and is unaffected. medium Windows: VERIFIED (CI: test_wwsaveload, which holds persist_factory_writes_a_pointer_token_load_can_read.) Build test_wwsaveload on Windows and run persist_factory_writes_a_pointer_token_load_can_read. It goes red on the old code on x64 and green on the new.
2026-09-22 test audit GeneralsMD/Code/CMakeLists.txt add_lib_test() now always calls add_test(); a PENDING_MACOS target is registered DISABLED instead of being skipped. A configure-time message(STATUS ...) lists the deferred ones. On Windows ZH_NOT_YET_PORTABLE is empty, so exclude is empty, so nothing is marked DISABLED, the global property stays empty and the message does not print — all 16 tests register exactly as before. If that reasoning is wrong, tests would be marked DISABLED on Windows and silently stop running, which is the one failure mode this change exists to prevent and would be invisible in a green ctest. medium Windows: VERIFIED (VM check: ctest registers 52 tests on Windows and none is DISABLED (the configure message mirrors that property)) ctest -N on Windows must list 16 tests and report none as Disabled. Check the configure output does NOT contain a ctest: N test(s) registered DISABLED line.
2026-09-22 B9 15 files in GameEngine, WWVegas (147 include directives) Backslashes became forward slashes inside #include "..." directives, and nothing else. One #include <sys\stat.h> in WWLib/TARGA.CPP went the same way. Line counts are unchanged and no other backslash in the tree was touched. A no-op on Windows by construction: MSVC resolves "Common\Foo.h" and "Common/Foo.h" to the same file, so the preprocessor sees identical content and emits an identical object. The change would only bite if some path resolved to a different file under the two spellings, which needs two headers differing only by separator - impossible, a separator cannot be in a filename. low Windows: VERIFIED (CI: build.) Build Windows and diff the .obj files, or just confirm the targets still compile.
2026-09-22 B10 WWLib/bittype.h uint32 changed from unsigned long to uint32_t, sint32 from signed long to int32_t. Width on Windows is unchanged (LLP64 long is already 32 bits); the type identity is not. unsigned long and unsigned int are distinct types even where both are 32 bits, so this can change overload resolution, template specialisation and printf-format diagnostics on MSVC. A function overloaded on unsigned long and unsigned int binds differently; %lu over a uint32 becomes a format mismatch; a template<> struct X<unsigned long> specialisation stops matching. None of this is a size problem and none of it shows up by checking sizes. Measured on macOS: across the 34 objects that currently compile, the warning set is byte-identical before and after (104 either way), and the only error that changes is test_w3dlayout going green. But that is 34 objects out of 701 uses in 98 files — most of WWVegas cannot compile here yet (windows.h, B5), so the sweep is real but thin, and MSVC diagnoses some of this differently in any case. high Windows: PARTLY VERIFIED (CI: build, test_w3dlayout. Left: the grep for specialisations and %l formats over uint32/sint32.) Do NOT check sizeof. Full Windows build with warnings up, then grep for template specialisations over uint32/sint32, and for printf/sprintf/DEBUG_LOG format strings using %l with a uint32 argument. ctest -R test_w3dlayout must be green.
2026-09-22 B10 WWLib/bittype.h, WW3D2/agg_def.h DWORD and ULONG removed from bittype.h — they could not be retyped, because a non-verbatim duplicate of an SDK typedef is a hard error on MSVC. agg_def.h's two uses became uint32. The other six SDK names are untouched. On Windows every WWVegas and Tools/WW3D user of DWORD/ULONG also reaches windows.h, and in all 23 the include resolves before first use — established by include-closure analysis, not by compiling. If that is wrong for any translation unit it is an undeclared-identifier error at compile time: loud, not silent. agg_def.h's m_Version and Class_ID go from unsigned long to uint32_t on Windows — same 32-bit width, same type-identity caveat as the row above. medium Windows: VERIFIED (CI: build.) Full Windows build; any breakage names its own file and line. Confirm agg_def.h::Class_ID() still suits its callers — it returns m_MiscInfo.OriginalClassID, which is itself a uint32, so the return type is now correct rather than coincidental.
2026-09-22 A1 GeneralsMD/Code/CMakeLists.txt set(CMAKE_MSVC_RUNTIME_LIBRARY ...) and set(CMAKE_POLICY_DEFAULT_CMP0091 NEW) moved from above project() to below it, inside if(ZH_PLATFORM_WINDOWS). The reasoning is that the first is read when a target is created and the second when a vendored subdirectory is added, and every one of those is later than project(). If either is in fact read at project() time, the static CRT setting is lost and generals.exe imports MSVCP140.dll and VCRUNTIME140.dll by name again — which is the exact undiagnosable startup failure the comment above those lines exists to prevent, on a machine with no redistributable and no log to send back. high Windows: VERIFIED (VM check: dumpbin /dependents generals.exe lists no MSVCP140 or VCRUNTIME140, and the projects say RuntimeLibrary MultiThreaded.) Configure, then dumpbin /dependents Run\generals.exe and confirm neither DLL is listed. Or check MSVC_RUNTIME_LIBRARY on a target: cmake --build build --target help then read build/*/vcxproj for <RuntimeLibrary>MultiThreaded</RuntimeLibrary>.
2026-09-22 A1 GeneralsMD/Code/CMakeLists.txt The if(MSVC) flag block is untouched; an elseif(ZH_PLATFORM_MACOS) branch was added after it. /W3 /permissive /EHa /Oy- /Zi /FS /MP and add_link_options(/DEBUG) are in the same order with the same spelling. None expected: MSVC is still the condition and the branch is still the first one taken. If the elseif were reachable on Windows, -fexceptions and friends would reach cl.exe and it would reject them loudly rather than quietly. low Windows: VERIFIED (VM check: gameengine's Release project has /W3, /permissive (ConformanceMode false), /EHa (Async), /Oy- (OmitFramePointers false), /Zi, /FS, /MP, and generals links with /DEBUG. There is no log from before the port to diff against.) cmake --build build --config Release -- -v and diff the cl.exe command line against a log from the tree before the port.
2026-09-22 A1 GeneralsMD/Code/CMakeLists.txt WIN32 and _WINDOWS moved out of the unconditional add_compile_definitions into if(ZH_PLATFORM_WINDOWS); _CRT_SECURE_NO_WARNINGS and _CRT_NONSTDC_NO_WARNINGS stayed unconditional. If the guard is somehow false on Windows, both defines vanish and several hundred #ifdef sites compile the wrong branch. It would not be subtle — the build would collapse — but it would collapse on someone else's machine. medium Windows: VERIFIED (VM check: WIN32;_WINDOWS are in gameengine's PreprocessorDefinitions.) Confirm /DWIN32 /D_WINDOWS still appear on the cl.exe command line in a verbose build log.
2026-09-22 A1 GeneralsMD/Code/CMakeLists.txt add_lib_test() gained an optional PENDING_MACOS first library argument, and five call sites pass it. On Windows it is stripped from the library list and the test is registered exactly as before. If the keyword were not stripped, test_harness PENDING_MACOS would go to the linker as -lPENDING_MACOS. If the add_test guard were wrong, five tests would silently disappear from ctest on Windows — a shrinking test count nobody looks at. low Windows: VERIFIED (CI: all five run in the Windows ctest.) Both paths were exercised with a standalone cmake -P script rather than assumed; on Windows, confirm ctest -N still lists test_wwmath, test_wwlib, test_wwsaveload, test_wwutil and test_gameengine.
2026-09-22 A1 GeneralsMD/Code/CMakeLists.txt target_link_options(test_wwlib PRIVATE /LARGEADDRESSAWARE) is now inside if(MSVC). If the guard is false, the flag is dropped and cpudetect_memory_fits_in_the_signed_int_its_callers_use measures a binary that does not see what the game sees — so it passes or fails for the wrong reason. low Windows: VERIFIED (CI: test_wwlib; VM check: test_wwlib links with LargeAddressAware.) ctest -R test_wwlib on Windows, and check /LARGEADDRESSAWARE in the link command line.
2026-09-22 A1 GeneralsMD/Code/CMakeLists.txt wwlib's PUBLIC winmm version moved into if(ZH_PLATFORM_WINDOWS); PRIVATE wwdebug stayed unconditional. Dropping winmm on Windows is an unresolved timeGetTime/timeBeginPeriod at link time, and version an unresolved GetFileVersionInfo. Loud, not silent. low Windows: VERIFIED (CI: build.) Link any wwlib consumer on Windows.
2026-09-22 A1 GeneralsMD/Code/CMakeLists.txt The vendored-source check no longer demands Libraries/DirectX/Include/d3d8.h or Libraries/Source/GameSpy/CMakeLists.txt on non-Windows. On Windows the list and the message are unchanged. If the list(APPEND ...) did not run on Windows, a clone with no vendored DirectX or GameSpy would get a missing-source error per library from the generator instead of the one clear message — which is the thing that check exists to prevent. low Windows: OPEN (Left: the configure run with Libraries/DirectX/Include renamed.) Rename Libraries/DirectX/Include and confirm the FATAL_ERROR still names d3d8.h.
2026-09-22 W1 WWLib/crc.h, WWLib/crc.cpp CRCEngine's accumulator pinned from long to int32_t, its staging union from char[sizeof(long)] to char[sizeof(int32_t)], and _lrotl(CRC,1) replaced by an explicit 32-bit rotate. This changes a checksum if the premise is wrong. The premise is that long is 32 bits on Windows, so every one of these is the same type and the same arithmetic it already was, and the generated code should be identical. If it is not - if some Windows configuration makes long anything else - every CRC this engine produces changes, and it is used by obscure.cpp, ini.cpp, TagBlock, crcpipe, crcstraw and miscutil. The reason it had to change is that on LP64 the old code rotated within 64 bits and blocked on eight bytes, computing a different CRC in silence: the existing crcengine_byte_at_a_time_matches_block test passes at either width, because both sides of it move together. high Windows: VERIFIED (CI: test_wwlib (crcengine_accumulator_is_32_bits_wide), E1.) Tests/test_wwlib.cpp now has crcengine_accumulator_is_32_bits_wide, which asserts the absolute value 0x93b0f838 for "Westwood Studios". Run it on Windows first - it should pass unchanged, and if it does the premise held.
2026-09-22 W1 WWLib/random.cpp The 40 constants in Random3Class::Mix1/Mix2 given explicit (int) casts. All forty have their top bit set, so none fits in an int; MSVC takes them with warning C4305 and wraps to the negative two's-complement value, while clang rejects a braced initialiser it cannot narrow. The casts are what MSVC was doing implicitly and the stored bits are identical. If that is wrong the seed table of a generator the simulation draws from changes, which moves a replay. medium Windows: VERIFIED (probe: Random3Class::Mix1[0] is -1163302777 on MSVC, clang and GCC (the literal (int)0xbaa96887; this row's -1163104121 was a slip), and the Mix tables and the first draws agree on all three; CI: E1.) Print Mix1[0] on Windows before and after; it should be -1163104121 both times. Then replay-check.ps1.
2026-09-22 W1 WWLib/bool.h Guard changed from (_MSC_VER < 1100) to defined(_MSC_VER) && (_MSC_VER < 1100). Nothing on Windows: _MSC_VER is defined there and the comparison is unchanged, so the file stays inert exactly as it has been since Visual C++ 5. Borland and Watcom were already excluded by their own clauses. low Windows: VERIFIED (probe (MSVC): TRUE_FALSE_DEFINED is not defined and sizeof(bool) is 1.) Confirm bool is still the built-in type and TRUE_FALSE_DEFINED is still undefined in a Windows build.
2026-09-22 W1 WWLib/strtok_r.h, WWLib/strtok_r.cpp Condition changed from #ifndef _UNIX to #if defined(_MSC_VER). Windows keeps both the declaration and the definition, because _UNIX is not defined there either - so the set of things compiled on Windows is unchanged. The risk would be a Windows toolchain that is not MSVC, which this project does not have. low Windows: VERIFIED (CI: build.) strtok_r still links on Windows.
2026-09-22 W1 WWLib/point.h, WWLib/multilist.h, WWLib/int.cpp this-> on dependent-base members in TPoint3D and PriorityMultiListIterator; template<> on bignum's four static members. The standard spelling of what the code already meant, and MSVC accepts all of it. multilist.h already had PriorityMultiListIterator::List written out, so somebody met this once before and qualified one name. low Windows: VERIFIED (CI: build.) It compiles or it does not.
2026-09-22 W1 WWLib/lcw.cpp, WWLib/srandom.cpp (unsigned) to (uintptr_t) on an alignment test; <process.h> guarded and <unistd.h> used elsewhere for getpid. The cast reads the low two bits of a pointer either way, so the value is the same; truncating first was simply undefined on 64-bit. <process.h> is unchanged on Windows. low Windows: VERIFIED (CI: test_wwlib, build.) lcw round-trip through test_wwlib; srandom links.
2026-09-22 B3 Compression/EAC/gimex.h ggetm/gputm's single-native-load branch is now guarded on byte order (__BIG_ENDIAN__ / __BYTE_ORDER__) rather than on __APPLE__. MSVC defines neither macro, so Windows takes the portable byte-at-a-time branch it already takes today - __APPLE__ was never defined there. If some future MSVC did define __BYTE_ORDER__ as big-endian, Windows would take a branch it has never taken; x86 and arm are both little-endian so that cannot happen in practice. low Windows: VERIFIED (CI: compression_selfcheck.) Round-trip a buffer through the RefPack codec on Windows; compression_selfcheck covers it. The bytes of a .big archive header are the observable thing.
2026-09-22 B3 CMakeLists.txt (compression target) UINT32=unsigned int and UINT16=unsigned short added as compile definitions on non-Windows only, pre-empting LZH-Light's #define UINT32 unsigned long. Nothing reaches Windows: the definitions are inside if(NOT ZH_PLATFORM_WINDOWS). They were briefly unconditional, which would have put a UINT32 macro in front of basetsd.h's typedef unsigned int UINT32, *PUINT32; - reached from NoxCompress.cpp through Lib/BaseType.h and <windef.h> - turning it into typedef unsigned int unsigned int, *PUINT32;. clang warns and limps on; MSVC is stricter about duplicate declaration specifiers. The residual risk is the other direction: if the vendored header ever stops asking #ifndef first, the definitions silently stop applying and macOS regresses to a SIGBUS while Windows carries on working. low Windows: VERIFIED (VM check: no UINT32 among the compression target's definitions.) On Windows, confirm no UINT32 macro is on the compiler command line for the compression target, and that UINT32 is still the SDK typedef. On macOS, compression_selfcheck covers it - the NoxLZH row is the one that crashes without it. Re-check after any vendor.ps1/vendor.sh bump of LZH-Light.
2026-09-22 B3 Libraries/Include/Lib/DetRound.h The arm64 branch now undoes FCVTNS's saturation and handles NaN, so it returns what cvtss2si/cvtsd2si return for every input rather than only for in-range ones. The x86 branch is untouched - it is still the same two intrinsics - so Windows codegen should be unchanged. The added compares are in the arm64 branch only. If they were somehow compiled on Windows, Float_To_Long would gain two branches in the renderer's rasteriser inner loops. low Windows: PARTLY VERIFIED (detround_selfcheck and E1 in CI. Left: the disassembly showing cvtss2si inline.) The arch_differential harness is the check, and it runs on this machine; on Windows, confirm Float_To_Long still inlines to cvtss2si with no comparisons around it.
2026-09-22 B3 FastAllocator.h, ini.cpp, TARGA.CPP, GameMemory.h, wwstring.h <malloc.h> and <tchar.h> guarded on _MSC_VER, with the shim supplying <alloca.h>, _alloca, TCHAR and the _tcs* spellings on macOS. Windows keeps both includes verbatim, so nothing there changes. The shim's macOS TCHAR is char and its _tcs* are the narrow functions, which is only correct while _UNICODE is undefined - it is, everywhere, and the shim #errors if that ever stops being true rather than silently picking narrow. low Windows: VERIFIED (CI: build; probe (MSVC): sizeof(TCHAR) is 1.) Confirm <tchar.h> and <malloc.h> are still included on Windows and that TCHAR is still whatever <tchar.h> says it is.
2026-09-22 B3 Libraries/Include/Platform/MSVCCompat.h, 103 files 326 call sites renamed to the standard CRT names - strcasecmp, strncasecmp, strdup, snprintf, vsnprintf, access, mkdir - with the shim header teaching MSVC those names through inline wrappers onto its _-prefixed versions. The wrappers are the one place the Microsoft spellings must survive. The first bulk run rewrote return _stricmp(a, b) inside the MSVC wrapper into a call to strcasecmp, making it call itself: compiles, recurses until the stack ends, and only on Windows. It is fixed and the header now says at the top to exclude itself from sweeps, but this is the shape of thing to look for first. high Windows: VERIFIED (CI: the game and ctest run; a wrapper that called itself would never return.) Build on Windows and call strcasecmp, strncasecmp and access once each. An infinite recursion shows up immediately. Then grep MSVCCompat.h for any wrapper whose body calls its own name.
2026-09-22 B3 AsciiString.cpp, wwfile.cpp, File.cpp, Debug.cpp, wwstring.cpp _snprintf/_vsnprintf to snprintf/vsnprintf. On MSVC these are different functions, not two spellings: _snprintf returns -1 and writes no terminator on truncation, snprintf returns the length it wanted and always terminates. Every caller reading the return value was rewritten to the C99 test. This changes Windows behaviour deliberately, and in the safe direction, but it does change it. AsciiString::format_va threw ERROR_OUT_OF_MEMORY on a negative return and now throws on wanted >= sizeof(buf); if the rewrite is wrong, a long format string either throws when it should not or silently truncates when it should throw. FileClass::Printf used to pass Microsoft's -1 to Write() as a length; it now clamps. medium Windows: OPEN (Left: the two truncation checks, through AsciiString::format and FileClass::Printf.) On Windows, format a string longer than the buffer through AsciiString::format and through FileClass::Printf and check the first throws and the second writes a truncated line rather than a negative length. Tests/test_debug.cpp and Tests/test_wwdownload.cpp already reason about the old convention in comments - read them before trusting either.
2026-09-22 B3 Libraries/Include/Platform/MSVCCompat.h _MAX_PATH deliberately not renamed to PATH_MAX, and defined as 260 on macOS. _isnan/_finite shimmed rather than renamed. Nothing should change on Windows: _MAX_PATH still comes from <stdlib.h> there and the macOS definition is guarded out. If the guard were wrong and both were visible, the #ifndef keeps the SDK's. The risk being avoided is the one not taken: renaming to PATH_MAX would have changed 117 buffer sizes from 260 to 1024 on macOS, including members of structures that go into save games and the multiplayer INI checksum. low Windows: VERIFIED (probe (MSVC): static_assert(_MAX_PATH == 260) compiles.) Confirm _MAX_PATH is still 260 in a Windows build - static_assert(_MAX_PATH == 260) anywhere - and that no struct's sizeof moved.
2026-09-22 B3 Libraries/Include/Lib/DetRound.h, wwmath.h, BaseType.h WWMath::Float_To_Long and fast_float2long_round now call DetRound::To_Long, which is _mm_cvtss_si32/_mm_cvtsd_si32 on x64 - the same instructions as before, one indirection further away - and vcvtns_s32_f32/vcvtnd_s64_f64 on arm64. This is simulation arithmetic. On Windows the instruction is unchanged and the functions are inline, so the generated code should be identical; if inlining fails, a call appears in the hot path of every Float_To_Long caller in GameLogic. If the x64 branch were ever taken on the arm64 path or vice versa, replays diverge and network games desync, and nothing says so at compile time. E1 must treat DetRound.h as something to verify, not something already verified. high Windows: PARTLY VERIFIED (detround_selfcheck and E1 in CI. Left: the disassembly of a Float_To_Long caller.) Tests/test_detround.cpp is registered as detround_selfcheck and runs on both platforms - run it on Windows first, it should pass unchanged. Then diff a disassembly of one Float_To_Long caller before and after; the cvtss2si should still be inline. Then replay-check.ps1.
2026-09-22 B3 BaseType.h, dettrig.cpp Int64/UnsignedInt64 and DetInt64 from __int64/unsigned __int64 to int64_t/uint64_t, with <stdint.h>. Same width on MSVC x64, so sizeof and layout do not move - but the type identity changes, which is what bit B10 in bittype.h. If any overload, template specialisation or %I64d format string in the tree resolves on __int64 specifically, it now resolves differently. Int64 is in save games and in the replay checksum; DetInt64 is the integer arithmetic the whole determinism story rests on. medium Windows: PARTLY VERIFIED (CI: build, E1. Left: the %I64 and overload grep, and a save/load round trip.) Do not check sizeof - it will pass. Grep for %I64 and for overloads taking Int64 alongside long long. Then a save/load round trip and replay-check.ps1.
2026-09-22 B3 always.h <stddef.h> added, and the array-placement-new guard changed from !defined(_MSC_VER) || _MSC_VER < 1300 to defined(_MSC_VER) && _MSC_VER < 1300. Both conditions are false on modern MSVC, so the block is skipped either way and nothing changes there. If _MSC_VER were somehow below 1300, the old form and the new form still agree. The change only affects compilers that are not MSVC at all, where the old form declared what <new> already defines. low Windows: VERIFIED (CI: build.) Confirm the operator new[]/delete[] placement block is still skipped, e.g. by checking that a new[](size_t, void*) call still resolves to the standard one.
2026-09-22 B3 Vector.H, simplevec.h, v3_rnd.h, mempool.h this-> on dependent-base members; four in-class operator= with the redundant class qualification removed; template<> added to DEFINE_AUTO_POOL. All four are the standard spelling of what the code already meant, and MSVC accepts every one of them. DEFINE_AUTO_POOL is the only one with reach - it expands in ten translation units, and if MSVC rejected template<> there the build would fail loudly in all ten rather than subtly in one. low Windows: VERIFIED (CI: build.) It compiles or it does not. No runtime behaviour to check.
2026-09-22 B3 mutex.h, wwmemlog.cpp #include <intrin.h> guarded on _MSC_VER. Nothing on Windows: the include is unchanged there, and both files genuinely need it for _interlockedbittestandset. low Windows: VERIFIED (CI: build.) It compiles.
2026-09-22 B3 Compression/EAC/huffencode.cpp ((int) bptr1 - (int) EC->buffer) to (int)(bptr1 - EC->buffer). The old form truncated both pointers to 32 bits and subtracted, which is correct modulo 2^32 for two pointers inside one buffer - so Windows x64 got the right answer and MSVC only warned (C4311). The new form is the same value without the truncation. It would differ only if the two pointers were ever more than 2GB apart, which would have been broken before too. low Windows: VERIFIED (CI: compression_selfcheck.) Round-trip a file through CompressionManager with the EAC Huffman codec; compression_selfcheck covers it.
2026-09-22 B3 Download.cpp _mkdir("download") to mkdir("download", 0777). The shim's MSVC mkdir drops the mode, so Windows behaviour is unchanged. If the shim were bypassed and POSIX mkdir reached on Windows, it does not exist there and the build fails loudly. low Windows: VERIFIED (CI: build.) wwdownload links on Windows.
2026-09-22 D1 PR1 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h, dx8wrapper.cpp ~380 new lines: OwnedGeometryClass and its two lock classes, EngineVertexShaderClass, AssembledPixelShaderClass, and nine new DX8Wrapper statics (Set_Owned_Geometry, Draw_Owned_Triangles, Draw_Owned_Points, Set_Engine_Vertex_Shader, Set_Assembled_Pixel_Shader, Get_Render_Target_Description, Read_Back_Render_Target, Read_Back_Frame, Device_Is_Ready, plus the protected Copy_Surface_To_System_Memory). Purely additive — nothing in the engine calls any of it. This code has never been compiled by any compiler. A1 gates ww3d2 and every dx11* target out of the macOS configure, so there is no toolchain on this project that will even parse it. A syntax error, a wrong overload, a missing const, a friend declaration MSVC reads differently — any of those is a broken Windows build the moment someone builds it, and it would be D1 PR1's fault and nobody else's. The behaviour risk is nil (no caller); the build risk is the whole of it. high Windows: VERIFIED (CI: build, test_ww3d2.) Build ww3d2 on Windows. That is the entire verification and it is sufficient: if it compiles and links, this row closes, because no call site reaches any of it. Do this before PR2, which is the first pull request that calls into it.
2026-09-22 D1 PR1 dx11runtime.h, dx11backend.h, dx8wrapper.cpp, dx11device.h, ffprobe.h, ffshader.h, d3dx9math.h, d3dx9runtime.h, d3d8shadertranslate.h, test_dx9_smoke.cpp, W3DDisplay.cpp, dx11-check.ps1 Comments only. The three stale "236 places" claims now carry the 2026-09-22 measurement and the measurement from a call-site survey; the ten RENDERER-ROADMAP.md citations are replaced with plain descriptions, because that file has never existed in this repository on any branch or in any commit. None — no token outside a comment changed in any of these files, and dx11-check.ps1 does not run on macOS anyway. Listed so the diff's size is not mistaken for a code change. low Windows: nothing to verify (comments only.) Read the diff.
2026-09-22 A1 Libraries/Source/WWVegas/WWDebug/wwdebug.h #include "..\..\..\..\gameengine\include\common\debug.h" became #include "../../../../GameEngine/Include/Common/Debug.h". Same file, forward slashes, and the capitalisation that is actually on disk. MSVC accepts either separator and is case-insensitive, so this should be inert. If the relative path were wrong it would be a missing-header error in every WWVegas translation unit, not a silent change. low Windows: VERIFIED (CI: build.) Any Windows build reaches this header from wwdebug.h; it either resolves or it does not.
2026-09-22 A2 GeneralsMD/Code/Tools/vendor.sh (new) A POSIX twin of vendor.ps1. No tracked file a Windows build reads was touched: vendor.ps1, build.bat and CMakeLists.txt are unchanged. The two scripts must drop identical trees, because a shared checkout (VM, network share) will have had both run in it. One divergence is known and unchecked: the GameSpy drop carries its own top-level .clang-format, .github/ and .gitignore, and vendor.sh copies them. Whether Copy-Item $source\* -Recurse -Force does the same decides whether the two trees match. low Windows: VERIFIED (the Windows VM and a Linux host: vendor.ps1's and vendor.sh's GameSpy drops hold the same 726 files, the SDK's .clang-format, .github/ and .gitignore included. The bytes differ in the nine files of vendor.sh's POSIX-only patches (gamespy-gsi-unix.patch, gamespy-strlwr-c-only.patch), and in the tracked .gitignore, which git checks out with CRLF there.) Run vendor.ps1 -Force and vendor.sh --force into two clean clones and diff -r Libraries/Source/GameSpy.
2026-09-22 A2 Libraries/Source/Compression/ZLib/zconf.h (vendored, not tracked) vendor.sh deletes zlib 1.1.4's #if !defined(MACOS) && !defined(TARGET_OS_MAC) guard around its Byte typedef, so the typedef is unconditional. vendor.ps1 does not, so the two scripts now leave different bytes in zconf.h. Neither name is ever defined on Windows, so MSVC took the typedef before and takes it after: the preprocessed output should be identical. If some MSVC build does define MACOS, it was silently relying on MacTypes.h supplying Byte, and it would now get zlib's instead - a redefinition, not a silent change. zlib upstream deleted this guard in 1.2.0. low Windows: VERIFIED (VM check: no MACOS among the compression target's definitions.) Vendor with vendor.sh, then build compression on Windows. Or just grep -rn MACOS the Windows build's compiler command lines and confirm nothing defines it.
2026-09-22 A3 build.sh (new), .gitignore A POSIX twin of build.bat, building into build-mac/. build.bat is unchanged; .gitignore gains build.local.sh and loses nothing (build-mac/ was already there from A1). build-mac/ and build64/ are meant to coexist in one checkout, which is the whole reason the tree is not called build64. Nobody has had both in one clone. If CMake or the Visual Studio generator objects to a second build tree, or if build.bat picks up something out of build-mac/, Windows builds break in a clone that has been built on a Mac. low Windows: OPEN (Left: build.sh and build.bat in one clone.) In one clone run build.sh then build.bat, then build.sh again, and check both trees still build.
2026-09-22 B8 GeneralsMD/Code/GameEngine/Source/Common/System/JobSystem.cpp The whole pool changed primitive. CreateThread/WaitForSingleObject/CloseHandle became std::thread; CreateSemaphore + ReleaseSemaphore(N) became an Int permit count under a std::mutex with a std::condition_variable predicate wait; the auto-reset CreateEvent became a second condition variable over s_workersBusy == 0; InterlockedExchangeAdd/InterlockedIncrement over volatile LONG became std::atomic<Int>; __declspec(thread) became thread_local; GetSystemInfo().dwNumberOfProcessors became std::thread::hardware_concurrency(). The public interface and all five consumers are untouched. The two wakeups are where this breaks if it breaks, and it breaks as a hang, not a wrong answer. If the permit count does not store a wakeup for a worker that has not yet reached the wait, s_workersBusy never reaches zero and parallel_for never returns — the game freezes on the first particle update, on that machine, with no log line. The identical failure on the join side returns early instead, which is worse: the caller reuses output buffers while a worker is still writing them, and the symptom is intermittent particle corruption a long way from the cause. high Windows: PARTLY VERIFIED (CI: test_gameengine (the parallel_for cases), E1. Left: -jobthreads 0 against the default over one scene.) ctest -R parallel_for on Windows, and specifically parallel_for_covers_forks_back_to_back_and_forks_after_a_pause — 2000 back-to-back forks, which is the test that fails if either wakeup is wrong. It hangs rather than failing, so run it under a timeout. Then play a mission with heavy particle work and confirm -jobthreads 0 and the default give the same picture.
2026-09-22 B8 GeneralsMD/Code/GameEngine/Source/Common/System/JobSystem.cpp s_nextIndex's chunk claim is fetch_add(..., std::memory_order_relaxed). InterlockedExchangeAdd was a full barrier. This is the only ordering in the file that came out weaker than Win32's, so it is the one to look at if jobs produce wrong output rather than hanging. It is sound as written — RMW on one atomic is totally ordered whatever the order asked for, so no index is claimed twice, and the job's inputs and outputs are ordered by the permit handover and the join respectively. It relies on JobSystem.h's rule 3, that an item writes only its own slot. A caller that breaks rule 3 was racy before too, but the barrier was hiding it on x86. medium Windows: PARTLY VERIFIED (CI: test_gameengine, E1. Left: the lock xadd disassembly.) x86-64 gives lock xadd for a relaxed fetch_add anyway, so MSVC/x64 codegen should be unchanged — check that first, and it likely closes the question. Otherwise, the particle output is the observable: -jobthreads 0 versus the default over the same scene.
2026-09-22 B8 GeneralsMD/Code/GameEngine/Source/Common/System/JobSystem.cpp shutdown() no longer does WaitForSingleObject(thread, 5000) per worker. std::thread has no timed join, so it waits once on the workers' own exit count with wait_for(5s) and detach()es any straggler instead of leaking a HANDLE. It also no longer destroys the sync objects, where the Win32 version called CloseHandle on a semaphore a stuck worker could still be parked on. Both paths should be unreachable — there is no work in flight at shutdown by construction. If the timeout is somehow hit on Windows, the old code leaked a handle and the new code leaks a thread; the new one is the safer of the two, because the object that thread is waiting on now outlives shutdown(). low Windows: VERIFIED (CI: test_gameengine; generals.exe exits at the end of every E1 run.) ctest -R the_pool_survives_being_started_and_stopped_repeatedly, and confirm generals.exe exits rather than lingering in Task Manager after a normal quit.
2026-09-22 B8 GeneralsMD/Code/GameEngine/Source/Common/System/JobSystem.cpp init()'s "could not create sync objects, running single threaded" fallback is deleted along with its DEBUG_LOG. A std::mutex and std::condition_variable with static storage duration cannot fail to exist. Thread creation failure is still tolerated — std::thread's std::system_error is caught and the pool keeps whatever workers it got, which is what CreateThread returning NULL did. If MSVC's std::thread constructor reports a failure some other way than std::system_error, the exception escapes init() and takes the process down at startup instead of quietly running with a smaller pool. The standard requires system_error, so this is a conformance question, not a design one. medium Windows: VERIFIED (VM check: MSVC 14.44's <thread> reports a failed start through _Throw_Cpp_error(_RESOURCE_UNAVAILABLE_TRY_AGAIN), which throws std::system_error.) Hard to provoke deliberately. Reading the <thread> implementation for the MSVC version in use settles it faster than trying to exhaust thread handles.
2026-09-22 B8 GeneralsMD/Code/Tests/test_gameengine.cpp The JobSystem test helpers only: volatile LONG + InterlockedExchange became std::atomic<Int>, GetTickCount/Sleep became std::chrono::steady_clock/std::this_thread::sleep_for. No assertion changed. Sleep(0) yields only to a ready thread of equal priority on Windows; std::this_thread::yield() is the same intent but not the same guarantee. If the spin in jobTestWaitForAWorker no longer lets a worker in, a_job_computes_floats_the_way_the_game_does fails its ranOnAWorker > 0 check — loudly, and as a test failure rather than a shipped bug. low Windows: VERIFIED (CI: test_gameengine.) ctest -R a_job_computes_floats on Windows.
2026-09-22 B7 Tests/test_w3dlayout.cpp, CMakeLists.txt New header-only test pinning sizeof/offsetof for 28 .w3d structs, plus one add_lib_test(test_w3dlayout). No existing target or flag touched. The asserted numbers are clang measurements with long forced to 32 bits, which reproduces the Windows layout by construction but is not MSVC. If MSVC lays any of these 28 structs out differently, test_w3dlayout fails to compile there. That is the benign direction — a loud compile error, not a misread file — but it lands on someone else's machine. low Windows: VERIFIED (CI: test_w3dlayout.) Build test_w3dlayout on Windows and run ctest -R test_w3dlayout. A green build IS the verification; there is nothing else to check.
2026-09-22 B13 GameEngine/Include/Common/AsciiString.h, Source/Common/System/AsciiString.cpp m_refCount becomes std::atomic<unsigned short> — still 16 bits, so sizeof(AsciiStringData) and every offset in it are unchanged (verified on arm64 and x86-64, debug and release layouts). The four InterlockedIncrement/Decrement((long *)&…) calls become fetch_add/fetch_sub, and #include "windows.h" leaves the header. AsciiString's public interface is untouched. This is the string class and it is in almost every translation unit. The layout claim is the one to check first: if sizeof(AsciiStringData) moved on MSVC, every pooled string allocation changes size and MemoryInit.ini's block sizes no longer match what the code asks for. It would not be subtle, but it would be everywhere at once. Second: m_refCount is read by validate() under _DEBUG/_INTERNAL, which is a configuration nobody here can build. high Windows: PARTLY VERIFIED (CI: build, ctest, E1. Left: the sizeof(AsciiStringData) check, and an _INTERNAL build.) static_assert(sizeof(AsciiStringData) == 4) in a Release build and == 16 in Debug, or just sizeof printed once at startup. Then ctest — every suite constructs strings. Build the _INTERNAL configuration specifically, since it is the one that compiles validate().
2026-09-22 B13 GameEngine/Include/Common/AsciiString.h A behaviour change, deliberate, and the only one in this task. releaseBuffer() and set(const AsciiString&) used to decrement the refcount and then re-read m_refCount as a separate load to decide whether to free. They now use the value fetch_sub returns. The old shape is a double-free: two threads dropping the last two references can both observe zero and both call freeBytes(). Reproduced here with AddressSanitizer — it presents as a heap-use-after-free, because the re-read itself touches the block another thread has already freed. On a single thread the two shapes are identical, so this only differs under the exact race the interlocked calls exist to handle. I judged that preserving a known double-free to keep the diff behaviour-free was the wrong trade; say if you disagree and it is a two-line revert. high Windows: argued, not run (no run can show it; the argument stands.) Not reproducible on demand — it needs two threads releasing the last two references of one string simultaneously. The argument is the evidence: fetch_sub returns the pre-decrement value, so exactly one caller sees 1.
2026-09-22 B13 GameEngine/Include/Common/AsciiString.h Memory ordering is now explicit where Interlocked* was a full barrier on every operation: relaxed on the increment, acq_rel on the decrement. The increment is relaxed because the caller already holds a reference, so the buffer cannot die underneath it and nothing is being published — this is what every standard library does for a shared_ptr use count. The decrement must be acq_rel or the release can run before another thread's last write to the buffer is visible. If the increment analysis is wrong the symptom is a use-after-free far from the cause, which is why it is written out at the call site rather than left as a constant. On x86-64 both compile to lock-prefixed instructions regardless, so MSVC codegen should be unchanged. medium Windows: PARTLY VERIFIED (CI: ctest, E1. Left: the lock xadd disassembly.) Compare the Release disassembly of AsciiString's copy constructor before and after; on x86-64 it should still be a lock xadd.
2026-09-22 B13 GameEngine/Source/Common/System/AsciiString.cpp newData->m_refCount = 1 becomes a placement-new. allocateBytesDoNotZero returns raw bytes that are cast to AsciiStringData and no constructor has ever run for it, so a std::atomic member needs its lifetime started explicitly. It compiles to the same 16-bit store, so this is an object-model correction rather than a codegen one. If MSVC's std::atomic<unsigned short> constructor is not trivial in the way assumed, this is where it would show — as a stray store, not a failure. low Windows: PARTLY VERIFIED (CI: ctest, E1. Left: the disassembly's single 16-bit store.) Confirm the Release disassembly of ensureUniqueBufferOfSize still has a single 16-bit store of 1.
2026-09-22 B1 GameEngine/Source/Common/System/WideCharFns.cpp (new) A new .cpp under GameEngine/Source, which file(GLOB_RECURSE) adds to gameengine on every platform. Its Windows branch calls wcslen, wcscpy, wcscat, wcsncpy, wcscmp, wcsncmp, wcschr, wcsrchr, wcsstr, wcsspn, wcscspn, _vsnwprintf, vswscanf and fwprintf through a reinterpret_cast. It has never been through MSVC. vswscanf in particular is UCRT-only (VS2015+) and was never called from this tree before. If any spelling is wrong the whole library fails to build. high Windows: VERIFIED (CI: build.) Build gameengine. It compiles or it does not.
2026-09-22 B1 Libraries/Include/Lib/WideCharFns.h (new), GameEngine/Include/Common/Language.h Language.h now #includes Lib/WideCharFns.h, and its twenty Game* macros name the new functions instead of the CRT. Seven macros with no exact shim (GameSprintf, GameVsprintf, GameSscanf, GameStrtok, GameAtoi, GameAtod, GameItoa) were removed rather than repointed; none had a caller. Language.h is included widely and the new header pulls in Lib/BaseType.h, <stdarg.h> and <stdio.h>. An include-order collision with PreRTS.h/windows.h would surface in unrelated files, not in this one. A removed macro with a caller outside the three trees surveyed would be an undefined identifier. medium Windows: VERIFIED (CI: build.) Build gameengine; the failures, if any, are in the files that include Language.h.
2026-09-22 B1 GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp (via Language.h) GameIsAscii was iswascii; it is now WideCharIsAscii, spelled out as c >= 0 && c < 128 because iswascii is not in the standard headers off Windows. GameIsDigit/GameIsAlNum/GameIsAlpha still forward to the CRT unchanged. iswascii is ((unsigned)(c) < 0x80), which agrees with the new body on every input including negatives - checked by reading it, not by running it. The three callers (GadgetTextEntry.cpp:121,126,131) all test == 0, so returning 1 rather than some other non-zero cannot matter. low Windows: OPEN (Left: the five winIsAscii values.) winIsAscii of -1, 0, 127, 128, 0x0130: expect 0, non-zero, non-zero, 0, 0.
2026-09-22 B1 GameEngine/Source/Common/Recorder.cpp Three fwprintf(m_file, L"%ws", s) in the replay header became WideCharFileWrite(m_file, s), which on Windows is fwprintf(f, L"%ls", s). The replay file format. %ws and %ls are both "wide string" inside a wide format under MSVC, so the bytes should be identical - read off the documentation, not observed. If they are not, every replay this build writes is unreadable by the shipped one, and RecorderClass::readUnicodeString's fgetwc loop is what would notice. high Windows: VERIFIED (W2: a replay recorded on Windows plays back on Linux, and macOS and Linux replays play back on Windows, with no mismatch.) Record a replay on Windows, compare the bytes after GENREP with one recorded before this change, then run replay-check.ps1.
2026-09-22 B1 GameEngine/Source/Common/System/UnicodeString.cpp, GameEngine/Source/GameClient/InGameUI.cpp The five _vsnwprintf calls became WideCharFormatV, which on Windows is _vsnwprintf with the same arguments behind one function call. Nothing should change; the Windows branch is the same call. If the funnel's truncation contract is wrong, two sites throw ERROR_OUT_OF_MEMORY where they used to succeed and three log a truncation that did not happen. medium Windows: PARTLY VERIFIED (W2 measured _vsnwprintf and the funnel follows it; CI: widechar_format_selfcheck. Left: the 2048 and 2047 characters through UnicodeString::format.) Format a string longer than MAX_FORMAT_BUF_LEN (2048) and one exactly 2047 long: expect a throw for the first and a clean result for the second.
2026-09-22 B1 GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp Two swscanf calls became WideCharScan, which on Windows is vswscanf with the same format string. swscanf and vswscanf should parse identically. If not, the direct-connect box stops accepting a typed address - a Windows-only feature failing silently, because the caller only checks that it got four fields. medium Windows: OPEN (Left: an address typed into Direct Connect.) Type 192.0.2.7:8088 into Network > Direct Connect and confirm the entry is kept.
2026-09-22 B1 Tests/test_widechar_width.inc (new), Tests/test_gameengine.cpp Four new tests: sizeof(WideChar) == 2, an XferSave/XferLoad round trip of Turkish text, the saved file's byte count, and the XferCRC of that string against 0x25265B36. The constant was derived twice - by hand from XferCRC::addCRC/xferImplementation, and by compiling those two functions standalone under clang - but never by running this test, on either platform. If it is wrong the test is red on Windows from the day it lands. medium Windows: VERIFIED (CI: test_gameengine.) ctest -C Release -R test_gameengine. A failure prints the value it got; if that is stable across runs, the constant is what is wrong.
2026-09-22 B1 30 files across GameEngine (list in the commit) 70 %ls/%ws in narrow format strings became %s with the argument wrapped in WideCharAsUtf8(...). Nothing else in those statements changed. The bytes in DebugLogFile.txt change on Windows for non-ASCII text. %ls converted through the process ANSI codepage; this writes UTF-8. That is the file players send back with a bug report, so a German or Turkish player name now reads as UTF-8 in a viewer expecting CP1252. It is an improvement - today a name outside the codepage is rendered ? - but it is a change, not a no-op. low Windows: OPEN (Left: a DebugLogFile.txt with a non-ASCII player name.) Open a DebugLogFile.txt from a Windows run with a non-ASCII player name in it and confirm the name is legible as UTF-8.
2026-09-22 B1 GameEngine/Source/Common/StatsCollector.cpp:345, GameEngine/Source/Common/Recorder.cpp:1582 Two of those 70 are not logs: both build a file name (m_statsFileName, and the auto-saved replay's name) out of %ls of each human player's name. The file on disk gets a different name for a non-ASCII player name - UTF-8 bytes rather than ANSI. No path-illegal byte is introduced, because every byte of a UTF-8 sequence is >= 0x80 and none of Windows' reserved characters are. If anything this is a fix: %ls rendered an unmappable character as ?, which is illegal in a Windows filename, so those saves could have failed to open at all. Reasoned, not observed. medium Windows: OPEN (Left: a non-ASCII player name's replay and stats file.) Set a player name with a character outside the system codepage, finish a skirmish, and confirm the replay file is written and appears in the replay menu.
2026-09-22 B1 GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp:4874 DEBUG_LOG(("%ls\n", msg.str())) where msg is an AsciiString. The format became %s; the argument is untouched and is not wrapped. A pre-existing defect, not a port change: it has always handed a char* to a wchar_t* conversion. On Windows it printed rubbish or walked off the end of the string. Fixing it changes what that one debug line prints - from garbage to the intended text - which is a behaviour change even though it is plainly the right one. low Windows: OPEN (Left: the object-geometry debug command.) Trigger the object-geometry debug command and confirm the line reads as the extent message rather than as noise.
2026-09-22 B1 Libraries/Include/Lib/WideCharFns.h, GameEngine/Source/Common/System/WideCharFns.cpp Added WideCharToUtf8 and the WideCharAsUtf8 value wrapper, the latter a class with a 1024-byte member defined in the header and constructed as a temporary at 70 call sites. Never compiled by MSVC. The wrapper is non-copyable by design; if any call site were to need a copy it would fail to build there rather than silently. Its buffer is on the stack on purpose - it is reached from DEBUG_CRASH, from the crash handler and from CRCDEBUG_LOG inside the simulation loop, where taking the allocator is how a diagnostic becomes a second crash. medium Windows: VERIFIED (CI: build, test_gameengine (the width tests)) Build gameengine. The encoder itself is covered by two tests in test_widechar_width.inc.
2026-09-22 B11 GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h CRITICAL_SECTION m_windowsCriticalSection became std::recursive_mutex m_mutex; InitializeCriticalSection/DeleteCriticalSection disappear into the member's own lifetime, and EnterCriticalSection/LeaveCriticalSection become lock()/unlock(). CriticalSection and ScopedCriticalSection keep their names, their members' meaning and their virtual destructors. recursive_mutex is load-bearing and a future tidy-up must not "simplify" it to std::mutex. UnicodeString::set(const UnicodeString&) takes the lock at UnicodeString.cpp:157 and calls releaseBuffer() at :162, which takes the same lock at :130, in the ordinary &stringSrc != this branch. A CRITICAL_SECTION is recursive so this has always been well-defined; std::mutex is not, and it deadlocks on the first such call rather than intermittently. high Windows: VERIFIED (CI: ctest.) ctest on Windows exercises UnicodeString::set everywhere, so a wrong choice here does not reach a subtle failure — the test binary stops. The narrower check: set a breakpoint on CriticalSection::enter and confirm a re-entrant acquire on the Unicode lock still returns.
2026-09-22 B11 GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h CriticalSection is now non-copyable, because std::recursive_mutex is. It was copyable before, in the sense that MSVC would generate a copy that duplicated the CRITICAL_SECTION struct — which would have been a bug had anyone used it. Nothing in the tree copies one: all five instances are static CriticalSection critSec1..5 in WinMain.cpp:995 plus one local in test_gameengine.cpp:10082, and every consumer holds a CriticalSection *. If some Windows-only file does copy one, it is now a compile error rather than a silently broken lock — the good direction, but it stops the build. low Windows: VERIFIED (CI: build.) The Windows build either compiles or names the file.
2026-09-22 B11 GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h, Source/Common/System/CriticalSection.cpp extern FastCriticalSectionClass TheAsciiStringCriticalSection and its definition are deleted, and with them the #include "mutex.h" that only it needed. The symbol is dead: its three uses in AsciiString.h (:378, :389, :450) are all commented out, nothing else in the tree names it, and WinMain.cpp never assigned it — critSec1 at WinMain.cpp:995 is declared and never used, which is the same vestige. If some Windows-only translation unit was relying on CriticalSection.h to drag in mutex.h for FastCriticalSectionClass, it now fails to compile and needs its own include. medium Windows: VERIFIED (CI: build.) Grep a Windows build log for FastCriticalSectionClass errors. Tests/test_wwlib.cpp uses the class heavily but includes the WWVegas headers directly, so it is unaffected.
2026-09-22 B11 GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h The #ifdef PERF_TIMERS blocks are kept verbatim in all four members, including the two in the constructor and destructor that no longer wrap a Win32 call and now time nothing. PERF_TIMERS is never defined — PerfTimer.h:39 and :41 define NO_PERF_TIMERS in both branches — so this is dead code on both platforms and was before. Kept rather than deleted so that a developer who switches it on locally, which the comment there invites, gets the same shape they had. low Windows: OPEN (Left: a build with PERF_TIMERS defined.) Define PERF_TIMERS locally and confirm it still compiles.
2026-09-22 B5 GeneralsMD/Code/Libraries/Include/Lib/BaseType.h The _AMD64_ define and #include <windef.h> are now inside #if defined(_WIN32). #undef BitTest and the four Bit* macros stay unguarded. Separately, #include <emmintrin.h> moved out of that block to sit beside its only user, fast_float2long_round, guarded on x86 — the header #errors outright on arm64. The windef.h include exists only to close winnt.h's include guard before winnt.h can claim BitTest for the _bittest intrinsic, and the comment above it says so. On Windows the guard is true, the include still happens first, and the #undef still runs, so the fight is resolved exactly as before. If the guard were somehow false on Windows, BitTest would be silently rewritten into an intrinsic taking a LONG* and the game's bit fields would stop compiling — loudly, not subtly. The emmintrin.h move is the riskier half: it is now included later in the file than it was, so anything between the old and new positions that wanted an SSE2 intrinsic would break. Nothing between them does. medium Windows: PARTLY VERIFIED (CI: build. Left: the cvtss2si disassembly.) Build on Windows; BitTest misuse is a compile error, not a runtime one. Confirm fast_float2long_round still emits cvtss2si in a Release disassembly.
2026-09-22 B2 87 files across GameEngine, GameEngineDevice and Libraries/Source/WWVegas 462 mechanical substitutions by script, then eight files by hand: timeGetTime→Clock_Milliseconds, GetTickCount→Clock_Milliseconds_Coarse, QueryPerformanceCounter(&x)→x = Clock_Ticks(), QueryPerformanceFrequency(&x)→x = Clock_Ticks_Per_Second(), timeBeginPeriod/EndPeriod(1)→Clock_Begin/End_Fine_Resolution(). Every one of them forwards to exactly the Windows call it replaced. On Windows each function is a one-line forward, so behaviour cannot shift — but 462 edits cannot all be eyeballed and none of them has been compiled by any compiler: gameengine is gated out of the macOS build until B6. The realistic failure is a type mismatch the script created, not a behaviour change. Four were found and fixed by an automated type audit (two LARGE_INTEGER locals in W3DWater.cpp, two in W3DWaterTracks.cpp, which now hold long long); the audit found none left. high Windows: VERIFIED (CI: build, ctest.) Build on Windows. A mismatch is a compile error, not a wrong number. Then run ctest — the timing-sensitive suites are the ones to watch, and nothing should move.
2026-09-22 B2 GameEngine/Include/Common/PerfTimer.h, GameEngine/Source/Common/PerfTimer.cpp GetPrecisionTimer's __asm RDTSC block became *t = Clock_Ticks(), and InitPrecisionTimer's TSC-against-QPC calibration was deleted in favour of Clock_Ticks_Per_Second(). This is a real behaviour change in any build that defines PERF_TIMERS or DUMP_PERF_STATS: the timers now count performance-counter ticks rather than CPU cycles, and startup no longer spends 60ms measuring the ratio. The numbers a PerfGather scope reports change units — same durations, different tick rate, and GetPrecisionTimerTicksPerSec changes with them, so anything dividing one by the other is unaffected. Anything that hard-codes a cycle count is not; nothing in the tree appeared to. There is no working Windows behaviour being replaced: those configurations do not compile today (see the standing item below), so this cannot be a regression against something that ran. medium Windows: OPEN (Left: a -DPERF_TIMERS=ON build that runs.) Configure with -DPERF_TIMERS=ON on Windows, which is currently a compile failure and should become a build that runs. Compare a PerfGather dump against… nothing, because there is nothing to compare against; sanity-check that the milliseconds are plausible.
2026-09-22 B2 GeneralsMD/Code/CMakeLists.txt One line: include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Libraries/Include) near the top, so the thirteen targets that now read Lib/Clock.h can find it without naming each one. An extra /I on every target in the directory. It carries no define and changes no struct, so the failure mode the file's own warning is about does not apply. If it were somehow wrong, the result is a missing-header error in the first affected library, not a silent difference. low Windows: VERIFIED (CI: build.) Configure on Windows; if Lib/Clock.h resolves in ww3d2, it resolves everywhere.
2026-09-22 B5 Libraries/Source/WWVegas/WWLib/win.h #include <windows.h> at :62 is now inside #if defined(_WIN32). Nothing else in the file changed — the #pragma warning(push, 3)/(pop) pair around it is already _MSC_VER-guarded, and the #ifdef _WINDOWS block at :72 that declares ProgramInstance, MainWindow and Print_Win32Error is untouched. This header's entire job is to include <windows.h> with the warning level turned down, so on Windows the guard is true and it still does exactly that. If the guard were somehow false on Windows, 32 consumers lose every Win32 type at once — it would not be subtle. The #else branch of the _WINDOWS block has existed since Westwood wrote it and has never been reachable; it is now. low Windows: VERIFIED (CI: build.) Any Windows build reaches this from wwstring.h; it resolves or it does not.
2026-09-22 B5 Libraries/Source/WWVegas/WWLib/FastAllocator.h #include <malloc.h> became #if defined(_WIN32) #include <malloc.h> #else #include <stdlib.h> #endif. The Windows branch is byte-identical on purpose. Nothing in this header uses a malloc.h-only entry point — StackAllocator is new/delete over a stack buffer — but a consumer could be leaning on this header to supply _msize or _alloca transitively, and there is no way to check that from a machine that cannot compile the Windows include graph. Keeping the include on Windows costs nothing and removes the question. low Windows: VERIFIED (CI: build.) If a consumer was relying on it, the Windows build names the file and the symbol.
2026-09-22 B14 WWLib/mutex.{h,cpp}, WWLib/thread.{h,cpp}, WWLib/critsection.{h,cpp}, WWLib/wwmouse.{h,cpp}, WWDebug/wwmemlog.cpp, profile/internal.h Every Win32 threading primitive in WWVegas became a standard-library one: CRITICAL_SECTION ×3 → std::recursive_mutex/std::mutex, the Win32 mutex → std::recursive_timed_mutex, three copies of the _interlockedbittestandset spin → std::atomic_flag, _beginthread → std::thread, two Interlocked pairs → std::atomic<long>. No interface moved and no consumer was edited. This is the same class of change B8 made, and the same size of risk. On Windows the locks stop being kernel/user hybrid primitives tuned by Microsoft and become libc++/MSVC-STL ones. Correctness should be identical — the recursion, the timeout and the poll semantics were each mapped deliberately and each is covered by a test — but the timing is not guaranteed identical, and FastCriticalSectionClass backs StringClass, WideStringClass, FastAllocator and mempool, which is every allocation and every string operation in WWVegas. high Windows: PARTLY VERIFIED (CI: build, test_wwlib. Left: the frame-time comparison.) Build on Windows and run ctest, which now includes seven new test_wwlib cases covering the properties that were mapped. Then measure: a frame time comparison before and after on the same scene is the only thing that will show a lock that became slower rather than wrong.
2026-09-22 B14 WWLib/thread.h ThreadClass::running changed from volatile bool to std::atomic<bool>. Fixes a real race rather than causing one, but it is still a behaviour change on Windows. MSVC's default /volatile:ms gave the old member acquire/release semantics, so Windows was accidentally correct; the atomic makes that explicit and costs nothing MSVC was not already emitting. If anything depended on the old member being assignable from a BOOL or taking its address, it would not compile rather than misbehave — nothing does. low Windows: VERIFIED (CI: build.) It either compiles or it does not. ThreadSanitizer reported the old form as a race on macOS and reports the new one clean.
2026-09-22 B14 WWLib/thread.cpp ThreadClass::Stop(ms) no longer calls TerminateThread when its timeout expires. It returns with the thread still running, and ~ThreadClass joins it. The one behaviour change here that a Windows user could see. Before: a thread that would not exit was killed, the shutdown continued, and any lock it held stayed locked forever. Now: shutdown blocks in the destructor until the thread returns. A thread that never returns hangs the quit instead of corrupting it. The one consumer where this was ever reached — TextureLoader::Deinit — had its lock ordering fixed already, and its regression test still passes. medium Windows: PARTLY VERIFIED (CI: test_wwlib (the stop timeout). Left: quitting during a texture load.) On Windows, quit the game repeatedly with a texture load in flight and confirm it exits. test_wwlib's threadclass_stop_deadlocks_if_the_caller_holds_the_workers_lock covers the timeout path itself.
2026-09-22 B14 WWLib/thread.cpp ThreadClass::Switch_Thread was WaitForSingleObject on a process-global event nothing ever signalled, timeout 1; it is sleep_for(1ms). The global HANDLE test_event is gone. Same wait, one fewer kernel object. If a Windows sleep_for(1ms) rounds differently from a 1ms WaitForSingleObject, the spin backoff for FastCriticalSectionClass changes length — and that lock is on the allocator's path. Measured on macOS: a contended acquire took 11ms to 11.4s depending on load, which is what a 1ms backoff costs and is not new. medium Windows: PARTLY VERIFIED (CI: ctest, E1. Left: the frame-time comparison.) The frame-time comparison in the first row covers this; it is the most likely thing to show up there.
2026-09-25 B17 WW3D2/d3dx9math.h, new WW3D2/d3dxportable.h d3dx9math.h's existing text is now inside #if defined(_WIN32), byte for byte (the diff is 99 additions and 0 deletions). A new #else branch declares D3DXVECTOR4, D3DXMATRIX, D3DXVec4Transform and D3DXVec4Dot without d3d9.h, and forwards the two functions to d3dxportable.h. At the time, Windows still bound D3DXVec4Transform out of d3dx9_43.dll and only non-Windows builds used the reimplementation. Superseded by the 2026-09-25 Windows row below, which routes Windows through it too. This is CRC-path arithmetic, and it was verified against one architecture and not against the DLL it replaces as a Windows process runs it. What was verified: d3dxportable.h built for x86_64 is bit-identical to Microsoft's own scalar and non-Intel SSE bodies of d3dx9_43.dll 9.29.952.3111 x64, which Tests/d3dx_oracle runs under Rosetta over 1,000,000 inputs and the 15 rows of Tests/d3dx_golden.h; and E3 shows the arm64 build agreeing with the x86_64 build over the same sweep (fingerprint 0x18b774e8 in both). What was NOT verified: (1) which body a Windows process gets, which was read out of the DLL's dispatch code and never observed; (2) that a Mac matches Intel Windows machines — it deliberately does not. The DLL sums pairwise on GenuineIntel, and on lane x of the Bezier basis that differs on 36-45% of inputs (port defect 7); (3) the NaN that inf*0 generates, which is 0x7FC00000 on arm64 and 0xFFC00000 on x86 (recorded in known_differences.txt); (4) MXCSR flush-to-zero/denormals-are-zero in a running game. The Windows-side risk of the edit itself is only that some Windows configuration fails to define _WIN32 and gets the portable branch; MSVC always defines it, and mingw-w64's front end takes the Windows branch cleanly. high Windows: PARTLY VERIFIED (dx9_smoke on the VM (GenuineIntel): "D3DXVec4Transform ran the GenuineIntel pairwise body", and every dumped row equals d3dx_golden.h, lane x from its intel_x column. Left: an AMD machine, and a replay recorded on one.) E1: run dx9_smoke on one GenuineIntel and one AMD Windows machine. Its d3dx9 capture lines must name the pairwise body on Intel and the left-to-right body on AMD, and every dumped row must equal d3dx_golden.h. Then take a replay with artillery fire recorded on an AMD Windows machine and check a Mac build reproduces its CRC. Replays recorded on Intel machines before the Windows row below are expected to diverge.
2026-09-25 B17 WW3D2/test_dx9_smoke.cpp, CMakeLists.txt (dx9_smoke include path) dx9_smoke gained a block after its existing basis-transform check. It reads the CPUID vendor with __cpuid, runs the 15 d3dx_golden.h rows through the real D3DXVec4Transform, prints every result and which DLL body produced it, and fails only if the result matches neither body. The block has never been compiled by MSVC. x86_64-w64-mingw32-g++ -fsyntax-only accepts it, and it accepts the untouched file too, so the check is a front end and not a build. A compile error here breaks dx9_smoke, which is a Windows-only test and not the game. medium Windows: VERIFIED (dx9_smoke on the VM prints the d3dx9 capture: lines and passes.) Build and run dx9_smoke on Windows; the new output starts with d3dx9 capture:.
2026-09-25 B17 Tests/test_d3dxportable.cpp, CMakeLists.txt (d3dxportable_selfcheck) A header-only self-check registered on every platform, like detround_selfcheck. On Windows it tests d3dxportable.h only; the d3dx9math.h part is #if !defined(_WIN32). Never compiled by MSVC; mingw-w64 accepts it with -Wall. It asserts IEEE bit patterns from + and * only, so an MSVC build fails it only if MSVC contracts or reassociates, and that is exactly what it is there to catch. low Windows: VERIFIED (CI: d3dxportable_selfcheck.) ctest -R d3dxportable_selfcheck on Windows.
2026-09-25 B17 (Windows flip) WW3D2/d3dx9math.h, WW3D2/d3dx9runtime.cpp, WW3D2/test_dx9_smoke.cpp, WW3D2/d3dxportable.h, Tests/test_d3dxportable.cpp, CHANGELOG.md Windows now computes the simulation's D3DX maths with d3dxportable.h, as macOS does. Decided 2026-09-25 (PORTING.md, decision 1). D3DXVec4Transform and D3DXVec4Dot are now one pair of inline functions after the platform split, on every platform. The DLL's transform is still bound by Bind_D3DX9_Runtime, but under the name D3DXVec4TransformFromDLL, which the SDK does not own, and only dx9_smoke calls it. The Windows branch's own copy of D3DXVec4Dot (d3dx8math.inl's expression) was removed; the shared one uses the same expression, term for term. No game source changed. The only callers are BezierSegment.cpp:112, BezFwdIterator.cpp:69-71 and dx9_smoke; nothing in the renderer calls either name. d3dxportable_selfcheck now also tests the d3dx9math.h names on Windows. This changes what a Windows game computes on the replay and network CRC path, deliberately. It is expected to be a no-op on any machine whose DLL ran the scalar or non-Intel body: Tests/d3dx_oracle measured d3dxportable.h bit-identical to both (0 of 1,000,000, Microsoft's bytes under Rosetta). On a GenuineIntel machine it changes lane x of the cubic coefficient on 46.8% of the oracle's inputs shaped like BezFwdIterator's (35.7% over all its basis inputs), so shells fly the same path everywhere, and replays recorded on Intel machines before this change may not play back. Everything here rests on a reading of the DLL's dispatch that has never been observed on Windows. If that reading is wrong the change is a no-op everywhere, which is why it could be decided without a Windows machine. Never compiled by MSVC. x86_64-w64-mingw32-g++ -std=c++17 -Wall -fsyntax-only accepts d3dx9math.h, d3dx9runtime.cpp, test_dx9_smoke.cpp, test_d3dxportable.cpp, and a BezFwdIterator-shaped TU. That TU static_asserts that D3DXVec4Transform and D3DXVec4Dot are functions and D3DXVec4TransformFromDLL is a pointer, i.e. each SDK name resolves once and not to the DLL. The same TU fails against the pre-flip header. Contraction: MSVC has no /arch flag here, so x64 is SSE2-only and there is no FMA to contract into. The fp contract(off) pragma in d3dxportable.h is clang-only, so if anyone adds /arch:AVX2, check MSVC's /fp:contract default for the toolset in use. Side effect: flying a shell no longer needs d3dx9_43.dll bound at all. high Windows: PARTLY VERIFIED (steps 1 to 3: CI (build, d3dxportable_selfcheck, dx9_smoke), and the capture above confirms the dispatch reading on Intel; step 5 on Intel: E1 equals macOS and Linux. Left: step 5 on an AMD machine.) 1. Build on Windows. 2. ctest -R d3dxportable_selfcheck passes; on Windows it now includes the d3dx9math.h names. 3. dx9_smoke passes. Read its d3dx9 capture: line: it names the CPU vendor and the body the DLL selected. That is the one observation that confirms or refutes the dispatch reading: GenuineIntel should report the pairwise body, anything else left-to-right. Its dumped rows must equal Tests/d3dx_golden.h. 4. d3dx_oracle is a macOS test (it runs the DLL under Rosetta) and does not run on Windows; dx9_smoke's capture is its Windows counterpart. Re-run it on a Mac with ZH_D3DX9_X64 set. 5. replay-check.ps1 on a replay with artillery fire, on an AMD machine and an Intel one: both must agree with each other and with a Mac build.
2026-09-22 vendored-predicate sweep Libraries/Source/Compression/EAC/gimex.h The ARGB channel-order #if gained a fourth arm — a __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ test — inserted after the existing _MSC_VER || __i386__ and __R5900 || SGI arms. None on Windows, and the diff is the proof rather than a claim: the change is purely additive apart from one #else comment, #if/#elif evaluate in order, and MSVC still matches the first arm. The preprocessor output on Windows is identical. On arm64 it changes a@0 r@1 g@2 b@3 to b@0 g@1 r@2 a@3, which is what MSVC has always had. Verified by compiling the header both ways and printing offsetof. Inert either way today — nothing in the built tree reads an ARGB. low Windows: VERIFIED (CI: build.) Compile anything that includes codex.h; if it builds, the arm MSVC takes is the arm it took before.
2026-09-25 B16 WWDebug/wwdebug.cpp, WWDebug/wwdebug.h <windows.h>, GetLastError, FormatMessage, the no-handler assert dialog (Is_Trying_To_Exit, ExitProcess, MessageBoxA, __debugbreak) and the DBWIN32 handler and its declaration are behind #ifdef _WIN32; the other side is errno/strerror_r and stderr + SIGABRT. #include "except.h" became "Except.h", the spelling on disk. Intended to be a no-op on Windows. Checked on macOS without a Windows compiler, a method anyone can repeat: put an empty file for every header the source includes in one stub directory; clang -x c++ -E -P -nostdinc -D_WIN32 -DWIN32 -D_MSC_VER=1900 [-DWWDEBUG] -I<stubs> over git show HEAD:<file> and over the working copy; squeeze whitespace; cmp. Run a control too: the same without -D_WIN32 must differ, or the check is blind. Here: identical in both WWDEBUG states, control differs, and MessageBoxA, FormatMessage, GetLastError, __debugbreak, CreateFileMapping and Is_Trying_To_Exit are all still in the Windows stream. That check cannot see the real SDK headers - if some SDK header on the include path undefined _WIN32, the Windows build would take the POSIX branches and fail to compile on strerror_r. Loud, not silent. The Except.h case change relies on NTFS being case-insensitive. low Windows: VERIFIED (CI: build.) Build wwdebug on Windows. For the stronger check, cl /P old and new wwdebug.cpp and diff the .i files; they should be identical apart from #line directives.
2026-09-25 B16 WWDebug/wwprofile.h, WWDebug/wwprofile.cpp __int64/_int64 became int64_t (with <stdint.h>), per B3's direction. ::GetCurrentThreadId() became ThreadClass::_Get_Current_Thread_ID() at five sites, following B14's change to wwmemlog.cpp in the same library. Five StringClass objects passed to %s through varargs now pass .Peek_Buffer(). WWProfile_Get_Inv_Processor_Ticks_Per_Second and WWProfile_Get_Ticks gained a non-Windows branch on Lib/Clock.h; the WIN32 branches, __rdtsc and CPUDetectClass, are untouched. __int64 and long long are the same type on MSVC and MSVC's int64_t is long long, so unlike B10's uint32 this should not move type identity - but that is from documentation, not a compiler. _Get_Current_Thread_ID() returns GetCurrentThreadId() on Windows (thread.cpp:189), so the profiler's thread filter compares the same numbers, but through a call into wwlib instead of the SDK: wwdebug now needs thread.obj at link time wherever it pulls wwprofile.obj. The varargs change: MSVC copied the whole StringClass onto the stack and %s read its first word, which is m_Buffer, its only instance member - so the text printed is the same; the difference is that it is now defined behaviour. low Windows: PARTLY VERIFIED (CI: build. Left: a run with WWMemoryAndTimeLog.) Build wwdebug and link a consumer that uses WWProfileManager. Run anything with WWMemoryAndTimeLog on and check the log's indentation and names still print.
2026-09-25 B16 WWLib/systimer.h #include <windows.h> and #include "mmsys.h" are behind #ifdef _WIN32. B2 had already moved the body onto Clock_Milliseconds, so the header no longer uses either. None on Windows: the guard is true there and the preprocessed header is identical (checked the same way as the wwdebug.cpp row). They were kept on Windows rather than deleted because nine files include systimer.h, and any of them may be getting windows.h through it. low Windows: VERIFIED (CI: build.) Build wwlib on Windows.
2026-09-25 B16 WWMath/test_inverse.cpp, GeneralsMD/Code/CMakeLists.txt The self-check counts failures and returns 1 instead of assert(0), and checks the non-uniform-scale inverse against exact expected values. wwmath_selfcheck's link line lost its if(ZH_PLATFORM_WINDOWS): the Windows arguments, wwmath wwsaveload wwlib wwdebug in that order, are now used everywhere. The link line on Windows is the same arguments in the same order, so the command line should not move. The test can now fail on Windows where before it could not in Release: if MSVC's Get_Inverse is wrong it goes red, which is the point. The exact check expects diag(0.5, 2, 0.25) and translation (-0.5, -4, -0.75); every step is a power-of-two reciprocal or an exact product, so x64 SSE arithmetic gives exactly that, with or without contraction. If MSVC produced anything else, that would be a real defect in Matrix3x3::Inverse on Windows, not a test problem. low Windows: VERIFIED (CI: wwmath_selfcheck (Release)) ctest -R wwmath_selfcheck in a Release Windows build: exit 0, prints OK. To see it can fail, drop the - from inv_t in Matrix3D::Get_Inverse and confirm exit 1.
2026-09-25 B6 drops GeneralsMD/Code/CMakeLists.txt gameengine's link line: debuglib and dinput8 became ${ZH_GAMEENGINE_DEBUGLIB} and ${ZH_GAMEENGINE_DINPUT8}, set to those names inside if(ZH_PLATFORM_WINDOWS) and unset elsewhere. Intended to be the same list on Windows. Checked by running the old and new blocks through cmake -P with target_link_libraries replaced by a function that prints its arguments: with ZH_PLATFORM_WINDOWS TRUE the two lists are identical, item for item and in order; unset, exactly those two names drop (the control). The check evaluates the block alone, so it relies on nothing else setting those variables (grep: nothing does) and on ZH_PLATFORM_WINDOWS being TRUE on Windows, which CMakeLists.txt:11-12 sets from CMAKE_SYSTEM_NAME. If it were somehow false, gameenginedevice would lose dinput8 and fail to link on DirectInput8Create - loud. low Windows: VERIFIED (VM check: generals links debug.lib (debuglib), and dumpbin lists DINPUT8.dll.) Configure on Windows and confirm debuglib/dinput8 still appear on generals.exe's link line, e.g. in build/GeneralsMD.dir or with cmake --build . --target generals -- -v.
2026-09-25 B5 (wwlib) GeneralsMD/Code/CMakeLists.txt wwlib's source list moved verbatim into set(WWLIB_SOURCES ...), then add_library(wwlib ... ${WWLIB_SOURCES}). Under if(NOT ZH_PLATFORM_WINDOWS) fifteen Win32-only sources are list(REMOVE_ITEM)ed: DirectDraw (convert, ddraw, dsurface), _mono/mono, data, rcfile, msgloop, keyboard, LaunchWeb, WWCOMUtil, verchk, win, registry, srandom. On Windows the removal is never evaluated, so wwlib gets the same 82 sources in the same order. The only way this is wrong is if ZH_PLATFORM_WINDOWS were false on Windows, in which case those fifteen objects vanish and RegistryClass, MainWindow/ProgramInstance and the rest go unresolved at the exe link - loud, and named. low Windows: VERIFIED (VM check: wwlib.dir\Release\registry.obj is built.) Configure on Windows and diff the wwlib source list in the generated project against the list before this change, or confirm registry.cpp.obj is built.
2026-09-25 B5 (wwlib) WWLib/systimer.h, WWLib/refcount.cpp, WWLib/ini.cpp, WWLib/registry.h <windows.h> and mmsys.h in systimer.h, and <windows.h> in refcount.cpp, now sit inside #if defined(_WIN32). ini.cpp's OutputDebugString is inside the same guard with fputs(stderr) as the other arm. registry.h gained a #if !defined(_WIN32) #error. SysTimeClass::StartTime, WrapAdd and Get's local time went from unsigned long to unsigned int. The guards and the #error are not seen differently by a Windows build, since _WIN32 is the compiler's own. The width change is to private members and a local, and unsigned long is 32 bits on Windows, so the arithmetic is the same arithmetic; it is the B10 row's type-identity caveat in miniature, confined to three names nothing outside the class can see. low Windows: VERIFIED (CI: build.) Build wwlib, wwsaveload and wwdebug (wwprofile.cpp reaches systimer.h).
2026-09-25 B5 (wwlib) WWLib/RAWFILE.H, WWLib/rawfile.cpp Every #ifdef _UNIX ... #else <Win32> #endif became #if defined(_WIN32) <Win32> #else <POSIX> #endif, and the Win32 arms are textually unchanged. In shared code, Error(GetLastError(), ...) became Error(RAWFILE_LAST_ERROR(), ...), a macro that is GetLastError() on Windows, and int readok=TRUE;/int writeok=TRUE; lost initialisers that both arms overwrite before reading. Get_File_Handle gained a non-Windows twin. Set_Name's _UNIX arm is untouched. Windows preprocesses to the same tokens except for the two dropped =TRUEs, which are dead stores on that path, so this can only be wrong if _WIN32 is undefined in some Windows TU, and then nothing in RawFileClass would compile. low Windows: VERIFIED (CI: build, test_wwlib.) Build wwlib. Then ctest -R test_wwlib - see the next row.
2026-09-25 B5 (wwlib) Tests/test_wwlib.cpp Three RawFileClass tests against the real disk: READ|WRITE keeps the contents, Seek answers the new position, and Get_Date_Time returns packed DOS date/time in UTC (1000000000 → 0x2B290DD4, worked by hand). On Windows the file time is set with SetFileTime directly. <windows.h> is now included only on Windows. The tests encode two claims about Win32 that nobody here can check. (1) FileTimeToDosDateTime does not convert the UTC FILETIME to local time; the POSIX arm uses gmtime_r on that assumption. If it is wrong, the date test goes red on any Windows machine not on UTC, and the Mac and Windows builds stamp files differently by the zone offset. (2) DosDateTimeToFileTime refuses month 13 rather than normalising it. If that is wrong, one CHECK(!Set_Date_Time(...)) goes red. Neither is a build break. medium Windows: VERIFIED (CI: test_wwlib passes on the VM, whose zone is Pacific Standard Time (UTC-8), so claim (1) held.) ctest -R test_wwlib on a Windows machine set to a non-UTC zone. If (1) fails, the POSIX arm is what changes: switch Dos_Date_Time_Of to localtime_r, not the test.
2026-09-25 B5 follow-up (AUTO_POOL) WWLib/mempool.h (DEFINE_AUTO_POOL, ten users in WWLib, WWMath, WW3D2, WWAudio and W3DDevice), WWLib/int.cpp:48 template<> ObjectPoolClass<T,B> AutoPoolClass<T,B>::Allocator; became ...::Allocator{};, and template<> bignum bignum::Remainder; became ...::Remainder{};. Without an initializer an explicit specialization of a static data member is only a declaration, so clang emitted none of the three symbols the wwlib objects need, nor presumably the other eight pools. Behaviour: none intended. Both types have a user-provided, non-explicit, non-constexpr default constructor and no initializer_list constructor, so {} value-initializes by calling that constructor, as the bare form default-initialized by calling it. Zero-initialization of static storage happens first either way, and both remain dynamic initializers in the same place in their TU. Build: the bare form came in with an earlier port change (2026-09-22, which named WWLib's dependent base members the standard way; not on main) and has never been compiled by MSVC, so nobody knows whether Windows links today. If MSVC under /permissive treats the bare form as a definition, this changes nothing; if it treats it as a declaration, the Windows link has been broken since that change and this repairs it. The one way it hurts: MSVC rejecting brace-initialization of an explicitly specialized static member, which would be a loud compile error at mempool.h:175/int.cpp:52. high Windows: VERIFIED (CI: build, and generals.exe links.) Build wwlib, wwmath, ww3d2, WWAudio and gameengine; link generals.exe. dumpbin /symbols slnode.obj | findstr Allocator should list it in a SECT section, not as UNDEF.
2026-09-25 B19 WWLib/cpudetect.cpp, WWLib/cpudetect.h The x86 code now sits under CPUDETECT_X86, defined from _M_IX86 || _M_X64: <intrin.h>, Calculate_Processor_Speed, the timed half of Init_Processor_Speed, and CPUID's __cpuidex. <windows.h> is under _WIN32. ProcessorTicksPerSecond is defined as sint64, which the header already typedefs to signed __int64 on WIN32. OSVERSIONINFO os; moved inside Init_OS's #ifdef WIN32. Two SYSLOG lines that sat in identical WIN32 and _UNIX arms are now unconditional. Get_OS_Info's VER_PLATFORM_* cases are inside #ifdef WIN32. The CPUDetectInitClass:: qualifier on its own constructor is gone. Init_Memory()/Init_OS() moved from the last two lines inside if (Has_CPUID_Instruction()) to straight after it. Every one of these compiles to the same thing on Windows x64 only if _M_X64 is defined, and MSVC defines it for every x64 target. The reorder is behaviour-neutral because under CPUDETECT_X86 HasCPUIDInstruction is set true unconditionally, so the block always ran and the two calls still run last, in the same order. If CPUDETECT_X86 were somehow false on a Windows build, CPUID would read as absent, the CpuType would be XX, and GameLOD would pick its default preset through the benchmark stub instead of the CPU tables: a changed default detail level, not a crash. medium Windows: PARTLY VERIFIED (CI: test_wwlib. Left: the Processor_Log against one from before the change.) ctest -R test_wwlib on Windows. Its x86 arm asserts CPUID, RDTSC, MMX, SSE and a nonzero speed. Then compare the Processor_Log against one from a build before this change.
2026-09-25 B19 GeneralsMD/Code/CMakeLists.txt mpu.cpp joins wwlib's off-Windows REMOVE_ITEM list. Not evaluated on Windows, so wwlib still compiles all 82. low Windows: VERIFIED (VM check: wwlib.dir\Release\mpu.obj is built.) As the B5 CMake row.
2026-09-25 C1 (mixfile) WWLib/mixfile.cpp, WWLib/mixfile.h Resolving every conditional as Windows sees it leaves only width retypes: MIXFILE_HEADER/MIXFILE_DATA_HEADER and MixFileCreator's header words go long → sint32, and both FileInfoStructs go unsigned long → uint32. mixfile.h now includes bittype.h. The _splitpath, DeleteFile/MoveFile and GetFileAttributes calls are unchanged inside #if defined(_WIN32); the makemix tool (Add_Files, Setup_Mix_File) is now inside #if defined(_WIN32) but unchanged. The widths are the same 32 bits under LLP64, so every file this reads or writes is byte-identical. The risk is B10's: unsigned long → unsigned int is a different type. The fields reach WWDEBUG_SAY as %d/%08X, which fit either, and a qsort comparator that already reads them as unsigned int. bittype.h is newly included by texturethumbnail.cpp, whose only use of mixfile.h is MixFileFactoryClass; B10 made bittype.h define no SDK names. medium Windows: VERIFIED (CI: build, test_wwlib.) Build wwlib and ww3d2; ctest -R test_wwlib runs mixfile_writes_the_format_byte_for_byte against hand-built bytes and mixfile_reads_and_flushes_through_the_real_file_system.
2026-09-25 wwsaveload WWSaveLoad/persistfactory.h Now #include "persist.h", so PersistClass is complete where SimplePersistFactoryClass::Save calls obj->Save(). clang's two-phase lookup requires that at the template's definition; MSVC's /permissive defers it. persistfactory.h has 30 includers, and on Windows each now sees persist.h earlier or twice. persist.h includes only always.h, refcount.h and postloadable.h, defines nothing but its guard, forward-declares PersistFactoryClass rather than including this header, and so has no cycle. An earlier include cannot change what later code means unless it defines a macro, and it defines none. low Windows: VERIFIED (CI: build, test_wwsaveload.) Build wwsaveload, ww3d2 and gameengine; ctest -R test_wwsaveload.
2026-09-25 wwsaveload WWSaveLoad/saveload.cpp <windows.h> inside #if defined(_WIN32). Not seen differently by Windows. Nothing in the file names a Win32 type or call, checked by grep and by compiling it without the include in Release and Debug. low Windows: VERIFIED (CI: build.) Build wwsaveload.
2026-09-25 wwsaveload / B3 Libraries/Include/Platform/MSVCCompat.h, Tests/test_wwlib.cpp _strlwr, _strupr, strlwr, strupr as inline functions inside the existing #else // !_MSC_VER branch, ASCII-only through tolower/toupper on unsigned char. A test, strlwr_and_strupr_are_ascii_only_and_in_place, runs on both. These are names MSVC's CRT owns, so the second-reader rule applies. They sit inside !_MSC_VER and are never preprocessed by MSVC. What Windows does see is the test, which runs MSVC's own _strlwr and asserts that 0xC9/0xE9 are left alone. That holds in the "C" locale, where MSVC's CRT starts; nothing in the tree or its vendored libraries calls setlocale. If it fails on Windows, the two builds lower-case asset names differently, and a hash key built on one misses on the other. low Windows: VERIFIED (CI: test_wwlib.) ctest -R test_wwlib on Windows.
2026-09-25 sweep tool GeneralsMD/Code/CMakeLists.txt set(CMAKE_EXPORT_COMPILE_COMMANDS ON) inside if(ZH_PLATFORM_MACOS), so a macOS configure writes compile_commands.json for Tools/syntax_sweep.py and clangd. None expected: the guard is false on Windows, so the variable is never set there, and even when set it only writes a JSON file beside the build and changes no target, flag or command line. The Visual Studio generator ignores it in any case. low Windows: VERIFIED (VM check: no compile_commands.json in build64.) Configure on Windows; compile_commands.json should not appear, and nothing else should change.
2026-09-25 wwutil Wwutil/miscutil.cpp win.h/mmsys.h, GetFileAttributes, Get_Image_File_Header, strupr, DeleteFile and the \\ separator in Get_File_Id_String are behind #ifdef _WIN32; the other side is stat/S_IWUSR, a timestamp of 0, a toupper loop, remove() and /. Intended to be a no-op on Windows. Preprocessed old and new with _WIN32 defined against empty stub headers: the token streams are identical, and all five Windows calls are still in them; the non-Windows control differs. The check cannot see the real SDK headers. low Windows: VERIFIED (CI: build, test_wwutil.) Build wwutil on Windows; ctest -R test_wwutil.
2026-09-25 wwutil Tests/test_wwutil.cpp file_is_read_only now also makes the file read-only and expects yes - with _chmod(_S_IREAD) on Windows, chmod(0444) elsewhere - then restores write access before removing it. get_file_id_string_strips_the_directory builds ./file off Windows; the Windows string is unchanged. New test code on Windows that has never run there. If _chmod does not set the attribute GetFileAttributes reads, the new check fails - which would be the test being wrong, not the code. If the restore failed, DeleteFile would refuse the read-only file and later tests would see it; the restore runs before any removal for that reason. low Windows: VERIFIED (CI: test_wwutil; VM check: no wwutil_test_tmp.dat left.) ctest -R test_wwutil on Windows, then confirm wwutil_test_tmp.dat is not left behind.
2026-09-25 test_wwlib Tests/test_wwlib.cpp, WWLib/lcw.cpp, WWLib/LCW.H B14's four thread tests read Clock_Milliseconds_Coarse() instead of GetTickCount() (8 sites) and include Lib/Clock.h. widestring_basics/widestring_compare_and_format are inside #if defined(_WIN32). LCW_Comp's #if defined(_MSC_VER) and LCW.H's non-MSVC extern "C" branch are gone. Resolving every conditional as Windows sees it, lcw.cpp and LCW.H are textually identical, and the two wide-string tests are unchanged. What Windows does see is the eight renames. Clock.h defines Clock_Milliseconds_Coarse on Windows as (unsigned int)GetTickCount(), and each site stores it in an unsigned, so the tests read the same clock at the same width. low Windows: VERIFIED (CI: test_wwlib.) ctest -R test_wwlib on Windows; the four thread tests must pass as before.
2026-09-25 test_wwlib (endian) WWLib/wwendian.h (new), WWLib/fixed.h, WWLib/base64.cpp #ifdef BIG_ENDIAN (three sites) became #if WW_BIG_ENDIAN, from wwendian.h: 1 only when __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__, which MSVC never defines, so 0 there by construction. Unverified: whether any Windows SDK or CRT header defines BIG_ENDIAN. If none does, Windows compiled the little-endian branch before and after, and the only change it sees is the new #include (resolved as MSVC sees it: WW_BIG_ENDIAN is 0, and the layouts are identical). If one does, Windows has always taken the big-endian branch on a little-endian CPU, so fixed's Whole/Fraction and base64's byte and bit order were wrong in the shipping game, and this change CORRECTS them on Windows. That is a behaviour change: fixed values, and anything base64-encoded by INIClass's UU-blocks, would differ from an older build. The new predicate is right either way; what is unknown is whether Windows moves. medium Windows: VERIFIED (CI: test_wwlib.) On Windows, preprocess fixed.h in a real TU (cl /P) and check BIG_ENDIAN against the old line; or run ctest -R test_wwlib: base64_known_vectors and fixed_* would have failed on the old code if it was defined.
2026-09-25 test_wwlib (SHA-1) WWLib/sha.h, WWLib/sha.cpp Every SHA-1 word went from long/unsigned long to uint32_t: the digest state, the round functions and constants, the block expansion, and the block and length stores. SRC_BLOCK_SIZE/PROC_BLOCK_SIZE use sizeof(uint32_t). The file's three _rotl overloads became one SHA_Rotate_Left(uint32_t, int), and <stdint.h> is included. Byte counts (Length, the Hash() API) are unchanged. On Windows long is 32 bits, so every width is unchanged and the digest is the same bits. Two things did change there. Signedness: the words were signed long; they are unsigned now, so the round additions wrap by definition rather than by MSVC's handling of signed overflow. The results are identical in two's complement, and the right shifts are masked in Reverse_LONG. Rotation: with uint32_t words, the old overload set would have let MSVC silently bind to the CRT's _rotl(unsigned int, int). An explicit 32-bit rotate replaces all three, and it is the same operation the old overloads performed. low Windows: VERIFIED (CI: test_wwlib.) ctest -R test_wwlib: sha1_known_vectors (FIPS 180 vectors), sha1_incremental_matches_single_shot, sha1_result_is_non_destructive.
2026-09-25 test_wwlib (MD5) WWLib/global.h, GeneralsMD/Code/CMakeLists.txt typedef unsigned long int UINT4 became #include <stdint.h> plus typedef uint32_t UINT4. test_wwlib loses PENDING_MACOS. Both are 32 bits on Windows, so every MD5 digest is unchanged. The type is now unsigned int rather than unsigned long (B10's caveat), but global.h is included only by md5.cpp and test_wwlib, and md5.cpp has no format string. PENDING_MACOS is stripped on Windows, so test_wwlib registers exactly as it did. low Windows: VERIFIED (CI: test_wwlib.) ctest -R test_wwlib: md5_known_vectors (RFC 1321 vectors).
2026-09-25 platform deps Tools/vendor.ps1, GeneralsMD/Code/CMakeLists.txt vendor.ps1 gains one Step 'skipping SDL3 and miniaudio: ...' line before Install-Art, the mirror of vendor.sh's DirectX line. The vendored-sources check sets VENDOR_HINT per platform, and on Windows it is the exact text the message always had. SDL3, miniaudio and sdl_gpu_probe are inside if(ZH_PLATFORM_POSIX). The PowerShell line was not run: there is no PowerShell here. It is a call to the script's own Step function with a string literal, so a syntax slip would stop vendor.ps1 on its first run, and loudly. The CMake message is assembled from a variable now, so if VENDOR_HINT were unset on Windows, the hint would silently vanish from a missing-file error. It is set in the same if(ZH_PLATFORM_WINDOWS) branch that appends the Windows files. low Windows: PARTLY VERIFIED (vendor.ps1 runs in every build.bat and prints the line. Left: the configure run with a vendored file renamed.) Run Tools\vendor.ps1 once; configure with one vendored file renamed and read the error.
2026-09-25 B5 (GameEngine) GameEngine/Include/Precompiled/PreRTS.h Lines 43-96 - WIN32_LEAN_AND_MEAN, the AnimateWindow rename, atlbase.h, windows.h, every SDK and CRT header after them, DIRECTINPUT_VERSION and dinput.h - are inside #if defined(_WIN32), byte for byte. The #else includes the portable headers from that block, plus <wchar.h>. Intended to be a no-op on Windows; this is the precompiled header every engine file includes first, so it wants a second reader. Checked three ways against stub headers with _WIN32 defined, each with a non-Windows control: the include sequence (56 headers, identical order; control drops to 36), the macro set from -dM (535, identical; control loses WIN32_LEAN_AND_MEAN and DIRECTINPUT_VERSION), and the token stream. The token stream check is blind for this file - it preprocesses to one line and its control is identical too - so it is not the evidence. The checks cannot see the real SDK: if some SDK header undefined _WIN32, the Windows engine would lose windows.h and fail to compile everywhere. Loud. medium Windows: VERIFIED (CI: build.) Build gameengine on Windows. For the stronger check, cl /P any engine .cpp before and after and diff; the .i files should be identical.
2026-09-25 B5 (GameEngine) 101 files: 58 headers under GameEngine/Include, plus View.h, GlobalData.h, TerrainVisual.h, CommandXlat.h, and in GameEngineDevice/WorldBuilder W3DShaderManager.h, W3DScienceModelDraw.h, W3DBridgeBuffer.h, wbview3d.h Every forward-declared enum, 62 of them, has an explicit : Int/: int on its declaration and its definition. Four opaque declarations were added where an enum was named before being declared. The commit lists the enums. MSVC's unfixed unscoped enum is already int underneath, so this should be the same type, the same size and the same overload behaviour there; that rests on MSVC's documented rule, not a compiler run. It is still a type change in one sense: an unfixed enum becomes a fixed one, which now allows values outside the enumerator range without being ill-formed. The failure MSVC would give loudly is a declaration whose underlying type differs from the definition's. All 136 forward declarations tree-wide were changed, including six in Windows-only code, and the four elaborated first uses got real declarations for that reason. Any remaining enum X; of one of these 62 anywhere would be a hard error on Windows. medium Windows: VERIFIED (CI: build, E1; git grep finds no enum declared without an underlying type in GeneralsMD/Code at that CI run.) Full Windows build. Then git grep -nP '^\s*enum\s+\w+\s*;' GeneralsMD/Code: only the three device-only enums and GameLODLevel should remain. replay-check.ps1 for the layout: nothing should move.
2026-09-25 B5 (GameEngine) GameClient/KeyDefs.h, new GameClient/DIKeyCodes.h KeyDefs.h's DIRECTINPUT_VERSION and #include <dinput.h> are inside #if defined(_WIN32), unchanged. Elsewhere it includes DIKeyCodes.h: the 107 DIK_ values the engine uses, and an #error if included on Windows. Intended to be a no-op on Windows. Checked against stub headers with _WIN32 defined: token stream, include sequence and -dM macro set are identical to before; the control shows a different include sequence and macro set. The token check is blind for this file too: its control is identical, because the DIK_ names stay unresolved against stubs. The values themselves were checked by a MinGW-compiled TU asserting each of the 107 against MinGW-w64's dinput.h, with a false control that fired. That header is Wine's, under LGPL-2.1+: only the numbers were taken, as facts, and they were checked rather than transcribed. low Windows: VERIFIED (CI: build.) Build gameengine on Windows: DIKeyCodes.h must never be reached there, and its #error would say so.
2026-09-25 B5 (GameEngine) new Common/WallClock.h; GameState.h, Recorder.h, Recorder.cpp, GameState.cpp, InGameUI.cpp SYSTEMTIME became WallClockTime and GetLocalTime became getLocalWallClock at every engine site (16 lines), and GameState.h/Recorder.h include the new header. On Windows the header is typedef SYSTEMTIME WallClockTime; and an inline that calls GetLocalTime, and it adds no include. The same type and the same call on Windows, by construction. The diff was checked mechanically: every changed line is the old line with only those two renames. What matters beyond Windows: SYSTEMTIME is in the replay format. RecorderClass writes it raw into every replay header and reads it back with fread(sizeof). The non-Windows struct is pinned to its 16 bytes and field offsets by static_assert, and a deliberately wrong layout was seen to fail them. Save games carry the fields one at a time through Xfer and are unaffected. The header relies on every includer already seeing SYSTEMTIME on Windows, which was already true, or those files would not have compiled. low Windows: PARTLY VERIFIED (CI: build. Left: a replay recorded before the change.) Build on Windows. Then load a replay recorded before this change: the header's date and the fields after it must read correctly.
2026-09-25 C4 Libraries/Source/WWVegas/Miles6/include/MSS/MSS.h windows.h, mmsystem.h and __stdcall moved under #if defined(_WIN32). The #else branch gives POSIX stdint.h/stdio.h, empty AILCALL/AILCALLBACK and WAVE_FORMAT_PCM 1, and AILFILEHANDLE is uintptr_t there instead of UINT_PTR. A comment on S32 was lengthened. The header is shared by miles_xaudio2.cpp, MilesAudioManager.cpp and miles_smoke.cpp. If the guard were false on Windows, AILCALL would lose __stdcall (a no-op on x64) and the SDK names MSS.h uses would be undeclared, which is a loud compile error. Checked by preprocessing: before and after with unifdef -D_WIN32 -DWIN32 -D_MSC_VER=1930, the only difference is the comment. With -U the output differs, which is the control that shows the check can see a change. It was not compiled with MSVC. low Windows: PARTLY VERIFIED (CI: build. Left: miles_smoke (no sound on the workers)) Build milesaudio and gameenginedevice on Windows, then ctest -R miles_smoke.
2026-09-25 C4 Tests/miles_smoke.cpp #include <windows.h> is now under #if defined(_WIN32). The #else branch has local shims for LONG, MAX_PATH, InterlockedExchange, InterlockedCompareExchange, Sleep and GetTempPathA. They are file-local and exist only off Windows, so no SDK name is defined where the SDK is present. The Windows view is byte-identical: unifdef -D_WIN32 gives the same output before and after, and the -U control differs. If the guard were somehow false on Windows, the shims would collide with windows.h's declarations, which is a compile error, not a silent change. It was not compiled with MSVC. GCC on Linux warns -Wformat-truncation at the shared snprintf of the temporary path (line 210). That is harmless and was left alone. low Windows: OPEN (Left: miles_smoke (no sound on the workers)) ctest -R miles_smoke on Windows.
2026-09-25 C4 GeneralsMD/Code/CMakeLists.txt A second milesaudio (miles_miniaudio.cpp) is added inside the existing if(ZH_PLATFORM_POSIX) block. A new if(ZH_PLATFORM_POSIX) block registers miles_smoke, test_miles_miniaudio and miles_listen, and adds the cache variable ZH_GAME_DATA. On Windows neither block is entered, so the Windows milesaudio and miles_smoke definitions are the only ones, as before. If ZH_PLATFORM_POSIX were true on Windows, CMake would stop on a duplicate target: loud. ZH_GAME_DATA is an empty cache entry on Windows and nothing reads it there. low Windows: VERIFIED (VM check: miles_smoke is registered once.) cmake -S GeneralsMD/Code -B build on Windows, then ctest -N lists miles_smoke once, from Run/.
2026-09-25 B5 (GameEngine) Tools/vendor.sh, new Libraries/Source/gamespy-strlwr-c-only.patch vendor.sh gains install_gamespy_patch, which narrows gsplatform.h's #if !defined(_WIN32) around its C-linkage _strlwr/_strupr declarations to && !defined(__cplusplus). It is checked by a marker, and exits 1 if the patch did not take. vendor.ps1 is unchanged. None on Windows: the edited guard is the !_WIN32 half of the header, which a Windows build never reads, so vendor.ps1 needs no matching step. Measured off Windows: the SDK still builds standalone (libgamespy.a, 0 errors), and its C still defines and calls its own _strlwr. Also measured: a plain git apply inside the outer repository, without GIT_CEILING_DIRECTORIES, exits 0 having applied nothing, which is why the step checks the marker. low Windows: nothing to verify (the row: none needed on Windows.) None needed on Windows. On any non-Windows machine, a fresh vendor.sh prints the patch step and grep 'Zero Hour Reforged: C only' finds the marker in gsplatform.h.
2026-09-25 B5 (GameEngine) SaveGame/GameState.cpp, Lib/WideCharFns.h, System/WideCharFns.cpp getUnicodeDateBuffer/getUnicodeTimeBuffer gained a !_WIN32 branch using strftime (%x, %X) and a new WideCharFromUtf8. The Windows bodies are unchanged under #else. GameState.cpp's Windows token stream and include sequence are identical to before, against stubs with _WIN32, with a differing control. WideCharFromUtf8 is compiled on Windows too, where it adds one declaration and one function that nothing there calls: additive and unreached. It was tested at both WideChar widths (wchar_t and char16_t): malformed input, surrogate pairs, truncation at a whole character, and a round trip through WideCharToUtf8. low Windows: VERIFIED (CI: build.) Build on Windows; nothing should call WideCharFromUtf8 there yet.
2026-09-25 Linux lane 177 files: 37 header renames (all case-only, R100) and 161 #include lines in GameEngine, GameEngineDevice, WWVegas, Compression, Tests Every #include in the POSIX build now names its file in the file's own case: Vector.H is included as Vector.H, buff.h is the file BUFF.H renamed, Common/file.h is included as that. Nothing but #include lines and file names changed. Measured by resolving MSVC's view of every C/C++ file the branch changes (unifdef -D_MSC_VER=1930 -D_WIN32 -DWIN32, before and after, comments stripped): 183 files; 138 differ only in the case of #include lines, 38 are identical, 7 carry the differences listed in these rows and nothing else. NTFS folds case, so MSVC resolves each include to the same file as before. The two residual risks are in git, not in the compiler: (1) a Windows working tree that already had these files can keep the old on-disk case after the pull, which is harmless to MSVC but shows up as a case-only difference in some tools; (2) the VC6 .dsp files (wwlib.dsp, WWDownload.dsp) still list the old spellings. CMake never reads them, and on NTFS they resolve anyway, so they were left alone. include_case_check runs only on POSIX, where compile_commands.json exists. low Windows: PARTLY VERIFIED (CI: build; VM check: a clean git status, and ls-files lists buff.h. Left: an older Windows working tree updated across the renames.) Build on Windows. git status after the pull must be clean, and git ls-files GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/buff.h must list the file.
2026-09-25 Linux lane Platform/MSVCCompat.h, WWLib/always.h, Common/GameMemory.h, GameMemory.cpp The global operator delete(void*) and operator delete[](void*), declared in both headers and defined in GameMemory.cpp, gained WW_NOEXCEPT_DELETE. MSVCCompat.h defines it as noexcept off MSVC and as nothing under _MSC_VER. GameMemory.h's #if _MSC_VER < 1300 became #if defined(_MSC_VER) && _MSC_VER < 1300. Measured by resolving MSVC's view of every C/C++ file the branch changes (unifdef -D_MSC_VER=1930 -D_WIN32 -DWIN32, before and after, comments stripped): 183 files; 138 differ only in the case of #include lines, 38 are identical, 7 carry the differences listed in these rows and nothing else. For these four sites the MSVC view is the old declaration plus one macro token that unifdef shows defined empty, and the guard rewrite resolves to the same branch. If the macro were not empty under MSVC, the declarations would gain noexcept. vcruntime_new.h declares them that way, so that would very likely be accepted, but it has not been compiled. The Windows declarations are otherwise textually the old ones. medium Windows: VERIFIED (sized-delete run: GameMemory.cpp recompiled with no diagnostic but the three old C4267s.) Build on Windows with the usual warning level; nothing new should appear around operator delete. For information, not required: try defining the macro as noexcept on MSVC too, and if it builds, the special case can go.
2026-09-25 Linux lane WWLib/wwstring.cpp StringClass::Format_Args passes its const va_list & to vsnprintf through const_cast<va_list &>. The signature, and so the Windows symbol, is unchanged. Measured by resolving MSVC's view of every C/C++ file the branch changes (unifdef -D_MSC_VER=1930 -D_WIN32 -DWIN32, before and after, comments stripped): 183 files; 138 differ only in the case of #include lines, 38 are identical, 7 carry the differences listed in these rows and nothing else. This is one of the seven. MSVC's va_list is char *, so the parameter is char * const & and the cast yields char *&. It is valid C++ and changes no value. It was needed because x86-64 System V's va_list is an array, whose const binds to the elements. Never compiled by MSVC; the realistic failure is a compile error, not a changed string. medium Windows: VERIFIED (CI: build, test_wwlib.) Build on Windows; ctest -R test_wwlib (its string formatting tests go through Format).
2026-09-25 Linux lane WWLib/Vector.H, WWLib/lcw.cpp, WWLib/stringex.h, WWLib/cpudetect.cpp <stdint.h> added to Vector.H and lcw.cpp; <wchar.h> added to stringex.h, whose own strlcpy family is now skipped only where glibc 2.38+ provides one; cpudetect.cpp gained a POSIX arm for memory, OS version, the compact log's time-zone column and Get_OS_Info. Measured by resolving MSVC's view of every C/C++ file the branch changes (unifdef -D_MSC_VER=1930 -D_WIN32 -DWIN32, before and after, comments stripped): 183 files; 138 differ only in the case of #include lines, 38 are identical, 7 carry the differences listed in these rows and nothing else. cpudetect.cpp is one of the 38 identical files: every change is in a non-Windows arm. Two standard headers that MSVC has shipped since VS2010; __GLIBC__ is never defined on Windows, so stringex.h's definitions compile exactly as before. low Windows: VERIFIED (CI: build.) Build on Windows.
2026-09-25 Linux lane WWLib/trim.cpp strtrim and wcstrim shift the string left over itself with memmove instead of strcpy/wcscpy. The number of characters moved is the source length plus its terminator, the same bytes strcpy was asked to move. strcpy between overlapping regions is undefined, and glibc's aarch64 strcpy under GCC corrupted the result (test_wwlib's strtrim_in_place). MSVC's strcpy evidently copied forwards and gave the intended result, since every INI line in the shipping game goes through strtrim; memmove gives that same result by definition. The risk is only that MSVC's undefined behaviour differed from the intended result somewhere and the game came to depend on it, which nothing suggests. medium Windows: VERIFIED (CI: build, test_wwlib, test_gameengine.) Build on Windows; ctest -R test_wwlib; then any INI-reading test (test_gameengine's INI cases) must be unchanged.
2026-09-25 B5 (GameEngine) GameState.cpp, ScriptActions.cpp, Shell.cpp, TerrainLogic.cpp Five DEBUG_LOG calls pass name.str() instead of an AsciiString object to %s. This changes Windows output, on purpose. AsciiString is one pointer to a refcount header with the text after it. Compiled for x86_64-pc-windows-msvc, clang copies the object to a temporary and passes printf the temporary's address, so Windows printed a few bytes of a heap address, or nothing for an empty string, and never the name. It now prints the name. All five are debug-log lines, none persisted or player-visible. The ABI claim comes from clang's MSVC-compatible code generation, not from cl.exe. low Windows: OPEN (Left: the name in the unknown-block log line.) On Windows, trigger one (e.g. load a save with an unknown block): DebugLogFile.txt should now show the name.
2026-09-25 B5 (GameEngine) Tools/vendor.sh, new Libraries/Source/gamespy-gsi-unix.patch; Platform/MSVCCompat.h; new Tools/unix_define_check.py, CMakeLists.txt The vendored GameSpy SDK's _UNIX is renamed GSI_UNIX by a vendor.sh patch, with a marker check. MSVCCompat.h gains #if defined(_UNIX) #error, outside every platform branch. A POSIX-only ctest, unix_define_check, is added. None expected on Windows. The SDK's _UNIX was only ever defined for Linux and Apple, and vendor.ps1 does not apply the patch. The #error fires only if _UNIX is defined, which no Windows configuration does; grep of the tree and of the compile flags found no definition anywhere. The ctest is registered inside if(ZH_PLATFORM_POSIX). If some Windows file did define _UNIX before MSVCCompat.h, that file would now fail to compile, which is loud and would name the rule. low Windows: VERIFIED (CI: build.) Build on Windows; nothing should hit the #error.
2026-09-25 D-spike GeneralsMD/Code/CMakeLists.txt Adds the w3d_view executable inside the existing if(ZH_PLATFORM_POSIX) block, next to sdl_gpu_probe, linking SDL3::SDL3-static wwmath wwlib wwsaveload wwdebug. Everything else the spike added is new files under Tests/w3d_view/, which nothing on Windows builds. On Windows the block is not entered, so the target does not exist and the libraries it names are linked exactly as before. If ZH_PLATFORM_POSIX were somehow true on Windows, CMake would fail at SDL3::SDL3-static, which is only added in that same block. That failure is loud. low Windows: VERIFIED (VM check: no w3d_view project in build64.) cmake -S GeneralsMD/Code -B build on Windows, then cmake --build build --target help does not list w3d_view.
2026-09-25 B5 (GameEngine) GameLogic/FPUControl.h, System/FPUControl.cpp, System/SimulationMathCrc.cpp, RandomMapGenerator.cpp New restoreFPMode(mode). On Windows its body is exactly _controlfp( mode, FP_MODE_FIELDS );, the raw call both callers used to make themselves, and they now call it. SimulationMathCrc saves getFPMode() (the rounding field) rather than the whole control word. FP_MODE_FIELDS is defined only on Windows. POSIX gets fesetenv(FE_DFL_ENV) + fesetround(FE_TONEAREST), and a debug assert that FZ/DN (arm64) or FTZ/DAZ (x86-64) are clear. The callers' spelling changed on the simulation path. Tools/windows_view_diff.py shows MSVC sees setFPMode, getFPMode and expectedFPMode unchanged, one added function whose body is the old call, and the callers calling it. SimulationMathCrc's saved value is now masked to the rounding field; its restore applies the same mask, so the same bits are restored. On glibc x86-64, fesetenv(FE_DFL_ENV) leaves the x87 control word at 0x037F (64-bit extended), where Windows' _fpreset leaves 0x027F (53-bit). That reaches only long double and x87 code, and the simulation has neither (grep, 2026-09-25). medium Windows: PARTLY VERIFIED (CI: build, E1. Left: a replay recorded before the change, and SimulationMathCrc against an older build.) Build on Windows. replay-check.ps1: a replay recorded before this change must play to the same end CRC. The mismatch dump's SimulationMathCrc values must match an older build's for the same state.
2026-09-25 B5 (GameEngine) 73 lines in 26 engine files Pointer-to-integer casts read through intptr_t/uintptr_t: (Int)(intptr_t)p for (Int)p. The same value on MSVC x64, the pointer's low 32 bits, by construction. Each line is the old line plus one cast. The claim that nothing is lost, on Windows or anywhere, rests on the store side: every store feeding these reads was checked to be an integer, and the six lists that hold real pointers are read only as pointers. A store added later that puts a pointer into one of these lists would truncate on every 64-bit platform, as it would have before. low Windows: VERIFIED (CI: build.) Build on Windows. None needed beyond that.
2026-09-26 B1 (CI) Lib/BaseType.h, UnicodeString.cpp Off MSVC, BaseType.h includes nineteen standard headers ahead of its min/max macros, because libstdc++, unlike MSVC's library and libc++, does not survive a function-like max defined before it. UnicodeString.cpp includes <wctype.h> for iswspace, which glibc does not supply transitively. windows_view_diff: BaseType.h identical in MSVC's view, UnicodeString.cpp + one #include <wctype.h>. A standard header MSVC has always shipped; nothing else reaches Windows. low Windows: VERIFIED (CI: build.) Build on Windows.
2026-09-26 B1 (CI) Tests/test_widechar_crc_gate.cpp, CMakeLists.txt (widechar_crc_gate) New test: the real Xfer, XferCRC, UnicodeString, AsciiString and WideCharFns sources, hashing 11 UnicodeStrings through Xfer::xferUnicodeString and XferCRC and comparing with a table computed independently. Registered on every platform; the -fshort-wchar twin and its CRT shim only for GCC/Clang. Never compiled by MSVC. On Windows it is CI's real column: before B1's flip it must print the 2-byte column (MSVC's wchar_t), after it the same. The stubs (malloc-backed allocator, engine singletons that abort if reached) must compile under MSVC's _DEBUG too, where DECLARE_LITERALSTRING_ARG2 adds a parameter; the stub uses the macro for that reason, untested. medium Windows: OPEN (Left: widechar_crc_gate in a Debug build.) ctest -R widechar_crc_gate on Windows, Release and Debug. Its golden lines must equal the macOS/Linux widechar_crc_gate_msvc_model output, row for row.
2026-09-26 D3 WW3D2/ffshader.h, ffvertex.h, ffshader.cpp, ffvertex.cpp; new ffstate.h, ffstate_values.h The generators' D3D9 state names became their own: D3D<family>_X → FF_<family>_X and DWORD → FixedFunctionValue, in code only (comments keep the D3D names). There are 99 tokens in 94 lines. On Windows ffstate.h includes <d3d9.h> as the two headers did, typedef DWORD FixedFunctionValue, and static_asserts all 78 FF_* values equal to the SDK's. Type identity: unchanged. The fields are still DWORD, and so is every %lu key format. Values: asserted at compile time on every Windows build, so a wrong one stops the build; mingw-w64 (whose d3d9types.h the table came from) passes them. Text: 108 generated D3D9 and D3D11 programs are byte-identical before and after, in a mingw build under Wine and natively. Unverified: MSVC itself. mingw is not MSVC, but the only conditional here is _WIN32, where both take the same branch. low Windows: VERIFIED (CI: build, test_ffshader, test_ffvertex, test_engineshader.) Build ffshader, ffvertex, engineshader and ww3d2 with MSVC. A failed static_assert names the value. Then ctest -R "test_ff|test_engineshader".
2026-09-26 D3 WW3D2/ffshader.h, ffvertex.h, engineshader.h/.cpp, ffshader.cpp, ffvertex.cpp; new sdl3target.h New enumerators COMBINER_SHADER_TARGET_SDL3_GPU and VERTEX_SHADER_TARGET_SDL3_GPU, each added last. EngineShader_Vertex_Program/_Pixel_Program gain a trailing target parameter defaulting to D3D11. Each generator answers the SDL3 target by calling itself for D3D11 and rewriting the text (sdl3target.h, header-only). The engine programs now refuse an explicit D3D9 target, which no caller passes. No Windows caller passes the new values or the new parameter, so every existing call compiles to the same call. A switch over either target enum without default would now lack a case. That is warning C4062, off at /W3, and none was found. sdl3target.h is compiled into the three generators on Windows too, unused there. low Windows: OPEN (Left: the /W4 build.) Build with MSVC /W4 once, to see whether C4062 or C4061 names a switch.
2026-09-26 D3 GeneralsMD/Code/CMakeLists.txt All new: POSIX-only ffshader/ffvertex/engineshader libraries (the Windows ones are unchanged, in the Windows block), glslang and SPIRV-Cross subprojects, sdl3_shadercross, sdl3shadercompile, test_shader_sdl, ffshader_dump, and w3d_view's extra links. All inside if(ZH_PLATFORM_POSIX) blocks. Windows never enters them. If it did, the libraries would be defined twice, which is a loud configure error. low Windows: VERIFIED (VM check: no test_shader_sdl is registered.) cmake -S GeneralsMD/Code -B build on Windows; ctest -N lists no test_shader_sdl.
2026-09-26 D3 GeneralsMD/Code/Tools/vendor.ps1 One Step line saying glslang, SPIRV-Cross and SDL_shadercross are skipped on Windows, like the existing SDL3 line. A PowerShell syntax slip would stop vendoring on Windows. It is the same shape as the line above it. low Windows: VERIFIED (vendor.ps1 prints the glslang/SPIRV-Cross/SDL_shadercross line in every build.bat.) Run vendor.ps1 once.
2026-09-26 D3 (width) WW3D2/ffstate.h, ffshader.cpp, ffvertex.cpp FixedFunctionValue is uint32_t off Windows, where it was unsigned long; Windows keeps typedef DWORD. The three key functions now cast each value they print with %lu to (unsigned long). On Windows the casts are no-ops, because DWORD is unsigned long, and the typedef is untouched. Measured: ffshader_dump's 177 programs, index and pipeline keys are identical before and after, under mingw-w64 in Wine and on macOS, with -Wall -Wformat clean on both. low Windows: VERIFIED (CI: build, test_ffshader, test_ffvertex.) Build ffshader/ffvertex with MSVC; ctest -R "test_ff".
2026-09-26 B1 (funnel) WideCharFns.cpp, Tests/test_widechar_format.cpp, Tests/widechar_test_stubs.cpp, CMakeLists.txt Off Windows, WideCharFormatV now formats strings and characters itself with MSVC's LEGACY wide meanings (%s/%ls/%ws/%c wide, %S/%hs/%C/%hc narrow, %n refused, %p as MSVC prints it) and delegates only numeric conversions. The Windows branch is unchanged: windows_view_diff shows WideCharFns.cpp gaining <stddef.h>, <stdint.h> and <stdio.h> and nothing else. New test widechar_format_selfcheck, registered everywhere. The test's expected strings are this project's reading of MSVC's legacy wide printf, never checked against it. On Windows the test runs the real _vsnwprintf against them, so a wrong reading shows there as a failing test, not as a wrong POSIX formatter nobody notices. The cases most likely to be misread: %hc/%S of a byte above 0x7F (claimed: the code unit of the same value, as MSVC's "C" locale converts), %p (claimed: 16 upper-case hex digits, no 0x), (null) for a null string, and the zero-padding of a string under a 0 flag (not tested). medium Windows: VERIFIED (CI: widechar_format_selfcheck (W2 made the POSIX formatter follow the measured MSVC)) ctest -R widechar_format_selfcheck on Windows. Any failure is a fact about MSVC to copy into the POSIX formatter, not a Windows bug.
2026-09-26 B1 (step 3) NetPacket.cpp (16 sites), UnicodeString.cpp:356, Lib/BaseType.h, new Lib/WideChar.h Wide-text byte counts say sizeof(WideChar) where they said sizeof(UnsignedShort) or 2: the chat and disconnect-chat packet writes, reads and lengths, and UnicodeString::nextToken. WideChar's typedef moved from BaseType.h into Lib/WideChar.h, still wchar_t, and BaseType.h includes it. Value-identical on Windows, where wchar_t, UnsignedShort and 2 are all two bytes. windows_view_diff lists these as different because the text is. A mistake would be a wrong multiplier in a packet: a LAN chat that arrives half-length or garbled. low Windows: PARTLY VERIFIED (CI: build. Left: a non-ASCII LAN chat line between two Windows copies.) Build; then a LAN chat between two copies (lan-play.ps1) with a non-ASCII line.
2026-09-26 B1 (step 3) GameSpy/ThreadUtils.h, Thread/ThreadUtils.cpp MultiByteToWideCharSingleLine returns std::basic_string<WideChar> instead of std::wstring; before the flip that is the same type on Windows, and after it the ten callers' .c_str() still hands UnicodeString a WideChar*. The Windows body makes the same MultiByteToWideChar(CP_UTF8, 0, orig, -1, dest, len) call and the same WideCharToMultiByte pair, through reinterpret_cast<LPWSTR>/<LPCWSTR>; the line-break replacement is a loop instead of repeated wcschr; the array NEWs are freed with delete[], where they were freed with delete, which is undefined. POSIX uses WideCharFromUtf8/WideCharToUtf8. A rewritten function on Windows that nobody here has compiled with MSVC. Its callers are the GameSpy UI and HtmlOverlay.cpp:396, the command bar's text. A mistake would show as mangled or truncated text there, not as a desync. medium Windows: PARTLY VERIFIED (CI: build. Left: non-ASCII text in the command bar and a lobby.) Build; open the command bar and a lobby, and check non-ASCII text in both.
2026-09-26 B1 (flip) Lib/WideChar.h, and 78 files across GameEngine, GameEngineDevice, Tests (list in the commit) typedef char16_t WideChar, with static_assert(sizeof(WideChar) == 2) beside it, and every L"..."/L'x' that holds engine text is u"..."/u'x' (471 strings, 988 characters, 29 more in render2dsentence.cpp). WideChar was wchar_t; on MSVC that is the same two unsigned bytes, but a distinct type. No MSVC has compiled this. Two kinds. Build: every place that hands a WideChar * to something typed wchar_t * (a CRT wcs*, a Win32 W API, std::wstring) is now a type error on MSVC. The mingw-as-MSVC differential below found 14 and they are fixed; what it cannot see is below. Run time: none intended - every flipped literal is ASCII or a \x/\u escape at most 0xFFFF, so each has the same code units as before, and the width, signedness and byte order MSVC gave wchar_t are the ones char16_t has. widechar_crc_gate shows the same 11 XferCRC values from the pre-flip Windows model (A) and the post-flip build (B). If MSVC ever resolved an overload differently (wchar_t and char16_t are distinct types, so an operator<<, a template or an overload set that had a wchar_t case and no char16_t one now picks something else), a string could print as a number or an address. high Windows: VERIFIED (CI: build, ctest (widechar_crc_gate included), E1.) Windows: full build, full ctest, replay-check.ps1. Gate: widechar_crc_gate prints the 11 golden lines test_widechar_crc_gate.cpp's table holds. Coverage of the stand-in: x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only -D_MSC_VER=1930 over all 848 .cpp in GameEngine/Source, GameEngineDevice/Source, Main and WW3D2, with MSVC branches taken and mingw's two-byte wchar_t, errors not suppressed: 641 compile clean before and after, and the set of error lines is identical before and after. GCC is not MSVC, and the 207 files that fail for unrelated reasons (ATL, DirectX SDK headers, MSVC extensions) are seen only up to where GCC's recovery gives out. Not covered at all: Tools/ (WorldBuilder, GUIEdit, ParticleEditor: not in the CMake build).
2026-09-26 B1 (flip) Debug.cpp:889, Win32OSDisplay.cpp:110, GameText.cpp:467, IMEManager.cpp (4), PopupReplay.cpp (2), ReplayMenu.cpp, W3DDisplay.{h,cpp}, Display.h, ThreadUtils.cpp Win32 W calls take reinterpret_cast<LPCWSTR>/<LPWSTR> of WideChar text: MessageBoxW, SetWindowTextW, MultiByteToWideChar, FormatMessageW (whose buffers became WideChar[1024], sized sizeof(buffer)/sizeof(buffer[0]) as before). getRendererName returns const WideChar *. Each cast carries a comment naming the API. The cast is honest only because WCHAR is two bytes on Windows, which is also why these files do not build off Windows. A cast hides a real type mismatch from the compiler: if one of these ever passed a narrow buffer, nothing would say so. Each was read by hand against the API's signature. medium Windows: PARTLY VERIFIED (CI: build. Left: the crash box, the warning box, the window title, an IME, a read-only replay's delete.) Windows: a fatal ReleaseCrashLocalized box and an OSDisplayWarningBox show localised text; the window title reads the game's name; typing with a Japanese or Chinese IME puts the composed characters in a chat box; deleting a replay that is read-only shows Windows' reason.
2026-09-26 B1 (flip) GameState.cpp:281, :321 The save-game date and time buffers became WideChar, cast at GetDateFormatW/GetTimeFormatW, and their size argument became the character count (DATE_BUFFER_SIZE, TIME_BUFFER_SIZE). It was sizeof(buffer), twice the buffer in WCHARs: the API takes characters. A behaviour change, and a fix: before, a date longer than the buffer could be written past its end, because the API was told there was twice the room. Now it fails with ERROR_INSUFFICIENT_BUFFER and the buffer is left as it was. Real dates are far shorter than either buffer, so no player should see a difference. low Windows: OPEN (Left: the save/load screen's dates.) Windows: the save/load screen shows each save's date and time as before.
2026-09-26 B1 (flip) WW3D2/render2d.{h,cpp}, WW3D2/render2dsentence.{h,cpp}, WW3D2/font3d.{h,cpp} The text renderer takes WideChar where it took WCHAR (75 sites; the headers include Lib/WideChar.h, not BaseType.h: see that file). GDI calls cast: ExtTextOutW, GetTextExtentPoint32W. wcschr(text, '\n') became a loop; Draw_Text(const char *) casts WideStringClass's WCHAR buffer. WW3D2 builds only on Windows. Everything the engine draws as text goes through here. A cast gone wrong is garbled or missing glyphs on every screen, not a subtle difference. The mingw differential compiles all of WW3D2 and reports no new error. high Windows: PARTLY VERIFIED (CI: build. Left: text drawn on screen (menu, tooltip, chat, Turkish)) Windows: the main menu, a tooltip, a chat line and a Turkish-language menu all draw their text.
2026-09-26 B1 (flip) UnicodeString.{h,cpp}, Platform/MSVCCompat.h, 12 engine files (LANAPI.cpp and others, list in the commit) wcslen/wcscmp/_wcsicmp/wcscpy/wcscat/wcsspn/wcscspn/wcschr/wcsstr/wcsrchr/towupper/iswspace became the WideChar* functions of Lib/WideCharFns.h. On Windows most forward to the same CRT call with a cast. compareNoCase is the one that does not: it was _wcsicmp and is WideCharICmp, which folds A-Z to lower case and nothing else. MSVCCompat.h's _wcsicmp bridge is gone. _wcsicmp in the "C" locale - and the game never calls setlocale on Windows - folds ASCII only, to lower case, which is what WideCharICmp does. If a Windows build ever set LC_CTYPE, _wcsicmp would have folded more, and the two would disagree on non-ASCII names. low Windows: OPEN (Left: two LAN players whose names differ in case, the ignore list.) Windows: a LAN lobby with two players whose names differ only in case, and an ignore-list entry, behave as before.
2026-09-26 B1 (flip) WOLBuddyOverlay.cpp:443 _wtoi(info.m_locationString.str()) became atoi(WideCharAsUtf8(...).str()). _wtoi is MSVC's and takes wchar_t. A room number is ASCII digits, which UTF-8 leaves as they are, so the value is the same. low Windows: OPEN (Left: a buddy's location (GameSpy)) Windows: a buddy's location shows the right lobby room.
2026-09-26 B1 (flip) GameSpy/PeerThread.h, ThreadUtils.h, InGameUI.cpp, ControlBarPopupDescription.cpp std::wstring became WideCharString, a std::basic_string<WideChar> - std::u16string on every platform. Before the flip these were the same type on Windows; now they are not, so an overload or a .c_str() handed to a wchar_t parameter is a compile error, not a silent change. The mingw differential reports none. low Windows: VERIFIED (CI: build.) Windows: full build.
2026-09-26 B1 (flip) Input/Keyboard.cpp:468 The UK layout's AltGr character on the 4 key is u'\u20AC', the euro sign. It held the three bytes EF BF BD - U+FFFD in UTF-8, left where some earlier re-encoding of the file lost the euro sign. Player-visible; CHANGELOG.md has the line. MSVC without /utf-8 (this tree does not set it) reads those bytes in the ANSI code page as three characters in a wide character literal and keeps the first (warning C4066): ï, i-diaeresis, on a Western code page. So AltGr+4 typed that, and now types the euro sign. That is the intent. low Windows: OPEN (Left: AltGr+4 on a UK layout.) Windows, UK layout: AltGr+4 in a chat box types the euro sign.
2026-09-26 B1 (flip) WWLib/cpudetect.cpp A raw non-ASCII micro sign in a CPU-description string became ASCII: "%dk uOPs". Cosmetic: the debug text reads uOPs where it read a code-page-dependent character. low Windows: nothing to verify (the row: none needed.) None needed.
2026-09-26 B5 (GameEngine) Common/System/ControlServer.cpp Ported to BSD sockets. File-local POSIX definitions of SOCKET, INVALID_SOCKET and closesocket. #if at the real differences: Winsock startup/cleanup, fcntl(O_NONBLOCK), SO_REUSEADDR (POSIX only), EINTR retry, EAGAIN/EWOULDBLOCK, and SO_NOSIGPIPE on the accepted socket. The two sends pass CONTROL_SEND_FLAGS, which is MSG_NOSIGNAL on Linux and 0 elsewhere. Intended to be a no-op on Windows. The preprocessed token stream with _WIN32 defined is identical to before (710 lines; POSIX control differs). That rests on the Windows SDK defining neither MSG_NOSIGNAL nor SO_NOSIGPIPE; mingw-w64's Winsock headers define neither, which is a proxy for Microsoft's SDK, not proof. If the SDK defined SO_NOSIGPIPE, Windows would gain a harmless setsockopt on the client socket; if it defined MSG_NOSIGNAL without SO_NOSIGPIPE, the two sends would pass that flag. low Windows: PARTLY VERIFIED (CI: build. Left: control_client.py against -control.) Build on Windows, then Tools/control_client.py against -control: connect, send a command, disconnect, reconnect.
2026-09-26 B5 (GameEngine) CommandLine.cpp, CinemaDirector.cpp, DisconnectMenu.cpp, PopupSaveLoad.cpp Standard names at the call site: struct _stat/_stat/_S_IFDIR became struct stat/stat/S_IFDIR, and three itoa(n, buf, 10) became snprintf(buf, sizeof buf, "%d", n). One DeleteFile whose result is unused became remove. CinemaDirector's three DWORD clock values became UnsignedInt. MSVC provides the POSIX stat names (under _CRT_NONSTDC_NO_WARNINGS) and remove (standard C, which deletes the file as DeleteFileA does); both should behave the same on Windows. %d prints what itoa(..., 10) did for an Int. DWORD and UnsignedInt are both 32-bit unsigned: the same wrap in wall - theCinemaSeenFrameAt, but a different type identity (unsigned long against unsigned int), and these values are only subtracted and stored. PopupReplay's DeleteFile is unchanged on Windows, because its error text comes from GetLastError; POSIX gets remove and strerror. low Windows: PARTLY VERIFIED (CI: build. Left: the disconnect timer, deleting a save; -mod went with mod support on 2026-11-04.) Build on Windows; the disconnect screen's timer and vote counts, and deleting a save from the load menu.
2026-09-26 B5 (GameEngine) GUICallbacks/Menus/PopupReplay.cpp Both FormatMessageW calls pass sizeof(buffer)/sizeof(buffer[0]) (1024) where they passed sizeof(buffer) (2048). The parameter counts wide characters. A behaviour change on Windows, on purpose, and only in the overflow case. With the old count a system message longer than 1024 characters would be written past the 1024-wchar_t stack buffer; now it is truncated to fit. For every message that fits, the output is identical. low Windows: PARTLY VERIFIED (CI: build. Left: a failed replay save's error box.) Build on Windows; fail a replay save (e.g. a read-only replay folder) and check the error box still shows the system's reason.
2026-09-26 B5 (GameEngine) new Common/ExecutableDirectory.h, new Common/System/ExecutableDirectory.cpp; MiniLog.cpp, System/MemoryInit.cpp, System/Debug.cpp The three copies of "GetModuleFileName, then walk back to the last '\\'" became one function, getExecutableDirectory(buf, size, keepTrailingSeparator). Debug.cpp keeps the separator (TRUE), the other two cut on it (FALSE), as each did. Its Windows view (windows_view_diff's own view() and MSVC flags, control positive) is the old loop with '\\' and the old size, (DWORD) of the same sizeof. Windows compiles one more TU in gameengine (the source list is a GLOB). MemoryInit calls it before main, from a static constructor: if MSVC ran it before something it needs, the pool sizes from Data\INI\MemoryPools.ini would not load and every pool would take its default size. It needs nothing but GetModuleFileName and strlen, so this is not expected. A wrong cut would move MemoryPools.ini or the debug log out of the game's directory. low Windows: OPEN (Left: the debug log beside generals.exe and the MemoryPools.ini sizes, in a Debug build.) Windows Debug build: the debug log appears next to generals.exe as before, and MemoryInit's pool sizes match MemoryPools.ini (a pool listed there with an unusual size shows it in the memory report).
2026-09-26 B5 (GameEngine) Common/System/GameMemory.cpp GlobalAlloc(GMEM_FIXED), GlobalSize and GlobalFree are called through three file-local functions, sysMemoryAllocate, sysMemorySize (MEMORYPOOL_DEBUG only) and sysMemoryRelease, whose Windows bodies are those calls. windows_view_diff: the three wrappers and six renamed call sites, nothing else. None expected in Release. Every pool blob and single block comes through here, so a wrong wrapper would fail at startup, not subtly. Debug: sysMemorySize is GlobalSize, as before; only POSIX reports a usable size that can exceed the request. low Windows: OPEN (Left: a Debug build's memory report.) Windows Release starts and plays; a Debug build's memory report totals match a build before this change.
2026-09-26 B5 (GameEngine) GameClient/GameClient.cpp preloadAssets' memory diagnostics read three figures through a file-local getPreloadMemoryStatus() into a PreloadMemoryStatus of size_ts, where they declared MEMORYSTATUS before, after and called GlobalMemoryStatus eight times. The Windows body is GlobalMemoryStatus and copies dwAvailPageFile, dwAvailPhys, dwAvailVirtual (all SIZE_T on x64). The DEBUG_LOG text is unchanged, field names included. Log values only: none of this reaches game state. If a field were copied wrong, one preload log line would show another figure. low Windows: VERIFIED (VM check: an E1 run's startup log (det0_backDebugLogFile.txt) has the three Preloading memory lines. Their figures pass size_t through %d and print negative on the 16 GB VM, as MEMORYSTATUS's SIZE_T fields did before (latent, log only)) Windows with the startup log on: the Preloading memory lines read as before.
2026-09-26 B5 (GameEngine) GameClient/GameText.cpp GameTextManager::init's window-title block (extern HWND ApplicationHWnd, SetWindowText, SetWindowTextW) moved unchanged into a file-local setApplicationWindowTitle(), called from the same place; off Windows the function does nothing until C2 owns a window. None expected: the same statements in the same order, one call deeper. low Windows: OPEN (Left: the window title.) Windows: the window title reads "Command & Conquer Generals Zero Hour" (or the language's own) as before.
2026-09-26 B5 (GameEngine) GameClient/GlobalLanguage.cpp AddFontResource, RemoveFontResource and the GetVersionEx Win9x test moved unchanged into file-local installLocalFont(), removeLocalFont() and isWindows9x(); init tests !installLocalFont(font) for AddFontResource(...) == 0, and isWindows9x() && isExist keeps the old evaluation order (doesFileExist still runs first, unconditionally, for NameKeyGenerator's sake). Off Windows: no install (D6's), Win9x never. None expected: the same calls, same order, one call deeper. A wrong negation would assert on every font at startup in Debug and leave the language's fonts uninstalled in Release. low Windows: OPEN (Left: a language with LocalFontFile entries.) Windows, a language with LocalFontFile entries (Korean, Chinese): its text draws in its own font; a Debug start raises no "Failed to add font" assert.
2026-09-26 B5 (GameEngine) Include/Common/EarlyOptions.h <windows.h>/<shlobj.h> and the three Windows-service functions (findDocumentsFolderA, isDirectoryWritable, findUserDataDirectory) are under _WIN32, unchanged; off Windows findUserDataDirectory returns false until C1. The portable Options.ini reader calls strncasecmp/strcasecmp where it called _strnicmp/_stricmp, and the header includes Platform/MSVCCompat.h, whose MSVC strcasecmp/strncasecmp are inline forwarders to those two (MSVCCompat rule: standard name at the call site). None expected: the same comparisons through a one-line inline forwarder; the include is guarded and every includer already had it (WinMain via Lib/BaseType.h, GlobalData via PreRTS.h). low Windows: OPEN (Left: Options.ini's windowmode = 2 and ClassicGraphics.) Windows: a hand-edited Options.ini with windowmode = 2 (lower case) still opens borderless; ClassicGraphics = TRUE still reads as yes.
2026-09-26 B5 (GameEngine) Include/Common/Monitors.h <windows.h> and every function body are under _WIN32, unchanged. MonitorEntry spells its two Windows types through names that are them on Windows: typedef RECT MonitorRect; and enum { MONITOR_DEVICE_NAME_LENGTH = CCHDEVICENAME };. Off Windows: one 800x600 primary monitor offering one mode, until C2 enumerates displays with SDL3. None expected: the same types and the same array bound, spelled through a typedef and an enumerator; WinMain's const RECT screen = findMonitor(...).rect still gets a RECT. low Windows: OPEN (Left: the monitor list, a second monitor.) Windows: the options menu lists the same monitors and resolutions; borderless on a second monitor opens there at its size.
2026-09-26 B5 (GameEngine) GameNetwork/DownloadManager.h, GUICallbacks/Menus/DownloadMenu.cpp, CMakeLists.txt; new GameNetwork/DownloadManagerPosix.cpp DownloadManager.h's WWDownload includes and class are under _WIN32, unchanged (windows_view_diff: identical). In DownloadMenu.cpp, static time_t lastUpdate = 0; and static Int timeLeft = 0; are declared a few lines earlier, above the Windows-only DownloadManagerMunkee block, because the menu's own functions use them. The CMake platform split leaves DownloadManagerPosix.cpp out on Windows, so Windows builds the same sources. None expected: two file-scope statics with constant initializers, moved within the file, before any use. low Windows: OPEN (Left: the patch-download menu.) Windows: the patch-download menu (GameSpy patch check) still shows its progress and time left, if that service can be reached at all.
2026-09-26 B5 (GameEngine) GameClient/ChromaKeyboard.cpp The CHROMADRILL debug-log line is built with snprintf where it used _snprintf (MSVCCompat rule: standard name at the call site). The two differ only on truncation - _snprintf returns -1 and leaves the buffer unterminated, snprintf returns the would-be length - and this line cannot truncate: at most 18 + 22 * 7 + 1 characters into 256. None expected: the same characters, the same lengths, since nothing is ever cut. Only DEBUG_LOGGING builds (Release included, through RELEASE_DEBUG_LOGGING) compile it. low Windows: OPEN (Left: the CHROMADRILL lines with Chroma lighting.) Windows with the startup log and Chroma lighting on: the CHROMADRILL: row lines read as before.
2026-09-26 B5 (GameEngine) Menus/OptionsMenu.cpp, Menus/MainMenu.cpp Three pointer-to-integer casts go through uintptr_t/intptr_t - (UnsignedInt)(uintptr_t)GadgetComboBoxGetItemData(...) twice, (GameDifficulty)(Int)(intptr_t)userData - the pattern of the 2026-09-25 cast row; and the firewall-behaviour preference is formatted with snprintf(num, sizeof(num), "%d", (Int)...) where it used itoa(..., num, 10). None expected: MSVC x64 truncated the pointer to its low 32 bits before and does now; itoa took an int and wrote base 10, which %d of the same Int writes. low Windows: OPEN (Left: the options menu's IP choices, the firewall refresh, a campaign's difficulty.) Windows: the options menu keeps the LAN and online IP choices; "refresh firewall" writes FirewallBehavior = 0 to Options.ini; a campaign starts at the chosen difficulty.
2026-09-26 B5 (GameEngine) Common/GlobalData.cpp m_doubleClickTimeMS is set from a file-local systemDoubleClickTimeMS() whose Windows body is return GetDoubleClickTime();, where the constructor called GetDoubleClickTime() itself. Off Windows it returns 500, Windows' own default, until C3 reads the platform's setting. None expected: the same call, one function deeper, converted to UnsignedInt as the field always was. low Windows: OPEN (Left: a non-default double-click speed.) Windows with a non-default double-click speed in Mouse settings: double-clicking a unit selects all of its type at that speed, as before.
2026-09-26 B5 (GameEngine) Menus/MainMenu.cpp The three _spawnl(_P_NOWAIT, "WorldBuilder*.exe", ...) < 0 tests call a file-local startWorldBuilder(exe) whose Windows body is return _spawnl(_P_NOWAIT, exe, exe, NULL) >= 0;, as !startWorldBuilder(...). Off Windows it returns FALSE: there is no WorldBuilder to start, so the menu shows its existing "could not load" box. None expected: the same call with the same arguments, and the same condition negated twice. low Windows: OPEN (Left: the WorldBuilder button.) Windows with WorldBuilder.exe beside the game: the main menu's WorldBuilder button starts it; without it, the "could not load" box appears.
2026-09-26 B5 (GameEngine) Common/System/FunctionLexicon.cpp All 238 table entries spell (void *)Name where they converted Name to void *func implicitly, an MSVC extension clang and GCC reject. Script-made; removing the 238 casts gives the old file exactly. The tables stay aggregates with address constants. MSVC's implicit function-to-void * conversion is the conversion the cast spells, so the object code should not change. If MSVC treated the cast differently - it has no reason to - a window callback would resolve to the wrong address and a menu would misbehave at once. Measured off Windows only: the real FunctionLexicon.o has no dynamic initializer under Apple clang (Linux not checked: macOS is CI). low Windows: OPEN (Left: the menus (every run here is headless), and the dumpbin /relocations comparison.) Windows Release: the menus work (every one resolves its callbacks through these tables); dumpbin /relocations on the object lists the same entries before and after.
2026-09-26 WWLib Debug new Platform/BreakIntoDebugger.h; WWLib/refcount.cpp; GameEngine/Source/Common/System/Debug.cpp DebugBreak() is called through breakIntoDebugger(), an inline function whose Windows body is DebugBreak(); the header includes <windows.h> on Windows, as refcount.cpp did at the same place. Debug.cpp's console log keeps OutputDebugString under _WIN32. windows_view_diff: the include and the three renamed calls, nothing else. Only Debug builds reach these lines (refcount's BreakOnReference, the assertion box's Retry). If the inline wrapper were not inlined, a debugger would stop one frame deeper, inside breakIntoDebugger; nothing else changes. low Windows: OPEN (Left: a Debug build under a debugger.) Windows Debug: set BreakOnReference to a live object in the debugger, or press Retry on an assertion; the debugger stops, and continues.
2026-09-26 B5 (GameEngine) GameNetwork/GameSpy/MainMenuUtils.cpp Four callbacks read their run number as (Int)(intptr_t)param where they cast (Int)param, the pattern of the 2026-09-25 cast row. Everything else - the DNS lookup's CreateThread and TerminateThread, _open/_close in hasWriteAccess - is unchanged inside _WIN32 (windows_view_diff: the four casts only). None expected: MSVC x64 truncates the pointer to its low 32 bits either way. low Windows: OPEN (Left: the GameSpy patch check.) Windows: the GameSpy patch check and online count still start (if the service answers) and a cancel still stops them.
2026-09-26 B5 (GameEngine) Common/System/GameMemory.cpp Five sizeof Type (an MSVC extension; standard C++ needs parentheses around a type) are sizeof(Type); the Debug alignment check tests (uintptr_t)result&3 where it tested unsigned(result)&3; the Debug pool report's second loop declares MemoryPool *pool itself instead of reusing the first loop's, which only VC6's for-scope allowed. None expected: the same sizes; the same low two bits of the pointer; the same loop. The last one is a fix on Windows too, where a conforming for-scope rejects the old form in Debug. low Windows: OPEN (Left: a Debug build's pool reports.) Windows Debug: pool overflow and underflow reports print as before.
2026-09-26 C1 (b) GameEngine/Source/Common/System/LocalFile.cpp The _open/_read/_write/_lseek/_close calls and the _O_* flags go through file-static helpers (openFile, readFile, writeFile, seekFile, closeFile) and an OPEN_* enum. On Windows each helper is static inline and makes exactly the call it replaced, with the same arguments, and each OPEN_* equals its _O_*. readFile's extra text flag is unused there. windows_view_diff.py shows only that substitution. If an SDK header that PreRTS.h pulls in defines a macro with one of the OPEN_* names, the enum does not compile. mingw-w64's headers define none of the thirteen names; MSVC's SDK was not checked. The helpers' parameter types are the CRT's (_read takes unsigned int, _lseek long), so the implicit conversions are the ones the call sites had. The Windows block was compiled standalone with mingw-w64 against the real <io.h> (-Wall -Wextra, clean), not with MSVC. high Windows: VERIFIED (CI: build, test_gameengine.) Build gameengine on Windows. Then ctest -R test_gameengine: it reads a real INI through LocalFile.
2026-09-26 C1 (b) GeneralsMD/Code/CMakeLists.txt (Windows block) list(FILTER GAMEENGINEDEVICE_SOURCES EXCLUDE REGEX "/Source/PosixDevice/") after the Win32DIMouse.cpp removal, because the recursive glob would otherwise pick up the new POSIX-only PosixDevice/ sources. Checked with cmake -P running the same glob and filter over this tree: 105 found, 102 kept, none under PosixDevice/. The base revision's glob gives the same 102. If the filter did not match (e.g. a path spelling CMake gives differently on Windows), gameenginedevice compiles PosixLocalFileSystem.cpp, which includes posixpath.h, whose #error stops the build. Loud, not silent. medium Windows: VERIFIED (CI: build (a PosixDevice source would stop it at posixpath.h's #error)) Configure on Windows and confirm gameenginedevice's project lists no file under PosixDevice.
2026-09-26 C1 (b) MemoryInit.cpp, RAMFile.cpp, StreamingArchiveFile.cpp A PosixLocalFile pool row inside #if !defined(_WIN32), and the unused #include <io.h> inside #if defined(_WIN32). windows_view_diff.py reports all three identical to MSVC. None expected: the Windows text is unchanged. low Windows: VERIFIED (CI: build.) Build gameengine on Windows.
2026-09-26 C1 (b) follow-up GameEngine/Source/Common/System/GameMemory.cpp initMemoryManager's link check: char* linktest became char* volatile linktest. The pointer now escapes, so an optimiser cannot drop the three new/delete pairs whose calls theLinkTester counts. clang -O2 did drop them, and the process exit(-1)ed. Superseded 2026-09-26: removed on merge; B1 fixed the same exit by calling ::operator new/::operator delete by name (see its row), so the declaration is back to char* linktest, as on Windows. On Windows the calls were evidently kept, because the game starts, and volatile only forbids dropping them. The count stays 6 (10 with MEMORYPOOL_OVERRIDE_MALLOC). Deleting through a volatile-qualified pointer is ordinary C++. Not compiled with MSVC. low Windows: VERIFIED (CI: the game starts in every E1 run.) Build gameengine on Windows and start the game: it must get past initMemoryManager (a wrong count exits with no message).
2026-09-26 C1 (b) follow-up GameEngine/Source/Common/System/GameMemory.cpp initMemoryManager's link check: char* linktest became char* volatile linktest. The pointer now escapes, so an optimiser cannot drop the three new/delete pairs whose calls theLinkTester counts. clang -O2 did drop them, and the process exit(-1)ed. On Windows the calls were evidently kept, because the game starts, and volatile only forbids dropping them. The count stays 6 (10 with MEMORYPOOL_OVERRIDE_MALLOC). Deleting through a volatile-qualified pointer is ordinary C++. Not compiled with MSVC. low Windows: VERIFIED (CI: the game starts in every E1 run (this row repeats the one above)) Build gameengine on Windows and start the game: it must get past initMemoryManager (a wrong count exits with no message).
2026-09-26 C1 (g) WideCharFns.cpp, Lib/WideCharFns.h, Recorder.cpp The replay header's strings are written and read with fputc/fgetc on every platform. WideCharFileWrite was fwprintf(f, L"%ls", s) on Windows. Recorder's three fputwc(0, ...) are now WideCharFilePut, and its two fgetwc are now WideCharFileGet. Each code unit is two bytes, low first; WideCharFileGet returns 0xFFFF at the end, as MSVC's WEOF. The replay file format on Windows. The new calls reproduce MSVC's documented binary-mode behaviour: no conversion, raw wchar_t. If MSVC's fwprintf/fputwc on a "wb" stream did anything else - converted through the locale, or wrote a BOM - replays this build writes would differ from the shipped game's, and the shipped game's would read wrongly here. Wine's msvcrt agrees with the new bytes exactly (Tests/replay_wide_oracle.cpp); Microsoft's CRT was not run. This supersedes B1's %ws/%ls row for Recorder.cpp: no wide format call is left on the replay stream. high Windows: PARTLY VERIFIED (W2: Windows replays play back on Linux and back; CI: widechar_file_selfcheck. Left: the bytes against a replay from before C1 (g)) Record a replay on Windows with this build and with one from before C1 (g); the bytes from GENREP up to the game options must be identical. Then load each in the other build and run replay-check.ps1. Or build Tests/replay_wide_oracle.cpp with MSVC and compare its output with widechar_file_selfcheck's expected bytes.
2026-09-26 C1 (c) Common/LocalFileSystem.h, Win32LocalFileSystem.{h,cpp}, Tests/test_gameengine.cpp LocalFileSystem gains five pure virtuals: copyFile, deleteFile, moveFileReplacing, getFilesInDirectory and getCurrentDirectory. Win32 implements each with the call its sites made (CopyFileA, DeleteFileA, MoveFileExA(..., MOVEFILE_REPLACE_EXISTING), a FindFirstFileA/FindNextFileA/FindClose loop over dir\pattern, GetCurrentDirectoryA). TestLocalFileSystem gets inert overrides. A LocalFileSystem subclass this tree does not show would stop compiling (abstract class). Only the three listed exist in GeneralsMD/Code. The Win32 bodies were compiled verbatim against mingw-w64's <windows.h> (-Wall -Wextra, clean), not with MSVC. medium Windows: VERIFIED (CI: build, test_gameengine.) Build gameenginedevice and test_gameengine on Windows.
2026-09-26 C1 (c) GameState.cpp, GameStateMap.cpp, Recorder.cpp, GameEngine.cpp, InGameUI.cpp, Image.cpp, PopupReplay.cpp, ReplayMenu.cpp, PeerDefs.cpp Every direct CopyFile/DeleteFile/MoveFileEx/CreateDirectory/FindFirstFile/Get/SetCurrentDirectory goes through TheLocalFileSystem. The save list and the scratch-map cleanup list the save folder by path instead of changing into it. Under Wine, the old and new listings were byte-identical in all 12 cases, and the new one is what Win32LocalFileSystem runs. What does change on Windows: (1) a missing save folder lists nothing, where it listed the game folder and deleted its .map files (defect 16, fixed); (2) the menu's save-header read gets the full path; (3) Image.cpp loads user mapped images only if a file matches *.ini; (4) the three CreateDirectory sites (GameState, InGameUI, PeerDefs) now refuse paths of 256-259 characters (_MAX_DIR); (5) patch 1.01's Data\INI\INIZH.big delete runs a little later in GameEngine::init, still before the archives mount. The save/load menu reading headers by path is the change a player would see first if wrong: an empty or broken list. The rest are failure-path or edge changes. The error messages still come from GetLastError straight after the call. medium Windows: OPEN (Left: the save/load menu, replay copy and delete, the checkpoint folder, the Ladders folder.) On Windows: save a game and see it listed in the load menu with its details; load it. Save, copy (to the Desktop) and delete a replay from the menus. Watch a replay far enough to take checkpoints, and see the ReplayCheckpoints\<pid> folder emptied after. Start GameSpy once and see GeneralsOnline\Ladders created.
2026-09-26 C1 (e) Common/EarlyOptions.h, ReplayMenu.cpp, registry.cpp (comment), CMakeLists.txt The POSIX user-data and Desktop lookups live in EarlyOptions.h's #else branch. ReplayMenu.cpp's Desktop lookup gains an #else, and its EarlyOptions.h include is POSIX-only. test_gameengine's ZH_USER_DATA_DIR is POSIX-only. windows_view_diff.py reports all three C/C++ files identical to MSVC. None expected: the Windows text of every file is unchanged. low Windows: VERIFIED (CI: build.) Build gameengine on Windows.
2026-09-26 C1 (d) 26 GameEngine files, WWLib mixfile.cpp/argv.cpp/rawfile.cpp, Wwutil miscutil.cpp, EarlyOptions.h 78 raw fopen/remove/rename/access/_open/stat/unlink calls (with miscutil's ::remove, which becomes zh_unlink) became zh_fopen and its siblings, which on Windows are the same calls, inline, in zhio.h. Each file gains #include "zhio.h". windows_view_diff.py shows nothing else in those files. zhio.h pulls <direct.h> and <io.h> into files that did not include them before. A name clash there would be a compile error, not a behaviour change. EarlyOptions.h reaches WinMain.cpp and Win32BIGFileSystem.cpp, which now see zhio.h too. Not compiled with MSVC. medium Windows: VERIFIED (CI: build.) Build gameengine, gameenginedevice and generals on Windows.
2026-09-26 C1 (d) WWLib/zhio.h zh_stat(path, struct stat *), on Windows inline stat(path, status), the CRT's POSIX name, which CommandLine.cpp's mod check already called. It needs <sys/types.h> and <sys/stat.h>, now included by zhio.h on every platform. struct stat and stat are MSVC's POSIX-name compatibility spellings. With _CRT_NONSTDC_NO_WARNINGS defined, as it is, they compile quietly; without it, a deprecation warning. low Windows: VERIFIED (CI: build. The -mod directory check it was left for went with mod support on 2026-11-04.) Build any zhio.h includer on Windows.
2026-09-26 C1 (d) WWLib/rawfile.cpp RawFileClass::Set_Name's #ifdef _UNIX block, which lowercased names and turned backslashes into slashes, is removed; the POSIX arms call zh_open/zh_unlink. None on Windows: nothing defines _UNIX there (B5's tripwires). low Windows: VERIFIED (CI: build.) Build wwlib on Windows.
2026-09-26 C1 (d) CMakeLists.txt ZH_ZHIO_LIBS (wwlib wwdebug) is linked into the widechar gates, widechar_format_selfcheck, widechar_file_selfcheck and gametext_csf. It is set only when ZH_PLATFORM_POSIX; on Windows it is empty and the link lines are unchanged. If the variable were set on Windows, those tests would link wwlib too: harmless, only slower. low Windows: VERIFIED (VM check: widechar_crc_gate, widechar_format_selfcheck, widechar_file_selfcheck and gametext_csf, the targets of this kind Windows builds, link no wwlib.) Configure on Windows and confirm those five targets link no wwlib.
2026-09-26 C1 (f) Win32Device/Common/Win32BIGFileSystem.cpp, CMakeLists.txt Built off Windows too. Its <winsock2.h>/<windows.h>, its MessageBox and its BIGF DEBUG_CRASH are the _WIN32 side of new #ifs; the other sides are POSIX-only. Two includes were corrected in case (Common/file.h, Common/Registry.h). The two Win32 BIG sources are added to the POSIX-only posixdevice list. windows_view_diff.py: include case only. None expected: NTFS folds case, and the Windows text is otherwise unchanged. low Windows: VERIFIED (CI: build.) Build gameenginedevice on Windows.
2026-09-26 A0 37 files in WW3D2/ and W3DDevice/ (A0's change), Libraries/Include/Platform/RenderTypes.h, 7 WW3D2/W3DDevice headers Win32 scalar types out of the renderer (decision 7). DWORD becomes uint32/UnsignedInt where the value never reaches the device by address, and RenderUInt32 where it does. HRESULT/FAILED/SUCCEEDED/S_OK/E_FAIL become RenderResult/Render_Failed/Render_Succeeded/D3D_OK/RENDER_FAIL; RECT/POINT/HWND become RenderRect/RenderPoint/RenderWindow; LONG becomes Int, CONST becomes const. On Windows every Render* name is a typedef of the SDK type, and Render_Failed/Render_Succeeded are inline FAILED/SUCCEEDED. 20 in-class qualified member declarations (Class::member inside the class) lose the qualifier. windows_view_diff.py, normalised by those substitutions: nothing else changed. (1) A DWORD that became uint32/UnsignedInt (unsigned int, not unsigned long) but whose address does reach an SDK call: a compile error (unsigned int * against DWORD *), loud. The address-taking sites were found by name and read; others would have to be through a pointer the reading missed. (2) RenderTypes.h includes <windows.h>: it is placed after each file's own SDK includes, so win.h/winsock ordering is unchanged, but an MSVC build is the only proof. (3) Overload or template choice on unsigned int versus unsigned long: none found (std::vector<uint32> in ffprobe is filled from RenderUInt32 values). Not compiled with MSVC. medium Windows: PARTLY VERIFIED (CI: build. Left: a scene with water, shadows and bloom.) Build ww3d2 and gameenginedevice on Windows. Then any scene with water, shadows and bloom: those files hold most of the change.
2026-09-26 A1 183 files in WW3D2 and W3DDevice, 8 WWAudio/WWLib headers (include spelling only), Libraries/Include/Platform/MSVCCompat.h, CMakeLists.txt (A1's change) Decision 7 phase A1: the renderer compiles and links off Windows. What a Windows build compiles differently: (a) 335 #include lines respelled to the on-disk case; (b) TRUE/FALSE become true/false in WW3D2 (render states, BOOL locals, Begin_Chunk() == TRUE); (c) lstrcpy/lstrcat/lstrlen/lstrcmpi/ZeroMemory become strcpy/strcat/strlen/strcasecmp/memset, and lstrcpyn(d, s, n) becomes snprintf(d, n, "%s", s); (d) ISO spellings of what MSVC let through: functional casts, false as a null pointer, StringClass through varargs (now (const char *)), friend-only names forward-declared, enum forward declarations given : int, __int64 as Int64, register dropped, ShaderClass::ShaderClass(x); (e) six draw modules include Drawable.h before Xfer.h; (f) two pointer truncations fixed (surfaceclass.cpp alpha pointer, the assetmgr name length); (g) missingtexture.cpp's two arrays lose static (MSVC had made them internal); (h) dx11runtime.h, d3d8shadertranslate, RenderDeviceDescClass and the ZH_WW3D2_SOURCES list take A0's types or a shared list; (i) W3DModelDraw.cpp is stored LF (it held a raw NUL, so git had kept it binary and CRLF). Everything else is behind #if defined(_WIN32), with the Windows lines as they were. Checked: every changed .cpp compiles under MinGW-w64 against the Windows headers with no error it did not have before (about 60 of them, many clean where they were not); the Windows ww3d2 source set is the same 112 files. windows_view_diff.py over A1's change (with _WINDOWS resolved): 203 C/C++ files, 7 identical, 126 include case only, 56 different, each difference one of (a)-(h). (1) true where an int/BOOL TRUE was: a bool overload or template chosen instead - each site was read, and every one is an int/unsigned/BOOL parameter or a bool comparison. (2) snprintf against lstrcpyn: the same bytes for n > 0 on a C99 snprintf (MSVC 2015 and later); an older CRT's _snprintf-like snprintf would not terminate on truncation. (3) strlen where lstrlen took NULL: lstrlen(NULL) is 0, strlen(NULL) faults; the three sites are guarded or never NULL, by reading. (4) missingtexture.cpp's arrays now external: a clash with another object's missing_image_pixels would fail the link, loudly; there is none in the tree. (5) The : int on GraphicsVenderID and waveType: MSVC's unscoped enums are int already, so no layout moves. (6) The include-order change in the draw modules: MSVC compiled the old order, and the new one is the order every other draw module uses. (7) The two pointer-truncation fixes: surfaceclass.cpp's changes behaviour only above 4 GB, from a fault to the right answer, and only Font3D (never created by the game) reaches it; assetmgr.cpp's gives the same number it always did. Not compiled with MSVC. medium Windows: PARTLY VERIFIED (CI: build. Left: a skirmish with shadows and water, the window modes, F12, -video.) Build ww3d2 and gameenginedevice with MSVC. Then a skirmish with shadows, water and the options screen's window modes, an F12 screenshot and a -video range.
2026-09-26 A1 findings GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp Port defect 18 fixed: CreateBMPFile, which writes F12 screenshots and -video frames, is the portable writer on Windows too, through zh_fopen (fopen there) instead of CreateFile/WriteFile. It reads exactly the image's 3 * width * height bytes and pads each row to four, where the Windows writer wrote (width + 7) / 8 * height * 24 bytes out of that buffer: past its end when the width is not a multiple of 8, and a skewed picture when it is not a multiple of 4. zhio.h is included on Windows now too. Checked: a 5x3 image written by this code is clean under AddressSanitizer, read back by macOS's own decoder (sips) as 5x3, and every row holds its bytes padded to 16; W3DDisplay.cpp compiles under MinGW-w64 against the Windows headers with _WINDOWS and WIN32 defined. (1) A path CreateFile opened and fopen does not: both take the same ANSI path and neither is asked to share; a screenshot that fails to open is silently skipped either way. (2) Byte-identical files: a width that is a multiple of 8 gives the same header and pixels as before except biSizeImage, now the padded size; any other width gives a correct file where it gave a broken one. Not compiled with MSVC. low Windows: OPEN (Left: F12 screenshots.) Take an F12 screenshot at 1366x768 windowed and at 1920x1080; both open in any viewer, straight.
2026-09-26 B5 (GameEngine) Menus/WOLBuddyOverlay.cpp, Menus/WOLLobbyMenu.cpp, GUI/GameWindowTransitionsStyles.cpp Four forward declarations - insertChat, refreshGameList, refreshPlayerList, drawTypeText - say static, as their definitions in the same file always did. MSVC accepted the mismatch as an extension (C4211, "redefined extern to static") and gave each internal linkage; clang and GCC reject it. No other file names them. None expected: the linkage MSVC already gave them, now declared. low Windows: PARTLY VERIFIED (CI: build. Left: the buddy overlay, lobby lists, transitions.) Windows: builds as before; the buddy overlay, lobby lists and window transitions behave as before.
2026-09-26 B5 (GameEngine) Libraries/Source/profile/profile.h, profile_highlevel.h, profile_funclevel.h Six _int64/unsigned _int64 spellings are long long/unsigned long long, and ProfileFuncLevel's GetId returns (unsigned)(uintptr_t)m_threadID where it returned unsigned(m_threadID). These are the public headers the engine includes (Shell.cpp, GameLogic.cpp) even where the profile library is not built. None expected: MSVC treats _int64 and long long as one type with one mangling, so the Windows-only profile .cpp files, which still say _int64, match these declarations; the thread id keeps the pointer's low 32 bits, as before. low Windows: OPEN (Left: a _PROFILE build.) Windows with the profiler on (_PROFILE): profile.lib links and reports as before.
2026-09-26 B5 (GameEngine) Common/PerfTimer.cpp Deleted ProfileGetTime(__int64&), an x86 __rdtsc reader with no caller in the file or the engine; every caller is in the profile library, which has its own copy in profile/internal.h. None: an unreferenced inline function. low Windows: VERIFIED (CI: build.) Windows: builds and links as before.
2026-09-26 B5 (GameEngine) GameLogic/AI/AIPathfind.cpp 19 __int64 are Int64 (BaseType's int64_t, one type with __int64 on MSVC); 20 return false; in functions returning Path * are return NULL;; two register keywords (removed from C++17) are dropped. None: the same types, the same null pointer (false converted to it), and register never changed codegen. Simulation code, so stated plainly: nothing here reaches computed values. low Windows: VERIFIED (CI: E1.) Windows: a replay CRC-compares as before (replay-check.ps1).
2026-09-26 B5 (GameEngine) new Platform/SleepMilliseconds.h; GUI/LoadScreen.cpp, GameNetwork/FileTransfer.cpp, GameClient/GameClient.cpp, GameLogic/System/GameLogic.cpp Eleven Sleep(n) calls (six in LoadScreen, one in FileTransfer, and the three B5 had fenced inline) call sleepMilliseconds(n), whose Windows body is ::Sleep(n); the header includes <windows.h> on Windows. LoadScreen's static BOOL firstLoad is a Bool: it is only ever set and tested as TRUE/FALSE. None expected: the same call, one inline function deeper; none of these waits is a simulation step (load screens, a video frame wait, map-transfer pacing). low Windows: OPEN (Left: the load screens, the intro video, a map transfer.) Windows: the load screens, the intro video and a multiplayer map transfer behave as before.
2026-09-26 B5 (GameEngine) GameLogic/Object/Contain/OpenContain.cpp, GameNetwork/FirewallHelper.cpp Five itoa(v, buf, 10) are snprintf(buf, sizeof(buf), "%d", (Int)v): three in OpenContain build an exit or fire-point bone name's number, two in FirewallHelper write Options.ini values. FirewallHelper's debug log after a failed gethostbyname reports WSAGetLastError() on Windows, unchanged, and h_errno elsewhere. None expected: itoa of an int in base 10 and %d of the same Int write the same characters. OpenContain is simulation code: the bone names are unchanged, so the exits used are too. low Windows: PARTLY VERIFIED (CI: E1. Left: exits and fire points by eye.) Windows: units leave a multi-exit building by the same doors, a gattling unit fires from the same points; a replay CRC-compares as before.
2026-09-26 B5 (GameEngine) GameClient/SelectionInfo.cpp, GUI/GameWindowManagerScript.cpp drawableListToFill = FALSE; and a return FALSE; from a function returning GameWindow * are NULL. None: MSVC converted FALSE (0) to the same null pointer. low Windows: VERIFIED (CI: build.) Windows: builds as before.
2026-09-26 B5 (GameEngine) WW3D2/dllist.h DLDestroyListClass's destructor calls this->Head() where it called Head(). Head is a member of the dependent base DLListClass<T>; standard two-phase lookup needs this->, MSVC's permissive lookup did not. None: the same member function. low Windows: VERIFIED (CI: build.) Windows: builds as before.
2026-09-26 B5 (GameEngine) new Platform/DoubleClickTime.h; Common/GlobalData.cpp, GUI/Gadget/GadgetListBox.cpp systemDoubleClickTimeMS() moves from a GlobalData-local function to a shared header (Windows body return ::GetDoubleClickTime();, the header including <windows.h> on Windows), and GadgetListBox's file-static doubleClickTime is initialised from it where it called GetDoubleClickTime() directly. None expected: the same call at the same moment, static initialisation for the list box and GlobalData's constructor for the global. low Windows: OPEN (Left: a list box at a non-default double-click speed.) Windows with a non-default double-click speed: double-clicking a list-box entry (a map, a save) takes effect at that speed, as before.
2026-09-26 B5 (GameEngine) new Platform/IsWindows9x.h; GameClient/GlobalLanguage.cpp, GUI/HeaderTemplate.cpp, Menus/PopupPlayerInfo.cpp The three GetVersionEx/VER_PLATFORM_WIN32_WINDOWS tests call one isWindows9x(), whose Windows body is that test (the header includes <windows.h> on Windows); GlobalLanguage's file-local copy of it moves there. HeaderTemplate and PopupPlayerInfo's nested if (GetVersionEx) { if (9x) ... } becomes if (isWindows9x()) .... None expected: the same query and the same condition; the nested form and the && form are true in exactly the same cases. low Windows: OPEN (Left: HeaderTemplate.ini, the player-info checkboxes.) Windows: HeaderTemplate.ini (not the 9x file) loads, and the player-info popup's Asian-text checkboxes stay enabled, as before.
2026-09-26 B5 (GameEngine) Menus/PopupPlayerInfo.cpp messageBoxYes's forward declaration says static, as its definition always did (MSVC's C4211 extension gave it internal linkage). None: the linkage it already had. low Windows: VERIFIED (CI: build.) Windows: builds as before.
2026-09-26 B5 (GameEngine) GameClient/InGameUI.cpp Two replay-checkpoint timers hold Clock_Milliseconds() (an unsigned int) in an UnsignedInt where they used DWORD, the same width and signedness on Windows. The checkpoint folder's name uses GetCurrentProcessId() on Windows, unchanged, and getpid() elsewhere. None expected: the same 32-bit unsigned arithmetic, and the Windows call untouched. low Windows: OPEN (Left: replay rewind's checkpoints.) Windows: replay rewind still writes and forgets its checkpoints.
2026-09-26 B5 (GameEngine) Menus/WOLLoginMenu.cpp obfuscate's key variable is xorKey, not xor (a C++ alternative token for ^ that MSVC does not reserve). isAgeOkay's three GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, "yyyy"/"MM"/"dd", ...) + atoi move into a file-local todaysDatePart(picture) whose Windows body is that call and that atoi; off Windows it is localtime_r's year, month or day. None expected: a renamed local, and the same three calls one function deeper. low Windows: OPEN (Left: GameSpy account creation's age check.) Windows, GameSpy account creation (if it answers): a birth date 13 years ago today is accepted and 12 years ago is refused, as before.
2026-09-26 B5 (GameEngine) Menus/SkirmishGameOptionsMenu.cpp CheckForCDAtGameStart passes its callback as the message box's void *userData with an explicit (void *) cast, the conversion MSVC made implicitly (see FunctionLexicon's row); startPressed's local BOOL isReady is a Bool. None expected: the same pointer value, and a flag only ever set to and tested for TRUE/FALSE. low Windows: OPEN (Left: the insert-CD box.) Windows without the CD check passing: the insert-CD box still starts the game when OK is pressed.
2026-09-26 B5 (GameEngine) Input/Keyboard.cpp, GUI/Gadget/GadgetTextEntry.cpp, MessageStream/LookAtXlat.cpp Keyboard's layout-language test calls a file-local keyboardLayoutLanguage() whose Windows body is GetKeyboardLayout(0), masked to its low word through uintptr_t where it cast the HKL to UnsignedInt; off Windows it is 0 until C3. The text entry's IME-character test compares with u'\r' (WideChar is char16_t since B1) where it compared with VK_RETURN, both 13. LookAtXlat includes windows.h only on Windows (windows_view_diff: identical; it uses nothing from it). None expected: the same low 16 bits of the same handle, and the same constant. low Windows: OPEN (Left: a French layout's key names, Enter in a text entry.) Windows on a French keyboard layout: the numpad keys keep their French names in the key-mapping screen; Enter still finishes a text entry.
2026-09-26 B5 (GameEngine) GameLogic/ScriptEngine/ScriptEngine.cpp The developer-tool DLLs (DebugWindow.dll, ParticleEditor.dll, vtuneapi.dll) are loaded and called through file-local loadToolDLL, findToolProc and freeToolDLL, whose Windows bodies are ::LoadLibrary, ::GetProcAddress and ::FreeLibrary, over ToolModule/ToolProc, which are typedef HMODULE/typedef FARPROC on Windows: 3 + 31 + 3 call sites and 3 + 22 declarations renamed. Six __int64 condition timers are Int64 (the same type on MSVC). Off Windows no tool DLL loads. None expected: the same calls with the same arguments, through file-local functions, and the same types under other names. low Windows: OPEN (Left: -scriptDebug and -particleEdit.) Windows, windowed with -scriptDebug: the script debugger window opens and follows the scripts; with -particleEdit the particle editor opens.
2026-09-26 B5 (GameEngine) Include/Common/StackDump.h; GameSpy/Thread/BuddyThread.cpp, PersistentStorageThread.cpp, GameResultsThread.cpp, PeerThread.cpp, PingThread.cpp The five GameSpy threads call InstallThreadExceptionTranslator() first thing where they called _set_se_translator( DumpExceptionInfo ); it is a header-inline function in StackDump.h whose Windows body is that call, and which does nothing off Windows (no structured exceptions; crash reporting there is C5's). None expected: the same call on the same thread, one inline function deeper. low Windows: OPEN (Left: a crash inside a GameSpy thread.) Windows: a crash inside a GameSpy thread still writes the exception dump and stack to the log.
2026-09-26 B5 (GameEngine) Menus/WOLGameSetupMenu.cpp Behaviour change, port defect 13 (a project decision). The staging room's "STATS/" message formats formatPlayerKVPairs(subStats).c_str() where it passed the std::string itself through %s. Intended: on Windows the message's text after the profile id changes from the string object's bytes (garbage for anything over 15 characters) to the stats list itself. Only GameSpy staging rooms see it. low Windows: OPEN (Left: a GameSpy staging room.) Windows, GameSpy staging room (if it answers): another player sees this player's wins and losses.
2026-09-26 B5 (GameEngine) Menus/WOLLoginMenu.cpp obfuscate() frees its NEW char[] buffer with delete[] buf where it used delete buf (a project decision; latent undefined behaviour). None expected: both CRTs already released a char array either way; this removes the undefined behaviour, not a visible one. low Windows: OPEN (Left: GameSpy's remember-me.) Windows, GameSpy login with "remember me": the saved login still reads back.
2026-09-26 B5 (GameEngine) Common/System/registry.cpp Windows body unchanged under _WIN32 (windows_view_diff: identical); off Windows the three reads come from Registry.ini in the user data directory, and until C1 places it every value keeps its default. Recorded because a value could not be established: GetRegistryVersion's default is 65536 (0x10000), and what a Windows install holds depends on its patch level: a 1.0 install writes dword:00010000 (RegFiles.net's copy of the key), and the 1.04 patch rewrites it through the launcher's patcher (Tools/Launcher/patch.cpp) to the patch's number, reported as 00010004; no primary source for that number is in this repo. The value reaches only GameSpy's peerSetTitle and the options screen's version label - not LAN matching, not the replay header, not the CRC (those use TheVersion and the exe CRC). GetRegistryMapPackVersion (65536; RegFiles.net shows 00010000) reaches only WWDownload's patch URL, which is Windows-only; GetRegistryGameName has no callers. A Mac player in a GameSpy-style lobby would report 1.0 where a patched Windows player reports 1.04, if such a lobby ever compares it; the options label would read 1.0. low Windows: OPEN (Left: a retail 1.04 install's registry value (the VM has none)) A Windows 1.04 install: read HKLM\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Command and Conquer Generals Zero Hour\Version and record the number here; the launcher then writes the same into Registry.ini.
2026-09-26 B5 (GameEngine) GameNetwork/Network.cpp, Menus/ScoreScreen.cpp Network's four __int64 frame-timing locals are Int64 (BaseType's int64_t, the same type on MSVC); ScoreScreen's one Sleep(n) calls sleepMilliseconds(n) (Platform/SleepMilliseconds.h, ::Sleep on Windows). None expected: the same type, and the same call one inline function deeper. low Windows: OPEN (Left: a LAN game's pacing, the score screen.) Windows: a LAN game's frame pacing and the score screen behave as before.
2026-09-26 wwmath axis Tests/test_wwmath.cpp, WWMath/test_inverse.cpp Five axis-angle test matrices normalize their axis first (Vector3 axis(...); axis.Normalize();). None to the game: test code only. The tests' checks are round trips and agreements, so a Windows run passes or fails exactly as before in Release; a Windows Debug build no longer stops on matrix3d.h:594's assert. low Windows: VERIFIED (CI: test_wwmath, wwmath_selfcheck.) Windows: ctest -R "test_wwmath|wwmath_selfcheck".
2026-09-26 B1 (.csf) GameEngine/Source/Common/System/GameMemory.cpp (initMemoryManager) The link test calls ::operator new/::operator new[]/::operator delete/::operator delete[] by name, three pairs, where it used three new-expressions and their deletes. It still counts six calls into this file's operators and still exits if it sees another number. Off Windows this was a defect: clang at -O3 elides a new-expression paired with its delete (C++14 allows it), the count stayed 0, and initMemoryManager called exit(-1) - silently in a release build, since DEBUG_CRASH is empty there. Every POSIX build of the game would have stopped before its first frame. On MSVC the count was already 6. An explicit call to a replaceable operator new is an ordinary call no compiler may drop, so it is 6 there too; if MSVC ever reached a different operator by name than through new char, the game would exit at start-up, loudly in a debug build. low Windows: VERIFIED (CI: the game starts.) Windows: the game starts.
2026-09-26 B1 (.csf) Tests/test_gametext_csf.cpp, CMakeLists.txt (gametext_csf) New test, registered on every platform: the real GameText.cpp, RAMFile.cpp, File.cpp, GameMemory.cpp and MemoryInit.cpp load Data\English\generals.csf out of the install's EnglishZH.big, and every label is checked against an independent reading, nine against hand-written English text. Prints golden strings 6422 of 6422 equal 307740 units 0x62CF1DC2 for the 1.04 English file and asserts it. Skipped (77) without ZH_GAME_DATA. This row is the Windows half of B1's ".csf loads on both platforms". The golden line is the thing to diff: a Windows build that prints another hash reads the game's text differently from the Mac. Compile: all six translation units are clean under mingw-as-MSVC -fsyntax-only; link not tried. ApplicationHWnd is stubbed under _WIN32 for GameText.cpp's window title. medium Windows: VERIFIED (W2 and CI: gametext_csf with ZH_GAME_DATA, golden 0x62CF1DC2.) Windows: configure with -DZH_GAME_DATA=<folder holding zerohour\> and ctest -R gametext_csf -V; the golden line must read 0x62CF1DC2.
2026-09-26 B5 (GameEngine) GameSpy/Thread/PeerThread.cpp Fixes a Windows build break from B14 (by reading, not compiled with MSVC). B14 made ThreadClass's running a std::atomic<bool> on every platform; PeerThread.cpp:1772 passed it to DEBUG_LOG's varargs, which needs a copy, and std::atomic's copy constructor is deleted in every standard library, MSVC's included. With RELEASE_DEBUG_LOGGING on by default, that line is compiled in Release. It now passes (Int)running.load(), which prints what the old volatile bool promoted to. It was B14's only non-boolean use of running in the tree (grep). If MSVC never compiled this line (DEBUG_LOG off), nothing was broken and nothing changes: the log text is the same. medium Windows: VERIFIED (CI: the Release build compiles PeerThread.cpp.) Windows Release build of the current tree compiles PeerThread.cpp; the log line reads "voluntarily ending peer thread 0".
2026-09-26 B5 (GameEngine) Common/GameEngine.cpp Twelve DWORDs holding Clock_Milliseconds() readings, their differences and millisecond constants are UnsignedInt (the same 32-bit unsigned type on Windows); the draw-delay drill's ::Sleep calls sleepMilliseconds (::Sleep on Windows). The ATL _Module (the embedded browser's COM host) and its Init/Term, ApplicationHInstance and the unused ApplicationHWnd extern are under _WIN32, unchanged; the model-checksum cache's scratch-file name uses GetCurrentProcessId() on Windows, unchanged, and getpid() elsewhere. None expected: the same unsigned 32-bit arithmetic and wrap-around, the same calls. low Windows: PARTLY VERIFIED (CI: the game starts and runs. Left: the -drawDelay drill.) Windows: the game starts and runs; a timing drill (-drawDelay) paces as before.
2026-09-26 B5 (GameEngine) new Common/MessageBoxFlags.h; Common/System/Debug.cpp, Common/GameEngine.cpp MessageBoxWrapper's flags and answers are the engine's MSGBOX_*/MSGBOX_ID_* names, each static_asserted equal to its SDK MB_*/ID* on Windows; 30 tokens renamed (token count: Debug.cpp 53 = 24 renamed + 17 in comments + 12 in direct ::MessageBox* calls, which keep the SDK names; GameEngine.cpp 6 = 6). Its signature is const char *, const char *, unsigned int (LPCSTR and UINT are those types). The five "hide the full-screen window" blocks call one hideFullScreenWindowForMessage() with that block as its Windows body. The log-flush timer's three DWORDs are UnsignedInt. Everything else Windows-only is under _WIN32 unchanged: the thread-id check, ::MessageBox/W/A, SetWindowPos, TheSystemIsUnicode's definition. None expected: equal numbers (checked at compile time), the same types, the same block through a function. low Windows: OPEN (Left: a Debug build's assertion box.) Windows Debug: an assertion shows Abort/Retry/Ignore and each button does what it did; a release crash shows "Technical Difficulties...".
2026-09-26 B6 (keys, MapObject) new GameEngine/Source/Common/WellKnownKeys.cpp, Common/MapObject.cpp; W3DDevice/GameClient/WorldHeightMap.cpp; Tests/test_gameengine_stubs.cpp The Windows link layout changes. The 128 well-known Dict keys and MapObject's data members are defined in gameengine now instead of gameenginedevice; the text of every moved definition is unchanged, and Common/MapObject.h is not touched, so MapObject's layout is the same. The three RenderObjClass members stay in WorldHeightMap.cpp. test_gameengine links the real keys and MapObject instead of its own copies (whose constructor and getThingTemplate differed from the game's) and keeps only the three render members, _WIN32-only. A symbol defined twice or not at all in generals.exe: two definitions would be a link error; none would be too, unless a stale object or the old gameengine.lib supplied it. Static-initialisation order moves: the keys are StaticNameKey objects constructed before main, now in a different library's object, and anything that reads one during another translation unit's static initialisation would see it unconstructed on one side and not the other. Nothing does today (keys are read by Dict lookups at run time, not in initialisers - not proved for every TU). test_gameengine tests now run against the real MapObject. high Windows: PARTLY VERIFIED (CI: build, ctest, E1. Left: WorldBuilder's own project.) Windows: full build and link of generals.exe (and WorldBuilder, which also compiles WorldHeightMap.cpp's neighbours - not in the CMake build, check its project); ctest; replay-check.ps1, since MapObject is what a map's objects are loaded into before the simulation starts. Proof done here: mingw-as-MSVC nm of the two new objects and the test stubs, and a grep of WorldHeightMap.cpp, which mingw cannot build (28 errors before and after, the same).
2026-09-26 B5 (LAN) GameNetwork/Transport.cpp Three from.sin_addr.S_un.S_addr read from.sin_addr.s_addr (one of them in a comment); s_addr is winsock's own macro for S_un.S_addr (mingw-w64's inaddr.h:25; the Windows SDK's inaddr.h is documented to carry the same define, not read here), so MSVC sees the same member. The two DEBUG_ASSERTLOGs call lastSocketError(), a static inline whose Windows body is return WSAGetLastError();, at the same point. WSAStartup/WSACleanup and m_winsockInit's handling are under _WIN32, unchanged. Not compiled with MSVC. None expected: the same member, the same call. low Windows: OPEN (Left: a LAN game between two Windows machines.) Windows: a LAN game between two machines lobbies and plays as before.
2026-09-26 B5 (LAN) GameNetwork/IPEnumeration.cpp; GameNetwork/udp.h, GameNetwork/Transport.cpp IPEnumeration's two gethostname failure logs call lastSocketError() for WSAGetLastError(); that helper moves from Transport.cpp (static inline) to udp.h (inline, beside GetWSAErrorString), Windows body return WSAGetLastError();. WSAStartup/WSACleanup and the gethostbyname lookup are under _WIN32, unchanged; the address list, its ascending sort and getMachineName are the shared code, unchanged. Off Windows the addresses come from getifaddrs fed through the same loop, and the machine name is cut at its first dot. Not compiled with MSVC. None expected: the same calls at the same points. low Windows: OPEN (Left: the LAN address list.) Windows: Options lists the machine's LAN addresses, lowest first, as before; a LAN lobby hosts on the chosen one.
2026-09-26 B5 (LAN) GameNetwork/NetworkDefs.h, GameNetwork/FirewallHelper.h, GameNetwork/LANAPI.h Compile-time checks only: sizeof(TransportMessageHeader) == 6, sizeof(ManglerData) == 20, sizeof(ManglerMessage) == 30, sizeof(LANMessage) == 471, and off MSVC a little-endian __BYTE_ORDER__ (MSVC does not define it, and skips it). FirewallHelper.h's size comments said 16 and 26; they say 20 and 30. The sizes were measured with clang on macOS arm64; for MSVC they follow from the field types (char, char16_t WideChar, bool, 32-bit int/unsigned, int-sized enums, all under pack(1)), by reading, not compiled. If MSVC laid any of them out differently, the build fails at the assert instead of the game talking a different wire format to a Mac. low Windows: VERIFIED (CI: build (the asserts compile)) Windows build compiles FirewallHelper.cpp, LANAPI.cpp and Transport.cpp.
2026-09-26 B6 (keys, MapObject) new GameEngine/Source/Common/WellKnownKeys.cpp, Common/MapObject.cpp; W3DDevice/GameClient/WorldHeightMap.cpp; Tests/test_gameengine_stubs.cpp The Windows link layout changes. The 128 well-known Dict keys and MapObject's data members are defined in gameengine now instead of gameenginedevice; the text of every moved definition is unchanged, and Common/MapObject.h is not touched, so MapObject's layout is the same. The three RenderObjClass members stay in WorldHeightMap.cpp. test_gameengine links the real keys and MapObject instead of its own copies (whose constructor and getThingTemplate differed from the game's) and keeps only the three render members, _WIN32-only. A symbol defined twice or not at all in generals.exe: two definitions would be a link error; none would be too, unless a stale object or the old gameengine.lib supplied it. Static-initialisation order moves. Closed 2026-09-26: StaticNameKey's constructor is constexpr (it stores a sentinel and a pointer; key() resolves lazily), so every key is constant-initialized at load time, before any dynamic initializer anywhere runs, on every compiler: there is no order. Checked: clang requires it key by key (require_constant_initialization; with constexpr removed all 128 fail to compile), a constexpr probe in WellKnownKeys.cpp makes every compiler check the constructor, and the mingw-as-MSVC and clang objects of WellKnownKeys.cpp carry no initializer function or section - the keys are 128 static relocations in .data. test_gameengine tests now run against the real MapObject. high Windows: PARTLY VERIFIED (CI: build, ctest, E1. Left: WorldBuilder's own project (this row repeats 205)) Windows: full build and link of generals.exe (and WorldBuilder, which also compiles WorldHeightMap.cpp's neighbours - not in the CMake build, check its project); ctest; replay-check.ps1, since MapObject is what a map's objects are loaded into before the simulation starts. Proof done here: mingw-as-MSVC nm of the two new objects and the test stubs, and a grep of WorldHeightMap.cpp, which mingw cannot build (28 errors before and after, the same).
2026-09-26 B6 (constant-init keys) Common/NameKeyGenerator.h, Common/WellKnownKeys.h, Common/WellKnownKeys.cpp StaticNameKey(const char*) is constexpr. WellKnownKeys.h gains a WELL_KNOWN_KEY_CONSTANT_INIT token in DEFINE_KEY's instantiating form, empty except under clang. WellKnownKeys.cpp adds one static constexpr StaticNameKey probe. MSVC must accept a constexpr constructor with a mutable member and a const char* store, which C++11 allows and MSVC 2017+ implements; a rejection is a compile error, not a behaviour change. The keys' values are the same; only when they are set moves, to load time, which MSVC was free to do already for this constructor. low Windows: VERIFIED (CI: build.) Windows: build gameengine.
2026-09-26 B6 (GameSpy) GeneralsMD/Code/CMakeLists.txt The GameSpy SDK's add_subdirectory and its four GS_* cache settings are no longer inside if(ZH_PLATFORM_WINDOWS); Libraries/Source/GameSpy/CMakeLists.txt moved from the Windows vendored-file list to the common one. None intended: on Windows the same lines run in the same order, and the vendored check tests the same set of files (the GameSpy line is now checked before d3d8.h, which only changes which missing file a broken fetch names first). low Windows: VERIFIED (CI: build.) Windows: configure; gamespy builds as before.
2026-09-26 B6 (hooks) GameClient/InGameUI.cpp (addSignalMark), GameClient/RadiusDecal.cpp Both now test TheProjectedShadowManager for NULL before addDecal: addSignalMark returns without a mark, RadiusDecal skips its decal. The rest of this step is PosixDevice and a POSIX-only test, which Windows does not build. None on Windows as shipped: the W3D device creates the manager before either can run, so the test is always true. If a Windows build ever ran either without a device (a headless replay), it now draws nothing instead of crashing. MSVC-mode syntax of both files: the same errors before and after (1 and 0). low Windows: OPEN (Left: a smoke signal's mark, a radius decal.) Windows: send a smoke signal in a match and see its ground mark; select a unit with a radius decal.
2026-09-26 B6 (test_gameengine) Tests/test_gameengine.cpp, Tests/test_gameengine_stubs.cpp What MSVC sees: four Color literals in original_scheme_and_unknown_colors_pass_through_untouched are cast to Color (the same values), and the stubs define the same symbols with g_strFile/g_csfFile moved above the device stand-ins. Everything else is inside #if !defined(_WIN32) or keeps its Windows text in the #else. None intended. If MSVC ever warned on the narrowing it now does not; a changed value would fail that test. low Windows: VERIFIED (CI: test_gameengine.) Windows: ctest -R test_gameengine.
2026-09-26 B6 (link list) GeneralsMD/Code/CMakeLists.txt (gameengine's target_link_libraries) ww3d2, wwdownload, eabrowserdispatch, profile, wininet, imagehlp, imm32 are now spelled through variables set only inside if(ZH_PLATFORM_WINDOWS), the way debuglib and dinput8 already were. None intended: on Windows each variable holds its old name and sits in the old position, so the list is the same items in the same order. If a variable were misspelled, its library would vanish from the Windows link - loud, as unresolved externals. low Windows: VERIFIED (CI: build (generals.exe and test_gameengine link)) Windows: link generals.exe and test_gameengine.
2026-09-26 B6 (seen while porting the test) Tests/test_gameengine.cpp, simulation_trig_fingerprint_is_pinned Nothing changed. The test calls _controlfp(_PC_53, _MCW_PC) and _controlfp(_PC_64 | _RC_CHOP, _MCW_PC | _MCW_RC), and the same file says elsewhere (setfpmode_pins_the_control_word_from_whatever_it_finds) that on x64 "_controlfp fails fast on a mask that names _MCW_PC". Possibly a broken Windows test; verify on Windows. If MSVC's x64 CRT raises the invalid-parameter handler for _MCW_PC, this test ends the test_gameengine run on Windows where it is reached; if it ignores the field, the test passes and only proves the rounding half. medium Windows: VERIFIED (VM check: test_gameengine runs all 454 of its cases on Windows, 0 failed, so simulation_trig_fingerprint_is_pinned ran to its end.) Windows x64: ctest -R test_gameengine -V and read whether simulation_trig_fingerprint_is_pinned runs to its end.
2026-09-26 B5 (registry) Common/EarlyOptions.h findEarlyOptionValueIn's test of whether a line sets a key (skip blanks, case-insensitive key, blanks, =, blanks) moves verbatim into a new earlyOptionLineValue( line, key ), which returns where the value starts or NULL; the loop calls it and copies the value as before. Registry.ini's writer (registry.cpp, POSIX only) uses the same function, so it replaces the line the reader reads. Not compiled with MSVC. None expected: the same statements in the same order, through an inline function. Options.ini's early options (window mode, MSAA and the like) read as before. low Windows: OPEN (Left: WindowMode = 1 in Options.ini.) Windows: a hand-edited Options.ini with WindowMode = 1 still starts windowed.
2026-09-26 B6 (registry) GeneralsMD/Code/CMakeLists.txt, new GameEngine/Source/Common/System/WWDownloadRegistryPosix.cpp, new Tests/test_wwdownload_registry.cpp The new source is added to the Windows REMOVE_ITEM list beside the other *Posix.cpp, and the test is defined only off Windows. On Windows WWDownload's registry.cpp and urlBuilder.cpp stay the definitions, over the registry. None intended: GAMEENGINE_SOURCES on Windows loses exactly the file it gained. A slip would put a second definition of the four registry functions and FormatURLFromRegistry into the Windows link beside wwdownload's - a loud duplicate-symbol error. low Windows: VERIFIED (CI: build.) Windows: link generals.exe.
2026-09-26 B5 (GameEngine) Common/GameMemory.h, Common/System/GameMemory.cpp, Common/System/AsciiString.cpp, Common/System/UnicodeString.cpp; Tests/widechar_test_stubs.cpp; new Tests/test_premain_strings.cpp, CMakeLists.txt preMainInitMemoryManager loses static and is declared in GameMemory.h (the declaration was already there, commented out). AsciiString::ensureUniqueBufferOfSize and UnicodeString::ensureUniqueBufferOfSize call it when TheDynamicMemoryAllocator is NULL, just before they first use the allocator: one pointer test that is already loaded, with a not-taken branch (arm64 Release: ldr + cbnz). The widechar tests' stub file gains a never-reached preMainInitMemoryManager, since their allocator is never NULL. New tests test_premain_strings and test_premain_unicode are registered on every platform. Not compiled with MSVC. None where the static-init order already worked: the allocator is set, so the branch is not taken. Where a static constructor builds a string before anything has called operator new, Windows would have crashed as macOS did; now the manager starts, as it would have from operator new (PORTING.md, "Defects found while porting"). low Windows: VERIFIED (CI: the game starts, and test_premain_strings and test_premain_unicode pass in Release (the Debug build's printout waits for the Debug build)) Windows: the game starts. test_premain_strings and test_premain_unicode pass, and each prints "*** Initing Memory Manager prior to main!" in a Debug build.
2026-09-26 B5 (LAN) Common/MessageStream.h GameMessage::Type is enum Type : Int. Outside comments the diff is two tokens, : and Int (git diff --word-diff). A static_assert after the class checks that the underlying type is Int, and <type_traits> is included for it. NetPacket sends a message's type as sizeof(GameMessage::Type) bytes, so the width is part of the wire format. Not compiled with MSVC. None expected: MSVC's unfixed unscoped enum is already int underneath (its documented rule, as in the 62-enum pass above). Clang's was unsigned int (shown by the assert firing without the pin), so the pin moves clang to MSVC's type. The size (4) and integral promotion (to int) are the same either way. low Windows: PARTLY VERIFIED (CI: build. Left: a LAN game between Windows and a Mac.) Windows build compiles. A LAN game between a Windows and a Mac build exchanges commands.
2026-09-26 C2 CMakeLists.txt; GameClient/GameText.cpp; new GameClient/ApplicationWindowTitle.h The configure-time version headers (BuildVersion.h, GeneratedVersion.h and GENERATED) are written just above the Windows device block instead of inside it, so the POSIX generals gets the same ones. The same commands run earlier in configure; nothing reads GENERATED in between. GameText.cpp includes the new header, whose whole body is #if !defined(_WIN32), so it is empty on Windows (windows_view_diff: that include line is the only difference). The POSIX targets (sdldevice, the POSIX generals, and RELEASE_DEBUG_LOGGING on posixdevice/sdldevice/generals) sit in ZH_PLATFORM_POSIX branches. Not configured or compiled on Windows. None expected: the same headers with the same contents, and an empty include. low Windows: VERIFIED (CI: build; VM check: an E1 run's log reads "Generals version 2.1 (Release)" and "Built by: cmake".) Windows: configure and build generals; the log's banner reads "Generals version 2.1 (Release)", "Built by: cmake", as before.
2026-09-26 T1a (terrain data and maths) new GameLogic/WorldHeightMapData.{h,cpp}, GameLogic/TerrainHeightSampling.{h,cpp}; W3DDevice/GameClient/WorldHeightMap.{h,cpp}, BaseHeightMap.{h,cpp}; new Tests/test_terrain_golden.cpp, Tests/terrain_grid.h The simulation's terrain changes library, and WorldHeightMap's layout changes. WorldHeightMap is RefCountClass, WorldHeightMapInterfaceClass, WorldHeightMapData (RefCountClass still first): its height, cell and cliff members and 17 functions (parsing, cliff bits, flip and seismic flags) are the new base's, verbatim. ParseBlendTileData's first half is parseBlendTileCells, which it calls before the textures (the tail gained only int i, j;). BaseHeightMapRenderObjClass's getHeightMapHeight, isClearLineOfSight, getMaxCellHeight, isCliffCell, getClipHeight and initHeightData's min/max pass are gameengine's TerrainHeightSampling, verbatim but for m_map/getMaxHeight() becoming parameters; the render object's methods are one-line calls, so Windows runs the one copy. A member now read at a different offset only matters to code that addresses WorldHeightMap by layout: a grep found no sizeof/offsetof, no raw copy or read/write of the object, and W3DTerrainVisual::xfer writes the heights through getDataPtr, member-wise. The five (WorldHeightMap *)userData casts are void* round trips of the same type, and the new base has its own callbacks casting to its own type, because with RefCountClass first the base is not at the same address. Behaviour: a text change in any moved line would move every unit's height; the verbatim check, run against the pre-move commit, found every moved function identical (it caught one missed substitution in isClearLineOfSight's inactive #else branch, fixed). high Windows: VERIFIED (W2 and CI: build, E1, test_terrain_golden with ZH_GAME_DATA.) Windows: full build and link; replay-check.ps1; ctest -R test_terrain_golden with ZH_GAME_DATA must print same for all nine maps. Done here: the height golden - the original code under Wine, and the moved code on arm64 and on x86_64 under Rosetta, identical on nine maps; mingw-as-MSVC over all 864 Windows-side files, the same 3,412 errors before and after with line numbers set aside, 686 -> 688 clean (the two new files). The first after run caught two errors the Mac build cannot see: BaseHeightMap.h missing the new include, and initHeightData's m_mapDX/m_mapDY locals, which the moved block had taken with it and the shoreline pass still reads.
2026-09-26 C2 Common/MessageBoxFlags.h Two answers are added to the engine's message-box names, MSGBOX_ID_OK (1) and MSGBOX_ID_NO (7), each static_asserted equal to the SDK's IDOK and IDNO on Windows, as the others are. SDL's box answers with them off Windows. The hook TheMessageBoxHook is declared under #if !defined(_WIN32). Monitors.h's and Debug.cpp's changes are in their POSIX halves (windows_view_diff: identical). Not compiled with MSVC. None expected: two new enumerators nothing on Windows uses, checked against the SDK at compile time. low Windows: VERIFIED (CI: build.) Windows build compiles Debug.cpp (the asserts).
2026-09-26 Test harness user-data guard CMakeLists.txt; new Tests/test_user_data_guard.cpp; Tests/test_wwdownload_registry.cpp (POSIX-only) The guard file and the loop that gives every test its ZH_USER_DATA_DIR are inside if(ZH_PLATFORM_POSIX), so no Windows target gains a source. The one line Windows does see: test_terrain_golden's ctest ENVIRONMENT (set when ZH_GAME_DATA is configured) loses ZH_USER_DATA_DIR, keeping ZH_DATA_DIR. Windows' findUserDataDirectory never reads ZH_USER_DATA_DIR (EarlyOptions.h: its only getenv of it is in the POSIX half), so removing it changes nothing a Windows test reads. If that is wrong, Windows test_terrain_golden would put its GlobalData's folder under Documents, as Windows test_gameengine always has. low Windows: VERIFIED (VM check: test_terrain_golden's ENVIRONMENT is ZH_DATA_DIR alone, and it passes in CI.) Configure on Windows with ZH_GAME_DATA; ctest -R test_terrain_golden -V passes and the ENVIRONMENT line shows only ZH_DATA_DIR.
2026-09-26 T1c (defect 17) GameLogic/System/GameLogic.cpp, GameClient/TerrainVisual.h; W3DWater.{h,cpp}, W3DTerrainVisual.{h,cpp}; new GameLogic/WaterGridMotion.{h,cpp} The water grid's mesh motion leaves WaterRenderObjClass::update (the client pass) for WaterGridMotion::updateForLogicFrame, called at the top of GameLogic::update through a new pure virtual TerrainVisual::updateWaterGrid (W3DTerrainVisual's forwards to the render object). The step's text is unchanged, frame CI included (verbatim check). WaterRenderObjClass::WaterMeshData is now a typedef of WaterGridMotion::MeshPoint: the same four members in the same order; IN_MOTION is still 0x01. This changes what the simulation computes on Windows, deliberately: on a map with a WaveGuide1 waypoint (base Generals' CHI03, GLA01, USA06; no Zero Hour map), whenever the catch-up runs several logic frames in one pass (network games, a capped frame rate falling behind), the grid now steps once per frame as EA's loop did, where it stepped once per pass, so isUnderwater answers differ from the previous build there. Headless and one-frame-a-pass runs step exactly as before, so replay-check's corpus should not move. If the placement is wrong (something in a frame reads the grid before the top of GameLogic::update), such replays would differ from EA's. Also: the client now draws the grid one step behind EA within a pass (visual only), and a _DEBUG/_INTERNAL -jumpToFrame N run (or -noDraw under DEBUG_CRC), whose client pass skipped the terrain visual's update until frame N and so never stepped the grid before it, now steps it every frame like any other run. high Windows: PARTLY VERIFIED (CI: build, test_water_grid, E1. Left: CHI03 at two speeds.) Build; ctest -R test_water_grid; replay-check (expect no change). Then CHI03 (the dam) with its WaveGuide1: record at a capped rate on a slow and a fast machine, or play one replay back at two speeds; the CRCs must now agree where the previous build's could not.
2026-09-26 D6a (FreeType) Tools/vendor.ps1 One comment and one Step line: "skipping FreeType: text off Windows, vendor.sh fetches it", beside the SDL3 and shader-compiler skips. Nothing else Windows builds or runs changed: FreeType, glyphrasteriser and test_glyph_rasteriser are inside if(ZH_PLATFORM_POSIX), and glyphrasteriser.cpp is not in ww3d2's explicit source list. A PowerShell syntax slip would stop build.bat's vendor step before the art download. low Windows: VERIFIED (vendor.ps1 prints the FreeType line and "everything the build needs is in place" in every build.bat.) Run Tools\vendor.ps1 on Windows; it prints the skip line and ends with "everything the build needs is in place".
2026-09-26 C3a (input on SDL3) Libraries/Include/Platform/DoubleClickTime.h; CMakeLists.txt (a comment in the shared IMEManager exclusion note; the test inside if(ZH_PLATFORM_POSIX)) DoubleClickTime.h gains an #elif defined(__APPLE__) body; its _WIN32 branch is unchanged. Everything else C3a touches is outside the Windows build: SdlDevice/ is a POSIX-only target, and IMEManagerPosix.cpp is in the REMOVE_ITEM list for Windows. windows_view_diff.py against the tree before the change says DoubleClickTime.h is IDENTICAL to MSVC. It reports IMEManagerPosix.cpp and SdlGameEngine.cpp as different because it reads text, not build lists; neither is compiled on Windows. If the exclusion list were wrong, Windows would link two CreateIMEManagerInterfaces and fail loudly. low Windows: VERIFIED (CI: build.) Build on Windows; GetDoubleClickTime() is still what GlobalData reads.
2026-09-26 C4 upper half MilesAudioDevice/MilesAudioManager.{h,cpp}, Common/ScopedMutex.h Every non-AIL site in the manager, the cache's mutex member and ScopedMutex are under #if defined(_WIN32) with the Windows text unchanged. Two includes change case: Lib/Basetype.h becomes Lib/BaseType.h, and Common/File.h becomes Common/file.h. (SdlGameEngine.cpp and miles_miniaudio.cpp also changed; neither is in the Windows build.) windows_view_diff.py against the tree before the change: ScopedMutex.h and MilesAudioManager.h are IDENTICAL, and MilesAudioManager.cpp is INCLUDE CASE only. NTFS folds case, so the same files are included. The risk is that one of the #if lines is unbalanced in a way unifdef tolerates and MSVC does not. low Windows: PARTLY VERIFIED (CI: build. Left: a skirmish with sound, miles_smoke (no sound on the workers)) Build on Windows; play a skirmish with sound; miles_smoke.
2026-09-26 C5 Common/System/Debug.cpp; CMakeLists.txt Debug.cpp includes the new Common/CrashHandler.h, whose whole body is #if !defined(_WIN32), so it is empty on Windows (windows_view_diff: that include line is the only difference); its other changes are in its POSIX branches. CMake's Windows list of POSIX-only sources to leave out gains CrashHandlerPosix.cpp, which was never in the Windows build; the -g comment in the clang branch is reworded. StackDumpPosix.cpp and the new files are not built on Windows. Not configured or compiled on Windows. None expected: an empty include and a file excluded from a build it was never in. low Windows: PARTLY VERIFIED (CI: build. Left: a deliberate crash's ReleaseCrashInfo.txt.) Windows: configure and build; a deliberate crash still writes ReleaseCrashInfo.txt as before.
2026-09-26 C3b W3DDevice/GameClient/W3DGameClient.h, W3DMouse.{h,cpp} The factories' #if defined(_WIN32) gains #else branches (SDL's keyboard, W3DMouse over SdlMouse), and W3DMouse's Windows-only lines are guarded. The one line MSVC sees change is HRESULT res; → RenderResult res; in W3DMouse::setCursor's RM_DX8 branch: A1's spelling, a typedef of HRESULT in Platform/RenderTypes.h on Windows. windows_view_diff.py against the tree before the change: W3DGameClient.h and W3DMouse.h are IDENTICAL; W3DMouse.cpp differs in that one line. If RenderTypes.h were not in W3DMouse.cpp's include graph on Windows, the build would stop there, loudly. low Windows: PARTLY VERIFIED (CI: build. Left: the RM_DX8 cursor.) Build on Windows; RM_DX8 cursor (-winCursors off and the DX8 mode) still shows.
2026-09-26 A2 WWLib/TARGA.H The TGA 2.0 footer's two offsets and the extension area's four long fields (KeyColor, ColorCor, PostStamp, ScanLine) are int; two static_asserts pin the structs at 26 and 495 bytes, the sizes in the file. Off Windows long is 64 bits, so the footer read 34 bytes and every TGA failed to open (found by A2's checkpoint: all 740 install TGAs loaded as the missing texture). On Windows long and int are both 32-bit signed, so both structs keep their layout under the header's #pragma pack. The only uses are in TARGA.CPP (compared with 0, passed to File_Seek(int), assigned from it), and they compute the same. windows_view_diff has nothing to resolve: the header has no platform conditional. None expected: the same sizes and values on Windows. The asserts would stop a Windows build only if the layout were already different from the file. low Windows: PARTLY VERIFIED (CI: build. Left: a TGA-only texture on screen.) Windows: build; a TGA-only texture (for example loadpageuserinterface.tga) still shows.
2026-09-26 C2 (A1 items) W3DDevice/GameClient/W3DShaderManager.cpp; W3DDisplay.cpp, WorldHeightMap.cpp, Common/MapObject.cpp; CMakeLists.txt Decision 2 (B19 (c)) moves from PosixDevice's deleted stand-in into W3DShaderManager::testMinimumRequirements, where B19 named it. The new lines sit under #if defined(CPUDETECT_UNMEASURED_PROCESSOR_MHZ), which cpudetect.h defines only when CPUDETECT_X86 is not defined, and MSVC defines that for _M_IX86 or _M_X64. So on x86 and x64 Windows the only difference is braces around the if (cpuFreq) body, the same statement. A Windows ARM64 build would get the rule, as decision 2 intends for any CPU cpudetect cannot time. W3DDisplay.cpp's changes are all in its !_WIN32 branches (windows_view_diff: identical). WorldHeightMap.cpp and MapObject.cpp change comments only. CMake's Windows list of POSIX-only sources drops MapObjectRenderPosix.cpp, which is deleted and was never in the Windows build. None expected. low Windows: PARTLY VERIFIED (CI: build. Left: the first and a later launch's detail preset.) Windows: build; the default detail preset on a first and a later launch is unchanged.
2026-09-26 V1 Bink/include/bink.h, Bink/ffmpeg/bink_ffmpeg.cpp, W3DDevice/GameClient/W3DGameClient.h, Tools/vendor.ps1, CMakeLists.txt bink.h gains #if !defined(_WIN32) && !defined(__stdcall) / #define __stdcall. bink_ffmpeg.cpp's XAudio2 sites are each wrapped in #if defined(_WIN32) with a POSIX #else (C4's pushed-PCM voice, PosixPath_Resolve); the Windows lines are unchanged. W3DGameClient.h's #if defined(_WIN32) around the BinkVideoPlayer.h include and around createVideoPlayer is removed, and the method gains a trailing ///< comment. vendor.ps1 gains one skip Step line and two comment lines for the FFmpeg tarball. CMake: FFmpeg's POSIX build, the POSIX binkvideo, test_binkvideo and BinkVideoPlayer.cpp in w3ddevice are all inside if(ZH_PLATFORM_POSIX) blocks. windows_view_diff.py over V1's change: all four Windows-compiled files are identical as MSVC x64 reads them. The two it lists as different (SdlGameEngine.cpp, miles_miniaudio.cpp) and the added and deleted headers are compiled only off Windows. The risk left is a mistake in a guard's spelling that unifdef resolved differently from MSVC's preprocessor, which would show as an XAudio2 or BinkVideoPlayer compile error on Windows. low Windows: PARTLY VERIFIED (CI: build. Left: bink_smoke (no sound or video on the workers)) Windows: build binkvideo and gameenginedevice; bink_smoke passes from Run/.
2026-09-26 E1 Common/CRCDebug.cpp getFname, which trims __FILE__ to its leaf for the CRC debug log, took the last '\\' and returned reverseFind('\\') + 1, which is NULL + 1 when there is none. It now takes the last '\\' or '/' and returns the whole name when there is neither. Under MSVC __FILE__ is backslashed, so the leaf is the same, except in a path that mixes separators after its last backslash, where the leaf is now shorter and more correct. Debug text only (-DebugCRCFromFrame); nothing the simulation reads. Off Windows the old line segfaulted on the first dump. None expected: the same leaf for a backslashed path. low Windows: OPEN (Left: a -DebugCRCFromFrame run's file names.) Windows: a -DebugCRCFromFrame run's crcDebug*.txt still names files by their leaf.
2026-09-26 E1 (port defect 20) GameLogic/Object/Object.cpp; GameClient/Drawable.cpp Object::xfer (version 7 and up) and Drawable::xfer (version 5 and up) call setTransformMatrix with the transferred matrix only when loading. They did so on save too, and the setter recomputes the cached angle from the matrix and clears the cached flags, so every save nudged every object's heading. What changes: after a save, including each replay checkpoint the viewer takes every 900 frames of playback, the world is exactly what it was. Checkpointed playback therefore follows its recording. Unchanged: loading, normal play, recording, and network CRCs (Object::crc is a separate function). A single-player game continued after a save no longer carries the save's heading round trip, and a replay watched with checkpoints now plays the recorded match rather than a slightly different one. Both are intended. medium Windows: PARTLY VERIFIED (CI: E1 seed 1 at 12000 frames records and plays back to one CRC on Windows. Left: a playback with checkpoints on.) Windows: record a long skirmish (for example replay-check.ps1 -Seeds 1, now at the generator's own map size) and play it back with checkpoints on: the playback's HEADLESS CRC must equal the recording's. On macOS seed 1 at 12,000 frames went from 0x352D97A4 to the recording's 0xB5B11D73. Since upstream d4c1f156 (2026-09-30) upstream makes the same change in both functions, so the port no longer differs from upstream here; upstream reports fourteen replay checks ending on their recorded CRC, which is its report, not a run of ours.
2026-09-26 E1 replay-check.ps1 -MapCells defaults to 0, which leaves the random map's size to the generator (normal for the player count), and the cell count is passed only when it is set. It was 128, below even the generator's small size for two players, where seed 1 puts the two starts 124 units apart and the match stays idle (port defect 19). The POSIX twin, Tools/replay-check.sh, has the same default. A test script, not the game. The default runs play on 248-cell maps for two players, so their CRCs differ from runs made with the old default. low Windows: VERIFIED (CI: windows-ci runs replay-check.ps1 at the default map size, and seed 1's live run builds a base.) Windows: .\replay-check.ps1 with no arguments runs, and seed 1's live run builds a base. Not parsed or run here: no PowerShell.
2026-09-26 A3 generator fixes (port defect 21) WW3D2/ffvertex.cpp A two-element texture coordinate set passed through an enabled texture transform is padded (u, v, 1, 0), as Direct3D 9 pads it, instead of (u, v, 0, 1). Only programs with a passthrough stage under D3DTTFF_COUNTn change (the shader dump: one case, one line per target; every other program and key byte-identical). This changes what the Direct3D 11 renderer draws: every stage a 2D texture mapper moves (linear, sine, step, zig-zag and random offsets; the grid mapper's animated atlases) now moves, where it stood still. If something relied on the old padding (a matrix with its translation in _41/_42 under COUNT2), that texture now ignores its translation instead. None was found: every 2D mapper in mapper.cpp writes _31/_32. Direct3D 9 is unaffected (fixed function, and no generated vertex programs). medium Windows: OPEN (Left: -direct3d11 with a scrolling mapper.) Run with -direct3d11 on a map whose models use a scrolling or grid mapper; they should move as under Direct3D 9. The D3D11 program dump (Direct3D11_Dump_Programs_To) of a scrolling stage should read float4(input.TexCoordN, 1.0, 0.0).
2026-09-26 A3 generator fixes (port defect 22) WW3D2/ffvertex.h, WW3D2/ffvertex.cpp, WW3D2/dx11backend.cpp, WW3D2/dx11state.cpp The vertex description gains LocalViewer (default false). dx11backend fills it from D3DRS_LOCALVIEWER, and dx11state starts that state at Direct3D 9's TRUE instead of 0. A lit specular program with it set takes the halfway vector towards -view_position and carries :V in its key. Shader dump: only the new case vs_extra_specular_local_viewer changes (one line per target, and its key); every other program and key is byte-identical. Under Direct3D 11, every lit specular vertex program (W3D materials with a secondary gradient, water) now computes its highlight for a local viewer. Nothing shows until port defect 25 adds the specular to the pixel. If dx11state's mirror is ever compared against a Direct3D 9 device's states, LOCALVIEWER now agrees where it differed before. Direct3D 9 is unaffected: it runs no generated vertex programs. medium Windows: OPEN (Left: -direct3d11 water highlights.) After port defect 25: under -direct3d11, water highlights should sit where Direct3D 9 draws them. Now: the D3D11 program dump of a lit specular draw should read normalize(-view_position.xyz) in its halfway vector.
2026-09-26 A3 generator fixes (port defect 23) WW3D2/ffvertex.h, WW3D2/ffvertex.cpp, WW3D2/dx8wrapper.h, WW3D2/dx11runtime.h, WW3D2/dx11runtime.cpp, WW3D2/dx11runtime_posix.cpp, WW3D2/dx11backend.h, WW3D2/dx11backend.cpp Per-light registers go from six to seven (VERTEX_REGISTERS_PER_LIGHT), the seventh being the light's ambient. Direct3D11_Mirror_Light gains an ambient argument, which Set_DX8_Light passes from D3DLIGHT9::Ambient, and dx11backend stores and packs it. The program adds Atten * Spot * La to the ambient sum. Shader dump: the nine lit cases with a light change, in all three targets, and no key; unlit programs are byte-identical. Under Direct3D 11, point lights with an ambient (FX light pulses, police lights, terrain and water lights) now add it, as Direct3D 9 does. The vertex constant block grows by one float4 per light, so a mismatch between dx11backend's LightFields stride and the generated cbuffer would misplace every field of the second and later lights. Both now use VERTEX_REGISTERS_PER_LIGHT. Direct3D 9 draws are unaffected: only the D3D11 mirror call changed in dx8wrapper.h. medium Windows: OPEN (Left: -direct3d11 near an FX light pulse.) MinGW syntax checks of ffvertex.cpp, dx11runtime.cpp and dx8wrapper.cpp are clean; dx11backend.cpp's two sqrtf errors predate this. On Windows: build, then -direct3d11 near an FX light pulse at night. The pulse should reach the sides facing away from it, as under Direct3D 9.
2026-09-26 A3 generator fixes (port defect 24) WW3D2/ffshader.cpp A stage whose colour operation is DOTPRODUCT3 writes the replicated sum to alpha too, as Direct3D 9 does, instead of its alpha operation's result. Shader dump: one program changes (ps_shroud_widest), one line per target, the D3D9 target included; everything else is byte-identical. This changes both Windows renderers: Direct3D 9 (its generated combiner shaders are always on, W3DDisplay.cpp:1072, and replace the fixed-function stages, dx8wrapper.cpp:2592-2605) and Direct3D 11. At the engine's two DOT3 draws (render2d.cpp:687, W3DShaderManager.cpp:791, both grayscale conversions drawn with _PresetOpaqueShader), nothing reads the alpha, so no frame should change. If one of them does blend or alpha-test after all, its alpha now follows Direct3D 9's fixed function, which the combiner shaders exist to reproduce. medium Windows: OPEN (Left: a grayscale image and the black-and-white filter.) MinGW syntax check of ffshader.cpp. On Windows: a grayscale image (Render2D IsGrayScale) and the black-and-white filter should look the same before and after. Compare the ps_2_0 program ffshadercache compiles for such a stage: its alpha line should be the dot product.
2026-09-26 A3 generator fixes (port defect 25) WW3D2/ffshader.h, WW3D2/ffshader.cpp, WW3D2/ffshadercache.cpp, WW3D2/dx11backend.cpp Generated pixel programs add the vertex's specular colour after the stages when the draw has D3DRS_SPECULARENABLE (CombinerDescription::SpecularAdd, key :SP). ffshadercache reads the state from the D3D9 device, and dx11backend from its mirror. Shader dump: all existing programs byte-identical; the new specular case is the modulate program plus that one line, in the D3D9 target too. This changes both Windows renderers' frames. Under Direct3D 9 (combiner shaders always on) and Direct3D 11, lit highlights appear on specular materials (secondary gradient, shader.cpp:1018), on water (W3DWater.cpp:2616) and on cube-mapped shaders (shdcubemap.cpp:251), where they were missing. The D3D9 claim rests on the documentation that a bound ps_1_x/ps_2_0 replaces the fixed-function specular add (cited in port defect 25). If a D3D9 driver adds specular after a bound shader anyway, highlights there would now be doubled. medium Windows: OPEN (Left: water glints under D3D9 and D3D11.) MinGW syntax checks of ffshader.cpp and ffshadercache.cpp are clean. On Windows D3D9: water in daylight should show its specular glints, and D3D9's own capture with combiner shaders off (fixed function) should match it. A doubled highlight means the documentation reading is wrong for that driver.
2026-09-26 A3 generator fixes (port defect 26) WW3D2/ffvertex.h, WW3D2/ffvertex.cpp A vertex format with D3DFVF_SPECULAR gives the generated vertex program a Specular : COLOR1 input. Unlit programs pass it through as the specular colour, and D3DMCS_COLOR2 reads it (the material's colour without COLORVERTEX). Shader dump: every existing program byte-identical; only the new vertex-specular cases change, and the lit COLOR2 one goes from refused to generated. Under Direct3D 11, meshes with a second colour array now show it. Unlit with SPECULARENABLE, the pixel adds it (with port defect 25). Lit with a material colour source of COLOR2 (vertmaterial.cpp:355-377), the draw is generated instead of refused, so it appears where it was missing. The input layout is unchanged: dx11layout.cpp:104-105 already fed COLOR1, and a program that now declares it binds what was already there. If the layout's B8G8R8A8 were ever changed for COLOR1 alone, the colour would swap channels. Direct3D 9 is unaffected. medium Windows: OPEN (Left: -direct3d11 with a second colour array.) MinGW syntax check of ffvertex.cpp and the tests. On Windows: -direct3d11 on a map whose meshes carry a second colour array; the D3D11 program dump of such a draw should declare Specular : COLOR1.
2026-09-26 E1 (port defect 20's client twin) GameClient/View.cpp View::xfer calls setAngle and lookAt with the transferred camera only when loading. It did so on save too, re-applying the camera to where it already was, which can nudge it or stop a camera move in progress. The replay viewer saves a checkpoint every 900 frames of playback, so a watched replay could see that every 900 frames. Loading is unchanged: the position read before the angle is set is overwritten by the transfer either way. Client only; the logic does not read the view. A camera no longer twitches or stops at a replay checkpoint; nothing else. low Windows: OPEN (Left: the camera through a replay checkpoint.) Windows: watch a replay past frame 900 while panning the camera: it keeps moving through the checkpoint.
2026-09-26 P1 step 2 Common/System/Debug.cpp, Common/MiniLog.cpp, Common/ExecutableDirectory.h/.cpp, GameSpy/MainMenuUtils.cpp, WW3D2/ffprobe.cpp Debug.cpp's and MiniLog.cpp's getExecutableDirectory call is now under #if defined(_WIN32), with a POSIX #else calling the new getLogDirectory. ExecutableDirectory.h/.cpp gain getLogDirectory and an EarlyOptions.h include, both inside #if !defined(_WIN32). MainMenuUtils' POSIX #else branch calls zh_open instead of open (the Windows line is untouched). ffprobe.cpp's fopen is under #if defined(_WIN32), with a POSIX zh_fopen, and a zhio.h include inside #if !defined(_WIN32). windows_view_diff.py: each of these reads identically to MSVC; the Windows lines are the same text. The risk is a guard spelled so that MSVC's preprocessor takes the POSIX branch; that would show as an unknown getLogDirectory, zh_fopen or zh_open at compile time. low Windows: VERIFIED (CI: build; VM check: the E1 farm holds the debug logs and ffprobe.txt beside generals.exe.) Windows: build gameengine, ww3d2 and generals; the debug log and ffprobe.txt still land beside generals.exe.
2026-09-26 E1 (architecture axis) Common/System/AsciiString.cpp, UnicodeString.cpp The in-place path of ensureUniqueBufferOfSize copies with memmove (length computed first) where it used strcpy/strcat and WideCharCpy/WideCharCat (wcscpy/wcscat on Windows). The source can be the string's own text: nextToken sets the string to the rest of itself, and a string can be concatenated onto itself. Overlapping strcpy is undefined; MSVC's copies forward and produced the intended bytes, so every case that worked on Windows gives the same bytes. A self-concatenation, which the old code could overrun, now yields the string twice. This is the string core: every INI line and path goes through it. Any difference would show as a wrongly parsed INI or path, so the INI CRC and a replay's CRC are the checks. medium Windows: PARTLY VERIFIED (CI: E1. Left: a replay from before the change, the INI CRC against an older build.) Windows: the multiplayer INI CRC is unchanged, and a replay recorded before this change plays back to the same HEADLESS CRC.
2026-09-26 E1 (architecture axis) Win32Device/Common/Win32BIGFileSystem.cpp openArchiveFile's walk back to the last path separator tests filenameIndex >= 0 before reading buffer[filenameIndex], instead of after. The old order read buffer[-1] for a name with no separator, and the loop stopped at -1 whatever that byte was, so the archive directory it builds is the same. None expected. low Windows: VERIFIED (CI: the archives mount in every run.) Windows: the archives mount; the mount log lists the same files.
2026-09-26 particle orientation (latent UB) Libraries/Include/Platform/MsvcFloatCasts.h (new), W3DDevice/GameClient/W3DParticleSys.cpp, Tests/test_msvc_float_casts.cpp, CMakeLists.txt The two (uint8)(angle * 255 / 2π) conversions (:119, :399) go through floatToByteAsMsvc: truncation to a 32-bit int (INT_MIN for NaN or out of range) and its low byte. The helper claims to be MSVC's own lowering (cvttss2si, then the low byte). If MSVC ever produced something else for an out-of-range angle, Windows particles would now be oriented differently. In range the two agree by definition. The claim comes from the documented instruction, not a Windows measurement; the new test measures it on Windows (its _MSC_VER block compares MSVC's raw cast over -1000..1000). low Windows: PARTLY VERIFIED (CI: test_msvc_float_casts compares the helper with MSVC's own casts. Left: particles by eye.) Build and run test_msvc_float_casts on Windows: it passes only if MSVC's cast agrees. Particles look as before.
2026-09-26 A3 generator fixes (port defect 27) WW3D2/ffshader.cpp On the D3D11 profile a texture stage samples its own interpolator, TexCoord[stage], which is where ffvertex puts that stage's coordinates, instead of TexCoord[TCI & set mask]. The normal-mapped stage-0 sample does the same. Shader dump: only the new texgen-on-stage-1 case changes, one line in d3d11 and sdl3; d3d9 and every key byte-identical. Under Direct3D 11, every fixed-function draw with a stage whose TEXCOORDINDEX set differs from its stage number now samples the right coordinates: generated shroud coordinates on stage 1, or a stage reading set 1 at stage 0. Those draws change on screen, toward Direct3D 9. A stage whose set equals its number is unchanged. medium Windows: OPEN (Left: -direct3d11 with the shroud on stage 1.) Under -direct3d11, fixed-function draws with the shroud on stage 1 should be shrouded like Direct3D 9, not dark. The D3D11 program dump of such a stage should sample input.TexCoord1.
2026-09-26 B4 GameNetwork/NetworkDefs.h, GameNetwork/FirewallHelper.h, GameNetwork/LANAPI.h #include <stddef.h> in each, and static_asserts on the packed wire structs: sizeof of TransportMessage (16 + MAX_PACKET_SIZE) and DelayedTransportMessage, offsetof of their members, of TransportMessageHeader::magic, ManglerData::Padding, ManglerMessage::port, and of LANMessage's fields in every union arm. All derived from the definitions at pack(1) and checked on clang arm64. MSVC compiles these asserts for the first time. If its pack(1) layout differed from clang's (or Bool, WideChar or an enum had another size there) the Windows build FAILS at the assert. That is the intent, since the struct is the wire format, but it is a Windows compile that nobody has run. Nothing changes at run time. medium Windows: VERIFIED (CI: build (the asserts compile)) Windows: build gameengine; every assert in the three headers compiles.
2026-09-26 Decision 2, GPU GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp (testMinimumRequirements) The one statement if (videoChipType) *videoChipType = getChipset(); gained braces, so it can hold a #if !defined(_WIN32) block that reports DC_UNKNOWN as the top of the chipset table. The windows_view_diff shows the two braces and nothing else. MSVC compiles the same statement inside a block: the same call, the same store, no new name. The rule is compiled only off Windows, where the POSIX device answers no chipset the table knows. Windows D3D9 names its adapter, and keeps the original TNT2 presumption. low Windows: PARTLY VERIFIED (CI: build. Left: the first launch's preset.) Build w3ddevice on Windows. A first launch there still writes the preset its chipset earns (Options.ini, IdealStaticGameLOD).
2026-09-26 die-module flags (LP64) GameEngine/Include/Common/GameCommon.h, GameEngine/Include/GameLogic/Damage.h, Tests/test_gameengine.cpp The six get/set/clear helpers for VeterancyLevelFlags and DeathTypeFlags take their bit from veterancyLevelFlagBit/deathTypeFlagBit, (UnsignedInt)1 << ((dt - 1) & 31), where they wrote 1UL << (dt - 1). For value 0 (LEVEL_REGULAR, DEATH_NORMAL) that was a shift by -1: undefined, and on MSVC x64 a 32-bit shl whose count the CPU masks to 5 bits, giving bit 31. The mask computes that same bit explicitly, and every other value's bit is unchanged. Off Windows the old code gave bit 63 and skipped regular units' die modules; that is the port fix. The claim is that MSVC x64 compiled the old shift to a 32-bit shl on a runtime count. If MSVC had instead folded or exploited the UB somewhere, Windows' old answer differs from bit 31, and Windows' die-module behaviour changes. Decades of regular units playing their death animations on Windows say the check passed there. medium Windows: PARTLY VERIFIED (CI: E1. Left: a replay from before the change, slow deaths and hulks by eye.) Windows: a replay recorded before this change plays back to the same end; regular infantry still play their slow deaths and vehicles leave hulks.
2026-09-26 LP64 long audit GameEngine/Include/Common/GameCommon.h, GameNetwork/GameInfo.cpp, Common/UserPreferences.cpp, GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp, LanLobbyMenu.cpp, GameSpy/Thread/PeerThread.cpp, Lib/BaseType.h, Tests/test_gameengine.cpp The starting-cash SC= option, the three starting-cash preferences and the lobby's version/CRC numbers are parsed with strtoulAsWindows, which on Windows is strtoul( text, NULL, 10 ). REAL_TO_INT_CEIL/_FLOOR cast their long result to Int, the same width on Windows. Off Windows the helper reproduces the 32-bit answer (saturate past 0xFFFFFFFF, negate modulo 2^32), and the macros stop yielding a 64-bit long. The macros' type goes from long to Int: identical values, but a caller that relied on long for overload resolution or a format would now pick the int one. It builds on clang, and the audit found no such caller; MSVC is unbuilt. low Windows: PARTLY VERIFIED (CI: build. Left: the no-new-warnings comparison, starting cash.) Windows: the tree builds with no new warnings; a skirmish's starting cash is unchanged.
2026-09-26 float sweep S3 GameLogic/Object/Behavior/SlowDeathBehavior.cpp getProbabilityModifier's Int overkillModifier = overkillPercent * bonus goes through floatToIntAsMsvc. For an InactiveBody object (debris, hulks: max health 0, no damage dealt) the percent is 0/0 = NaN. MSVC x64 converts that with cvttss2si to INT_MIN, so the modifier is max(p + INT_MIN, 1) = 1; the helper is that conversion written out. Off Windows arm64 gave 0, so the modifier was p. None expected: the implicit conversion and the helper are the same instruction's answer on MSVC x64 for every input. low Windows: VERIFIED (CI: build, E1 (brutal-AI matches with vehicle and debris deaths play back to one CRC)) Windows: the tree builds; a replay with vehicle and debris deaths plays back to the same end.
2026-09-26 float sweep (simulation) WWMath/dettrig.cpp, Lib/BaseType.h, Platform/MsvcFloatCasts.h, AI/AI.cpp, AI/AIPlayer.cpp, ScriptEngine/ScriptConditions.cpp, Update/CommandButtonHuntUpdate.cpp, DockUpdate/SupplyWarehouseDockUpdate.cpp, Behavior/DumbProjectileBehavior.cpp, Behavior/SpawnBehavior.cpp, Update/SlavedUpdate.cpp, Tests/test_wwmath.cpp Changes:
- DetTrig's fixedAngle and arcTanUnit take a non-finite argument as 0 explicitly. Measured: the old code gave the same answers on arm64 and x86_64, and MSVC's lowering is the same arithmetic.
- Eight float-to-Int conversions and every REAL_TO_* macro go through floatToIntAsMsvc.
- floatToIntAsMsvc gains a double overload (cvttsd2si) and an integral/enum overload (the plain cast), so every argument type converts as before.
Everything rests on the header's model of MSVC x64: cvttss2si/cvttsd2si, INT_MIN out of range. That is unmeasured on Windows, and its own row stands. Where the model holds, Windows' output is unchanged at every site. If MSVC builds with /fpcvt:IA (saturating), Windows would differ from its old self only for out-of-range values. low Windows: VERIFIED (CI: build, E1.) Windows: the tree builds (the template overload needs <type_traits>); a replay plays back to the same end.
2026-09-26 float sweep (client) WW3D2/dx8wrapper.h, WW3D2/mapper.cpp, WW3D2/part_emt.cpp, GameClient/InGameUI.cpp, GameClient/System/ParticleSys.cpp Changes:
- Convert_Color(Vector3, alpha) converts each channel through floatToIntAsMsvc before masking the low byte. That is the same byte as the old cast for any value in int range, including negative channels, which wrap as they always did.
- The grid texture mapper's frame time (Milliseconds_Per_Frame), an emitter's interval and the superweapon strip's pulse period are capped at 0xFFFFFFFF instead of converting a value past an unsigned int's range. The mapper's frame time is also at least 1 ms, where a rate above 1000 frames a second used to give 0 and a division by zero.
- Three particle INI timers (InitialDelay, Lifetime, BurstDelay) go through particleTimerFrames: -1 or less (no shipped system) means 2^24 frames, and everything else converts as before.
Windows' output changes only for data no shipped asset or INI has: a grid animation above 1000 frames a second (it used to divide by zero), rates or durations whose conversions left the unsigned range, or a negative particle timer (believed "never" before, 2^24 frames now). low Windows: PARTLY VERIFIED (CI: build. Left: particles, grid textures and the superweapon strip by eye.) Windows: the tree builds; particles, grid-animated textures and the superweapon strip look as before.
2026-09-26 LOD pin Tests/test_gameengine.cpp A test, dynamic_lod_never_reaches_what_the_simulation_reads: with SlowDeathScale 0.5 and DebrisSkipMask 0xFF at every dynamic level, setting each level leaves getSlowDeathScale() at 1.0 and skips no debris. It pins applyDynamicLODLevel not applying the two values the logic reads. Test only; no engine change. None: it constructs a GameLODManager on the stack and touches no global. low Windows: VERIFIED (CI: test_gameengine.) Windows: test_gameengine passes.
2026-09-26 rank walk GameNetwork/RankPointValue.h, GUICallbacks/Menus/PopupPlayerInfo.cpp, GUICallbacks/Menus/WOLLobbyMenu.cpp, Tests/test_gameengine.cpp The three rank walks (while (points >= m_ranks[i + 1]) ++i, unbounded) become rankForPoints, which stops at RANK_COMMANDER_IN_CHIEF. CalculateRank's five float-to-Int sums go through floatToIntAsMsvc. Measured on the Windows conversion model with the shipped table: 2,000 points and up read one past m_ranks; 1,077,936,129 stops inside the multipliers (index 12); above 1,084,227,584 (400,000,000 wins is enough, with no overflow) walks off the struct. Windows' rank changes only where the old walk left the table: 2,000 or more points still show Commander in Chief (the walk used to read the first multiplier to find that), and points above 1,077,936,128, which only a hostile or corrupt stats record has, now show Commander in Chief instead of reading past the struct. medium Windows: OPEN (Left: the rank display.) Windows: a player's rank shows as before on the lobby, popup and load screen.
2026-09-26 rope segments W3DDevice/GameClient/Drawable/Draw/W3DRopeDraw.cpp numSegs is floatToIntAsMsvc(ceil(maxLen / wobbleLen)). A RopeWobbleLen = 0 is 1/0: INT_MIN on Windows (no rope), as before. None expected: the same answer as MSVC's conversion for every input, under the header's model. low Windows: OPEN (Left: a Chinook's rope.) Windows: a Chinook's rope draws as before.
2026-09-26 N1 GameEngine/Source/Common/GlobalData.cpp (the "lets CRC the executable!" block), CMakeLists.txt (build_fingerprint, build_fingerprint_header), .gitattributes m_exeCRC no longer hashes generals.exe: the GetModuleFileName read is gone. In its place are the four bytes of ZH_BUILD_FINGERPRINT, from BuildFingerprint.h, which a host tool (Tools/fingerprint/build_fingerprint.cpp) generates at build time over the files BuildFingerprint.manifest lists. The version and the two .scb terms follow, unchanged. Values: m_exeCRC changes on Windows, as after any rebuild. LAN and GameSpy matchmaking and the replay header compare it, so an old Windows replay says "different executable" on playback, as it would after any rebuild. Two Windows builds of the same source now agree, as does a Mac or Linux build of it: that is decision 5. Build: the MSVC build now compiles and runs a host tool before gameengine (a custom command with a stamp; the header is written only when its value changes). If the manifest names a file the Windows checkout lacks, or if add_custom_command's BYPRODUCTS misbehaves under the Visual Studio generator, the build stops with the tool's message. .gitattributes keeps the manifest LF under autocrlf, and the tool strips CRs anyway. Never compiled by MSVC. medium Windows: VERIFIED (CI: build, E1; VM check: build64's ZH_BUILD_FINGERPRINT is 0xD883D7C9 over 3736 files, the same as the macOS and Linux builds of the same tree.) Configure and build on Windows. <build>/generated/fingerprint/BuildFingerprint.h must hold the same ZH_BUILD_FINGERPRINT as a Mac build of the same commit (build_fingerprint --print GeneralsMD/Code GeneralsMD/Code/BuildFingerprint.manifest prints it). A second no-op build must not rerun it. Then replay-check.ps1.
2026-09-26 water tracks (.wak) W3DDevice/GameClient/Water/W3DWaterTracks.cpp, W3DWaterTracks.h, Tests/test_water_tracks.cpp, CMakeLists.txt, BuildFingerprint.manifest Changes to the map's .wak loader:
- It reads no more records than the file holds (wakTrackCount) and stops at a short read.
- A wave type outside the wave table (isWakWaveType) is skipped.
- A duplicate record is skipped with continue instead of i++; goto, which read on past the count.
It used the file's count and types as they came, and a network map transfer accepts .wak. All 25 shipped .wak files were checked: their counts match their sizes, their types are all in the table, and none ends on a duplicate, so they load as before.
Windows' output changes only for a .wak that indexed waveTypeInfo out of bounds, claimed more tracks than it holds, or ended on a duplicate. Before, those read out of bounds or looped; now the record is skipped or the list stops. medium Windows: OPEN (Left: waves on a beach map.) Windows: waves on a stock beach map (e.g. one with a .wak in MapsZH.big) look as before.
2026-09-26 road buffer W3DDevice/GameClient/W3DRoadBuffer.cpp, W3DRoadBuffer.h, Tests/test_road_buffer.cpp, CMakeLists.txt, BuildFingerprint.manifest Changes:
- loadFloat4PtSection stops writing vertices at MAX_SEG_VERTEX, the size of its stack array vb. It tested MAX_SEG_INDEX (2000), so a section of more than 500 vertices wrote past vb, and SetVertexBuffer then refused it anyway.
- Index writes stop when a step's six would pass ib; they used to overrun by up to five.
- Both sections' column count is roadColumnCountFor: at least 2, never more than the map's extents corner to corner, converted as Windows does.
- The lit section gets the vCount < 2 floor the float section always had.
Windows' output changes only where it wrote past a stack array or read out of bounds: a section of over 500 vertices now keeps its first 500 where it was dropped after corrupting the stack, and a road point outside the map or an absurd width (map or mod data) gives the floor. Every road inside a map converts and counts as before. medium Windows: OPEN (Left: roads.) Windows: roads on stock maps draw as before.
2026-09-26 reach and blind-spot guards GameClient/InGameUI.cpp, GameClient/InGameUI.h, Tests/test_gameengine.cpp Changes:
- templateReach gives a non-finite weapon range no reach.
- insideReach and reachViewHits treat a NaN distance as outside (!(d < r)), where it slipped past d >= r.
- reachAtAngle reads the first outline corner for a NaN angle.
- The blind-spot grid's ring count is blindSpotRingCount: converted as Windows does, and never more rings than the map's width plus height.
Windows' output changes only where it read out of bounds or ran away. An AttackRange of inf read the outline at INT_MIN on Windows and now draws no circle; a NaN position read the blind-spot table at INT_MIN; and a range longer than the map now stops at the map's size, where 1e6 froze every platform. Every real reach draws as before. medium Windows: OPEN (Left: a defence's reach circle and blind spots.) Windows: placing a defence shows its reach circle and blind spots as before.
2026-09-26 cursor guards GameClient/Mouse.h, GameClient/Input/Mouse.cpp, W3DDevice/GameClient/W3DMouse.cpp, Tests/test_gameengine.cpp Changes:
- The animated cursor's frame and the scrolling cursor's direction go through mouseCursorFrame and mouseCursorDirection: converted as Windows does, and outside the table they read its first entry. The direction's arithmetic is kept in double, with M_PI's digits written out because a header the whole engine includes cannot count on MSVC defining it.
- A cursor's Directions is capped at MAX_2D_CURSOR_DIRECTIONS (8) when Mouse.ini is parsed.
Windows' output changes only where it read or wrote out of bounds: a NaN or infinite FPS or scroll speed (INT_MIN), a negative FPS (a negative frame), and more than 8 directions (the load loops wrote past the table). Shipped Mouse.ini has 8 directions and finite rates, and every in-range index is the old one (the test sweeps it). medium Windows: PARTLY VERIFIED (CI: build (Mouse.h compiles). Left: cursors by eye.) Windows: the build compiles (Mouse.h no longer uses M_PI); cursors animate and point the way they did.
2026-09-26 particle counts GameClient/System/ParticleSys.cpp, WW3D2/part_emt.cpp A particle system's burst count after its multiplier (count *= m_countCoeff) and a W3D emitter's buffer size (BurstSize * emit_rate * (max_age + 1)) are converted with floatToIntAsMsvc. None expected: the same answer as MSVC's own conversion for every input, under the header's model. Off Windows a value past the int range was INT_MAX: a burst loop that ran until it gave out, or a buffer of 2^31 particles. low Windows: OPEN (Left: particles and W3D emitters by eye.) Windows: particles and W3D emitters look as before.
2026-09-26 emitter clone (strdup of NULL) WW3D2/part_emt.cpp ParticleEmitterClass's copy constructor copies NameString and UserString through strdupOrNull, a NULL for a NULL, where it called ::strdup on them directly. UserString is NULL until a user string is set, and Darwin's and glibc's strdup(NULL) read through the pointer. The fog of war clones every emitter it ghosts, so a stock map (Seaside Mutiny) crashed within seconds of a match off Windows. None expected: on Windows strdup is the UCRT's _strdup, which returns NULL for NULL, which is what the helper does. That is from the UCRT's behaviour as understood, not measured here. low Windows: PARTLY VERIFIED (W2: the UCRT's _strdup(NULL) is NULL. Left: fogged emitters by eye.) Windows: fogged emitters (burning buildings, smoke) still draw as ghosts.
2026-09-26 strdup sweep (port defect 31) Libraries/Include/Platform/StrdupAsWindows.h (new), 18 engine files (every site in the commit), Tests/test_msvc_float_casts.cpp, BuildFingerprint.manifest Every non-literal strdup in the engine's own code is strdupAsWindows. On Windows that calls _strdup itself, the function strdup already was there; elsewhere NULL gives NULL. part_emt.cpp's interim local helper is replaced by it. None expected: on Windows every call is the same _strdup call it was, so this rests only on the spelling compiling under MSVC (_strdup is declared by <string.h> there). low Windows: VERIFIED (CI: build; W2: _strdup(NULL) is NULL.) Windows: the tree builds with no new warnings.
2026-09-26 L1 (F2) Common/Recorder.{h,cpp}, Tests/test_gameengine.cpp A network replay's CRC check no longer drops its first computed CRC blindly (9126172a). replayIsMissingFirstCRC is replayMayLackFirstCRC (the same modes, GAME_LAN and GAME_INTERNET), and CRCInfo::readCRCFor decides at the first comparison: keep the head if it is the recorded CRC (a recording made since d9eccdda, which sends frame 0's CRC), drop it if the next one is (a retail or older recording, which lacks it), else compare as it stands. The log names the alignment ("Replay CRCs: recorded from frame 0" / "legacy: frame 0 missing"). The out-of-sync DEBUG_LOG and DEBUG_CRASH had the recorded and played-back values under each other's labels; they no longer do. Playback only: no simulation, nothing on the wire, and the replay file format is unchanged. Not compiled with MSVC. Before: every LAN replay recorded by a build since d9eccdda (2026-09-22) reported a false "out of sync" at its first CRC, and the check then went quiet for the rest of the replay (sawCRCMismatch). If the alignment were wrong, a Windows build would report such a false desync again, or, if a real desync fell on the first CRC and the recorded value happened to equal the next computed one (1 in 2^32), miss it. low Windows: OPEN (Left: LAN replays from this build and an older one.) Windows: play back a LAN replay recorded by this build and one recorded by a build before 2026-09-22 (or a retail one); the log says "recorded from frame 0" for the first and "legacy: frame 0 missing" for the second, and neither reports "out of sync".
2026-09-26 L1 (step 5) GameNetwork/NetPacket.cpp Compile-time checks only: the widths a game message's arguments travel at, on the wire and in the replay file (sizeof of Int 4, Real 4, Bool 1, ObjectID 4, DrawableID 4, UnsignedInt 4, Coord3D 12, ICoord2D 8, IRegion2D 16, and the 1- and 2-byte header types), beside what B4 and B5 already pinned. Checked with clang on arm64 and x86_64 (and an assert made false fails the compile); for MSVC they follow from the types (bool is 1 byte, float 4, int 4, the structs are Reals or Ints), by reading, not compiled. If MSVC gave any of them another width, the Windows build fails at the assert instead of a Windows player and a Mac player exchanging commands of different lengths. Nothing changes at run time. low Windows: VERIFIED (CI: build (the asserts compile)) Windows build compiles NetPacket.cpp.
2026-09-26 UDP bind socket leak GameNetwork/udp.cpp, GameNetwork/udp.h, Tests/test_lan_broadcast.cpp UDP::Bind closes the socket it had before making a new one, and closes the new one when its bind fails (a private closeSocket). "No socket" is -1 throughout: the constructor sets -1 where it set 0, and the destructor closes anything but -1 where it closed anything but 0. Transport::init's one-second retry loop leaked a socket per try while the port was taken (about 100,000 per failed init), on Windows as elsewhere. None expected where a bind succeeds the first time: the same socket, bound the same way. Where it fails, Windows now closes sockets it leaked. The destructor no longer calls closesocket(-1) after a failed socket(), which on Windows only returned WSAENOTSOCK. low Windows: OPEN (Left: LAN host and join, the handle count with the port held.) Windows: a LAN game hosts and joins as before; with the game's port held by another program, the failed start leaves the process's handle count where it was (Task Manager, Handles).
2026-09-26 -mission switch Common/CommandLine.cpp, Common/GameEngine.cpp, Common/GlobalData.h, Common/GlobalData.cpp, GameClient/CampaignManager.h, GameClient/System/CampaignManager.cpp, Tests/run_mission_check.sh (new), CMakeLists.txt, BuildFingerprint.manifest A new Release switch, -mission <map> [easy|normal|hard], starts a single player game after init()'s resetAll(): as the campaign or challenge mission that plays the map (the challenge menu's TheChallengeGameInfo setup mirrored in prepareChallengeMission), or plain. Two new GlobalData fields and CampaignManager::setCampaignAndMissionForMap. -file's .map branch in init() is byte-identical to HEAD, and now sits under an else after the -mission branch. None expected without the switch: every new path is entered only when -mission was given. With it, a mission that differs from the menu's start (e.g. a challenge field ChallengeMenu.cpp sets that this does not). low Windows: OPEN (Left: -mission on Windows.) Windows: -mission GC_ChemGeneral and -mission "Maps\MD_USA01\MD_USA01.map" hard start those missions; a start with no switch, and -file in a debug build, are unchanged.
2026-09-26 challenge load screen with no movie GameClient/GUI/LoadScreen.cpp ChallengeLoadScreen::init returns after opening the movie when there is no stream, as SinglePlayerLoadScreen::init does. It read the stream's width through NULL. None expected: it changes Windows only where Windows dereferenced NULL (a challenge whose movie is missing). low Windows: OPEN (Left: a challenge's load-screen movie.) Windows: a challenge's load screen still plays its movie.
2026-09-27 W1 (Linux build) JobSystem.cpp, W3DSupplyDraw.cpp, GUICommandTranslator.cpp, LookAtXlat.cpp, LobbyUtils.cpp, GameSpy/Thread/BuddyThread.cpp, GameSpy/Thread/PeerThread.cpp Errors GCC 16 with libstdc++ reports on the native Linux build (Linux x86_64): #include <system_error> for the std::system_error JobSystem catches, and #include <limits.h> for W3DSupplyDraw's INT_MAX, both of which MSVC and libc++ bring in through other headers; and static dropped from five static enum X { ... }; definitions that declare no variable, where GCC says "a storage class can only be specified for objects and functions". None expected: MSVC ignores static on a declaration with no declarator (its warning C4091 says so), so the five enums are the same types with the same scope, and the two headers only declare what was already in reach. Not compiled with MSVC. low Windows: PARTLY VERIFIED (CI: build. Left: GameSpy lobby and chat callbacks.) Windows build compiles the seven files; GameSpy lobby and chat callbacks behave as before.
2026-09-27 -offscreen (PERF1) Tools/vendor.sh, Tools/vendor.ps1 (a comment and its skip message), new Libraries/Source/sdl3-metal-windowless.patch; Main/PosixMain.cpp, SdlDevice/Common/SdlGameEngine.cpp, SdlDevice/Common/SdlGameEngine.h, SdlDevice/GameClient/SdlMouse.cpp, PosixDevice/Render/PosixDirect3D9.cpp, PosixDevice9.cpp, PosixDevice9.h, PosixDevice9Timing.cpp, SdlGpuFrame.cpp, SdlGpuFrame.h vendor.sh gains install_sdl3_patch: the vendored SDL3's METAL_PrepareDriver also accepts the hint ZH_SDL_GPU_METAL_WINDOWLESS, checked by a marker, exit 1 if it did not take. -offscreen / ZH_OFFSCREEN=1 runs the game with no window: SDL video (the dummy driver where there is no display), an offscreen GPU frame, the gamma pass into a texture of its own, two frames in flight, and an optional ZH_OFFSCREEN_HZ pacer; silent, and the mouse as a hidden window has it. None on Windows: SDL3 is not vendored there (vendor.ps1 skips it and says so), and every other file is POSIX-only (sdldevice, posixd3d9 and PosixMain.cpp build only under ZH_PLATFORM_POSIX). Off Windows, with the hint unset the patched expression is upstream's. low Windows: nothing to verify (the row: none needed on Windows.) None needed on Windows. On a POSIX machine a fresh vendor.sh prints the patch step and grep ZH_SDL_GPU_METAL_WINDOWLESS finds it twice in SDL_gpu_metal.m; a -offscreen capture matches a -hiddenwindow one signature for signature (50 of 50, 2026-09-27).
2026-09-27 the game's data gone (lid-close crash) Common/file.h, Common/LocalFile.h, Common/System/LocalFile.cpp, Common/Debug.h, Common/System/Debug.cpp, Common/System/StreamingArchiveFile.cpp, Win32Device/Common/Win32BIGFile.cpp, Common/GameEngine.cpp, GameLogic/System/GameLogicDispatch.cpp, Tests/run_data_gone_check.sh (new), CMakeLists.txt, BuildFingerprint.manifest A read of an open archive that fails because its drive went away (LocalFile records the error; on Windows _doserrno ERROR_DEVICE_NOT_CONNECTED, ERROR_NOT_READY, ERROR_DEV_NOT_EXIST or ERROR_FILE_INVALID) now calls GameDataGone. On the main thread that logs, shows a box ("the game's data is no longer available", MessageBoxWrapper, none under -headless) and _exit(3); from another thread it only records the loss, and GameEngine::execute stops at the top of its next pass. GameEngine::reset and GameLogic::prepareNewGame skip the backdrop layout when it is NULL. File gains a virtual deviceGone; LocalFile a member. None expected in normal play: every new path runs only after a read or seek has already failed, and the guards only when a layout is NULL. Where Windows crashed on a disconnected install drive it now shows a box and exits; if the Windows codes are not the ones Windows gives, it crashes as before (unmeasured: no Windows machine yet). low Windows: VERIFIED (W2: a VHD detached mid-match gives GAME DATA GONE and exit status 3; CI: play unchanged.) Windows: normal play, saves and replays unchanged; with the game on a USB drive, pulling it mid-game and ending the match shows the box instead of a crash.
2026-09-27 port defect 33 Include/Common/ThingTemplate.h, Source/Common/Thing/ThingTemplate.cpp, Source/Common/Thing/ThingFactory.cpp, Data/INI/FixesReforged.ini A ReplaceModule of an AI module now records how many locomotor sets the old module had (a new Byte m_locomotorSetsLostToReplace on ThingTemplate, set in parseReplaceModule). ThingFactory::postProcessLoad logs each thing whose replacement still has no SET_NORMAL, and DEBUG_CRASHes in a debug build. No game behaviour changes: nothing reads the count except that check. The INI re-states twelve units' Locomotor lines that upstream's fbe8dc6f/179e1f65 dropped. That is a data change on every platform, and it fixes Windows' crash too. The new member changes ThingTemplate's layout. Nothing serialises a ThingTemplate, and copyFrom copies it like every other member. If MSVC disagreed about LocomotorTemplateMap's iteration in the counting loop, the count could be off, which only changes a log line. A debug Windows build on data that relies on dropped locomotors now stops at the DEBUG_CRASH, as intended. low Windows: PARTLY VERIFIED (CI: build. Left: a Debug build starting without the DEBUG_CRASH.) W2: build on Windows; a debug build must start without the DEBUG_CRASH on the fixed data.
2026-09-27 port defect 32 dangling erase in LocomotorStore::reset GameLogic/Object/Locomotor.cpp, GameLogic/ScriptEngine/ScriptEngine.cpp, Tests/run_mission_check.sh LocomotorStore::reset erases with erase(it++) where it erased it and went on with it. That was UB on every platform, reached by a locomotor defined only by a map's map.ini (the shipped test map Hovercraft; any transferred custom map); the Mac hung at the end of the match. ScriptEngine::reset takes the iterator cleanupSequentialScript returns, as its other callers do, where it discarded it and went on with the erased one. None expected: where the old loops worked, the new ones visit the same elements in the same order and free the same objects. Windows changes only where it had UB: a map-only locomotor, which crashed Windows at the end of the match ("Pure virtual function called", measured on the W2 VM; with the fix, exit 0), and a checked-iterator Debug build at the end of a map with a sequential script pending. low Windows: PARTLY VERIFIED (W2: the Hovercraft map ends with the fix (exit 0, frame 600) and crashes without it; CI: E1. Left: scripted campaign missions.) Windows: the Hovercraft map ends and returns to the menu; campaign missions with scripted sequences end as before; replays unchanged.
2026-09-27 L1b Tests/test_wwlib.cpp threadclass_stop_deadlocks_if_the_caller_holds_the_workers_lock waits (up to about a second, in 1 ms sleeps) until its worker thread has taken the lock once, through a std::atomic<bool> the worker sets, instead of sleeping a fixed 20 ms; one CHECK more. The code under test (ThreadClass, FastCriticalSectionClass) is unchanged. The test is compiled by MSVC too. If std::atomic<bool> or the new member broke there, test_wwlib would fail to build; <atomic> is already included for the B14 thread tests, which use it the same way. On a machine where the worker takes over a second to start, the new CHECK fails loudly rather than the old one quietly. low Windows: VERIFIED (CI: test_wwlib.) Build and run test_wwlib on Windows (W2's ctest).
2026-09-27 W2 (the first MSVC build) WW3D2/sdl3target.h, WWDownload/Download.cpp, WWLib/mpu.cpp, profile/profile_funclevel.cpp, W3DDevice/GameClient/WorldHeightMap.cpp, CMakeLists.txt, Tests/test_ffvertex.cpp What MSVC refused in the fork's first Windows build:
- (std::max) against windows.h's macro.
- Download.cpp includes Platform/MSVCCompat.h, so its mkdir and strncasecmp resolve (row 61's prediction).
- mpu.cpp's abs takes (int) of the DWORD difference.
- ProfileFastCS::testEvent's orphaned Windows-only definition is removed.
- WorldHeightMap's unused j is removed.
CMake:
- SdlDevice/ is out of the Windows glob.
- test_clock links winmm, and the widechar tests link ws2_32.
- gametext_csf and test_premain_* take /NODEFAULTLIB:GameEngine.lib.
- The .sh oracles are POSIX only.
- test_ffvertex runs everywhere, updated to port defect 23 and port defect 26.
None expected: (std::max) is the same call; the shim's mkdir drops the mode as _mkdir did; abs of an int is what abs(int) or abs(long) gave on LLP64; the removed event was never waited on; the CMake changes touch no game target but gameenginedevice's glob, which now matches what it always meant. Measured: the build is green and the E1 CRCs equal the Mac's and Linux's. low Windows: VERIFIED (W2, the first MSVC build, on the data before upstream 843bf76b: build.bat Release, 0xE896DEF3 and 0x7C7DBA69 at 12000 frames.) Windows: build.bat Release succeeds; replay-check gives 0xE896DEF3 and 0x7C7DBA69 at 12000 frames.
2026-09-27 S8 (float to unsigned) Platform/MsvcFloatCasts.h, Common/INI/INI.cpp, GameLogic/Object/Update/SpecialAbilityUpdate.cpp, Update/AIUpdate/HackInternetAIUpdate.cpp, GameLogic/Object/Weapon.cpp, Update/ParticleUplinkCannonUpdate.cpp, Tests/test_msvc_float_casts.cpp Nine implicit float-to-unsigned conversions go through floatToUnsignedAsMsvc (uint32: the low 32 bits of the 64-bit truncation, 0 for NaN, the infinities and beyond int64) or floatToUnsignedShortAsMsvc (uint16: the low 16 bits of the 32-bit one): the INI duration parsers, pack/unpack variation, a zero-bonus reload, the uplink's scorch and pulse frames. None expected: both helpers are MSVC x64's own lowering, measured on Windows 11 with MSVC 19.44 over 18 edge values (W2), and test_msvc_float_casts compares them with MSVC's casts on Windows. The expressions inside are unchanged, so the float arithmetic is the same. low Windows: VERIFIED (CI: test_msvc_float_casts, E1.) Windows: test_msvc_float_casts passes; replay-check gives the E1 CRCs.
2026-09-27 the debug library's crash box under -headless Libraries/Source/debug/debug_debug.cpp, CMakeLists.txt (a PRIVATE include path for Common/EarlyCommandLine.h) Under -headless the "Game crash" box is skipped: its text goes to stderr and OutputDebugString, and the process _exit(1)s as it did after OK. Without -headless it is unchanged. None expected for a player: only a -headless run, which nobody plays, sees a difference, and it now ends instead of waiting on a box nobody will click. low Windows: VERIFIED (W2: the purecall under -headless exits 1.) Windows: a -headless run that hits a purecall (the Hovercraft mission before port defect 32) exits 1 instead of hanging.
2026-09-27 port defect 34 Source/Common/Thing/ThingTemplate.cpp, Source/Common/Thing/ThingFactory.cpp, Include/Common/ThingTemplate.h parseModuleName no longer runs clearCopiedFromDefaultEntries inside ReplaceModule/AddModule in a normal INI load (override loads already skip it). A new checkReskins after load logs any ObjectReskin lacking a behaviour module its source has, and DEBUG_CRASHes in debug builds. Measured: of 2116 loaded templates, only Demo_GLAVehicleTechnicalChassisTwo/Three change, each regaining 12 modules that upstream's fbe8dc6f had erased (Windows crashed on them too). EA's INIs use no ReplaceModule/AddModule, so EA's data loads identically. Only the fork's normal-loaded INIs are affected, and only these two templates today. A future mod that relied on a ReplaceModule clearing other copied modules would keep them instead; the reskin check reports the opposite case. low Windows: PARTLY VERIFIED (CI: build; seed 0 at 12000 frames completes on Windows, 0x5273770F, the pin before upstream 843bf76b's data (the sized-delete run and CI). Left: a Debug build starting without the port defect 34 DEBUG_CRASH.) W2: build on Windows; a debug build must start without the port defect 34 DEBUG_CRASH; seed 0 @12000 must complete.
2026-09-27 the global operators under a sanitizer GameEngine/Source/Common/System/GameMemory.cpp Six global operators added beside the four GameMemory already replaces: the sized deletes and the nothrow new, new[], delete and delete[], each forwarding to the replaced unsized form, with #include <new>. All of it is inside #ifndef _MSC_VER: a sanitizer runtime supplies these forms itself (TSan aborted before main when a sized delete freed a GameMemory block; under ASan a nothrow new from stable_sort in ScenarioDrill was freed by GameMemory's delete), and no sanitizer runtime is in play on Windows. None expected: MSVC's preprocessor drops all of it, so Windows compiles what it did before. It is guarded on purpose: under /EHa the nothrow news' catch (...) would also catch a structured exception and answer NULL, where the CRT's (compiled /EHsc) reach the crash handler. low Windows: VERIFIED (the sized-delete run: the build, with no new warning in GameMemory.cpp; ctest 47 of 47; E1 0x0177BEF6, 0x5273770F and 0x830467DB, the pins before upstream 843bf76b's data.)
2026-09-27 upstream 843bf76b integration (port defect 33) Data/INI/FixesReforged.ini The 15 Locomotor = SET_... lines port defect 33 had re-stated after twelve objects' AI ReplaceModules are gone, and the file's two comments say why: upstream's 4319c010 carries a replaced AI module's sets over in ThingTemplate::parseReplaceModule, and with both, AIUpdateModuleData::parseLocomotorSet refused the second specification, so no game started. None expected: the lines equal INIZH.big's own Locomotor lines for those twelve objects (extracted and compared object by object), and no other overlay INI touches them, so the carry-over restores exactly the sets the lines set. The file's bytes, and so the multiplayer INI checksum, change, as the rest of upstream's merge changes it anyway. low Windows: OPEN (a Windows CI run after the integration merge). Windows: the game loads (every E1 run), and locomotor_check's guard names no thing on POSIX; the cross-host E1 agrees.
2026-09-27 the infinite viewer (N27, N14) Libraries/Source/WWVegas/WW3D2/ffvertex.cpp, Tests/test_ffref_gpu.cpp The shared fixed-function vertex generator, which the D3D11 backend runs too: without LOCALVIEWER the halfway vector's eye is (0, 0, -1) instead of (0, 0, 1), and CAMERASPACEREFLECTIONVECTOR uses that fixed eye instead of the local one, as measured on Windows' own D3D9 (WARP and REF). An unlit program that reads the reflection vector without LOCALVIEWER is keyed :E. ffref_gpu gains the reflection vector with and without the local viewer. The D3D11 backend's output changes only on the LOCALVIEWER-off path, which the engine never generates: it never turns LOCALVIEWER off, and dx11state.cpp:182 defaults it to TRUE. A census of 967,680 descriptions x targets found 172,800 programs changed, every one with LOCALVIEWER off. If some engine path did turn it off, its highlights and reflection-mapped coordinates would move to what Windows' D3D9 draws. low Windows: OPEN (a Windows CI run of this change is pending: windows-ci.ps1, with dx9_smoke and test_dx11device in the desktop session.)
2026-09-27 a special-power timer cleared after its erase GameEngine/Source/Common/RTS/Player.cpp Player::init erased each SpecialPowerReadyTimerType from its list and then called clear() on it through a pointer taken before the erase: a write into the freed list node (EA's code; ASan under ZH_SANITIZE, at the reset after every match). The write is gone; the erases, and so the frees and their order, are as before. Simulation code, so the risk is a changed CRC. None is expected: GameMemory keeps a freed block's links in its header (m_nextBlock), so the removed write landed in dead user data that the next allocation zeroes anyway. low Windows: OPEN (a Windows CI run of this change is pending: windows-ci.ps1, E1's three CRCs unchanged.)
2026-09-27 ZH_SANITIZE (sanitizer builds) CMakeLists.txt, GameEngine/Source/Common/System/GameMemory.cpp A cache option ZH_SANITIZE, empty by default and read only in the Clang/GNU branch, adds -fsanitize= and defines ZH_SANITIZER_BUILD. Under that define GameMemory's global new and delete (all fourteen forms) take zeroed blocks from calloc and give them to free, instead of TheDynamicMemoryAllocator. None expected: MSVC never takes the Clang/GNU branch and never sees the define, so GameMemory.cpp preprocesses to the same code as before. Only line numbers move, and they reach the debug info and nothing else (measured on clang: GameMemory.cpp.o identical outside __DWARF; GameMemory.cpp's code uses no __LINE__). low Windows: OPEN (a Windows CI run of this change is pending: windows-ci.ps1, the build and E1's three CRCs as before.)
2026-09-27 test_wwlib timing Tests/test_wwlib.cpp mutexclass_timed_acquire_gives_up_and_says_so times its 60 ms wait with std::chrono::steady_clock where it read Clock_Milliseconds_Coarse, GetTickCount on Windows, and keeps its >= 50 bound. Test code only. The old read failed an integration CI run once on Windows: 15.625 ms ticks read a 60 ms wait as 46.9 ms. On MSVC, steady_clock is QueryPerformanceCounter. low Windows: OPEN (a Windows CI run of the change). Windows: ctest -R test_wwlib passes; the VM's 200-wait probe read steady_clock no lower than 61 ms.
2026-09-27 WWMath's validity checks on LP64 Libraries/Source/WWVegas/WWMath/wwmath.h, Tests/test_wwmath.cpp Is_Valid_Float and Is_Valid_Double read their argument's bits with memcpy into uint32_t / uint64_t instead of through an unsigned long *, which is 8 bytes on LP64 (macOS, Linux): Is_Valid_Float read 4 bytes past the float (the mask kept the answer right), and Is_Valid_Double took the 8 bytes after the double. wwmath.h adds <stdint.h> and <string.h>. test_wwmath checks both against std::isfinite over every class and a stride through the bits. None expected: on Windows unsigned long is 4 bytes, so the old code read exactly the float, and the second long of a double was its high word; the new code reads the same bits. If MSVC compiled the old reads differently from these memcpys, an inlined validity check would change - an assertion's verdict, not the simulation (E1 identical on macOS arm64). low Windows: OPEN (a Windows CI run of this change is pending: windows-ci.ps1, test_wwmath and E1's three CRCs.)
2026-09-27 LCW's long run on the last word Libraries/Source/WWVegas/WWLib/lcw.cpp, Tests/test_wwlib.cpp LCW_Uncomp fills a long run's aligned part one word at a time instead of in pairs; the pairs wrote one word past the run when its aligned length was 4 mod 8, and after the last operation that word landed past the output (ASan under ZH_SANITIZE). test_wwlib gains a run that ends the output, with canaries. None expected, and nothing in the game reaches it: LCW_Uncomp's loaders (Uncompress_Data, Load_Uncompress, LCWPipe, LCWStraw) have no callers outside WWLib. The run's own bytes are unchanged: a round trip over every file of the install (510 files, 92,586 chunks, 3.0 GB) decodes identically with the old and the new, and the old wrote past the output on 1,780 of those chunks. low Windows: OPEN (a Windows CI run of this change is pending: windows-ci.ps1, test_wwlib.)
2026-09-27 R1, smooth motion Common/DrawModule.h, GameClient/Drawable.h/.cpp, Common/GameEngine.h/.cpp, Common/GlobalData.h/.cpp, Common/OptionsCatalog.cpp, GameLogic/AI/AIPlayer.cpp, W3DDevice/GameClient/W3DSmoothMotion.h (new, header-only), W3DModelDraw.h/.cpp, W3DDisplay.cpp, W3DView.cpp, Data/Window/Menus/OptionsMenu.wnd, Data/Patch.str, Tests/test_smooth_motion.cpp Shared code for an option that defaults OFF on Windows (m_smoothMotion, #if defined(_WIN32) in GlobalData.cpp): three no-op DrawModule virtuals, Drawable members for a position history and a discontinuity flag, GameEngine_noteLogicTickDone stamping the logic loop's last tick (a clock read), W3DModelDraw's capture/apply/restore, W3DDisplay's three passes (each returns at once while the option is off), W3DView's camera lock (off: the 30 Hz gate and factors exactly as before), the dozer teleport's mark, and a new Options > Display check box. With the option off - Windows' default - the picture is as it was: the passes return before touching a render object and the camera keeps its gate. What differs regardless: the vtable and Drawable's size, a clock read per logic pass, and a check box a Windows player can tick, which then smooths motion as on the other platforms. If MSVC rejected the camera's capturing lambda or powf, W3DView.cpp would not compile. The game never changes either way: the seed-1234 skirmish ends on the same CRC with it on and off, and a deliberate leak changes it (test_smooth_motion). low Windows: OPEN (a Windows CI run of this change is pending: windows-ci.ps1, the build, ctest with test_smooth_motion and the optionsmenu selfcheck, E1's three CRCs.)
2026-09-27 the game-results worker GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp, Tests/test_game_results.inc, Tests/test_gameengine.cpp The results queue's one worker serves the queue it was given, instead of reading the global TheGameResultsQueue. GameEngine::init assigns that global only after the worker is already running, so every start had a data race (TSan). The worker now sleeps on a condition variable that addRequest and endThreads signal, where it polled with a 1 ms sleep: about 1,000 wakeups a second for the whole session. A failed host lookup no longer reads h_addr through NULL (EA's code). test_gameengine checks that a request is served, and that ending the queue wakes and joins the worker at once. If a request fails to wake the worker, it sits in the queue: an online ladder game's result would not be sent. JobSystem.cpp already uses std::mutex and std::condition_variable the same way under MSVC. On Windows the new test's send goes to 127.0.0.1:9, which the local machine refuses at once; a slow refusal would delay only the send, not the check. low Windows: OPEN (a Windows CI run of this change: the build, ctest with test_gameengine's new test, and E1's three CRCs as before.)
2026-09-27 LZHL's last block Libraries/Source/Compression/LZHCompress/NoxCompress.cpp, Tests/test_compression.cpp CompressMemory and CompressFile compress their last 500000-byte block from a copy with eight zeroed bytes after it. LZH-Light's compressor hashes LZMATCH bytes ahead of each position it matched, so a match that ends near the block's end read up to four bytes past it. Between blocks those bytes are the next block's, and those blocks are still handed over in place; after the last block they were past the caller's buffer (ASan, in test_compression and compression_selfcheck). test_compression gains a test that puts the input flush against an inaccessible page (VirtualAlloc and VirtualProtect on Windows, mmap and mprotect elsewhere). The output must be the same bytes. What the extra bytes steer is never used: the block ends with its raw tail and the compressor is destroyed. Over every file of the install (6,341 inputs, 3.5 GB, macOS arm64) the new output equals the old byte for byte, with 0x00 or 0xFF after the input. On Windows, if the page arithmetic in the new test were wrong, the test would fail or fault; the game is unaffected. Latent: the game compresses only with RefPack. low Windows: OPEN (a Windows CI run of this change: the build, ctest with test_compression's new test, and E1's three CRCs as before.)
2026-09-27 LZH-Light's history starts cleared Libraries/Source/lzhl-clear-history.patch (new), Tools/vendor.sh, Tools/vendor.ps1, CMakeLists.txt The vendored LZH-Light gets one patch: LZBuffer clears its history buffer after allocating it. The compressor's backward match read that buffer before writing it (MemorySanitizer, Lz.cpp:204). vendor.ps1 applies the patch through git apply, as it does litehtml's, and CMake now stops if _lz.h lacks the patch's marker, on every platform. The game's own bytes cannot change: GameMemory's operator new already zero-fills, so the buffer was always zeros in the game, and the patch writes the same zeros. On Windows the risks are the script: if git apply or the ceiling variable misbehaved under PowerShell, the patch would not apply and the configure would stop with the new message, which is loud rather than wrong. low Windows: OPEN (a Windows CI run of this change: build.bat's vendor.ps1 applies it, the configure passes the marker check, ctest and E1's three CRCs as before.)
2026-09-27 the LP64 sweep's two format fixes GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp, GameEngine/Source/Common/System/Debug.cpp Two debug-log formats print a 32-bit value with %08x and an unsigned int, where they used %08lx: W3DShaderManager's shader-translation failure ((unsigned int)hr), and Debug.cpp's coarse-clock prefix. Off Windows long is 8 bytes, so the failure code printed sign-extended. None expected: on Windows HRESULT and the clock are 32-bit, so %08lx and %08x print the same text. Only log lines change, and only off Windows. If MSVC warned about the cast, that would be a warning, not a behaviour change. low Windows: OPEN (a Windows CI run of this change: the build and ctest as before; nothing here reaches E1.)
2026-09-27 frames never presented, and what vsync really is off Windows PosixDevice/Render/SdlGpuFrame.h/.cpp, PosixDevice9Timing.cpp, PosixDevice9.cpp, W3DDevice/GameClient/W3DDisplay.cpp The POSIX device counts the Presents the display did not pace: those made while SDL called the window hidden, occluded or minimised, and those whose swapchain gave no drawable. ZH_GPU_TIMING's report prints both counts, and so does the run's closing line. W3DDisplay's init log says what vsync is off Windows: always on, the SDL GPU swapchain's VSYNC, whatever D3D9 asked. A locked MacBook Air had read as 119 fps on a 60 Hz panel. None on Windows: the PosixDevice files are not built there, and W3DDisplay.cpp's Windows line is unchanged inside its own #if defined(_WIN32) branch. low Windows: nothing to verify (the row: the Windows branch of W3DDisplay.cpp preprocesses to the line it had.) The Windows CI build compiling as before is the whole check.
2026-09-27 the texture loader thread waits instead of polling Libraries/Source/WWVegas/WW3D2/textureloader.cpp, Libraries/Source/WWVegas/WWLib/threadwake.h (new), Tests/test_wwlib.cpp WW3D's background texture loader thread slept on ThreadWakeClass (a mutex and a condition variable) until Begin_Load_And_Queue queues a task or Deinit or the exit stops it. It used to check its queue every millisecond (Switch_Thread) for the whole session: about 950 wakeups a second, measured by thread on Linux, for a queue the shipped game never fills (thumbnails are off, so every texture loads in the foreground: 1,425 foreground loads and no background request in a skirmish under gdb). test_wwlib checks the wait: work queued while asleep or before the first wait is served, and Stop ends a sleeping worker at once. The Windows build runs the same loader. If a wake were lost, a background load would wait for the next one, but the game queues none. If the stop failed to reach the sleeping thread, quitting would hang in the join: Deinit and the thread object's own destructor both call Stop() on the wake first. MSVC's std::condition_variable is already used by JobSystem.cpp. low Windows: OPEN (a Windows CI run of this change: the build, ctest with test_wwlib's four new tests, E1's three CRCs, and a quit that returns promptly.)
2026-09-27 X2 measurement hooks: ZH_DX11_DRIVER, ZH_D3D9_DEVTYPE Libraries/Source/WWVegas/WW3D2/dx11device.cpp, dx11device.h, dx8wrapper.cpp Two environment variables, read when each device is created, for measuring CPU submission cost on a machine with no GPU (X2). ZH_DX11_DRIVER=warp forces WARP; =null creates the Direct3D 11 device on the NULL driver, with no swap chain: Create_Views makes a texture of the swap chain's size and format as the back buffer, Resize rebuilds only the views, and Present does nothing. ZH_D3D9_DEVTYPE=nullref creates the Direct3D 9 device as D3DDEVTYPE_NULLREF, which needs d3dref9.dll (the DirectX SDK's debug runtime). The WW3D_DEVTYPE macro now calls a function, on Windows only. None when unset, which is every player's machine. The driver order (hardware, then WARP), the swap chain path, Resize and Present take the same branches as before; D3D9 is D3DDEVTYPE_HAL as before. The only difference is a getenv per device creation (and per caps or format query, which also names the device type). Present on an offscreen device (Create_Offscreen, no back buffer) now returns false where it used to dereference a NULL swap chain; nothing calls it there. A NULL-driver or NULLREF device that cannot be created is refused as on a machine without one: Direct3D 11 then leaves the frame to Direct3D 9, and a Direct3D 9 refusal is the usual start-up failure. low Windows: OPEN (a Windows build and CI run of the change, then the null and nullref runs, each checked for "draws made" in the Direct3D 11 statistics at shutdown.)2026-09-29: ZH_D3D9_DEVTYPE=nullref cannot run the game. A NULLREF device has no render target to give, and W3DShaderManager::init (W3DShaderManager.cpp:2848, the original code) calls GetDesc on what GetRenderTarget returned without checking: an access violation during start-up, in every leg, -d3d9 included (the Windows x64 CI machine). Running it would take null checks in engine code for a measuring mode, so the null-driver A/B was dropped. X2's speed question was answered on a real GPU instead: the Steam Deck through Proton 11 and DXVK, inferno30, where -dx11 (with its post chain and sun shadow map) took 13.15-14.00 ms a frame against -d3d9's 13.54-14.87 in paired runs (relative numbers only).
2026-09-27 Windows on ARM64 (W-ARM64) build.bat, windows-ci.ps1, Lib/BaseType.h, debug/debug_except.cpp, debug/debug_stack.cpp, Common/System/StackDump.cpp, Tools/ProfileSampler/eip_sampler.cpp, WWDebug/wwprofile.cpp, profile/internal.h, Main/WinMain.cpp, WW3D2/d3dx9runtime.cpp, new WW3D2/d3dx9portable.cpp/.h, WW3D2/d3dx9posix.cpp, WW3D2/test_dx9_smoke.cpp, Tests/test_msvc_float_casts.cpp, new Tests/test_d3dx9portable_oracle.cpp, Tools/ffmpeg-build.bat/.sh, CMakeLists.txt, replay-check.ps1 The tree builds for Windows on ARM64 with MSVC. _AMD64_, the x64 CONTEXT fields, __rdtsc, __cpuid and _set_FMA3_enable get ARM64 branches or stay x64-only. mpu.cpp is left out on ARM64. FFmpeg for ARM64 is built into dist-arm64. D3DX's arithmetic is the port's own (d3dx9portable.cpp, which macOS and Linux now forward to), with texture creation from the device and everything else refused. An ARM64 host builds ARM64 into build-arm64. Two CI fixes found on the way: the E1 farm falls back to hard links where UAC refuses symbolic links, and replay-check.ps1 kills a run past -TimeoutMinutes. x64 compiles what it did: every code change is under _M_ARM64 or keeps x64's value in its #else. d3dx9portable.cpp sits in the Windows d3dx9runtime library, but only test_d3dx9portable_oracle references it, and MSVC links a static library's object only when it is referenced. build.bat and windows-ci.ps1 choose build64 exactly as before on an x64 host. test_msvc_float_casts and dx9_smoke change only on ARM64. The farm's hard-link fallback is taken only where a symbolic link is refused, which the x64 VM never does (UAC off). replay-check.ps1 now bounds each run at 60 minutes, and its exit code is unchanged. On ARM64: E1 gives the three current pins; ctest passes 49 of 49 with test_d3dx9portable_oracle skipped (no DLL); dx9_smoke skips its D3DX half. low Windows: PARTLY VERIFIED (ARM64: built, ctest, E1 at the three pins and the data-folder check on the Windows ARM64 VM, after upstream 843bf76b was merged. x64: to be run through Windows CI, with test_d3dx9portable_oracle running against the DLL for the first time.)
2026-09-27 No modal under -headless GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp, Libraries/Source/WWVegas/WWLib/ini.cpp, Libraries/Source/WWVegas/WWDebug/wwdebug.cpp, CMakeLists.txt Three message boxes that a -headless run could still reach now never appear there. The missing base game (reportMissingBaseGame): under -headless it writes the reason to stderr and exits with code 2, on every platform, where Windows put up a task-modal box and POSIX carried on without the art. WWLib's duplicate INI entry (INIClass::DuplicateCRCError, Release on Windows): stderr and exit 2. WWDebug's assert box (Debug builds): stderr, then Ignore, which is how MessageBoxWrapper already answers an unattended run. A scripted run is marked by -headless or by the environment variable ZH_UNATTENDED (set, and neither empty nor 0), read by one helper, isUnattendedProcess() in Common/EarlyCommandLine.h, which Debug.cpp's isUnattendedRun, debuglib, wwlib and wwdebug now share (wwlib and wwdebug include it privately). windows-ci, replay-check, ai-batch, dx11-check, shadow-check and tree-check set ZH_UNATTENDED=1, so their windowed runs cannot wait on a box either. The other boxes were already covered (MessageBoxWrapper, ReleaseCrash, ReleaseCrashLocalized, PosixMain's) or cannot be reached from the game: texture thumbnails (Pre_Init has no caller), Except.cpp's DEMO_TIME_OUT (never defined), and OSDisplayWarningBox (no caller). None without -headless or ZH_UNATTENDED: every change is behind them, and players pass neither. With either, a run that would have hung on a box now exits (2 with the reason on stderr for the boxes above). low Windows: VERIFIED (x64 VM, in the desktop session, a Release build of the change, farms from windows-ci's New-Farm, a broken FixesReforged.ini: a -headless run exited in 4 s and a windowed run with ZH_UNATTENDED=1 in 5 s, while the same windowed run without it was still on its box after 60 s; the data folder was unchanged.)
2026-09-27 Direct3D 11 programs: shipped, and the cache in the user folder WW3D2/dx11backend.cpp/.h, WW3D2/dx11runtime.cpp/.h/dx11runtime_posix.cpp, W3DDevice/GameClient/W3DDisplay.cpp, CMakeLists.txt, new Tools/record-dx11-shaders.ps1 The backend reads dx11shaders.shipped next to the exe, after the player's cache, so for the same source a shipped program wins. It is compiled bytecode, recorded on Windows with Microsoft's d3dcompiler_47 by record-dx11-shaders.ps1 and copied beside the exe by the build when Data/dx11shaders.shipped exists. The player's dx11shaders.cache moves from the working directory (the install, which an installed game cannot write) to the user data folder. It is written during play (at most every 10 s, through a temporary file and a rename) as well as at exit. The shutdown log gives the shipped and held program counts. With a shipped file, Windows draws with the recorded bytecode instead of compiling the same source. The recording is exactly this compiler's run-time output, so on the recording machine the bytes are identical by construction; another Windows version's d3dcompiler_47 would have compiled the same source itself before. After updating, a player's first start compiles once more whatever the shipped file lacks, because the old cache in the install folder is no longer read. Under Wine, where d3dcompiler_47 is vkd3d-shader, a first start no longer compiles the recorded programs; one of those compiles took minutes (X2, on a Steam Deck). low Windows: OPEN (done: the recording on the x64 VM, 157 programs, 590,472 bytes, d3dcompiler_47 10.0.26100.6584, from seeds 0-2 with and without post and 5 min of the shell map; a check run with it shipped logged "157 shipped with the game, 157 held at the end" for seed 0 with and without post, so those matches compiled nothing, and its shell map compiled 1 program more. Open: a Windows build and CI run; byte-identity against run-time compiles from an empty cache (the wider recording); a Proton rerun with no user cache.)
2026-09-27 d3d9.dll kept loaded until exit WW3D2/dx8wrapper.cpp DX8Wrapper::Shutdown no longer calls FreeLibrary on the D3D9.DLL handle Init loaded. Windows only (the code was under _WIN32). Textures outlive DX8Wrapper::Shutdown: TheParticleSystemManager is shut down after TheGameClient, which owns the display, and releases its point groups' textures then. Where that handle was d3d9.dll's last reference, the release called into unmapped code: an access violation in ~TextureBaseClass on an exit that had drawn, seen under Proton (its stacks). Nothing else holds it: neither generals.exe (it imports d3d11.dll) nor Microsoft's d3dx9_43.dll (msvcrt, GDI32, KERNEL32, ADVAPI32) imports d3d9.dll. Required under Proton/Wine (measured red and green); harmless on native Windows (a clean exit before and after in two real scenes); a synthetic probe on the x64 VM in the game's order (device and texture alive, interface released, FreeLibrary) saw d3d9.dll unmapped and the texture's Release fault with 0xC0000005, so the mechanism can fault on Windows. Keeping the DLL until the process ends makes those releases valid; nothing used the unload. low Windows: VERIFIED (native Windows, x64 VM, two real scenes, exit 0 before and after: a 300-frame drawing -dx11 random-map match, before and after the fix; and in the desktop session the Proton scene itself, Alpine Assault with thirty Inferno Cannons, -dx11, 600 frames, before and after the fix. Under Proton with the same x64 build: before, the access violation in ~TextureBaseClass and a box; after, exit 0 and a clean log. The synthetic probe above is the only native fault.)
2026-09-28 The portable FVF size sizes XYZW as D3DX does WW3D2/d3dx9portable.cpp, Tests/test_d3dx9posix.cpp D3DXPortable_FVF_Vertex_Size gave a D3DFVF_XYZW position 16 bytes. Microsoft's d3dx9_43 D3DXGetFVFVertexSize gives it none (0x4002 is 0 bytes, 0x4102 is 8, 0x55554102 is 12): test_d3dx9portable_oracle's first x64 run failed 1728 FVF cases, every one an XYZW. The portable function now answers as the DLL does. Windows x64: none (it calls the DLL). Windows ARM64, macOS and Linux: an XYZW format's size now matches the DLL's. The engine builds no XYZW format (the only callers pass XYZRHW, and every DX8_FVF_* is XYZ), so no stride changes. low Windows: OPEN (the oracle on the x64 VM: 0 FVF failures.)
2026-09-28 -noDynamicLOD in every build, and it turns dynamic LOD off Common/CommandLine.cpp, Common/GlobalData.cpp/.h, Common/GameEngine.cpp, GameClient/System/ParticleSys.cpp, W3DDevice/GameClient/W3DDisplay.cpp, Tests/test_gameengine.cpp -noDynamicLOD and its parser were inside the _DEBUG || _INTERNAL blocks of CommandLine.cpp, so a Release build did not know the switch: measured on the x64 VM, a Release run with it still dropped to "dynamicLOD Medium" on a slow device, and a headless one ended "VeryHigh", enabled, never "off". A deliberate behaviour change, for upstream to judge: -noDynamicLOD, formerly Debug/Internal-only (EA kept it internal), is now accepted in Release, next to -particlecap; it only pins visual quality. The reason is that a comparison of two renderers or two machines has to draw the same effects. It is also its own flag (m_noDynamicLODOverride), because GameLODManager::init applies the static preset after the command line is parsed and sets m_enableDynamicLOD from it: the running game reads GlobalData::isDynamicLODEnabled() where it acts on dynamic LOD (the per-frame update and "force highest" in W3DDisplay::draw, and the two quality log lines), and m_enableDynamicLOD stays the player's setting, which the options menu shows and saves; the switch no longer writes it. The two quality log lines also print the particle ceiling in force (GlobalData::getEffectiveParticleCap(), which ParticleSys now uses too). A Release build now accepts -noDynamicLOD (it was Debug/Internal-only): with it, every effect draws at the highest dynamic level whatever the frame rate. Without the switch: none. Dynamic LOD is client-side only; nothing the simulation reads comes from it (test_gameengine's dynamic_lod_never_reaches_what_the_simulation_reads). low Windows: VERIFIED (x64 VM, desktop session, a Release build of this change (the same code), 300-frame skirmishes: -headless ends "dynamicLOD High"; -headless -noDynamicLOD and -hiddenwindow -noaudio -noDynamicLOD say "dynamicLOD off" at init and at the end. Before this change those two runs ended "VeryHigh" and "Medium". The data folder was unchanged. POSIX, after the merge: macOS arm64 and Linux x86_64 build, ctest passes with the two new test_gameengine tests, and E1's three runs give the pinned CRCs.)
2026-09-28 X1 (-d3d12) new GameEngineDevice/Source/D3D12Device/ (zh_d3d12.dll), new WW3D2/d3d12runtime.cpp/.h, WW3D2/dx8wrapper.cpp, WW3D2/d3dx9runtime.cpp, WW3D2/d3d8shadertranslate.cpp, WW3D2/dx11runtime.cpp, WW3D2/sdl3shadercompile.cpp, WW3D2/engineshader.cpp, W3DDisplay.cpp, CommandLine.cpp, GlobalData.h/.cpp, PosixDevice/Render/* (ZH_D3D12_DEVICE), Tools/vendor.ps1, CMakeLists.txt (ZH_D3D12), Tests/test_d3d12_slice.cpp, Tests/test_ffref_*.cpp -d3d12: the SDL3 GPU device (posixd3d9) on SDL's Direct3D 12 backend, inside zh_d3d12.dll behind a COM adapter, built with -DZH_D3D12=ON after vendor.ps1 -D3D12. -d3d12 asks for it; on Windows ARM64 it is also the default when zh_d3d12.dll is there (the Direct3D 9 path has no d3dx9_43.dll on ARM64 and draws without its terrain), and -d3d9/-dx11 (new) keep the old path. D3DX comes from the DLL and the arithmetic from d3dx9portable.cpp; its programs are kept in d3d12shaders.cache/.shipped. A default that should not have changed: x64 must still start on D3D11 and ARM64 without the DLL on its old path; an unattended run of a build without the DLL must not end (exit 3 is only for an explicit -d3d12). -dx11 is a prefix of -dx11dump/-dx11post: in the table before them it would take their arguments. medium Windows: PARTLY VERIFIED (2026-09-28) ARM64 (WARP): the game draws the whole scene under -d3d12, FFReference 65/0/1 known, the game's captures replay with 0 failed, the program cache fills then serves, a missing DLL exits 3 unattended and falls back attended. x64 (WARP): slice and FFReference pass. Still to see: the ARM64 default taking effect with no switch, -d3d9/-dx11 opting out, -dx11post off still parsed as itself, and x64 starting on D3D11 as before; then the x64 A/B and E1.
2026-09-28 -noaudio in every build Common/CommandLine.cpp, Common/GameEngine.cpp, Tests/test_gameengine.cpp -noaudio's table entry was inside CommandLine.cpp's _DEBUG || _INTERNAL block, so a Release build did not know the switch and a windowed Release run with it opened the audio device; only -headless (and off Windows -hiddenwindow and -offscreen) turned the sound off. The entry moves out of the block, next to -headless. Its parser, parseNoAudio, was already compiled in every build and is unchanged: it clears m_audioOn, m_musicOn, m_soundsOn and m_speechOn, as -headless does, and MilesAudioManager::openDevice returns before opening a device when m_audioOn is off. GameEngine::init now logs, after TheAudio is made, "TheAudio: audio off, no device opened" or "TheAudio: audio on, device handle set" (or "none"). test_gameengine: noaudio_switch_turns_every_sound_off_in_every_build parses -noaudio and checks the four flags. A Release build now accepts -noaudio (it was Debug/Internal-only): with it, the game opens no audio device and plays nothing. Without the switch: none, apart from the one log line at start-up. Nothing saves the four flags: they come from GameData.ini (AudioOn, MusicOn, SoundsOn, SpeechOn) and no code writes them to a file, so a run with the switch changes no setting. low Windows: VERIFIED (x64 VM, a Release build of this change, desktop session, 30-frame skirmishes with -hiddenwindow, which does not touch audio on Windows: with -noaudio, "TheAudio: audio off, no device opened"; without it, "TheAudio: audio on, device handle set"; the data folder unchanged. POSIX, a Linux x86_64 host, Release, a visible window as far as the engine knows, miniaudio's null backend: the same two lines with and without the switch, and a mutant with the table entry back inside the Debug block logs "audio on" with -noaudio and fails the new test, 4 of its 8 checks. macOS arm64 and Linux x86_64: ctest passes and E1's three runs give the pinned CRCs. The Windows ctest and E1 are the merge's CI run's.)
2026-09-28 -nologo and -novideo for harnesses in Release, the EA logo kept for players Common/CommandLine.cpp, GameClient/GameClient.cpp, Tests/test_gameengine.cpp -nologo and -novideo were formerly Debug/Internal-only (their table entries, and parseNoLogo itself, were inside _DEBUG || _INTERNAL blocks). They are now in the table of every build, but a Release build honours them only when ZH_UNATTENDED is set: the CI scripts and test harnesses, never a player (videoSkipAllowed, which logs "-nologo ignored: ..." otherwise). The reason is EA's own: Release's -quickstart skips the sizzle movie "but still force[s] the EA logo to show up. This is for legal reasons." (parseQuickStart, Patch 1.01), so a player's Release run still shows the logo whatever the command line says. A harness's visible run no longer spends about 72 s on movies. Presentation only: m_videoOn is read only by BinkVideoPlayer::createStream, which then gives no stream, as for a missing file; the movie script actions are fire-and-forget and nothing in GameLogic waits on a movie; every E1 run is -headless, which already turns video off. GameClient logs whether the EA logo movie started ("is playing" or "did not start (no stream ...)"). test_gameengine: nologo_and_novideo_skip_videos_in_release_only_when_unattended. A Release build now reads the two switches, but only with ZH_UNATTENDED set; a player never sets it, so a player's run is unchanged (the logo plays; -nologo and -novideo are ignored and logged). Debug and Internal builds behave as before. low Windows: OPEN (a Release build on the x64 VM: without ZH_UNATTENDED, -nologo -novideo is ignored and the logo plays; with it, no logo and no video stream. Measured on POSIX, a Linux x86_64 host, Release, a window as far as the engine knows, 60 s shell runs with -quickstart: without ZH_UNATTENDED, "-nologo ignored", "-novideo ignored" and "the EA logo movie is playing"; with it and -nologo -novideo, no logo line; with it and -novideo alone, "the EA logo movie did not start (no stream ...)"; the install unchanged. macOS arm64 and Linux x86_64: ctest passes and E1's three runs give the pinned CRCs. The same CommandLine.cpp and BinkVideoPlayer.cpp are compiled on Windows.)
2026-09-28 an observer with nothing selected: no portrait, not front() of an empty list GameClient/GUI/ControlBar/ControlBar.cpp ControlBar::update's observer branch took getAllSelectedDrawables()->front() whenever the selection count was not above one, so with nothing selected (an observer's usual state; every E1 run is an observer) it called front() on an empty std::list: undefined behaviour on every STL, in EA's original code. It now takes NULL when the list is empty: no drawable, so no portrait (the next line already handles NULL). What each STL gave (measured, or read in the linked headers): libstdc++ (GCC 16) and libc++ (Apple clang 21) read their element count, 0, so NULL. MSVC Release (no check at _ITERATOR_DEBUG_LEVEL 0) returns the sentinel node's _Myval; _Buyheadnode never writes it after allocate(1), which goes through the game's global operator new (allocateBytes, which zeroes), so NULL as well. MSVC Debug's _STL_VERIFY reports "front() called on empty list" and then _MSVC_STL_DOOM_FUNCTION ends the process: that is how the Windows Debug build found it, as E1's observer run leaving no replay. None a player can see: every Release build already got NULL here, so a Windows Release observer shows no portrait today and after. The change removes the undefined behaviour, which only worked because the game's allocator zeroes memory, and lets a Debug build's observer run live. Client UI only; the simulation never reads the control bar, so E1 is unaffected by construction (and gated). low Windows: VERIFIED (Release: the Windows CI run of the upstream integration, which carries this change, on the Windows CI VM: the build, ctest 50 of 50, the GPU tests and E1's three pinned CRCs. Debug: a Debug CI run on the Windows CI VM: the observer E1 run that found it, 0@1200, plays back to 0xE5C34BF3.)
2026-09-28 Direct3D 11 programs: 168 shipped Data/dx11shaders.shipped The shipped file grows from 157 programs (590,472 bytes) to 168 (632,868 bytes; SHA-256 F600D931…). The first 590,472 bytes are the old file byte for byte. Nine programs follow, recorded on the x64 VM with d3dcompiler_47 10.0.26100.6584 from an empty cache: two named maps for the lighting the random maps lack (Bitter Winter, snow; Lights Out, night), with and without post, 20 minutes of the campaign mission MD_USA01, 5 minutes of the shell map, and the Steam Deck's particle scene (Alpine Assault, thirty Inferno Cannons, 600 frames). One of them, be8f55b2afb8502f, is a program the Steam Deck compiled at run time under Proton. The last two, 7f9e71df39868052 and 28ebf4dd7baecd22, are the other two the Steam Deck compiled: the vertex and pixel programs of pipeline025 in the Steam Deck's own -dx11dump. No Windows run drew that state (a recording with -noDynamicLOD, the highest dynamic level, compiled 67 programs, all already held), so they were compiled from the dumped text instead: the cache key is FNV-1a over the profile and the generated text (program_hash), and the two texts cut from the dump as Dump_Program writes them hash to exactly those keys. They were compiled on the same VM as Compile_Program compiles (D3DCompile, the names ffvertex and ffshader, entry "main", vs_4_0 and ps_4_0, flags 0), and the same call on the dump's other 35 distinct programs gave bytes identical to the ones the file already held. None to the picture: a shipped program is used only where the backend would compile the same text at run time (the key is the text), and every program the recordings share with the file is byte-identical to a fresh run-time compile (54 and 66 shared in the two merges, the -noDynamicLOD recording's 67, and the 35 compiled from the dump: 0 differ). A program the file lacks is compiled on the player's machine, as before. The ff generators that write the two texts are unchanged between the Steam Deck's build and this one. low Windows: VERIFIED (x64 VM: with the first 166 programs shipped and the player's cache empty, the Steam Deck's scene logged "166 shipped with the game, 166 held at the end" and wrote no cache, so it compiled nothing, with and without -noDynamicLOD; the last two are the byte-checked compiles above.)
2026-09-28 The terrain's tile lists shift with memmove W3DDevice/GameClient/BaseHeightMap.cpp, W3DDevice/GameClient/HeightMap.cpp Removing a tile from a terrain tile list moves the rest of the array down one place. It did so with memcpy, whose source and destination overlap there, which C leaves undefined; it now uses memmove, at both such sites in Zero Hour: updateShorelineTiles (BaseHeightMap.cpp) and the extra blend tiles (HeightMap.cpp). AddressSanitizer stopped seed 2's skirmish on the shoreline one (memcpy-param-overlap, the ranges inside the one 278,528-byte array); the other is the same shift, found by searching for it. The same overlap exists at two places in the base game's Generals/ tree, which nothing builds; left as EA wrote it. None expected: the destination is below the source, and forward-copying memcpys (MSVC's and glibc's) already moved the tiles as memmove does, so the lists and the picture should be the same. This is render-only code, so E1's CRCs cannot move. low Windows: OPEN (CI on the change: the build and ctest as before, E1's three pins.)
2026-09-29 a menu skirmish repeatable with -seed GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp The skirmish menu seeded its game from the clock when it opened (setSeed(Clock_Milliseconds_Coarse())) and ignored -seed, which -autoskirmish already honours (GameEngine.cpp). It now takes TheGlobalData->m_fixedSeed when that is set (0 or more, the same -seed switch and parser), the clock otherwise. Without -seed, m_fixedSeed is -1 (GlobalData.cpp's default) and the line computes exactly what it did, so a player's skirmish is untouched; if the default were ever 0 or more, every menu skirmish would share one seed and its random factions, colours and start positions would repeat. low Windows: OPEN (the row's own -seed check has not been run on Windows.) -seed absent: two menu skirmishes started by hand get different seeds, as before (the E1 runs use -autoskirmish, not this menu, so their pins are unaffected); -seed 7: two menu skirmishes set up the same way give the same CRC.
2026-09-27 Windows Debug build Common/Debug.h, CMakeLists.txt, new Tests/test_wwdownload_stubs.cpp Debug.h's four SimpleProfiler counters are int64_t (with <stdint.h>), where an earlier port change had made them Int64. Under MSVC in the Debug configuration only: debug builds as debugdebug.lib and gameengine as GameEngineDebug.lib (OUTPUT_NAME_DEBUG), the names EA's #pragma comment(lib) lines ask for. The three tests that build GameMemory.cpp themselves drop GameEngineDebug.lib as they drop GameEngine.lib. test_wwdownload gains a DebugLog stub whose body exists only under _DEBUG. Release: none. On MSVC int64_t, Int64 and EA's __int64 are one type, and no Release target compiles DEBUG_PROFILE. OUTPUT_NAME_DEBUG and the $<CONFIG:Debug> link option touch only the Debug configuration, and the stub's object is empty in Release. Debug: a Debug build of the whole tree had not compiled on Windows since that change (wwdebug stopped at Debug.h:244). If a renamed library were still asked for by its old name, the link would say which. low Windows: VERIFIED (a Debug CI run on the Windows CI VM (windows-ci.ps1 -Config Debug): the build, ctest 50 of 50 with order_cameos_selfcheck skipped (no numpy there), the GPU tests, and E1 0@1200 playing back to 0xE5C34BF3, Release's pin. Earlier, on this row's own change: wwdebug compiles, debug builds as debugdebug.lib, and test_debug and test_wwdownload link.) Windows: windows-ci.ps1 -Config Debug builds everything and passes ctest; a Release gate is unchanged.
2026-09-28 a Debug build's subsystem list compares its own iterators Common/System/SubsystemInterface.cpp SubsystemInterfaceList::removeSubsystem, compiled only under DUMP_PERF_STATS (GameCommon.h: _DEBUG or _INTERNAL), walked m_allSubsystems until its iterator equalled m_subsystems.end(), another vector's end: undefined, and the walk could run off the end of m_allSubsystems when the subsystem was not in it. The loop now stops at m_allSubsystems.end(). EA's code. Found by the Windows Debug build: every shutdown deletes each subsystem, whose destructor calls removeSubsystem, and MSVC's debug STL asserted "vector iterators incompatible" there (from ~GameResultsQueue), which ended E1's observer run after its frame 1200 CRC had been logged. None in Release: the block is not compiled without DUMP_PERF_STATS. In a Debug or Internal build, a shutdown that removed a subsystem missing from the list could read past the vector; now it finds nothing and stops. low Windows: VERIFIED (a Debug CI run on the Windows CI VM (windows-ci.ps1 -Config Debug): the build, ctest 50 of 50 with order_cameos_selfcheck skipped (no numpy there), the GPU tests, and E1 0@1200 playing back to 0xE5C34BF3, Release's pin; the run shuts down cleanly, where before this change it stopped on "vector iterators incompatible".)
2026-09-29 the tests delete a scratch GlobalData while it is current Tests/test_gameengine.cpp, Tests/test_camera_behavior.inc, Tests/test_minimap_input.inc Eighteen tests and two fixtures deleted a scratch GlobalData while TheWritableGlobalData was something else: seventeen tests and both fixtures' destructors (the camera and minimap input fixtures) put the saved pointer back first, and one test never made its scratch current. ~GlobalData begins with a Debug-only DEBUG_ASSERTCRASH that reads TheWritableGlobalData->m_next, so a Debug build read through the restored pointer, NULL when the test ran first or alone. Each now deletes its scratch while it is current, then restores, with a line saying why. Found by the Windows Debug build: test_gameengine's borderless case sat on the debug library's exception dialog ("EXCEPTION_ACCESS_VIOLATION … address 0x00000cc0 was read from … GlobalData::~GlobalData+0x20, GlobalData.cpp:1282"), read from its window in the service session, until ctest's time limit. None to the game: test code only. Release never compiled the assertion, so the old order passed there. low Windows: VERIFIED (a Debug CI run on the Windows CI VM (windows-ci.ps1 -Config Debug): the build, ctest 50 of 50 with order_cameos_selfcheck skipped (no numpy there), the GPU tests, and E1 0@1200 playing back to 0xE5C34BF3, Release's pin; test_gameengine passes whole in Debug, where the borderless, placement and camera cases each stopped it before.)
2026-09-29 an unattended run gets no exception dialog Libraries/Source/debug/debug_except.cpp The debug library's unhandled-exception filter wrote its report to the debug log and then always opened its "Exception" dialog, which waits for OK. In a run with nobody to click it (isUnattendedProcess(): -headless or ZH_UNATTENDED, as debug_debug.cpp's crash box already asks) it now prints "Unhandled exception 0x at
; the report is in the debug log (unattended, so no dialog)" on stderr and ends the process as OK would (EXCEPTION_EXECUTE_HANDLER). The dialog is invisible in a service session (ssh, ctest), so every crash in a test there looked like a hang until ctest's limit: three Debug CI runs lost 45 minutes each to it.
Only unattended runs change: a player never sets ZH_UNATTENDED or -headless, so a player's crash still shows the dialog. An unattended run that crashes now ends at once with the exception code as its exit status, instead of waiting; the log report is written before either. low Windows: VERIFIED (an earlier Debug CI run on the Windows CI VM: the camera fixture's crash ended test_gameengine at once, with "Unhandled exception 0xC0000005 at 00007FF6E5B9C960; the report is in the debug log (unattended, so no dialog)" on stderr, and ctest reported "Exception: SegFault" after 1408 s instead of a timeout at 2700.)
2026-09-29 SDL_GPU's Direct3D 12 backend keeps its descriptor writes inside their heaps new Libraries/Source/sdl3-d3d12-descriptors.patch, Tools/vendor.ps1, Tools/vendor.sh, CMakeLists.txt, .gitattributes The vendored SDL 3.4.16's D3D12_INTERNAL_WriteGPUDescriptors switched to new shader-visible heaps only once one was full, then wrote the whole table past the end: the 2048-slot sampler heap at 2046 + 4 (debug layer: EXECUTION ERROR 646; WARP on ARM64: memory corruption or a lost device, the -d3d12 crashes). The patch makes room for a whole bind before writing any of it, marks every table for a rebind after a switch, keeps the old switch as a counted last line that refuses the draw, refuses a draw when the pool cannot make a heap instead of using NULL, and carries upstream's 67bf94eed5 (the debug-layer callback cookie) and f443c429c6 (the fence read under submitLock). Each guard logs once and is counted; the counts print at device destroy (always if one fired, else with ZH_SDL_GPU_D3D12_STATS=1). vendor.ps1 -D3D12 applies it the way it applies LZH-Light's, and a ZH_D3D12 configure stops without its marker. Only the -d3d12 renderer compiles this backend. A run that never overflowed draws what it drew before (a command buffer's first heaps also mark its tables for a rebind: a few descriptor copies). If the space count were short, the last line would switch late and refuse draws, which the destroy line counts. If the script misbehaved, the configure stops with the new message. medium Windows: OPEN (vendor.ps1 -D3D12 prints the patch step and the configure passes the marker; -d3d12 on x64 WARP and ARM64 WARP, seeds 0 and 2 and MD_USA01, with the ring and without: 0 late switches, 0 heap failures, 0 refused draws in every destroy line; the debug layer on one of each: no D3D12 ERROR; FFReference as before; ctest and E1's three CRCs.)
2026-09-29 At most three mid-frame flushes in flight, at most 2048 draws in a batch; ZH_GPU_DEBUG=gbv PosixDevice/Render/SdlGpuFrame.cpp/.h, PosixDevice/Render/SdlGpuFrameBatch.cpp, PosixDevice/Render/PosixDevice9.cpp SdlGpuFrame::Flush submitted and never waited, so flushes (a resource updated twice in a batch, textures restored after a device reset) could pile up with their command buffers and, on Direct3D 12, the two descriptor heaps each holds. A flush now takes a fence; done fences are let go and past three in flight the oldest is waited for (ZH_GPU_FLUSH_LIMIT=<n>, 0 for none). The closing line reports flushes, the most in flight and the waits. A batch also flushes before its 2049th draw (ZH_GPU_BATCH_DRAWS=<n>, 0 for none): it ended only at Present or at 64 MB of staged data, and a -mission quickstart, which draws its movie for minutes without presenting, put everything in one command buffer (on ARM64 WARP 256 descriptor heaps held by it, 20 GB, then the device removed); the closing line counts these flushes too. On Windows ZH_GPU_DEBUG=gbv also turns on Direct3D 12's GPU-based validation through D3D12GetDebugInterface before SDL makes its device (a diagnostic, off unless asked). Draw order and content are unchanged; a wait costs time only when three flushes are still on the GPU. The same code runs on Metal and Vulkan, where the POSIX suites cover it. low Windows: OPEN (the -d3d12 matrix of the descriptor-patch row, with and without ZH_GPU_FLUSH_LIMIT=0: the closing line's most in flight at 3 or fewer, and the pictures and FFReference as before.)
2026-09-29 A command-line start draws: -mission no longer runs with m_breakTheMovie set GameClient/GameClient.cpp GameClient::update's intro block sets m_breakTheMovie and calls showShell, which returns before pushing the main menu when a file was named on the command line, and MainMenuInit is what clears the flag. W3DDisplay::draw begins a frame only with it clear. A -mission campaign start's load screen (single player or challenge) does not clear it either, so the whole mission drew nothing and presented nothing: its movie's draws piled into one batch (on ARM64 WARP under -d3d12, 20 GB and a removed device). The block now clears it after showShell when m_initialFile is set (-mission, -file, a replay, a save); -file, replays and saves reached the same state before through ShellGameLoadScreen (when the memory check passed). Render-only: W3DDisplay's gate is the flag's one reader, so the logic cannot differ. If it were wrong, a command-line start would draw during its load screen, as a menu start always has. low Windows: OPEN (E1's three pins as before; a windowed -mission MD_USA01 -maxframes 900 run's HEADLESS CRC AT LIMIT the same before and after; the mission now presents and its picture is the scene.)
2026-09-29 Windows ARM64 builds -d3d12 by default CMakeLists.txt, build.bat ZH_D3D12's default now follows the target: ON for ARM64 (MSVC's CMAKE_CXX_COMPILER_ARCHITECTURE_ID, else the Visual Studio platform), OFF for x64; an explicit -DZH_D3D12= wins, and configure prints the value it chose. build.bat passes -D3D12 to vendor.ps1 when its platform is ARM64, so the SDL3 GPU stack is fetched. Before, a plain build.bat on ARM64 made no zh_d3d12.dll, and the game fell back to Direct3D 9, which has no d3dx9_43.dll on ARM64 and draws without its terrain. x64 unchanged (OFF, nothing more fetched). An ARM64 build tree configured before this had OFF cached as the old default; configure moves it to ON once and says so (a value set later, or a first -DZH_D3D12=OFF, is kept). If the architecture test missed, ARM64 would build as before (the old fallback), which the configure line shows. low Windows: OPEN (a fresh ARM64 clone's plain build.bat prints ZH_D3D12=ON and puts zh_d3d12.dll in Run, and a launch with no switch logs the Direct3D 12 renderer; the Windows ARM64 CI run at the pins; the Windows x64 CI run prints ZH_D3D12=OFF and passes as before.)
2026-09-29 FFmpeg's ARM64 build committed beside the x64 one Libraries/Source/FFmpeg/dist-arm64/ (new, 147 files), Libraries/Source/FFmpeg/.gitignore, .gitattributes, Tools/fingerprint-manifest.sh dist-arm64 is what Tools\ffmpeg-build.bat arm64 makes (FFmpeg 8.1.2, the in-tree configure line with --arch=aarch64 and the script's --disable-asm, LGPL 2.1 or later), laid out file for file as dist/ (5 DLLs, 5 import libraries, 136 headers, the same LICENSE.txt), committed as dist/ is: -text, and left out of the fingerprint manifest. A fresh ARM64 clone configured only after someone ran that script with MSYS2 and nasm installed. The same bytes the ARM64 builds already linked, copied by hand until now. low Windows: OPEN (a fresh ARM64 clone's plain build.bat configures, builds and runs with nothing seeded; the Windows ARM64 CI run passes.)
2026-09-29 Direct3D 12 programs: 85 shipped Data/d3d12shaders.shipped 25 programs added to the 60: what MD_USA01 (which draws since the -mission fix) and the inferno30 particle scene compiled at run time past the shipped file, recorded on the Windows x64 CI machine with record-dx11-shaders.ps1 -Renderer d3d12 -KeepShipped and Microsoft's d3dcompiler_47 10.0.26100.6584, twice. Every added key was compiled in at least two separate game runs with the same bytes (39 repeats across four recordings, 0 different); two keys seen only once are left out. The file is written as d3d12merge writes it: the marker, then each program once, sorted by key. Programs the device would otherwise compile on first use, so only the first start's time changes; a program whose key no draw asks for is never read. low Windows: OPEN (the loader line says 85 shipped; MD_USA01 and inferno30 compile 0 or near 0 at start; the Windows ARM64 CI run.)
2026-09-29 posixd3d9 stages only the vertices an indexed draw reads PosixDevice/Render/PosixDevice9Draw.cpp, SdlGpuFrame.h, SdlGpuFrameBatch.cpp, Tests/test_posix_gpu_draw.cpp An indexed draw from a dynamic vertex buffer staged every vertex from its base up to MinVertex + VertexCount. The engine's dynamic buffer is filled front to back through a frame, so each draw copied the whole buffer so far: in the inferno30 particle scene 92% of 2.6 GB staged in one run was below the draws' MinVertex, and the copies, their upload and the flushes they forced made the Steam Deck's native frames 60 ms and more. Only [MinVertex, MinVertex + VertexCount) is staged now, and the stream is bound MinVertex vertices before it, so every index reads the vertex it read before; a draw too near the stream's start stages from its base as before. Debug builds scan each staged indexed draw's indices and abort, naming the draw, if one is below MinVertex or past its range. The same vertices at the same indices, so pictures cannot change unless the engine passes a MinVertex above an index it draws, which the Debug check catches and a check run (inferno30, seeds 0-2, MD_USA01, the shell map) found in none. posix_gpu_draw_selfcheck draws from a dynamic buffer past its first vertex (the frame's first draw from its base, later ones shifted, one with a base vertex too) and requires the same bytes as the same draws from a static buffer; binding without the shift, or always shifting, fails it. This device is -d3d12's on Windows, so it applies there too. medium Windows: OPEN (ffref_gpu and the -d3d12 slice as before; ctest and E1's pins; the -d3d12 picture unchanged.)
2026-09-29 ZH_USER_DATA_DIR on Windows Common/EarlyOptions.h Windows honours ZH_USER_DATA_DIR for the user data folder, as POSIX does. It came in with the Windows gamepad change, the rest of which is gone (the 2026-10-02 row). Unset, the folder is Documents as before, and nothing outside the harnesses sets it. low Windows: VERIFIED (2026-10-02, replay-check.ps1 with its own -UserDataDir.)
2026-09-29 The HUD overlay is off by default in Release GameEngine/Source/Common/GlobalData.cpp, CommandLine.cpp, GameClient/InGameUI.cpp; Tools/stage-overlay.sh, package-common.sh, make-macos-app.sh, linux-portable.sh, dx11-check.ps1, shadow-check.ps1, tree-check.ps1 A project rule: GlobalData's m_showHudOverlay (upstream's ShowHudOverlay, TRUE on upstream and here until now) defaults to TRUE in Debug and _INTERNAL and FALSE in every other build, RELEASE_DEBUG_LOGGING included (a Release build that also logs). ShowHudOverlay = Yes in GameData.ini still turns it on, and the new switch -showHudOverlay turns it on over whatever the INI says (the command line is read after GameData.ini). The stager and the packages now refuse a shipped ShowHudOverlay = Yes instead of a No, and the harnesses whose screenshots are evidence pass the switch. Render-only: the readout is drawn over the frame and nothing in the logic reads the flag, so the CRCs cannot move. A Release player who had relied on it sees no corner readout until GameData.ini turns it on; a harness picture without the switch has no readout. low Windows: OPEN (a Release build starts without the readout and a Debug build with it; -showHudOverlay shows it in Release; dx11-check's pictures carry it; ctest and E1's pins as before.)
2026-09-29 E1's runs side by side on Windows replay-check.ps1, windows-ci.ps1 Windows honours ZH_USER_DATA_DIR (EarlyOptions.h), as POSIX does. replay-check.ps1 -UserDataDir sets it for the games it starts and reads their replays there; without it the script clears it, so the games and the script both keep Documents, as before. windows-ci.ps1's desktop part starts every E1 run at once, each a hidden powershell with its own farm (farm<n>) and user data folder (user<n>), and reads the results back in the runs' order; the one shared farm is removed. Harness only: the game is unchanged. The runs side by side share the CI machine's CPUs, so each is slower; their CRCs cannot change (each run is one process, as before). If two runs shared a user data folder they would race on Replays\00000000.rep, which each run's own folder rules out. low Windows: OPEN (on both VMs, twice: E1's CRCs as pinned with the runs side by side; the data folder unchanged; each run's replay in its own user<n>\Replays; a run with the variable unset writes its replay to Documents as before; the desktop part's time before and after.)
2026-09-29 The texture-stage transforms reach Direct3D 11 (X2) Libraries/Source/WWVegas/WW3D2/dx8wrapper.h DX8Wrapper::Set_Transform's default branch (both overloads) set D3DTS_TEXTUREn on the Direct3D 9 device only. The Direct3D 11 backend applies its own copy of each stage's matrix whenever TEXTURETRANSFORMFLAGS is on (dx11backend.cpp Set_Transform), so under -dx11 every material with a texture mapper (mapper.cpp, matrixmapper.cpp: the scrolling water, treads and signs, and the static scales and offsets) drew with a stale matrix. Both branches now also call Direct3D11_Mirror_Transform with the matrix exactly as Direct3D 9 received it, as the projection branch already did. None under -d3d9 or off Windows: the mirror returns unless the Direct3D 11 backend is active (dx11runtime.cpp:176-180), and the POSIX build's is an empty stub. Under -dx11 only draws with a texture transform on stages 0-3 can change: the backend's Set_Transform stores world, view and projection in their own cases and nothing else. No simulation change. medium (a visible Windows default-renderer defect) Windows: VERIFIED (the Windows x64 CI machine, 2026-09-29, WARP, on screen; Data/Scenarios/mappers.txt, -video 600 615, base 430572d5 against the fix, each under -dx11 and -d3d9). The fix and base -dx11 pictures differ in 2.0% of the pixels at all and in about 1,245 by more than 20 levels, all on mapped materials: the fountains' water, the Scorpions, and the town's windows. On those pixels the fix is 17 levels from -d3d9 on average, and base was 39. For the windows, the fix is 4.4 against base's 28.8, where the pixels the fix leaves alone are 5.5 apart from -d3d9 anyway, from the post chain and the shadow map. The fountain water, dull grey-cyan in base -dx11, is -d3d9's bright cyan with the fix.
2026-10-01 Port defect 35 .gitattributes; Tools/stage-overlay.sh; CMakeLists.txt (the test) GeneralsMD/Code/Data/INI/** text eol=crlf: the INI masters are checked out CRLF on every platform. A Windows checkout with autocrlf on, the expected one, already had them CRLF and is unchanged; one with autocrlf off now gets CRLF too. stage-overlay.sh (POSIX only) writes the staged INIs CRLF. A Windows checkout with autocrlf off used to get LF INIs and so another INI CRC than every other Windows build; it now agrees. If the attribute were wrong for a Windows file under Data/INI, that file's bytes in Run\Data\INI would change, and with them the INI CRC. low Windows: VERIFIED (x64 VM and ARM64 VM, 2026-10-01, the merge gate on the fix: all six E1 game logs on each log INI CRC is 0x0C91C99D, the value the x64 VM logged before the fix and the one macOS and Linux now log; the LF control gives 0x818D7B7F.) The x64 VM's INI CRC for a fresh checkout of the fix must equal the value it had before the fix and the one macOS and Linux log (INI CRC is 0x... in DebugLogFile.txt).
2026-10-02 Gamepad support removed CMakeLists.txt, build.bat, Tools/vendor.ps1, Tools/vendor.sh; Main/WinMain.cpp; Win32Device/Common/Win32GameEngine.cpp; Win32Device/GameClient/Win32Mouse.h/.cpp, Win32DIKeyboard.h/.cpp; W3DDevice/GameClient/W3DMouse.cpp, W3DDisplay.cpp, W3DPushButton.cpp, W3DGameFont.cpp; GameClient/GameConsole.h/.cpp, InGameUI.h/.cpp, GUI/GUICallbacks/Menus/QuitMenu.cpp; Common/GlobalData.h/.cpp, OptionsCatalog.cpp, Data/Window/Menus/OptionsMenu.wnd; Data/Patch.str, Data/Turkish/Generals.str The owner took the gamepad out on every platform. Gone: the Gamepad* client layer and GamepadReforged.ini, SdlGamepad, SdlInputScript and Win32GamepadOutput, Kenney's glyph fonts, the loose QuitMenu.wnd with its Trainer key, the Controls page's Controller, Controller Aim Assist and Swap Confirm and Cancel boxes, and the gamepad tests. Win32Mouse, Win32DIKeyboard and W3DPushButton are main's again. A Windows x64 build no longer fetches or links SDL3; -D3D12 and ARM64 fetch it for zh_d3d12.dll as before the gamepad change. ZH_USER_DATA_DIR stays. GamepadReforged.ini was never in the INI CRC, so the multiplayer checksum is unchanged. An install updated over an older one keeps any stale Run\Window\Menus\QuitMenu.wnd: its Trainer key would show and do nothing. The console's trainer command still opens the cheat panel. low Windows: VERIFIED (x64, 2026-10-02: build.bat Release test, ctest, and replay-check.ps1 with its own user data folder.)
2026-10-02 Windows Direct3D 12 renderer (X1) dropped CMakeLists.txt, .gitattributes, Tools/vendor.ps1, Tools/vendor.sh, Tools/record-dx11-shaders.ps1, Tools/d3d9posix_check.py, dx11-check.ps1, replay-check.ps1; GameEngineDevice/Source/D3D12Device/, WW3D2/d3d12runtime.cpp/.h, Data/d3d12shaders.shipped, Tools/windows-d3d12-licenses.txt, Tests/test_d3d12_slice.cpp, Libraries/Source/sdl3-d3d12-descriptors.patch (all removed); Common/CommandLine.cpp, Common/GlobalData.h/.cpp, W3DDevice/GameClient/W3DDisplay.cpp, WW3D2/dx8wrapper.cpp, WW3D2/dx11runtime.cpp, WW3D2/d3dx9runtime.cpp/.h, WW3D2/d3dx9math.h, WW3D2/d3d8shadertranslate.cpp, WW3D2/sdl3shadercompile.cpp/.h; the POSIX device's shared files and Platform/ headers The owner dropped the opt-in Windows renderer that ran the POSIX device on SDL3 GPU's Direct3D 12 backend. On an RTX 2060 it drew a black window: every pipeline was refused (0x887A0001) and the device was lost at frame 0; it had only been seen working on WARP, and it gave nothing over the Direct3D 11 frame. Gone: the ZH_D3D12 option and zh_d3d12.dll, the switch and its GlobalData flag, W3DDisplay's activation and the "D3D12 x64" HUD name, DX8Wrapper's and the D3DX binder's paths through the DLL, the DXBC program cache and its shipped file, vendor.ps1's -D3D12 fetch of SDL3 and the shader compilers, SDL's descriptor patch, and every ZH_D3D12_DEVICE branch in the shared POSIX sources. Windows is main's again: the Direct3D 11 frame by default, -d3d9 for Direct3D 9. macOS and Linux keep SDL3, posixd3d9 and the shader compilers, unchanged. x64 without ZH_D3D12 never compiled any of it, and the paths left are the ones that build ran. -d3d12 is now an unknown switch and is ignored. low Windows: VERIFIED (x64, 2026-10-02: build.bat Release test, ctest, replay-check.ps1, and a default start that logs Direct3D 11.)
2026-10-02 Windows ARM64 kept, on Direct3D 11 build.bat, windows-ci.ps1, CMakeLists.txt, .gitattributes; Libraries/Source/FFmpeg/dist-arm64/, FFmpeg/.gitignore, Tools/ffmpeg-build.bat/.sh, Tools/fingerprint-manifest.sh, Tools/license-headers.py; Lib/BaseType.h, Lib/DetRound.h, debug/debug_except.cpp, debug/debug_stack.cpp, profile/internal.h, Common/System/StackDump.cpp, WWDebug/wwprofile.cpp, Tools/ProfileSampler/eip_sampler.cpp, WW3D2/d3dx9runtime.cpp, WW3D2/d3dx9portable.cpp, WW3D2/test_dx9_smoke.cpp, W3DDevice/GameClient/W3DDisplay.cpp; README.md, PORTING.md The owner kept the Windows ARM64 target and dropped only Direct3D 12 (the row above). ARM64 builds as it did in the port: build.bat picks it on an ARM64 machine and builds into build-arm64, windows-ci.ps1 -Platform, FFmpeg's committed dist-arm64, the _M_ARM64 branches, mpu.cpp left out, and d3dx9runtime's DLL-less binding (the port's arithmetic, the device's own texture constructors, the rest refused). It now draws the way x64 does: the Direct3D 11 frame by default, -d3d9 for Direct3D 9, which on ARM64 is Windows' own 9-on-12 layer. Its -d3d12 default went with -d3d12, and with it m_direct3D12Refused and -dx11; build.bat no longer asks vendor.ps1 for -D3D12 there. The corner names the architecture: DX11 arm64, DX9 arm64. x64 compiles the #else side of every ARM64 branch, so x64 is what it was, corner name included (DX11 x64). A native ARM64 build has no d3dx9_43.dll, so under either renderer it starts but loads no file textures (MissingTexture), as -d3d9 and -dx11 did there before; ARM64 players run the x64 build under Windows' emulation. low Windows: PARTLY VERIFIED (x64, 2026-10-02: build.bat Release test, ctest, replay-check.ps1, a default start that logs Direct3D 11.) Left: an ARM64 build and its ctest; this machine has no MSVC ARM64 toolset.
2026-10-02 The last Direct3D 12 leftovers Libraries/Source/d3d8to9-d3d9on12.patch, WW3D2/test_dx8_smoke.cpp (both removed); comments in CMakeLists.txt, W3DDisplay.cpp, StackDump.cpp, dx8wrapper.cpp, test_dx9_smoke.cpp; Tests/ffreference/knownprobe_windows.cpp Main-era pieces of the d3d8to9 route: its Direct3D 9-on-12 patch, which nothing applied since d3d8to9 stopped being built, and the D3D8 smoke test, unbuilt for the same reason. The comments that named that route are reworded, and the reference probe no longer reports whether the 9-on-12 module is loaded. Comments and two unbuilt files; the probe is a test tool. Nothing the game runs changed. low Windows: VERIFIED (x64, 2026-10-02: build.bat Release test, ctest, replay-check.ps1.)
2026-10-02 One-command builds for macOS and Linux new build-macos.sh, build-linux.sh; build.sh moved to Tools/build-posix.sh; .gitignore, CMakeLists.txt (the POSIX vendor hint), Tools/vendor.sh, Tools/syntax_sweep.py; README.md, PORTING.md build.sh was the macOS build alone. It is now build-posix.sh <macos|linux>, behind one root script a platform, and it checks the toolchain, builds with Ninja and stages the game: the app bundle on macOS, a folder in the Linux package's layout on Linux. build.bat is unchanged. Nothing Windows compiles or runs changed: the CMake line is inside the non-Windows block. build-linux/ joins build-mac/ and build64/ as a tree one checkout may hold. low Windows: VERIFIED (x64, 2026-10-02: build.bat Release test, ctest, replay-check.ps1.) The two scripts were not run on macOS or Linux here: bash -n, and their platform and toolchain branches under Git Bash with a stand-in uname.
2026-10-02 -nologo and -novideo in every Release run; -mission removed Common/CommandLine.cpp, Common/GameEngine.cpp, Common/GlobalData.h/.cpp, GameClient/GameClient.cpp (a comment), GameClient/CampaignManager.h, GameClient/System/CampaignManager.cpp (both main's again), Tests/test_gameengine.cpp, Tests/run_mission_check.sh (removed), CMakeLists.txt, Tools/record-dx11-shaders.ps1, PORTING.md; PosixDevice/Render/SdlGpuFrame.h (a comment) The owner's decisions. -nologo and -novideo skip the logo and the movies in a Release build whatever the environment says: videoSkipAllowed and its ZH_UNATTENDED test are gone (the 2026-09-28 row). Main parsed both in Debug and Internal builds only, so a Release build there ignored them. -mission is gone with everything only it used: parseMission, startPendingMap, prepareChallengeMission, the two GlobalData fields, CampaignManager::setCampaignAndMissionForMap, mission_check and the shader recorder's -Missions. GameClient's clearing of m_breakTheMovie stays: it serves every start from the command line (-file, -replay, -loadsave), and only its comment named -mission. A player's Release run with -nologo or -novideo now skips the EA logo or the movies, where main played them. Without either switch nothing changed. -mission is an unknown switch now and is ignored. low Windows: VERIFIED (x64, 2026-10-02: build.bat Release test, ctest, replay-check.ps1, and a Release shell start with -quickstart -nologo -novideo and no ZH_UNATTENDED that logs no EA logo movie, against a control without them that logs it playing.)
2026-10-02 Menu layout: Fit or Stretch GameClient/GUI/GameWindowManagerScript.cpp, Common/GlobalData.h/.cpp, Common/OptionsCatalog.h/.cpp, GUI/GUICallbacks/Menus/OptionsMenu.cpp, Data/Window/Menus/OptionsMenu.wnd, Data/Patch.str, Data/Turkish/Generals.str, Tools/optionsmenu_layout.py (the contributor's Tools/menufit-click-check.sh and its ctest were not taken: they play their clicks through ZH_INPUT_SCRIPT, which went with the gamepad) A new option, MenuLayout (Options > Display), that defaults to Stretch on Windows (#if defined(_WIN32) in GlobalData.cpp) and Fit elsewhere. parseScreenRect, the shared .wnd loader, gains a Fit branch for Menus/ layouts: one scale, min(W/800, H/600), with the 4:3 area centred, except a window covering the whole layout (within 2 pixels), which still fills the screen. Stretch takes the old arithmetic unchanged. A new apply kind, APPLY_SHELL_REBUILD: changing the option on Accept rebuilds the shell, as a resolution change does. With Stretch, Windows' default, every rectangle is the old expression; what differs is a branch on a flag that is false, one file-name test per layout and a new combo box. A Windows player who picks Fit gets the macOS and Linux layout, and the shell is rebuilt on Accept, which in a match is the path a resolution change already takes. If MSVC evaluated min differently from the POSIX builds here, Fit rectangles could be a pixel off, never Stretch's. No CRC is read from window geometry. low Windows: VERIFIED (2026-10-02, the merge gate's x64 and ARM64 runs: build, ctest 53/53 and 56/56 with the optionsmenu selfcheck, E1 as pinned. x64 under WARP at 1280x800 against v3.0.0: the default Stretch draws the main menu and the skirmish screen with 0 pixels different, and the options page differs only in the new row (15,551 px in x 63-421, y 469-570); MenuLayout = 1 draws the Map Preview at 234x198, w/h 1.182, as macOS and Linux do. Those runs were the contributor's, on his tree with the gamepad and ARM64 still in; on this merge, x64 2026-10-02: build.bat Release test, ctest, replay-check.ps1 and a default start. Left: no automated check of where a Fit click lands.)
2026-10-02 The in-game art download on macOS and Linux removed Tools/fetch-art.sh, Tests/test_fetch_art.sh (both removed); Main/PosixMain.cpp, CMakeLists.txt (ZH_ART_URL and the fetch_art_check test), Tools/make-macos-app.sh, Tools/linux-portable.sh, Tools/linux-packages.sh, Tools/linux-packages/ (CMakeLists.txt, PKGBUILD, the Flatpak manifest and metainfo), Tests/test_macos_app.sh, Tests/test_linux_portable.sh, PORTING.md The game no longer starts fetch-art.sh on macOS and Linux, and the packages no longer carry it; --art-url is gone from the packaging scripts. The art release it fetched from was never published. <user data>/ReforgedArt is still read as an overlay after a package's own, so whatever installs the art later puts it there. none on Windows: PosixMain.cpp and the packaging scripts are not built or run there, and the CMakeLists.txt lines removed were inside the macOS and POSIX test blocks none Windows: done (build.bat Release test on this branch.)
2026-10-02 Windows ARM64 loads its textures: the port's own D3DX WW3D2/d3dx9runtime.cpp/.h, new WW3D2/d3dx9portable_texture.cpp/.h and WW3D2/d3dx9texturerules.h, WW3D2/d3dx9posix_texture.cpp; PosixDevice/Render/PosixImage.cpp/.h (moved out of PosixResources9), PosixImageOps.h, PosixPixelCodec.h; W3DDevice/GameClient/W3DDisplay.cpp (one log line); CMakeLists.txt; Tests/test_d3dx9portable_oracle.cpp; tree-check.ps1; PORTING.md, README.md, CHANGELOG.md Without d3dx9_43.dll (ARM64 always, x64 with ZH_D3DX_PORTABLE=1), Bind_D3DX9_Runtime binds the port's own bodies and returns true: D3DXCreateTexture with D3DX's sizes and format substitution, D3DXLoadSurfaceFromSurface and D3DXFilterTexture through PosixImageOps (the macOS and Linux surface code) over the real device, reading a surface that will not lock through GetRenderTargetData and writing one through UpdateSurface, and the assembler, compiler and disassembler from d3dcompiler_47.dll's D3DAssemble, D3DCompile and D3DDisassemble. The log says which: W3DDisplay::init - D3DX: d3dx9_43.dll or the port's own, shaders by d3dcompiler_47.dll. D3DX_DEFAULT as a texture dimension is 256 now, on macOS and Linux too, as the DLL makes it. tree-check.ps1 takes -NewEnv and -Extra, uses a user data folder of its own and ends only the game it started: it took another checkout's screenshot once, and ended other checkouts' games by name. x64 without the variable binds the DLL exactly as before (the #else side of the old ARM64 branch is the same code). With it, a texture can differ from the DLL's by one step of its narrowest channel, two down a 5-bit mip chain; the cases where the port and the DLL part further (luminance destinations, D3DX_FILTER_TRIANGLE, a box over more than 2:1, DXT3/5 blocks with c0 <= c1 decoded on the CPU, image files) are paths no game call takes. low Windows: PARTLY VERIFIED (x64, 2026-10-02: build.bat Release test 58/58, 0 C4311/C4312, replay-check.ps1 seeds 0 and 1 the same at frame 6000; test_d3dx9portable_oracle on the real device: 55 results, 28 byte-identical, the rest within one step, two on R5G6B5 mip level 3, shader tokens equal; tree-check.ps1 -NewEnv ZH_D3DX_PORTABLE=1 against the same exe on the DLL, Direct3D 11: all 8 views within their limits on the third run (worst 1.13% of 1.2%), the two runs before each had one view over, a shot taken 9 or 10 frames apart under another checkout's games' load; -Extra -d3d9: all 8 within, worst 0.6%; the logs confirm the renderer and the binding of each side.) Left: an ARM64 build and run; this machine has no ARM64 toolset or hardware.
2026-10-08 The bridge decks' slope bias spelled without DWORD W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp 9cc0c0b0 passed the bias's bits as *(const DWORD *)&bridgeSlopeBias, and DWORD is not a type off Windows (bittype.h removed it on purpose), so every macOS and Linux build stopped there. It is now *(const uint32 *), as dx8wrapper.h's fog states are. None: DWORD and uint32 are both 32-bit unsigned under MSVC, so the call takes the same value. low Windows: OPEN (a Windows build; nothing else can differ.)
2026-10-13 -showHudOverlay and m_showHudOverlay removed Common/GlobalData.cpp/.h, Common/CommandLine.cpp, Tests/test_gameengine.cpp, dx11-check.ps1, shadow-check.ps1, Tools/linux-packages-check.sh Since 8b859d61 the info strip is drawn by ShowNetBox alone, so the field, its default and the switch decided nothing. ShowHudOverlay stays in GameData's field table as an ignored key, because an unknown key throws. The 2026-09-29 row's packaging refusals are left in. None: no reader of the field was left. low Windows: checked (build.bat Release test.)
2026-10-13 The packaging's ShowHudOverlay = Yes refusal removed Tools/stage-overlay.sh, Tools/package-common.sh, Tools/make-macos-app.sh, Tools/linux-portable.sh, Tests/test_macos_app.sh, Tests/test_linux_portable.sh, Tests/test_stage_overlay_hud.sh (removed), CMakeLists.txt (stage_overlay_hud_check), BuildFingerprint.manifest, PORTING.md The key is ignored since the row above, so a staged or shipped ShowHudOverlay = Yes changes nothing and the stager and both packagers stop looking for it. hud_check_files is gone from package-common.sh, and the two package tests lose their HUD controls. none on Windows: the scripts are not run there, and the ctest removed was inside the POSIX block none Windows: checked (bash -n on every touched script, fingerprint-manifest.sh --check, build.bat Release test.)

Standing items

These do not belong to one change.

Item Why it matters
Suspected live defect: texture stage 2 is invisible to the D3D11 backend. Windows, 2026-09-29: closed, unreachable. shader.cpp:955-963 and :1002-1014 do set stage 2 through raw DX8CALL, past the wrapper and the Direct3D 11 mirrors. But both run only when voodoo3 is true, and shader.cpp:553-554 sets it only for a 3dfx Voodoo 3: the vendor 3dfx (dx8caps.cpp:85, PCI vendor 0x121A, or :571-573, an unknown vendor whose driver DLL's name starts with '3') and the device 0x0005 (dx8caps.cpp:410). A Voodoo 3 cannot create a Direct3D 11 device. The only other way in is an adapter whose vendor that table does not know, with a driver DLL named '3...' and the device ID 0x0005; short of that, under -dx11 stage 2 is never set and the backend misses nothing. The real gap found on the way is the texture-stage transforms (D3DTS_TEXTUREn), in the ledger.
E1 cannot do its job — but E3 now covers one half of it. Windows, 2026-09-27: done for Intel. W2 and the 2026-09-27 CI run, on the data before upstream 843bf76b: Windows x64 (MSVC) gives the CRCs macOS arm64 and Linux x86_64 give, and replays cross between them with no mismatch. On AMD the D3DX body question is open (rows 75, 78). The determinism check was designed as a cross-platform checksum comparison: same seed, Windows and macOS, same result. With one platform it can only prove the Mac build is self-consistent and record a checksum for a future comparison. That is worth doing and is not the same thing. The question E1 exists to answer — does this port desync against Windows — stays open until a Windows machine exists. Nothing downstream of M1 should be described as validated until it is.

What E3 covers, as of 2026-09-22: the architecture half. ctest -R arch_differential builds one source for arm64 and x86_64 and runs both, so x86-versus-arm differences — float-to-int rounding, FMA contraction, the width of long — are caught here and now. It is green on 170 rows including every DetTrig output and an 80,000-value sweep fingerprint, and it names 12 rows that differ. What E3 does not cover: the compiler half. Both binaries are clang's. MSVC's codegen, its optimiser, its /fp: semantics and its 32-bit long remain entirely unverified, and the x86_64 column of E3's own table is not a Windows answer. This item stays open.
replay-check.ps1 cannot run. Windows, 2026-09-27: done. It runs in every Windows CI run, through windows-ci.ps1. PowerShell, and it is the tool CONTRIBUTING.md names for proving a change leaves replays and network games alone. Any change reaching GameLogic or the maths under it is unverified against it.
The MSVC flag semantics in CMakeLists.txt are unverified. Windows, 2026-09-27: checked. gameengine's Release project carries /W3, /permissive, /EHa, /Oy-, /Zi, /FS, /MP and the static CRT, and generals.exe imports no VC runtime DLL (rows 7, 8). A1 moves /EHa, /Oy-, /Zi, /FS, /MP and CMAKE_MSVC_RUNTIME_LIBRARY behind a platform guard. The intent is that Windows produces an identical compiler command line. Nobody has seen one. A1 left the if(MSVC) block itself byte for byte as it was and added an elseif after it, so the flags are not the risk; the two settings that moved above project() are, and they have a row of their own.
The first Windows build after A1 will fail on make -k-shaped grounds, not on flags. Windows, 2026-09-27: it happened and is fixed. W2: 63 errors, then 19 more once ATL was in (W2). A1's macOS branch is additive, but A1 also proved that wwdebug, wwutil and compression do not compile under clang at all. Nothing about that touches Windows — and it does mean that the next person to diff the two platforms is comparing a working build against a build that stops in its first library. Do not read that as a regression.
A Debug or _INTERNAL build of this tree does not compile on x64, and did not before this port started. Windows, 2026-09-29: done for x64 Debug; _INTERNAL not built. The build and what it then found are fixed: a Debug CI run on the Windows CI VM (windows-ci.ps1 -Config Debug): the build, ctest 50 of 50 with order_cameos_selfcheck skipped (no numpy there), the GPU tests, and E1 0@1200 playing back to 0xE5C34BF3, Release's pin. Before that, as found on 2026-09-27: windows-ci.ps1 -Config Debug on 2026-09-27 stops in wwdebug at Debug.h:244. A port change spelled SimpleProfiler's four counters Int64, which wwdebug's files do not declare; __int64 was the compiler's own. Only wwdebug compiles DEBUG_PROFILE, because only it lacks RELEASE_DEBUG_LOGGING. Three Debug-only test links fail too: GameEngineDebug.lib (gametext_csf, test_premain_strings, test_premain_unicode), debugdebug.lib (test_debug), and DebugLog (test_wwdownload). The fix is in this tree now. GameCommon.h:59 defines DUMP_PERF_STATS in every _DEBUG or _INTERNAL build. PerfTimer.h compiled GetPrecisionTimer under that define, and its body was an __asm RDTSC block — USE_QPF was never defined, so the assembly was the live branch, not the dead one. This project is x64 only (CMakeLists.txt:48-52 refuses anything else) and MSVC does not accept __asm on x64 at all. -DPERF_TIMERS=ON reaches the same code in a Release build. Found by B2, which has replaced the block with the clock shim, so the configurations should build again — but nobody has confirmed either the breakage or the fix on a Windows machine, and the conclusion rests on reading the preprocessor rather than on a compiler's answer. It also means an early claim that "every remaining __asm block is inside #if 0" was wrong; it has been corrected. The only other __asm in the tree, WWMath/vp.cpp, is expanded solely inside #if defined(__ICL) and is genuinely dead.
#pragma pack layout is assumed, not measured, on MSVC. Windows, 2026-09-27: checked. The B4 and L1 sizeof/offsetof asserts compile under MSVC (rows 208, 248, 267). B4 adds sizeof/offsetof asserts. They will be checked by a clang build only. If MSVC disagrees on any packed struct, the asserts fire there and the build fails loudly — which is the good outcome, but it happens on someone else's machine, later.

Independent Linux shadow parity contribution

This feature starts directly from reference/3.1.0. Sun capture, tree capture, shadow-option admission and queued cloak coverage are enabled on Linux. The Windows Direct3D 11 backend sources remain unchanged; the shared adapter forwards existing calls and returns empty queued coverage. Windows retains its original water programs, caster selection and constant-cache comparisons. Tree capture is on under Direct3D 11 too since the Windows follow-up: the batched trees and the object palms draw into the sun's map, and their silhouettes, blob decals and flattened palm copies stand down while SunShadow::OwnsSceneShadows holds; under -d3d9 no map takes the frame and the silhouettes stay. macOS refuses the new scene capture and retains its existing shadows. Shared API, shader and queue metadata still compile on these platforms; native builds and runtime validation remain required. Linux tests do not establish that evidence.

The generic SDL additions are depth-only targets, target-specific depth formats, smoke moments and diagnostic depth readback. The original emulated pixel register count, sampler limit, single-uniform bindings and legacy water source stay intact. No Modern water, cloud-volume feature, preview or workflow change is included.

Linux Modern water proposal (2026-10-18)

New water surfaces, material loading and native particle replacements are admitted only on Linux. Shared water declarations, portable sampling helpers and inert option metadata still compile elsewhere. Windows retains its original shader names and shader programs; macOS binds the legacy SDL programs. The Linux style widget is hidden on both platforms. Windows/macOS builds and runtime checks remain open; Linux compilation and GPU tests do not establish their runtime compatibility. The Windows half of this paragraph no longer holds: the last section below brings the Modern water to Direct3D 11.

Volumetric hazard clouds (2026-10-22, Direct3D 11 2026-10-23)

Windows compiles the neutral cloud core (Platform/HazardCloud.h, HazardCloudPolicy.h, HazardCloudFlow, HazardCloud.cpp) and, since 2026-10-23, the device-free half of a layer (Platform/HazardCloudCore.h, HazardCloudCore.cpp, HazardCloudShader.cpp) that the SDL backend shares. gameenginedevice links DX11HazardCloud.cpp in place of HazardCloudUnsupported.cpp, which only the device-less tests still link. HazardCloud::Supported() is true while the Direct3D 11 frame presents on a feature level 11 device, so the Cloud style selector shows on the default renderer and stays hidden under -d3d9 and -headless.

The extended field rules in W3DParticleSys.cpp (keys, owner choice, grace period, initial delay) now need the Volumetric style as well as the capability, and the Classic graphics setting turns them off, so a Classic player on any platform tracks the fields as upstream did. The cloud programs are compiled by the backend's Compile_Program at shader model 5 and kept in Run/dx11shaders.cache; the shipped cache (dx11shaders.shipped) holds none of them until it is recorded again, so a player's first Volumetric hazard pays their compile once.

The Direct3D 11 path was built and run on Windows: test_dx11backend compiles all eight programs with d3dcompiler_47, and a Twilight Flame Scud Storm field drew on the default renderer with no refusal in the log. The SDL backend was moved onto the shared core in the same change and has not been compiled since; Linux and macOS builds are owed.

Modern water on Direct3D 11 (2026-10-23)

The Modern water now builds on Windows as well as Linux. Platform/ModernWaterBuild.h defines ZH_MODERN_WATER for both, and the __linux__ gates in W3DWater.cpp/.h, the vessel-foam gates in W3DParticleSys.cpp/.h, W3DDisplay.cpp's read of the water at the sync point and GameEngine.cpp's ModernWater.ini load take it instead. ModernWater::Supported() decides at run time: true on Linux, and on Windows while Direct3D 11 is active and presenting, so -d3d9 and -headless stay Classic and the options menu hides the Water Style box for them. macOS compiles none of it, as before. The wave tracks keep their __linux__ gates, so Windows still updates them in their own flush.

One consequence for Classic on Windows: W3DWater now draws from the polygon copy taken at the sync point (takeReadsForRender) and reads the pause from it, as Linux always did, instead of walking the live PolygonTrigger list during the draw. The data is the same. A Classic shot of the Bombardment Beach shore at 1000,2350, frame 600, differs from the previous build's on 0.01% of the sampled pixels by more than 40, the clouds' wall-clock drift.

engineshader.cpp now writes the Modern text for the plain trapezoid water ps.1.1 and river water ps.1.1 names on the Direct3D 11 target too; the classic ... names keep EA's transcription, and W3DWater::registerWaterStyleShaders registers those under Classic on Windows. The Classic programs' text, and so their keys in dx11shaders.cache and dx11shaders.shipped, are unchanged.

The draw is the backend's (WW3D2/dx11water.cpp). A Modern draw binds fifteen stages: the backend's four, the shore's optical field at t4, copies of the target's colour and depth taken at the frame's first water draw into that target at t5 and t6, the bed at t7, the ocean's six maps at t8 to t13 and the vessels' foam atlas at t14, white where nothing is bound. Its four constant blocks come from W3DWater's 896 registers, which on Windows go to the backend through Direct3D11_Set_Water_Constants instead of the Direct3D 9 device (WaterConstants.h builds the block; it mirrors PosixDevice9::Build_Water_Constants, which the SDL device keeps until Linux can be built against the shared one). Over open sea the GPU ocean runs on the context first (spectrum, sixteen butterflies, the sign pass, then GenerateMips on six RGBA32F maps) and the draw's vertex half is swapped for the displaced one. Stages past 7 now reach the backend too: DX8Wrapper::Set_DX8_Texture mirrors them, where it used to hand them to the Direct3D 9 device alone. The shore overlay's second pass and its foam on the wave tracks are not drawn on Windows yet. The backend keeps one scene copy where the SDL device keeps one per target, so a frame drawing water into one target, then another, then the first again refracts the first water in its third draw. W3DWater::Render now saves stages 0, 1, 4 and 7 from the wrapper's record (Get_DX8_Texture, Get_DX8_Texture_Stage_State) rather than the Direct3D 9 device, which Defer_D3D9_State leaves behind the wrapper under Direct3D 11.

The two Modern pixel programs need shader model 5 (FXC refuses the dynamically indexed write that waterRefractionHit's neighbour mask used to make, and that line is now a multiply both compilers take). At d3dcompiler_47's default optimisation each took 34 s (trapezoid 33.6, river 34.2), and /O0 is no faster: the cost is the optimiser working through about 11 thousand instructions, most of them inlined copies of oceanHash (217) and oceanNoise (53). No loop attribute, table or precision flag moves it. They now compile with D3DCOMPILE_SKIP_OPTIMIZATION (DX11_MODERN_WATER_COMPILE_FLAGS), 6.0 and 5.5 s, and the flags join the cache key only when set, so no other program's key changed. test_dx11backend went from 89 s to 20 s. The driver optimises the bytecode again: over six interleaved warm runs of the shore view below the frame was 0.8 ms slower on average, inside the ±3 ms the same exe moved between runs, and the frame-600 picture against the optimised build's has 23 pixels past a difference of 24, against 162 between two runs of the optimised one. The water vertex program (0.6 s) and the FFT passes (32 ms at most) keep the default. The Modern programs are not in dx11shaders.shipped; recording them is open.

Measured on 2026-10-23, Release, 1280x720 windowed, -noFPSLimit -msaa 0, the same Bombardment Beach skirmish: with the shore in view the frame is 4.44 ms mean (p99 10.25) on Classic and 17.63 ms (p99 25.75) on Modern; with the camera inland at 1000,1850, 5.28 against 12.49 ms. The log's -dx11 water: line counted 1400 Modern draws, all displaced by the GPU ocean, and no refused draw. The Linux side of the shared changes (engineshader.cpp, WaterShoreOverlay.h, test_shader_sdl.cpp, the gate swap) has not been compiled.