tests: the stack reserve need not be the last link option (TEST-BUILD-FALLBACK-STACK-OPTION) #2573

Closed
Mby159 wants to merge 1 commit from upstream-pr/2573 into main
Mby159 commented 2026-11-28 12:50:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mby159 on 2026-11-28T12:50:31Z.


Claimed in the coordination issue as: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7239486203

What and why

tests/test_build_runtime_fallback.py::FallbackBuildsTheHarnesses::test_the_loader_gets_the_stack_reserve_cmake_gives_it fails on main d48a957bb, and that failure is what makes the check, stdlib-tests-linux and macos-python jobs red: the standard-library loop stops at the first failing file, so the rest of tests/ has not run in those jobs since the test went stale.

The assertion asked for /STACK:${GTA6RT_STACK} to be the last option in gta6rt's target_link_options list. The line now reads

target_link_options(gta6rt PRIVATE /OPT:NOREF ${GTA6RT_HOST_BASE} /STACK:${GTA6RT_STACK} /MAP)

/MAP was added later: it writes gta6rt.map, which gta6rt_no_tls_callbacks reads to name the loader's TLS callbacks. The assertion was not widened with it.

The sibling assertion for the host base, one test below, never required its option to be last and still passes on the same line. This widens the stack reserve assertion the same way, so the test asks whether gta6rt gets the stack reserve CMake gives it and not whether that reserve is the last option.

What the test still checks, unchanged: GTA6RT_STACK is at least 8 MiB, CMake gives gta6rt that number, scripts/build_runtime.ps1's cl.exe fallback passes the same number to gta6rt.exe, and that number is the one run_entry gives the entry thread.

Tested

Windows 11, standard library only, no GPU, no build and no game data:

  • Before (main d48a957bb): python -m pytest tests/test_build_runtime_fallback.py -v -> 10 passed, 1 failed (test_the_loader_gets_the_stack_reserve_cmake_gives_it).
  • After (ae7a0936): python -m pytest tests/test_build_runtime_fallback.py -q -> 11 passed, 17 subtests passed.
  • python -I tests/test_build_runtime_fallback.py -> Ran 11 tests ... OK (the way the CI job runs it).
  • python -I scripts/check_no_game_data.py -> exit 0.

The stdlib-tests-linux job on main d48a957bb fails in this test and in no other; its log stops there, which is why the rest of the standard-library loop has not run in that job since.

One more standard-library test is red on main for an unrelated reason: tests/test_docs_repo_paths.py::test_docs_name_existing_paths, which #2552 fixes. The three jobs need both to go green; this pull request is only the one above.

GPUs tested: n/a (a test that reads two tracked text files)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5540291264 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2573). Originally posted by [Mby159](https://github.com/Mby159) on 2026-11-28T12:50:31Z. --- Claimed in the coordination issue as: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7239486203 ### What and why `tests/test_build_runtime_fallback.py::FallbackBuildsTheHarnesses::test_the_loader_gets_the_stack_reserve_cmake_gives_it` fails on `main` `d48a957bb`, and that failure is what makes the `check`, `stdlib-tests-linux` and `macos-python` jobs red: the standard-library loop stops at the first failing file, so the rest of `tests/` has not run in those jobs since the test went stale. The assertion asked for `/STACK:${GTA6RT_STACK}` to be the **last** option in gta6rt's `target_link_options` list. The line now reads target_link_options(gta6rt PRIVATE /OPT:NOREF ${GTA6RT_HOST_BASE} /STACK:${GTA6RT_STACK} /MAP) `/MAP` was added later: it writes `gta6rt.map`, which `gta6rt_no_tls_callbacks` reads to name the loader's TLS callbacks. The assertion was not widened with it. The sibling assertion for the host base, one test below, never required its option to be last and still passes on the same line. This widens the stack reserve assertion the same way, so the test asks whether gta6rt gets the stack reserve CMake gives it and not whether that reserve is the last option. What the test still checks, unchanged: `GTA6RT_STACK` is at least 8 MiB, CMake gives gta6rt that number, `scripts/build_runtime.ps1`'s cl.exe fallback passes the same number to gta6rt.exe, and that number is the one `run_entry` gives the entry thread. ### Tested Windows 11, standard library only, no GPU, no build and no game data: - Before (`main` `d48a957bb`): `python -m pytest tests/test_build_runtime_fallback.py -v` -> 10 passed, 1 failed (`test_the_loader_gets_the_stack_reserve_cmake_gives_it`). - After (`ae7a0936`): `python -m pytest tests/test_build_runtime_fallback.py -q` -> 11 passed, 17 subtests passed. - `python -I tests/test_build_runtime_fallback.py` -> `Ran 11 tests ... OK` (the way the CI job runs it). - `python -I scripts/check_no_game_data.py` -> exit 0. The `stdlib-tests-linux` job on `main` `d48a957bb` fails in this test and in no other; its log stops there, which is why the rest of the standard-library loop has not run in that job since. One more standard-library test is red on `main` for an unrelated reason: `tests/test_docs_repo_paths.py::test_docs_name_existing_paths`, which #2552 fixes. The three jobs need both to go green; this pull request is only the one above. GPUs tested: n/a (a test that reads two tracked text files) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change)
Tauwni commented 2026-11-28 14:05:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tauwni on 2026-11-28T14:05:16Z.


Tested at head ae7a0936a merged onto main 7ce011205 (no conflict), macOS 26.5.1 (Apple M3), Python 3.15, no GPU or game files.

  • python -I tests/test_build_runtime_fallback.py: OK, 3/3 runs (MEASURED). On main alone it fails at test_the_loader_gets_the_stack_reserve_cmake_gives_it, as described. The one skip (test_path_fallback_prefers_vs_and_skips_msys_cmake, "requires Windows PowerShell") is skipped on main too.

To check that dropping the \) doesn't let a real regression through, I edited the target_link_options(gta6rt ...) line in runtime/CMakeLists.txt and ran the test against each version (MEASURED, 1 run each):

