scripts: --help answers in the Python and shell entry points #2853
Closed
github-bot
wants to merge 0 commits from
github-bot/gh-2853 into main
AGit
pull from: github-bot/gh-2853
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2853
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2853"
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?
@aznohonza on GitHub · 2026-12-01 09:30 UTC · original
aznohonza:scripts/entry-point-help→main· +74 −2 · 8 files · 1 commits · closed without mergingClaimed in the coordination issue as: ENTRY-POINT-HELP-PY-SH
What and why
KelboLive's 06:36 finding lists entry points that cannot produce help. This is the Python and shell part; the three PowerShell build scripts are ecox982745's
BUILD-POWERSHELL-HELP-ONLYclaim, so the two are disjoint.scripts/check_no_game_data.py --helptreated--helpas a path and answeredcannot read --help, exit 2 — in the tool every contributor is told to run. It now prints the usage text its module docstring already carries and exits 0. Every other argument is still a path, and the exit codes (1: game data found, 2: unreadable input) are unchanged.scripts/play-linux.sh --helpansweredNo --help, exit 1. It now prints its usage — the game executable,--series-x, and theLEONIDA_*variables that choose the runtime, the bundled VKD3D-Proton, the prefix, the caches and the saves — and exits 0 without touching Wine. No argument still prints the same usage, on stderr, exit 2, as before.scripts/run_wine_session.sh --helpexited 1 on the missingWINEPREFIX. It now prints its usage and exits 0 before that check.scripts/run_game_wine.sh's one-lineUsage:line omitted the required--shaders; its Inputs section already listed it, and a run without it is refused. The line names it now.Left out on purpose:
compute_workers_win.pyis an internal parent/worker adapter, silent by design, andsmooth-motion.ps1plusgame-gate.ps1's-Verbvalues are PowerShell, which this machine has nopwshto run.Tested
python -I tests/test_check_no_game_data.py22 pass,tests/test_run_game_wine.py9,tests/test_run_wine_session.py5,tests/test_run_game_wine_safety.py3,tests/test_leonida_launcher.py15, and the newtests/test_play_linux.py1.mainand only the tests changed, each new test fails —test_play_linux.py2,test_run_wine_session.py1,test_check_no_game_data.py1,test_run_game_wine.py1 — and all pass with the scripts.python3 -I scripts/check_no_game_data.py --help,sh scripts/play-linux.sh --helpandbash scripts/run_wine_session.sh --helpprint their usage and exit 0;bash scripts/run_game_wine.sh --help's first line now names--shaders.sh -nonplay-linux.sh,bash -nonrun_wine_session.shandrun_game_wine.sh, andpython3 -I scripts/check_no_game_data.pyon all eight changed files is clean.No game files, no game data, no GPU and no Wine; every path above is a synthetic argument list or an empty temporary folder.
GPUs tested: none needed (tools only).
AI-assisted: yes
Checklist
mainand merges cleanly.docs/design.md. (n/a: tools help only)@imShangLi on GitHub · 2026-12-01 12:42 UTC · original
VERIFY-2853 — Linux, Python 3.15, no GPU device, no game files
Verdict: PASS — all four entry points answer
--helpthe way the pull request says, the tests look at the code that decides it, and the behaviour that was there before is unchanged.Head
6da607c0, base the currentmain6c7f6b60, 1 commit, 8 files, +74/−2: four scripts underscripts/and the four test files that cover them.1. Its own tests, and the three rows
main+ this PRtest_check_no_game_data.py22 OK ·test_play_linux.py1 OK ·test_run_game_wine.py14 OK ·test_run_wine_session.py5 OKmain+ only this PR's test change (patched)Row B's failures are assertions, and each one shows the missing behaviour in the words the tool would have printed:
The last one is the strongest of the four: on
main,run_wine_session.sh --helpdied on the missingWINEPREFIXbefore printing anything, so the fix is not only new text but a check that moved.2. Discrimination: does each test look at the script it is about?
A test that passes with the fix and without it proves nothing, so I reverted each of the four production files alone to
main's copy on the green tree and ran its test:scripts/check_no_game_data.pyscripts/play-linux.shscripts/run_game_wine.shscripts/run_wine_session.sh3. The behaviour itself, measured on the scripts rather than read from the diff
I ran the scripts in a stripped environment (
env -i PATH=/usr/bin:/bin, noLEONIDA_*, noWINEPREFIX, no Wine) so that a--helpthat fell through to the real work would fail loudly instead of passing:scripts/play-linux.sh--helpscripts/play-linux.sh-hscripts/play-linux.shscripts/run_wine_session.sh--helpscripts/check_no_game_data.py--helpscripts/check_no_game_data.py-hscripts/check_no_game_data.pycannot read ...The no-argument case of
play-linux.shis the one the pull request's text calls out ("No argument still prints the same usage, on stderr, exit 2, as before"), and it holds: exit 2, the usage on stderr.4. What I did not check
scripts/play-linux.shdeclares#!/bin/sh, and on this machine/bin/shis a symlink to bash, so I ran it under bash. The added code is POSIX ([ "${1:-}" = "-h" ], a function,usage >&2), andbash --posix -nparses the whole file, but I did not run it under dash.scripts/run_wine_session.shuses[[ ... ]]and#!/usr/bin/env bash, so it is bash by declaration and by syntax.scripts/run_game_wine.sh— I only checked the usage text it prints. I did not run a game under Wine, so the rest of that script is untouched by this pull request and untested by me.scripts/check_no_game_data.py— the tool reads the first bytes of the files it is given; I did not run it over the repository, only over a missing path and--help.5. Neighbours
The four test files are the ones this pull request touches; no other test imports these scripts except the two the pull request edits. The standalone suite is in the next comment.
AI-assisted: MiniMax M3.1 Flash.
@aznohonza on GitHub · 2026-12-01 12:55 UTC · original
Thanks for the thorough check — the reverted-file row is the one that matters (each test fails on the file it covers, not on the others), and the stripped-environment runs match what the tests assert.
play-linux.sh's added branch is plain[ "${1:-}" = "-h" ]before anything else, so it does not depend on the shell beyond POSIX; on this machine/bin/shis bash too, so dash was not run here either. Nothing further from us on this one. AI-assisted.@aznohonza on GitHub · 2026-12-01 12:56 UTC · original
Correction to my last line:
/bin/shis dash on this box (I looked at the wrong host). Ran it under dash in a stripped environment:--helpand-hboth exit 0 with the usage on stdout and an empty stderr; no argument exits 2 with the usage on stderr and an empty stdout. So the one gap in §4 is covered here, andrun_wine_session.shis bash by its shebang. AI-assisted.@imShangLi on GitHub · 2026-12-01 13:07 UTC · original
6. The whole standalone suite, against the same runner on a clean tree
I ran the repository's standalone test runner over
main6c7f6b60+ this pull request and over a cleanmaintree, and compared the lists:main+ this PRmain6c7f6b60The one line that appears is this pull request's own new test file, and the skip lists are identical, so nothing was traded away to make room for it.
The one failure is
tests/test_run_semantic_tests.pyon both trees: two tests of the runner's SIGINT handling (communicate(timeout=5)times out on this machine, and one expects exit code 130 and gets 0). It is red on the clean tree as well, so it is not this change's.AI-assisted: MiniMax M3.1 Flash.
@imShangLi on GitHub · 2026-12-01 13:33 UTC · original
A note on this machine's graphics, so "no GPU device" is not misread
I said above that this host has no GPU device. That is true of the Vulkan device, and I should be precise about which path I mean, because the two paths differ here and a reader could otherwise take my wording the wrong way.
What this machine is. A VMware Workstation guest (Fedora 45) on a host with a Radeon 780M. There is no PCI passthrough: the only display device inside the guest is the virtual
VMware SVGA II (15ad:0405)driven byvmwgfx, and there is no AMD PCI ID anywhere in the guest.There is no Vulkan hardware device here. mesa's svga driver has no Vulkan backend, so the loader enumerates nothing by default; with
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.jsonit enumerates exactly one device,llvmpipe (LLVM 23.1.5, 256 bits)— a CPU software implementation. So no real GPU, no CUDA, no ROCm.The OpenGL path is hardware-accelerated, though. The guest's SVGA3D calls are forwarded by the host-side VMware renderer to the host's Radeon 780M. The evidence I measured, comparing the default path with
LIBGL_ALWAYS_SOFTWARE=1:GL_VENDOR = "VMware, Inc."appears only when the commands leave the guest for the host's renderer; llvmpipe runs entirely on the guest's CPU.glxinfo -Balso reportsVideo memory: 2048MB,direct rendering: Yes, OpenGL core profile 4.3 (Mesa 26.2.7), andvmwgfx's kernel capabilities include3D; GNOME logsCreated gbm renderer for '/dev/dri/card0'and the session is Wayland.What follows for the verification above. Anything that needs a real GPU device or driver is invalid on this host, and none of my conclusions rest on one: the tests I ran are CPU-only, and the tool they measure is a Python script. Where a measured number came from this machine's GPU stack, it says so.
Two things I checked that a reader might otherwise assume.
glxinfo'sAccelerated: nois not evidence that 3D acceleration is off — that field comes from mesa'sGLX_MESA_query_renderer, which cannot see an acceleration that happens on the host side. And OpenGL throughput on this host does not stand for real hardware: in my own measurements the software path was faster than SVGA3D for small, tightly-synchronised batches (713 vs 1061 draws/s in an off-screen rasterisation loop; 88 vs 308-692 FPS inglxgears), because SVGA3D pays a synchronisation round trip across the virtualisation boundary while llvmpipe rasterises locally. That says nothing about which path a real application would take — the vendor string settles that — and it is a reminder that a frame-rate number from here is not a hardware result.AI-assisted: MiniMax M3.1 Flash.
@imShangLi on GitHub · 2026-12-01 13:46 UTC · original
Correction to my note above: the frame-rate comparison was not controlled
My note above said that on this host the software path measured faster than SVGA3D (713 vs 1061 draws/s in an off-screen rasterisation loop; 88 vs 308-692 FPS in
glxgears), and put that down to SVGA3D paying a synchronisation round trip across the virtualisation boundary. That comparison was uncontrolled and the conclusion from it was wrong. I used the default window size and the default swap interval, and the ranking flips with those.With the window size and the swap interval fixed,
glxgearson this host gives:The two figures I quoted before were the default window with the default swap interval, which is the one combination that happens to favour the software path. So:
GL_VENDOR/GL_RENDERER(VMware, Inc./SVGA3DversusMesa/llvmpipe), never by the frame rate.One difference worth recording so the numbers are not read as a reproduction: in the vsync-on row my llvmpipe run reached 546 FPS where the other run on this host reached 89 FPS for the same setting. This is a Wayland session and the swap interval is not honoured identically on the two paths, so the vsync-on row is not a like-for-like comparison between them; the two vsync-off rows are.
AI-assisted: MiniMax M3.1 Flash.
@KelboLive on GitHub · 2026-12-01 17:54 UTC · original · reviewed
Verified on the head: all four entry points answer
--helpin ≤0.06 s with exit 0 and empty stderr (-htoo, and underdashand a scrubbed environment), while the base files exit 1/2/1 for the same calls exactly as the body says. The no-arg contract is preserved (play-linux.shstill exits 2 with usage on stderr), andHOME=/tmp/fakehomeis left untouched. The help text matches the code —--series-x,WINEPREFIX/WINE/WINESERVERand the fiveLEONIDA_*names are the ones actually read, and--shadersreally is required (run_game_wine.sh:138).The mutations go red, so this is genuinely guarded: dropping the
play-linux.shhelp branch failstest_play_linux, dropping--shadersfrom the synopsis failstest_run_game_wine, and hoisting theWINEPREFIXcheck above the help block failstest_run_wine_session. Reverting the four scripts to main fails all four suites.Merge is clean but the branch is 380 commits behind; I built the merged tree (
28d8a0945) and the usage line survives main's--cacheaddition with 22/5/14/1 green. Disjoint from #2902, clean with #2845.Two nits, no blocker: add
-hto therun_wine_sessionandcheck_no_game_datatests so a regression dropping the short flag is caught, andplay-linux.sh's help omitsLEONIDA_GAME_DIR, which the script honours at:59.One heads-up: this overlaps two items on a branch I have been preparing (
--shadersin therun_game_wine.shsynopsis and--helpforcheck_no_game_data.py), so I will drop those from my own change rather than duplicate yours — no action needed on your side.@aznohonza on GitHub · 2026-12-01 21:46 UTC · original
Thanks — both nits are in
1228aad13:test_run_wine_sessionandtest_check_no_game_datanow loop over-hand--help; dropping-hfrom either script fails its test (checked both mutations).play-linux.sh's usage namesLEONIDA_GAME_DIRwithLEONIDA_CACHE_DIRandLEONIDA_DATA_DIR.The three suites pass:
test_play_linux1,test_run_wine_session5,test_check_no_game_data22. Thanks also for the heads-up on the overlap — nothing else on my side.AI-assisted.
Pull request closed