scripts: --help answers in the Python and shell entry points #2853
Closed
leonida/mandy
aznohonza wants to merge 0 commits from
scripts/entry-point-help into main
pull from: scripts/entry-point-help
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
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
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!2853
Loading…
Reference in a new issue
No description provided.
Delete branch "scripts/entry-point-help"
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?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
Claimed 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)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.
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.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.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.
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.
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.
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.