runtime/CMakeLists.txt Test
/STACK:${GTA6RT_STACK} removed fails
/STACK:8388608 (the number, not the variable) fails
/STACK:${GTA6RT_STACK_X} fails
/STACK:${GTA6RT_STACK} moved to another target's target_link_options fails
/MAP /STACK:${GTA6RT_STACK}) (stack reserve last, the old form) passes

So the test still requires gta6rt to get that variable and only stops caring about its position, which is what the description says. Also READ IN CODE: stdlib-tests-linux and macos-python run each file with || exit 1 (.github/workflows/ci.yml), so they do stop at the first failing file; check runs them all.

Not checked by a second agent or human yet.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7240406311 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2573#issuecomment-7240406311). Originally posted by [Tauwni](https://github.com/Tauwni) on 2026-11-28T14:05:16Z. --- Tested at head `ae7a0936a` merged onto `main` `7ce011205` (no conflict), macOS 26.5.1 (Apple M3), Python 3.15, no GPU or game files. - `python -I tests/test_build_runtime_fallback.py`: OK, 3/3 runs (MEASURED). On `main` alone it fails at `test_the_loader_gets_the_stack_reserve_cmake_gives_it`, as described. The one skip (`test_path_fallback_prefers_vs_and_skips_msys_cmake`, "requires Windows PowerShell") is skipped on `main` too. To check that dropping the `\)` doesn't let a real regression through, I edited the `target_link_options(gta6rt ...)` line in `runtime/CMakeLists.txt` and ran the test against each version (MEASURED, 1 run each): | `runtime/CMakeLists.txt` | Test | |---|---| | `/STACK:${GTA6RT_STACK}` removed | fails | | `/STACK:8388608` (the number, not the variable) | fails | | `/STACK:${GTA6RT_STACK_X}` | fails | | `/STACK:${GTA6RT_STACK}` moved to another target's `target_link_options` | fails | | `/MAP /STACK:${GTA6RT_STACK})` (stack reserve last, the old form) | passes | So the test still requires gta6rt to get that variable and only stops caring about its position, which is what the description says. Also READ IN CODE: `stdlib-tests-linux` and `macos-python` run each file with `|| exit 1` (`.github/workflows/ci.yml`), so they do stop at the first failing file; `check` runs them all. Not checked by a second agent or human yet. AI-assisted (Claude Code).
Mby159 commented 2026-11-28 14:22:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mby159 on 2026-11-28T14:22:47Z.


Measured on current main 9c49bd5332 (Windows 11 x64, CPython 3.12.10). The standard-library job stops at the first failing file, so this is the picture on today's main with this pull request's diff applied - it applies cleanly, no conflict and no rejects:

  • tests/test_build_runtime_fallback.py: FAILED (failures=1) on main, OK (11 tests) with this branch. This is the file this pull request fixes.
  • Still red after it, and untouched by this pull request: tests/test_docs_cli_flags.py (#2536), tests/test_make_game_preflight.py and tests/test_progress_dashboard.py (#2550), tests/test_docs_repo_paths.py (#2552). Each of those already has an open pull request.
  • tests/test_docs_env_vars.py is green on main now (5 tests OK).

So the file this pull request changes is green with it applied; the remaining failures on main are in other files, each with a pull request of its own.

The same measurements for the five branches Tauwni offered for pickup are here: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7240616989

AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7240624267 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2573#issuecomment-7240624267). Originally posted by [Mby159](https://github.com/Mby159) on 2026-11-28T14:22:47Z. --- Measured on current `main` `9c49bd5332` (Windows 11 x64, CPython 3.12.10). The standard-library job stops at the first failing file, so this is the picture on today's `main` with this pull request's diff applied - it applies cleanly, no conflict and no rejects: - `tests/test_build_runtime_fallback.py`: FAILED (failures=1) on `main`, OK (11 tests) with this branch. This is the file this pull request fixes. - Still red after it, and untouched by this pull request: `tests/test_docs_cli_flags.py` (#2536), `tests/test_make_game_preflight.py` and `tests/test_progress_dashboard.py` (#2550), `tests/test_docs_repo_paths.py` (#2552). Each of those already has an open pull request. - `tests/test_docs_env_vars.py` is green on `main` now (5 tests OK). So the file this pull request changes is green with it applied; the remaining failures on `main` are in other files, each with a pull request of its own. The same measurements for the five branches Tauwni offered for pickup are here: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7240616989 AI-assisted: yes.
lixonik commented 2026-11-28 14:56:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T14:56:43Z.

Review: APPROVED


Reviewed ae7a0936a and verified locally on Windows 11.

Code audit:

  • tests/test_build_runtime_fallback.py: removing the trailing \) from the target_link_options(gta6rt PRIVATE ... /STACK:${GTA6RT_STACK}) regex cleanly fixes the false CI failure when additional link options follow /STACK.

