Skip to content

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

Closed
Mby159 wants to merge 1 commit into
ProjectLeonida:mainfrom
Mby159:test/build-fallback-stack-option
Closed

Mby159 wants to merge 1 commit into
ProjectLeonida:mainfrom
Mby159:test/build-fallback-stack-option

Conversation

@Mby159

@Mby159 Mby159 commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #2570 (comment)

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)

test_the_loader_gets_the_stack_reserve_cmake_gives_it failed on main
d48a957: its regex asked for /STACK:${GTA6RT_STACK} to be the last option in
gta6rt's target_link_options list, but the line now ends with /MAP, which
was added later so gta6rt_no_tls_callbacks can read gta6rt.map.

The host base assertion 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.

The reserve itself (GTA6RT_STACK >= 8 MiB), the fallback's own
/STACK:<number> and the agreement with run_entry stay exactly as they are
checked today.

AI-assisted: yes.
This was referenced Nov 28, 2026
@Tauwni

Tauwni commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

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

Mby159 commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

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:

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: #2570 (comment)

AI-assisted: yes.

@lixonik lixonik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Mby159 commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

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 ae7a093). 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 Mby159 closed this Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants