runtime: link no-relocation fixtures without incremental linking #2215

Merged
leonida/mandy
whoalin1 merged 2 commits from runtime-incremental-no-reloc-fixtures into main 2026-11-29 14:27:02 +00:00

Pull request successfully merged and closed

whoalin1 commented 2026-11-26 06:28:19 +00:00

Summary

  • pass /INCREMENTAL:NO when linking fixture images that have no base relocations (/FIXED or /NODEFAULTLIB)
  • cover tiny_game_fixed, tiny_tls_cb_only, dll_thread_calls, and gameinput_host
  • add a small static regression test so a new fixture of that kind does not regress the workaround

Item: BUILD-INCREMENTAL-NO-RELOC-FIXTURES

This carries forward the still-uncarried fix in old-pr/10053, originally written by wavehs, reapplied and verified on current main. The original report measured MSVC 14.51.35927 crashing with LNK1000 in IncrCalcPtrs on the default incremental relink of images with no base-relocation table; Microsoft fixed the linker itself in Visual Studio 2026 18.6, but non-incremental links are also correct for these fixtures.

Tests

Under the local machine coordination lock:

  • control: the static guard fails on unpatched runtime/CMakeLists.txt, finding all four vulnerable targets
  • fixed: python -I tests/test_runtime_incremental_link.py — 2 tests, OK
  • python -m compileall -q tests/test_runtime_incremental_link.py — pass
  • git diff --cached --check — pass

No game files or GPU.

AI-assisted with Devin.

## Summary - pass `/INCREMENTAL:NO` when linking fixture images that have no base relocations (`/FIXED` or `/NODEFAULTLIB`) - cover `tiny_game_fixed`, `tiny_tls_cb_only`, `dll_thread_calls`, and `gameinput_host` - add a small static regression test so a new fixture of that kind does not regress the workaround Item: BUILD-INCREMENTAL-NO-RELOC-FIXTURES This carries forward the still-uncarried fix in old-pr/10053, originally written by wavehs, reapplied and verified on current main. The original report measured MSVC 14.51.35927 crashing with `LNK1000` in `IncrCalcPtrs` on the default incremental relink of images with no base-relocation table; Microsoft fixed the linker itself in Visual Studio 2026 18.6, but non-incremental links are also correct for these fixtures. ## Tests Under the local machine coordination lock: - control: the static guard fails on unpatched `runtime/CMakeLists.txt`, finding all four vulnerable targets - fixed: `python -I tests/test_runtime_incremental_link.py` — 2 tests, OK - `python -m compileall -q tests/test_runtime_incremental_link.py` — pass - `git diff --cached --check` — pass No game files or GPU. AI-assisted with Devin.
lixonik reviewed 2026-11-26 08:47:47 +00:00
lixonik left a comment
No description provided.
Independent native RelWithDebInfo / Ninja check on MSVC 19.44: both Python tests passed. All four PE fixtures built, then relinked successfully after their object timestamps changed. Each generated link command ends its incremental-link flags with `/INCREMENTAL:NO`, and none produced an `.ilk` file. This exercises the actual fixture link rules on 19.44. AI-assisted.
Tyrannys commented 2026-11-27 14:51:13 +00:00

Independent verification of head e895cca95 merged into current main (ec91d695c); runtime/CMakeLists.txt auto-merges.

Machine: profile M (RTX 4070 SUPER 12 GB desktop, NVIDIA 621.01, Windows 11 Pro 26300, Ryzen 7 9800X3D), MSVC 14.52 (VS 2026, MSBuild generator), RelWithDebInfo, LEONIDA_SDL3_FETCH=ON. No game files.

Tests:

  • python -I tests/test_runtime_incremental_link.py against main's runtime/CMakeLists.txt (via LEONIDA_RUNTIME_CMAKE): fails, listing dll_thread_calls, gameinput_host, tiny_game_fixed, tiny_tls_cb_only. Against the merged file: 2 tests OK. So the guard catches what it should.
  • The four fixtures build and their tests pass: run_tiny_game_fixed, run_tiny_game_fixed_exit_code, loader_tls* (4), dll_thread_calls, gameinput_host.

Limits: my linker is MSVC 14.52 with the MSBuild generator, not 14.51 with Ninja, so I could not reproduce the LNK1000 crash. This run only shows that /INCREMENTAL:NO does no harm here.

Small point: the PR body says the linker was fixed in VS 2026 18.6, but the new CMake comment says 18.6 crashes and it was "Fixed in VS 2026 18.7". One of them should change.