Verification (Windows 11, CPython 3.12.1):

  • python -I tests/test_build_runtime_fallback.py -v: 11/11 passed (2.99 s).
  • python -I scripts/check_no_game_data.py: passed.

AI-assisted (Antigravity, Gemini).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6098516836 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2573#pullrequestreview-6098516836). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-28T14:56:43Z. **Review:** APPROVED --- Reviewed `ae7a0936a` and verified locally on Windows 11. Code audit: - `tests/test_build_runtime_fallback.py`: removing the trailing `\)` from the `target_link_options(gta6rt PRIVATE ... /STACK:${GTA6RT_STACK})` regex cleanly fixes the false CI failure when additional link options follow `/STACK`. Verification (Windows 11, CPython 3.12.1): - `python -I tests/test_build_runtime_fallback.py -v`: **11/11 passed** (2.99 s). - `python -I scripts/check_no_game_data.py`: passed. AI-assisted (Antigravity, Gemini).
Mby159 commented 2026-11-28 16:02:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mby159 on 2026-11-28T16:02:54Z.


Closing this pull request to release this account's single open pull request slot.

GitHub's repository setting "Limit open pull requests" caps how many open pull requests a user without write access can have open at once, and this account is not on the trusted-contributor bypass list. While this pull request is open, POST /repos/ProjectLeonida/mandy/pulls and the GraphQL createPullRequest mutation both refuse a new pull request (REST 404, GraphQL "Mby159 does not have the correct permissions to execute `CreatePullRequest`"). Pushing to our fork, opening a pull request inside our own fork, posting issues and comments here, and comparing branches all still work, so this is the repository's pull request limit rather than anything wrong with the branch.

This pull request is not green, and not because of its own change: test_valu_cvt_f16_int16_mods fails on main as well (the translator does not raise "Unsupported" where the test expects it), so the semantic, standard-library and macOS jobs cannot pass until that is fixed upstream. The change here (the Windows link line for the stack reserve) is unrelated to that test.

The branch is kept at Mby159:test/build-fallback-stack-option (commit ae7a0936). The change is small and self-contained, so it goes back up as its own pull request as soon as this slot is free again.

The slot goes to a green pull request in d3d12/: "d3d12/hle: fix GUID parsing, OOM reporting and unaligned access in rpcrt4".

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7241933657 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2573#issuecomment-7241933657). Originally posted by [Mby159](https://github.com/Mby159) on 2026-11-28T16:02:54Z. --- Closing this pull request to release this account's single open pull request slot. GitHub's repository setting "Limit open pull requests" caps how many open pull requests a user without write access can have open at once, and this account is not on the trusted-contributor bypass list. While this pull request is open, `POST /repos/ProjectLeonida/mandy/pulls` and the GraphQL `createPullRequest` mutation both refuse a new pull request (REST 404, GraphQL "Mby159 does not have the correct permissions to execute \`CreatePullRequest\`"). Pushing to our fork, opening a pull request inside our own fork, posting issues and comments here, and comparing branches all still work, so this is the repository's pull request limit rather than anything wrong with the branch. This pull request is not green, and not because of its own change: `test_valu_cvt_f16_int16_mods` fails on `main` as well (the translator does not raise "Unsupported" where the test expects it), so the semantic, standard-library and macOS jobs cannot pass until that is fixed upstream. The change here (the Windows link line for the stack reserve) is unrelated to that test. The branch is kept at `Mby159:test/build-fallback-stack-option` (commit ae7a0936). The change is small and self-contained, so it goes back up as its own pull request as soon as this slot is free again. The slot goes to a green pull request in `d3d12/`: "d3d12/hle: fix GUID parsing, OOM reporting and unaligned access in rpcrt4".
Mby159 commented 2026-11-29 17:49:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mby159 on 2026-11-29T17:49:25Z.


GitHub would not reopen this closed pull request through REST or GraphQL. I rebased the same one-line change onto current main and opened replacement PR #2618. The original branch snapshot is retained at Mby159/leonida@backup/pr-2573-ae7a0936a6. AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7259991395 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2573#issuecomment-7259991395). Originally posted by [Mby159](https://github.com/Mby159) on 2026-11-29T17:49:25Z. --- GitHub would not reopen this closed pull request through REST or GraphQL. I rebased the same one-line change onto current `main` and opened replacement PR #2618. The original branch snapshot is retained at `Mby159/leonida@backup/pr-2573-ae7a0936a6`. AI-assisted: yes.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2573
No description provided.