WIP: fix(linux): warn about low physical RAM even with ample swap #54
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
needs measurements
question
testing wanted
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!54
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki/Longshot:fix/linux-low-ram-warning"
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?
Why
Linux players with little physical RAM received no warning when their swap space took RAM plus swap above 10 GiB. This restores the advisory warning; it does not reduce allocations or fix the reported Water Temple freeze.
What changed
memory_notice_text()inhost/hos_main.cwarns below the existing 10-GiB floor in physical RAM on Linux even with ample swap. Keep exact RAM/swap figures in the log, explain paging and the 16-GB recommendation, and let startup continue.memory_notice()reuses the existing startup notice. Windowless starts log it without opening a dialog. Windows keeps its existing RAM-plus-page-file policy.tests/test_low_memory_notice.py,README.md,CONTRIBUTING.mdanddocs/tested-configurations.mdpreserve the deterministic Linux/Windows-policy fixture and measured memory guidance; correct its README link after the upstream filename rename. Allocations, budgets, OOM policy, saves and scheduling are unchanged.Flags and settings
No new player-facing runtime switch, menu row or ini key is introduced. These test controls and existing HOS names appear in the patch; the internal constant and fixture define are not environment settings.
--sourceintests/test_low_memory_notice.pyhos_main.cwhose real warning is extracted, enabling the main negative controlhost/hos_main.c--ccin that test{cxx}tool selectiongccwhen invoked directly; selected compiler in the suite-DTEST_WINDOWS_POLICYHOS_HEADLESSHOS_MEMORY_NEEDED_MBMeasurements
main:
d4a69456c9(2026-11-12)this PR: fix/linux-low-ram-warning @
bf0802e7d1Hardware: RTX 4090 24 GB, NVIDIA 615.78.08, Core i9-13900K, 96,233 MiB physical RAM, Arch Linux 7.2.15-1-omarchy
Scene: startup/opening sky-and-moon movie, no loaded save; windowless, output requested 1280×720 and captures 1280×720 (startup renderer reports 1920×1080), frame generation off, render-scale override 100%, precompile and prediction off
Method: a warm-up on each release-profile build, then 15-second before/after/before/after starts. Real process-local memory cap 7,639 MiB, swap forbidden, verified before execution. The same private, unshipped memory-query test double reports 7,639 MiB RAM / 32,767 MiB swap to the executable's startup notice on both builds; driver queries remain real. A memory cap alone does not change Linux's physical-memory query. Warning presence is the measurement, not frame time or memory savings.
How to reproduce: from this PR run
python -I -B tests/test_low_memory_notice.py --cc gcc(then--cc clang); for the negative control pass--source ../main/host/hos_main.c, where../mainis a checkout of the named main. The fixture executes the production warning for 7,639 MiB RAM plus 32,767 MiB swap, with visible/headless spies, boundaries and query failure. For a real low-RAM Linux start, RAM below 10 GiB with RAM plus swap above 10 GiB reproduces the missing main warning. On a large-RAM PC the recorded windowless experiment additionally needs an unshipped executable-onlysysinfofixture returning those exact counts: a cgroup cap alone cannot reproduce that query. Use a fresh copied profile, the settings above, a verified 7,639-MiB/no-swap process scope and a 15-second wall stop; read the startup line before any lengthy load. The private query fixture is not a supported player switch.Current branch:
fix/linux-low-ram-warning@15813ff4a5ee775e5925bee278ba74aa5ec9d2f5, rebased onto maind725b3631982ed0035ea3ac9cbe1677e9fad260c. The previously publishedba1284a1added only documentation after measured runtimebf0802e7; the rebase preserves that runtime and fixture byte for byte. The newer main differs from measuredd4a69456only in scripts, docs and tests, with no game code, so the recorded game measurements still hold and no game run was repeated.d4a69456bf0802e7d4a69456bf0802e7d4a69456bf0802e7Exit 124 is the deliberately bounded startup ending at its wall limit. Both warm-ups and all four measured starts have zero fatal, guest-crash, device-loss and kernel-fault counts with complete journal coverage. These were ordinary shared runs, not speed measurements.
In the retained pre-rebase suite, the branch failures were
tests/test_updater_asset_digest.py. The shared measured-base suite also failedtests/test_updater_asset_digest.pywith the same local .NETNU1100missing reference pack, andtests/test_appimage_package_retry.pyin two timing-dependent fake-command cases under heavy load. That base AppImage test passed all nine cases in the separately requested isolated follow-up; the original full-suite failure remains reported. Thatd4a69456base suite was run once for the moved pull requests and remains historical evidence, including its AppImage failure and isolated follow-up. The rebased source-check comparison follows below; no configured Forgejo runner replaces the local whole suite.Windows-target fixture syntax passed; the Windows-policy execution on Linux is not Windows execution. The earlier Hookshot fork checks passed on Windows after the documented test-only wording repair; that is historical evidence, not a new Longshot Windows run.
Rebased whole-suite comparison
The whole suite was run after rebase on exact head
15813ff4a5ee775e5925bee278ba74aa5ec9d2f5, including all documentation rows, with the repository's default compiler and a fresh test home. Main'sd725b363suite is shared once across the moved pull requests. The missing local ASP.NET reference pack is the inheritedtests/test_updater_asset_digest.pyfailure (NU1100); no new failure is attributed to this warning.d725b36315813ff4Not tested
Not tested: The visible dialog, real 8-GB hardware, Windows gameplay/full host build, AMD/Intel, long play and the reporter's failed session. No new hardware test request was posted. This warning cannot prevent a swap storm; absence of a warning does not guarantee sufficient memory. The historical Hookshot pressure runs still stalled, and their Water Temple load failure is not claimed fixed.
Tested but not measured: the inspected opening movie continues on both builds; no frame-rate or overhead conclusion was taken from these shared starts. Historical pressure runs still stalled, as described above.
Screenshots
Nothing on screen is changed by these windowless starts; the visible warning dialog was not captured. Nothing changes on screen in these windowless starts: the warning is in the log. The dialog itself was not captured.
main @
d4a69456(left); this PR @bf0802e7(right).Historical context, not a matched comparison: main @
51da0464and this PR @ c5708cb0 (the original Hookshot warning patch).Risk and rollback
The advisory notice can be too cautious for a particular small scene, and a failed memory query must not invent a warning. It does not bound allocation, stop a swap storm or diagnose the Water Temple failure; the game continues after warning. Windows must retain its old RAM-plus-page-file decision. There is no new opt-out flag: reverting the Linux warning change and its guidance is sufficient;
HOS_HEADLESShides only the dialog, not the warning or memory pressure.Reviewer notes
Start with
memory_notice_text()andmemory_notice()inhost/hos_main.c, then the nine RAM/swap cases, query-failure checks and visible/headless spies intests/test_low_memory_notice.py. Verify Linux physical RAM versus the unchanged Windows policy and its different continuation text. The older pressure experiment and current warning proof are deliberately separate; allocator changes, OOM policy and the reporter's freeze diagnosis are not part of this PR.Issues
See https://github.com/NotRexed/Hookshot/issues/2838 and https://github.com/NotRexed/Hookshot/issues/1241. The warning does not close the freeze report. Original pull request: https://github.com/NotRexed/Hookshot/issues/2901. No matching issue was present in the checked Longshot issue inventory; these are historical GitHub numbers, not Forgejo issue numbers.
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.docs/tested-configurations.mdfor each measured run.mainand passing here.tests/that reads changed source updated in this PR, not weakened.Moved from NotRexed/Hookshot#2901.
Assisted-by: GPT-6 Astra
Co-Authored-By: GPT-6 Astra [email protected]
fix(linux): warn about low physical RAM even with ample swapto WIP: fix(linux): warn about low physical RAM even with ample swapBack to work in progress, for its description only. This was opened shortly before #48 merged and follows the earlier template, so it does not pass the new description check (no Flags and settings and no Risk and rollback section, table columns named Before and After). The code and the measurements are unchanged: the whole suite passes on this exact commit apart from one local .NET failure that also fails on main. The description is being moved to the new template and the branch rebased onto
d725b363; it comes back throughpr readyonce the check passes.Updated the description to the current template, including the test controls, reproduction steps, named measurement commits, risk/rollback and reviewer notes; the uploaded pictures and earlier evidence are preserved. Rebased onto main
d725b363without changing the four patches, and the whole suite on15813ff4reports 510 passed, 1 failed and 20 skipped, with only the same local .NETNU1100failure as main. The game observations remain pinned to their actual measured commits because the newer main changes only scripts, docs and tests; the description checker passes without--wip.WIP: fix(linux): warn about low physical RAM even with ample swapto fix(linux): warn about low physical RAM even with ample swapba1284a1f1to15813ff4a5fix(linux): warn about low physical RAM even with ample swapto WIP: fix(linux): warn about low physical RAM even with ample swapBack to work in progress for two reasons, neither a change to the code or the measurements. The template gained a Testing section with #72 (what was tested, what was not, and which testers are needed, with test requests), which this description does not have yet. And #39's merge added a row to the results table at the same place as this pull request's rows, so the branch conflicts in that one file until it is rebased. Both are being done; it returns through
pr ready.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.