Full suite: this PR was tested together with #2173, #2152, #2170 and #2215 (they touch separate code) merged into main ec91d695c. ctest -j 6: 500/502; the two failures, xbox_present and d3d12_set_descriptor_heaps, fail on plain main here as well (known). Plain main baseline (first run in a fresh build dir): same two, plus xs_proxy_mock, d3d12_queue_handover_two_queues and timeouts in big_compile_gate and api_ref_state that still failed in a serial rerun there but pass on this tree. I take those as first-run noise on main, not as something this PR fixes. No new failure.

AI-assisted (Claude Code).

Independent verification of head `e895cca95` merged into current `main` (`ec91d695c`); `runtime/CMakeLists.txt` auto-merges. Machine: profile M (RTX 4070 SUPER 12 GB desktop, NVIDIA 621.01, Windows 11 Pro 26300, Ryzen 7 9800X3D), MSVC 14.52 (VS 2026, MSBuild generator), RelWithDebInfo, `LEONIDA_SDL3_FETCH=ON`. No game files. **Tests:** - `python -I tests/test_runtime_incremental_link.py` against `main`'s `runtime/CMakeLists.txt` (via `LEONIDA_RUNTIME_CMAKE`): **fails**, listing `dll_thread_calls`, `gameinput_host`, `tiny_game_fixed`, `tiny_tls_cb_only`. Against the merged file: 2 tests OK. So the guard catches what it should. - The four fixtures build and their tests pass: `run_tiny_game_fixed`, `run_tiny_game_fixed_exit_code`, `loader_tls*` (4), `dll_thread_calls`, `gameinput_host`. **Limits:** my linker is MSVC 14.52 with the MSBuild generator, not 14.51 with Ninja, so I could not reproduce the `LNK1000` crash. This run only shows that `/INCREMENTAL:NO` does no harm here. **Small point:** the PR body says the linker was fixed in VS 2026 **18.6**, but the new CMake comment says 18.6 crashes and it was "Fixed in VS 2026 **18.7**". One of them should change. **Full suite:** this PR was tested together with #2173, #2152, #2170 and #2215 (they touch separate code) merged into `main` `ec91d695c`. `ctest -j 6`: 500/502; the two failures, `xbox_present` and `d3d12_set_descriptor_heaps`, fail on plain `main` here as well (known). Plain `main` baseline (first run in a fresh build dir): same two, plus `xs_proxy_mock`, `d3d12_queue_handover_two_queues` and timeouts in `big_compile_gate` and `api_ref_state` that still failed in a serial rerun there but pass on this tree. I take those as first-run noise on `main`, not as something this PR fixes. No new failure. AI-assisted (Claude Code).
zmasi commented 2026-11-29 01:48:54 +00:00

Independent verification on Windows 11 (10.0.26200, x64) of e895cca952 merged onto current origin/main (59e65849b0, 0 git text conflicts), tested under both Python 3.12.10 and Python 3.14.5:

  • Post-base failure caught by the new static guard (PR + origin/main):
    • Against origin/main's runtime/CMakeLists.txt alone, python -I -B tests/test_runtime_incremental_link.py fails (rc=1) listing 5 targets: ['dll_thread_calls', 'fixed_base_probe', 'gameinput_host', 'tiny_game_fixed', 'tiny_tls_cb_only'].
    • With e895cca952 merged onto origin/main (59e65849b0), python -I -B tests/test_runtime_incremental_link.py still fails (rc=1) on both Python 3.12.10 and Python 3.14.5:
      ['fixed_base_probe'] : linked with /FIXED or /NODEFAULTLIB but not /INCREMENTAL:NO.
    • Cause & 1-line fix: since #2215's base, main added fixed_base_probe at runtime/CMakeLists.txt:1461-1464 with /NODEFAULTLIB and /FIXED (target_link_options(fixed_base_probe PRIVATE /NODEFAULTLIB /ENTRY:fixed_base_probe_main /FIXED /DYNAMICBASE:NO ...)), without /INCREMENTAL:NO. Adding /INCREMENTAL:NO to fixed_base_probe resolves both the LNK1000 exposure on that new fixture and the test failure.
  • Hygiene: git diff --check, python -I -m compileall -q tests/test_runtime_incremental_link.py, python -I scripts/check_no_game_data.py runtime/CMakeLists.txt tests/test_runtime_incremental_link.py, python -I tests/test_ctest_registration.py, and python -I tests/test_ci_registration.py (18/18) all exited 0.

AI-assisted.

