test(vk): the image reaper's threads check ends its process at once, as the game does on Linux #2000
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2000
Loading…
Reference in a new issue
No description provided.
Delete branch "cuecuemoar/Longshot:fix/reap-cap-linux-build"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
tests/test_image_reaper_threads.pyruns the image reaper ofgpu/vk/vk_vma.cppon threads against stubs. It could not finish on Linux. Until #1941 it did not compile there (the reaper's cap lambda, #1914). With that fixed, every case passes and the program printsimage reaper, on threads: ok, and then never exits: the reaper is a detached thread waiting on the namespace-level condition variablereap_cv, and areturnfrommainruns that variable's destructor, which blocks on glibc while a thread still waits on it. The runner waits out its 120 s and fails the check. A failing case ends the same way, throughreturn 1, so a broken reaper hung for the same 120 s and itsFAIL: ...line, buffered in the pipe, was lost with the killed process.To see it on main (Linux, Ubuntu 22.04 under WSL2, glibc 2.35):
python -I -B tests/test_image_reaper_threads.py --cxx clang++prints theokline and does not return;tests/run_all.pyreports it failed after 121.6 s.The game does not end like that:
host/posix/win32_posix.cExitProcessis_exit, "at once, as Windows ends the other threads first: exit() would run static destructors under running threads". The fixture now ends the same way on both paths:finish()flushes its output and callsstd::_Exit, andCHECKuses it. Read first:finishandCHECKin the fixture. Test-only: no game code, no switch, no docs.Testing
Tested: On Linux (Ubuntu 22.04 under WSL2, clang++ 23.1.5 and g++ 13.4) at
c4d385a8, on mainf1f2dc5b: the check passes in 1 to 2 s with both compilers. On main it hangs with both (killed after 45 s; ata7646537with both compilers, at6e1521a7with clang++; the runner's own limit is 120 s and it failed after 121.6 s in the suite run below). With a copy ofvk_vma.cppedited to break the reaper (--vma), the check now fails in about a second with its own message: a reaper that frees inside a compaction pass givesFAIL: a free was made while a compaction pass was open, and one that keeps no count givesFAIL: reaper_bytes is not 0 once the queue drained; before this change both hung for the full limit. On Windows (llvm-mingw's clang++ from the Longshot Builder's tools, run from WSL): the check passes in 3 s, with this change and with main's original, so the Windows behaviour is the same.tests/test_image_reaper.py(the same source, read as text) passes.The whole suite (
tests/run_all.pyin WSL on Ubuntu 22.04, without--strict), at 7a02e64e (this change before the rebase onto one more main commit, a host change that touches nothing this check reads) and at its base, main6e1521a7, one after the other: 794 passed, 93 failed, 18 skipped on the PR head; 793 passed, 94 failed, 18 skipped on main. No check fails only on the PR head; the one that differs is this one (121.6 s and failing on main, 2.1 s and passing here), and the other 92 failing files are the same on both, named in the comment posted with this description. One check is skipped here because dav1d is not installed, and--strictwould fail it.Still to test: None. (Not run: this check by hand on a Linux machine other than this one.)
Measurements
Nothing to measure: it changes how a test program ends, and no game code runs.
Risks
None for the game: no game code changes. The fixture ends its process without running static destructors, as the game's own
ExitProcessdoes on Linux; A revert restores the hang.Checklist
Ready for review
main; the title is a Conventional Commit. (Rebased onto mainf1f2dc5bwhen pushed.)mise run testpasses (any failure that also fails onmainis named). (tests/run_all.pywithout--strict: no check fails only on the PR head; the 92 files that fail on it also fail on main, named in the comment posted with this description; see Testing.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (The check itself: it fails on main after 121.6 s and passes here in 2.1 s.)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_01VxeaZmyPR6ARfQnykGHqw6
The suite, on the exact commits (
tests/run_all.py, WSL on Ubuntu 22.04, not--strict, 32 at once), one after the other: this change at 7a02e64e (before a rebase onto one more main commit,f1f2dc5b, a host change that touches nothing this check reads; the check was run again onc4d385a8and passes in 1 to 2 s with clang++ and g++ 13) and its base, main6e1521a7:No check fails only on the PR head. The one that differs is this one:
tests/test_image_reaper_threads.pyfails on main after 121.6 s (the runner's limit) and passes here in 2.1 s. The other 92 check files fail on both, so they are not this change's:From the failure output (not every test): tests that cut code out of main's source and no longer find it, and checks that regenerate or validate SPIR-V with the glslang 11.8 and spirv-tools 2022.1 of Ubuntu 22.04, older than the repository's pins. One check,
test_dav1d_av1, is skipped here because dav1d is not installed.WIP: test(vk): the image reaper's threads check ends its process at once, as the game does on Linuxto test(vk): the image reaper's threads check ends its process at once, as the game does on LinuxRecommendation: Request changes. The fixture fix addresses the Linux shutdown hang and preserves failure messages. The PR needs to correct its checked test requirement and account for the reported suite failures before merge.
The threaded image-reaper test flushes its result and exits before static teardown can block on the detached worker. The change is small, preserves the existing assertions, and affects only the test process.
@fixwill do (3)mise run testbox and says there is nothing still to test. That task runs with--strict, while the reported suite run omitted it and skipped a check for missing dav1d. Untick the box and list the strict suite comparison as outstanding until the required checks have run and any shared failures have been identified.mise run lintresult that CONTRIBUTING.md asks authors to report. Add the lint result for the current head, including the Python check for the changed fixture.Checks: Still running:
CI / Conventional Commit title (pull_request),CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request),CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request),CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request),CI / Workflow lint (actionlint) (pull_request),CI / Website build and checks (pull_request),Guide screenshots / Guide images and local UI source review (pull_request),Third-party parts / As their notes say (pull_request),Third-party parts / The same as upstream (pull_request),PR description / Description follows the template (pull_request_target).More: does it help, other systems, switches, what was read
Does it help: Yes. The reported WSL2 suite comparison went from a 121.6 s timeout on
6e1521a7to a 2.1 s pass on 7a02e64e. The author reports 1–2 s passes atc4d385a8with clang++ and g++, and a roughly 3 s pass on both sides with Windows llvm-mingw. Two deliberately broken reapers reportedly failed in about a second with their expected diagnostics. These are test timings.Other systems: The change is confined to the compiled fixture. The Python runner still checks the child exit status, enforces its timeout, and cleans up the temporary directory. The successful switch-off case still returns normally because it starts no worker. GPU vendors, drivers, Steam Deck gameplay, memory budgets, saves, audio, input, and game builds are outside the changed path.
Switches: None added, changed, or removed. The existing RX_VK_REAPER default is on. The fixture tests both settings through its own stub and command-line argument, independent of the game environment.
Reviewed:
c4d385a839againstf1f2dc5bd2: Read AGENTS.md, CONTRIBUTING.md, docs/dev/README.md, docs/dev/standards.md, the Forgejo PR template, the full diff and commit message, and every line of tests/test_image_reaper_threads.py twice. Read the extracted compaction and reaper code in gpu/vk/vk_vma.cpp, the companion source check, the POSIX ExitProcess implementation, and the relevant runner, mise, and CI sections. No review checklist was present. Run evidence came from the PR description. There were no comments, prior reviews, generated files, or translations to inspect.; nothing run (a code review).Checked and fine:
Testing: Read-only review. The author reports Linux clang++ and g++ passes, a Windows llvm-mingw pass, a companion source-check pass, and both negative controls. The reported suite run was non-strict and used an earlier revision. CI was listed as pending.
Overlaps and merge order: None found. The referenced reaper compile fix #1941 is already in the base.
Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.