Independent verification on Windows 11 (`10.0.26200`, x64) of `e895cca952` merged onto current `origin/main` (`59e65849b0`, `0` git text conflicts), tested under both `Python 3.12.10` and `Python 3.14.5`: - **Post-base failure caught by the new static guard (`PR + origin/main`)**: - Against `origin/main`'s `runtime/CMakeLists.txt` alone, `python -I -B tests/test_runtime_incremental_link.py` fails (`rc=1`) listing **5** targets: `['dll_thread_calls', 'fixed_base_probe', 'gameinput_host', 'tiny_game_fixed', 'tiny_tls_cb_only']`. - With `e895cca952` merged onto `origin/main` (`59e65849b0`), `python -I -B tests/test_runtime_incremental_link.py` **still fails (`rc=1`)** on both `Python 3.12.10` and `Python 3.14.5`: `['fixed_base_probe'] : linked with /FIXED or /NODEFAULTLIB but not /INCREMENTAL:NO`. - **Cause & 1-line fix**: since `#2215`'s base, `main` added `fixed_base_probe` at `runtime/CMakeLists.txt:1461-1464` with `/NODEFAULTLIB` and `/FIXED` (`target_link_options(fixed_base_probe PRIVATE /NODEFAULTLIB /ENTRY:fixed_base_probe_main /FIXED /DYNAMICBASE:NO ...)`), without `/INCREMENTAL:NO`. Adding `/INCREMENTAL:NO` to `fixed_base_probe` resolves both the `LNK1000` exposure on that new fixture and the test failure. - **Hygiene**: `git diff --check`, `python -I -m compileall -q tests/test_runtime_incremental_link.py`, `python -I scripts/check_no_game_data.py runtime/CMakeLists.txt tests/test_runtime_incremental_link.py`, `python -I tests/test_ctest_registration.py`, and `python -I tests/test_ci_registration.py` (`18/18`) all exited `0`. AI-assisted.
TheGeogeo commented 2026-11-29 02:17:00 +00:00

Tested e895cca95 merged (no commit) with main 53b77df14. GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40, Windows 11 10.0.26300; MSVC 19.52 (Visual Studio 18), Ninja, RelWithDebInfo; Python 3.12.4. check_no_game_data.py is clean.

Blocker: its own test fails once merged with current main. tests/test_runtime_incremental_link.py reports ['fixed_base_probe'] != []. fixed_base_probe, a /NODEFAULTLIB fixture added by #2525 since this branch, links without /INCREMENTAL:NO. The test does its job; the PR needs that fixture added. With the CMake change back to main, the same test lists 4 targets, so it is red without the fix and goes green once the new fixture is covered.

  • C++: the merge builds. The fixture tests (run_tiny_game_fixed, run_tiny_game_fixed_exit_code, dll_thread_calls, run_tiny_tls_ga) pass, and so do the 20 other tests of the 5 relinked executables. The LNK1000 itself needs a VS 2026 18.6 incremental relink, which I did not reproduce here.
  • LINK: gta6rt.exe links without ws2_32.lib with nothing new over main.

AI-assisted (Claude Code).

Tested `e895cca95` merged (no commit) with `main` `53b77df14`. GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40, Windows 11 10.0.26300; MSVC 19.52 (Visual Studio 18), Ninja, RelWithDebInfo; Python 3.12.4. `check_no_game_data.py` is clean. **Blocker: its own test fails once merged with current `main`.** `tests/test_runtime_incremental_link.py` reports `['fixed_base_probe'] != []`. `fixed_base_probe`, a `/NODEFAULTLIB` fixture added by #2525 since this branch, links without `/INCREMENTAL:NO`. The test does its job; the PR needs that fixture added. With the CMake change back to `main`, the same test lists 4 targets, so it is red without the fix and goes green once the new fixture is covered. - C++: the merge builds. The fixture tests (`run_tiny_game_fixed`, `run_tiny_game_fixed_exit_code`, `dll_thread_calls`, `run_tiny_tls_ga`) pass, and so do the 20 other tests of the 5 relinked executables. The LNK1000 itself needs a VS 2026 18.6 incremental relink, which I did not reproduce here. - LINK: `gta6rt.exe` links without `ws2_32.lib` with nothing new over `main`. AI-assisted (Claude Code).
timbot103 reviewed 2026-11-29 04:27:01 +00:00
timbot103 left a comment
No description provided.
Static audit of `e895cca95` against main `b6bf3aa0b`. No builds, tests, or GPU runs were performed. **Merge blocker.** Main added `fixed_base_probe` at `runtime/CMakeLists.txt:1484` with `/FIXED /DYNAMICBASE:NO` and `/NODEFAULTLIB`. The four edits leave that call without `/INCREMENTAL:NO`, so the new source check at `tests/test_runtime_incremental_link.py:36` will fail with `['fixed_base_probe']` when the standard-library CI sweep runs on the merged tree. Please add `/INCREMENTAL:NO` to the existing `fixed_base_probe` link options. The four edited calls in `runtime/CMakeLists.txt` add the switch unconditionally, overriding the MSVC Debug and RelWithDebInfo incremental defaults and matching the Release default. The existing Windows runtime guard covers the clang-cl/lld-link Windows cross-build and excludes native Linux, native macOS, and the documented MinGW tools-only build. AI-assisted.
OreoFR commented 2026-11-29 11:36:37 +00:00

TAKEN by OreoFR (Windows, RTX 4070 8 GB)

TAKEN by OreoFR (Windows, RTX 4070 8 GB)
OreoFR commented 2026-11-29 12:37:57 +00:00

Verified by OreoFR — READY

  • Base: main 8fb974878 + this PR (head 867eb160b) merged with --no-ff (still no conflict with main cc0f662a7)
  • Red (the PR's test against main's runtime/CMakeLists.txt, via LEONIDA_RUNTIME_CMAKE): python -I tests/test_runtime_incremental_link.py fails, 5 targets without /INCREMENTAL:NO (dll_thread_calls, fixed_base_probe, gameinput_host, tiny_game_fixed, tiny_tls_cb_only).
  • Green (merge): 2/2 OK; full clean build OK, all five fixtures link; ctest in its own package (main + #2215 only): 501 tests, new failures vs main: none (failures: xbox_present as on main, d3d12_mesh_heavy_cache once; it passes 5/5 when rerun alone on main and on the merge). ctest settings: Ninja RelWithDebInfo, all targets, gta6rt launchers excluded; main alone 501 tests, 2 failures (xbox_present, dxgi_waitable_latency).
  • gta6rt.exe links without the XMA decoder (LEONIDA_CARGO=OFF, LEONIDA_XMA2_DECODER_LIB empty); imports unchanged vs main (25 DLLs, no WS2_32)
  • Diff read: no issue. Only link flags of test fixtures change, so gta6rt is not affected. This MSVC 14.44 linker does not have the 14.51 LNK1000 crash, so I could not reproduce the crash itself, only check the guard.
  • Other runs: consistent with the earlier runs by Tyrannys, zmasi and TheGeogeo on e895cca95. The new head adds fixed_base_probe, which those runs did not cover.
  • Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44

AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.

Ready to merge per the maintainers' plan (green, no conflict, tested).

**Verified by OreoFR** — READY - Base: main 8fb974878 + this PR (head 867eb160b) merged with --no-ff (still no conflict with main cc0f662a7) - Red (the PR's test against main's `runtime/CMakeLists.txt`, via `LEONIDA_RUNTIME_CMAKE`): `python -I tests/test_runtime_incremental_link.py` fails, 5 targets without `/INCREMENTAL:NO` (dll_thread_calls, fixed_base_probe, gameinput_host, tiny_game_fixed, tiny_tls_cb_only). - Green (merge): 2/2 OK; full clean build OK, all five fixtures link; ctest in its own package (main + #2215 only): 501 tests, new failures vs main: none (failures: xbox_present as on main, d3d12_mesh_heavy_cache once; it passes 5/5 when rerun alone on main and on the merge). ctest settings: Ninja RelWithDebInfo, all targets, gta6rt launchers excluded; main alone 501 tests, 2 failures (xbox_present, dxgi_waitable_latency). - gta6rt.exe links without the XMA decoder (`LEONIDA_CARGO=OFF`, `LEONIDA_XMA2_DECODER_LIB` empty); imports unchanged vs main (25 DLLs, no WS2_32) - Diff read: no issue. Only link flags of test fixtures change, so gta6rt is not affected. This MSVC 14.44 linker does not have the 14.51 LNK1000 crash, so I could not reproduce the crash itself, only check the guard. - Other runs: consistent with the earlier runs by Tyrannys, zmasi and TheGeogeo on e895cca95. The new head adds fixed_base_probe, which those runs did not cover. - Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44 AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR. Ready to merge per the maintainers' plan (green, no conflict, tested).
MoonEyes commented 2026-11-29 14:27:05 +00:00

Merged. Tested by OreoFR (RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11) on this head: the PR's test red against main's runtime/CMakeLists.txt, green with the PR (READY). AI-assisted: yes.

Merged. Tested by OreoFR (RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11) on this head: the PR's test red against main's runtime/CMakeLists.txt, green with the PR (READY). AI-assisted: yes.
Sign in to join this conversation.
No description provided.