fix(input): a trigger presses only once it has read let go for a second #2337

Merged
HumanBean merged 7 commits from llun/Longshot:fix/trigger-rest into main 2026-11-23 15:59:32 +00:00
Member

Summary

A player's triggers acted as held from the moment the game started, whichever controller they used (a Switch 2 Pro
through Switch2Connect, a Flydigi Vader 2 Pro, an 8BitDo SN30 Pro Xbox Edition, a Mobapad Chitu 2). On the Controls
page, binding a button caught nothing. After trying, the triggers stopped acting held but no longer worked at all.
Starting the game through Steam made it go away.

Their log had two SDL controllers open for the whole run: Switch2Connect's virtual "DualSense Wireless Controller"
(054c:0ce6, version 0) and a "Retro Controller", USB 2563:0575 (a ShanWan generic pad, often a 2.4 GHz USB
receiver). A trigger that reads held for good on either one explains every symptom. host/pad_sdl.c presses ZL and ZR
past 8000, and every pad's buttons are combined, so that hold came through whatever pad the player used. The receiver,
whose full-range trigger axes at rest would read about 16384, was the likely one, but the log could not say which. The
other symptoms follow from it:

  • Binding catches nothing: the Controls page listens only once every input has been let go
    (gpu/vk/vk_menu.cpp, listen_armed), and these two never are.
  • Triggers drop out but stay dead: once the Insert menu closes, an input that was down waits to be let go before it
    reaches the game (host/nn_hid.c, pad_after_menu). These never are, so the player's real presses, on the same bits,
    are held back for the rest of the run.

The sticks already had this guard ("an axis steers only once it has been seen at rest since the pad was opened",
#1673). The triggers didn't. Now each trigger presses only once it has read let go (8000 or below) for a second
without a break
since its pad was opened (trigger_pull), a bit each beside the sticks' in pads[i].rested. A real
trigger rests when its pad opens, so it counts a second later. A pull in that second waits for a second let go. HD
Haptics' trigger effects (rh_ds_triggers) read the same admitted value, so a stuck trigger doesn't kick back either.

Why a second, not one reading. The first version counted a trigger once it had read let go once. The reporter ran
that build (pr-2337-222babe6): their triggers still misbehaved with the receiver plugged in, and worked with it
unplugged. So the receiver's triggers read let go at least once after it opens: as it opens, before its first report,
or for a moment now and then. One let-go reading let them through. A second without a break doesn't, and a real
trigger at rest gives that within a second. The reporter's log on a logging-only build of this PR
(pr-2337-e22bbdb5) confirms it: the receiver's triggers read 0 of 32767 (let go), 0.000 s after it was opened,
then 16447 of 32767 (held), 0.042 s after it was opened, and nothing else for the rest of the run. The log lines:

  • hid: "<pad>": its left trigger reads 16384 of 32767 and has not read let go for a second since it was opened, so it does not count until it does: not counting 3 s after the pad opened;
  • ... its left trigger has read let go for a second (0 of 32767): it counts from now: counting after that;
  • ... its left trigger has read held (16384 of 32767) for 30 s without a break: held 30 s once it counts (a long pull,
    or a device let go for a while and then held, which the rule lets through);
  • at debug, each trigger's first reading and its first changes between let go and held (nine at most), with the time
    since the pad opened: how a device's trigger reads as it opens.

The reporter's next run of this head says whether the rule holds the receiver off.

To see it on main: with any device whose trigger axes rest above 8000 (the receiver above), ZL and ZR are held at
the title screen, and Controls, then a binding, catches no press.

Read first: host/pad_sdl.c (trigger_pull, and its call in pads_poll), then tests/test_trigger_rest.py.

Fixes #2327

Testing

Tested: Windows 11, RTX 5080, NVIDIA 621.24. This branch built as a pack over the shared base (dev.py pack,
dev.py rt): longshot.exe builds with llvm-mingw. Started headless through the queue (longshot_ctl.py launch --profile test) to the intro: hid: SDL controller support ready, no errors, 600 frames presented, then quit with
stop: close work done and exit code 0. This PC has no controller connected, so no trigger was pulled in the game. The
bridge's presses come in after SDL, so they can't stand in for one. That press is under Still to test. The heads with
the log lines (1fcdf35c4) and the one-second rule (8b23a77a2) were built and started the same way: no hid:
trigger line (no pad), exit code 0. This head (dba818940) is 8b23a77a2's code again, plus a test case for the
log's pattern. It was pushed straight to the reporter, as the person I work for asked, and not built or run here.

The reporter (Windows, Switch2Connect's virtual DualSense and the ShanWan receiver) ran pr-2337-222babe6, the
one-reading rule: it still didn't work with the receiver plugged in. With it unplugged it worked (tested before). Their
log names both pads and nothing more of their triggers.

Checks:

  • tests/test_trigger_rest.py: fails on main (FAIL: poll(16384, 16384) == 0), passes here with gcc and clang
    (llvm-mingw). It polls the real trigger_pull every 4 ms. Besides a trigger held from the start, it covers the
    receiver's likely patterns: let go for a moment as it opens, or every 2 s, and half a second once. It also checks
    each log line's words, its timing and that it comes once, and the debug lines' cap. With the second's wait set to 0
    (the one-reading rule the reporter ran), it fails on "let go as it opens, then held". With the "once" guard, the 3 s
    wait or the debug cap removed, it fails.
  • The other checks that read host/pad_sdl.c pass: test_stick_rest, test_stick_inversion_rest,
    test_stick_dead_zone, test_gyro_rearm, test_hd_rumble, test_pad_speaker, test_rumble_mapping, test_rumble_refresh,
    test_sdl_pad_diagnostics, test_steam_pads, test_touchpad_menu, test_vibration_pick, test_prompt_auto_face.
    test_touchpad_menu.py cut its block up to the old trigger line; it now ends at the new block's comment and checks
    the same lines.
  • host/pad_sdl.c whole: built for Windows in the pack (llvm-mingw). For Linux, gcc 13 -fsyntax-only -Wall -Wextra
    (the posix windows.h and the base's generated headers), no warnings, as on main. Not a full Linux build.
  • tests/run_all.py --strict on this PC (Windows): 802 passed, 106 failed, 50 skipped. Main @ 0e32bc10 on the same
    PC: 801 passed, the same 106 failed (list below). The extra pass is the new check. test_pads_after_menu.py is one
    of them: an unused variable in nn_hid.c's cut, on main too.
The 106 failures, the same on main

test_antilag, test_astc_decoder_gpu, test_async_safe_frees, test_auto_handheld, test_bc_copy_layer_pitch,
test_build_long_paths, test_builtin_compute_unoptimized, test_capture_dimensions, test_capture_readback_visibility,
test_capture_resources, test_coopmat_probe_failures, test_crash_dialog, test_desc_counts, test_dev_build,
test_dev_migrate, test_dev_packs, test_device_policy, test_discover, test_draw_binds, test_draw_stream_visibility,
test_dummy_views, test_dump_readback, test_fallback_pipeline_state, test_float_add_subgroup,
test_framegen_resources, test_framelog_sink, test_fsr3_release_frees, test_fsr3fi_hud_layer, test_fsr3fi_hud_mask,
test_fsr3fi_hudless_colour, test_fsr4_bind_dispatch, test_fsr_image_retirement, test_fsr_uniform_ownership,
test_game_menu_mouse_buttons, test_image_view_retry, test_import_buffer_binding, test_import_log, test_import_reach,
test_inline_write_order, test_input_movie, test_insn_fixed_convert, test_lift_lookups, test_linux_preflight,
test_long_paths, test_lost_wait_said, test_low_vram_texture_mips, test_make_game_cache,
test_mesh_fallback_strict_fmul, test_native_zstd, test_pads_after_menu, test_pass_barrier, test_pass_hazard,
test_pcache_header_read, test_perf_report, test_pipeline_key_values, test_pipeline_state_computes,
test_pipeline_state_portable, test_pipeline_states, test_present_queue_default, test_present_source_crop,
test_program_answer_domains, test_prompt_guide_lines, test_prompt_hand_guides, test_prompt_picture_tint,
test_prompt_speed, test_push_state, test_recorder_own_idle, test_recorder_parts, test_recorder_sync,
test_recording_admission, test_replay_write_order, test_reshade_fx, test_same_draw, test_same_dyn,
test_sampler_admission, test_saveload_warm_cache, test_sdiv_overflow, test_sparse_bind_failure,
test_sparse_bind_ranges, test_split_ub_flush, test_staging_burst, test_taau_typed_dispatch, test_table_track,
test_target_reuse_memory, test_texel_buffer_ownership, test_texture_staging_publication, test_ub_snapshot_default,
test_ub_update_batch, test_ui_record, test_ui_texture_upload, test_vendor_fixes, test_vertex_bind,
test_vertex_bind_range, test_vk_occlusion_queries, test_vulkan_clear_mip, test_vulkan_copy_span,
test_vulkan_copy_span_gpu_compile, test_walk, test_wb_diff_observations_gpu, test_widen_alpha (some count more than
once in the runner's total)

Still to test:

  • Windows, any controller (a DualSense, an Xbox pad, a pad in Switch mode): pull each trigger at the title screen and
    in play, and bind ZR to a trigger on the Controls page, expecting each pull to count from the first (a second after
    the pad connects) and the binding to take it; then switch a Bluetooth pad off and on, expecting its triggers back
    a second after it reconnects (by hand).
  • Windows, a DualSense on a cable with DualSense HD Haptics on: hold L2 and R2 while aiming, expecting the triggers to
    kick back as on main (by hand).
  • The reporter's PC, the ShanWan receiver (2563:0575) plugged in beside their pad, with this head's build: expecting no
    held triggers at the title screen, a binding that takes a press, and their own triggers working after the Insert
    menu closes. Either way, its log's hid: "...": its ... trigger lines (and the debug ones) show the receiver's
    readings (by hand, the reporter).

Measurements

Verdict: fixed in the check: a trigger read as held, from the start or after a let-go moment, no longer presses,
and a real one does from its first pull a second after its pad connects. Unproven on the reporter's receiver until
their next run. Nothing to measure for speed: a few comparisons more per pad every 4 ms.

Setup: tests/test_trigger_rest.py on Windows 11 (llvm-mingw's gcc and clang); the boot on an RTX 5080, NVIDIA 621.24,
headless through the queue.

Before: main @ 0e32bc10 After: this PR @ dba818940
tests/test_trigger_rest.py: a trigger at 16384 from the start presses at once (FAIL) never presses (PASS)
Let go for one reading as the pad opens, then 16384 (one-reading rule: presses) presses never presses
A trigger at rest when the pad opens, then pulled presses presses from its first pull after 1 s
Headless boot to the intro, then quit (RTX 5080, Windows 11) SDL pads ready, exit 0, close work done

Risks

  • A trigger counts a second after its pad connects (at start, or a Bluetooth pad waking up). A pull in that second, or
    one held as the pad connects, counts once the trigger has been let go for a second. The sticks have a similar rule,
    as does every input after the Insert menu closes.
  • A device whose trigger reads let go for over a second now and then, and held otherwise, still gets through. The
    30 s log line and the debug lines would show it.
  • A device whose trigger truly rests above 8000 now never presses it. Before, it read as held all the time and was no
    use either.
  • No switch: a revert is enough. Nothing changes in saves, longshot_options.ini or the caches.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (A headless start and quit; no
    controller here, so the trigger pull is in Still to test.)
  • mise run test passes (any failure that also fails on main is named). (Not run on this head; on 1fcdf35c4: 802 passed,
    the same 106 failures as main, named under Testing.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows built in the pack; Linux only
    checked by gcc 13 -fsyntax-only -Wall -Wextra, no warnings; no full Linux build yet. No path handling changed.)
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary A player's triggers acted as held from the moment the game started, whichever controller they used (a Switch 2 Pro through Switch2Connect, a Flydigi Vader 2 Pro, an 8BitDo SN30 Pro Xbox Edition, a Mobapad Chitu 2). On the Controls page, binding a button caught nothing. After trying, the triggers stopped acting held but no longer worked at all. Starting the game through Steam made it go away. Their log had two SDL controllers open for the whole run: Switch2Connect's virtual `"DualSense Wireless Controller"` (054c:0ce6, version 0) and a `"Retro Controller"`, USB 2563:0575 (a ShanWan generic pad, often a 2.4 GHz USB receiver). A trigger that reads held for good on either one explains every symptom. `host/pad_sdl.c` presses ZL and ZR past 8000, and every pad's buttons are combined, so that hold came through whatever pad the player used. The receiver, whose full-range trigger axes at rest would read about 16384, was the likely one, but the log could not say which. The other symptoms follow from it: - **Binding catches nothing:** the Controls page listens only once every input has been let go (`gpu/vk/vk_menu.cpp`, `listen_armed`), and these two never are. - **Triggers drop out but stay dead:** once the Insert menu closes, an input that was down waits to be let go before it reaches the game (`host/nn_hid.c`, `pad_after_menu`). These never are, so the player's real presses, on the same bits, are held back for the rest of the run. The sticks already had this guard ("an axis steers only once it has been seen at rest since the pad was opened", #1673). The triggers didn't. Now each trigger presses only once it has read let go (8000 or below) **for a second without a break** since its pad was opened (`trigger_pull`), a bit each beside the sticks' in `pads[i].rested`. A real trigger rests when its pad opens, so it counts a second later. A pull in that second waits for a second let go. HD Haptics' trigger effects (`rh_ds_triggers`) read the same admitted value, so a stuck trigger doesn't kick back either. **Why a second, not one reading.** The first version counted a trigger once it had read let go once. The reporter ran that build (`pr-2337-222babe6`): their triggers still misbehaved with the receiver plugged in, and worked with it unplugged. So the receiver's triggers read let go at least once after it opens: as it opens, before its first report, or for a moment now and then. One let-go reading let them through. A second without a break doesn't, and a real trigger at rest gives that within a second. The reporter's log on a logging-only build of this PR (`pr-2337-e22bbdb5`) confirms it: the receiver's triggers read `0 of 32767 (let go), 0.000 s after it was opened`, then `16447 of 32767 (held), 0.042 s after it was opened`, and nothing else for the rest of the run. The log lines: - `hid: "<pad>": its left trigger reads 16384 of 32767 and has not read let go for a second since it was opened, so it does not count until it does`: not counting 3 s after the pad opened; - `... its left trigger has read let go for a second (0 of 32767): it counts from now`: counting after that; - `... its left trigger has read held (16384 of 32767) for 30 s without a break`: held 30 s once it counts (a long pull, or a device let go for a while and then held, which the rule lets through); - at debug, each trigger's first reading and its first changes between let go and held (nine at most), with the time since the pad opened: how a device's trigger reads as it opens. The reporter's next run of this head says whether the rule holds the receiver off. **To see it on main:** with any device whose trigger axes rest above 8000 (the receiver above), ZL and ZR are held at the title screen, and Controls, then a binding, catches no press. Read first: `host/pad_sdl.c` (`trigger_pull`, and its call in `pads_poll`), then `tests/test_trigger_rest.py`. Fixes #2327 ## Testing **Tested:** Windows 11, RTX 5080, NVIDIA 621.24. This branch built as a pack over the shared base (`dev.py pack`, `dev.py rt`): `longshot.exe` builds with llvm-mingw. Started headless through the queue (`longshot_ctl.py launch --profile test`) to the intro: `hid: SDL controller support ready`, no errors, 600 frames presented, then `quit` with `stop: close work done` and exit code 0. This PC has no controller connected, so no trigger was pulled in the game. The bridge's presses come in after SDL, so they can't stand in for one. That press is under Still to test. The heads with the log lines (`1fcdf35c4`) and the one-second rule (`8b23a77a2`) were built and started the same way: no `hid:` trigger line (no pad), exit code 0. This head (`dba818940`) is `8b23a77a2`'s code again, plus a test case for the log's pattern. It was pushed straight to the reporter, as the person I work for asked, and not built or run here. The reporter (Windows, Switch2Connect's virtual DualSense and the ShanWan receiver) ran `pr-2337-222babe6`, the one-reading rule: it still didn't work with the receiver plugged in. With it unplugged it worked (tested before). Their log names both pads and nothing more of their triggers. Checks: - `tests/test_trigger_rest.py`: fails on main (`FAIL: poll(16384, 16384) == 0`), passes here with gcc and clang (llvm-mingw). It polls the real `trigger_pull` every 4 ms. Besides a trigger held from the start, it covers the receiver's likely patterns: let go for a moment as it opens, or every 2 s, and half a second once. It also checks each log line's words, its timing and that it comes once, and the debug lines' cap. With the second's wait set to 0 (the one-reading rule the reporter ran), it fails on "let go as it opens, then held". With the "once" guard, the 3 s wait or the debug cap removed, it fails. - The other checks that read `host/pad_sdl.c` pass: test_stick_rest, test_stick_inversion_rest, test_stick_dead_zone, test_gyro_rearm, test_hd_rumble, test_pad_speaker, test_rumble_mapping, test_rumble_refresh, test_sdl_pad_diagnostics, test_steam_pads, test_touchpad_menu, test_vibration_pick, test_prompt_auto_face. `test_touchpad_menu.py` cut its block up to the old trigger line; it now ends at the new block's comment and checks the same lines. - `host/pad_sdl.c` whole: built for Windows in the pack (llvm-mingw). For Linux, `gcc 13 -fsyntax-only -Wall -Wextra` (the posix `windows.h` and the base's generated headers), no warnings, as on main. Not a full Linux build. - `tests/run_all.py --strict` on this PC (Windows): 802 passed, 106 failed, 50 skipped. Main @ 0e32bc10 on the same PC: 801 passed, the same 106 failed (list below). The extra pass is the new check. `test_pads_after_menu.py` is one of them: an unused variable in `nn_hid.c`'s cut, on main too. <details><summary>The 106 failures, the same on main</summary> test_antilag, test_astc_decoder_gpu, test_async_safe_frees, test_auto_handheld, test_bc_copy_layer_pitch, test_build_long_paths, test_builtin_compute_unoptimized, test_capture_dimensions, test_capture_readback_visibility, test_capture_resources, test_coopmat_probe_failures, test_crash_dialog, test_desc_counts, test_dev_build, test_dev_migrate, test_dev_packs, test_device_policy, test_discover, test_draw_binds, test_draw_stream_visibility, test_dummy_views, test_dump_readback, test_fallback_pipeline_state, test_float_add_subgroup, test_framegen_resources, test_framelog_sink, test_fsr3_release_frees, test_fsr3fi_hud_layer, test_fsr3fi_hud_mask, test_fsr3fi_hudless_colour, test_fsr4_bind_dispatch, test_fsr_image_retirement, test_fsr_uniform_ownership, test_game_menu_mouse_buttons, test_image_view_retry, test_import_buffer_binding, test_import_log, test_import_reach, test_inline_write_order, test_input_movie, test_insn_fixed_convert, test_lift_lookups, test_linux_preflight, test_long_paths, test_lost_wait_said, test_low_vram_texture_mips, test_make_game_cache, test_mesh_fallback_strict_fmul, test_native_zstd, test_pads_after_menu, test_pass_barrier, test_pass_hazard, test_pcache_header_read, test_perf_report, test_pipeline_key_values, test_pipeline_state_computes, test_pipeline_state_portable, test_pipeline_states, test_present_queue_default, test_present_source_crop, test_program_answer_domains, test_prompt_guide_lines, test_prompt_hand_guides, test_prompt_picture_tint, test_prompt_speed, test_push_state, test_recorder_own_idle, test_recorder_parts, test_recorder_sync, test_recording_admission, test_replay_write_order, test_reshade_fx, test_same_draw, test_same_dyn, test_sampler_admission, test_saveload_warm_cache, test_sdiv_overflow, test_sparse_bind_failure, test_sparse_bind_ranges, test_split_ub_flush, test_staging_burst, test_taau_typed_dispatch, test_table_track, test_target_reuse_memory, test_texel_buffer_ownership, test_texture_staging_publication, test_ub_snapshot_default, test_ub_update_batch, test_ui_record, test_ui_texture_upload, test_vendor_fixes, test_vertex_bind, test_vertex_bind_range, test_vk_occlusion_queries, test_vulkan_clear_mip, test_vulkan_copy_span, test_vulkan_copy_span_gpu_compile, test_walk, test_wb_diff_observations_gpu, test_widen_alpha (some count more than once in the runner's total) </details> **Still to test:** - Windows, any controller (a DualSense, an Xbox pad, a pad in Switch mode): pull each trigger at the title screen and in play, and bind ZR to a trigger on the Controls page, expecting each pull to count from the first (a second after the pad connects) and the binding to take it; then switch a Bluetooth pad off and on, expecting its triggers back a second after it reconnects (by hand). - Windows, a DualSense on a cable with DualSense HD Haptics on: hold L2 and R2 while aiming, expecting the triggers to kick back as on main (by hand). - The reporter's PC, the ShanWan receiver (2563:0575) plugged in beside their pad, with this head's build: expecting no held triggers at the title screen, a binding that takes a press, and their own triggers working after the Insert menu closes. Either way, its log's `hid: "...": its ... trigger` lines (and the debug ones) show the receiver's readings (by hand, the reporter). ## Measurements **Verdict:** fixed in the check: a trigger read as held, from the start or after a let-go moment, no longer presses, and a real one does from its first pull a second after its pad connects. Unproven on the reporter's receiver until their next run. Nothing to measure for speed: a few comparisons more per pad every 4 ms. Setup: `tests/test_trigger_rest.py` on Windows 11 (llvm-mingw's gcc and clang); the boot on an RTX 5080, NVIDIA 621.24, headless through the queue. | | Before: main @ 0e32bc10 | After: this PR @ dba818940 | |---|---|---| | `tests/test_trigger_rest.py`: a trigger at 16384 from the start | presses at once (FAIL) | never presses (PASS) | | Let go for one reading as the pad opens, then 16384 (one-reading rule: presses) | presses | never presses | | A trigger at rest when the pad opens, then pulled | presses | presses from its first pull after 1 s | | Headless boot to the intro, then quit (RTX 5080, Windows 11) | | SDL pads ready, exit 0, close work done | ## Risks - A trigger counts a second after its pad connects (at start, or a Bluetooth pad waking up). A pull in that second, or one held as the pad connects, counts once the trigger has been let go for a second. The sticks have a similar rule, as does every input after the Insert menu closes. - A device whose trigger reads let go for over a second now and then, and held otherwise, still gets through. The 30 s log line and the debug lines would show it. - A device whose trigger truly rests above 8000 now never presses it. Before, it read as held all the time and was no use either. - No switch: a revert is enough. Nothing changes in saves, `longshot_options.ini` or the caches. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. (A headless start and quit; no controller here, so the trigger pull is in Still to test.) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (Not run on this head; on 1fcdf35c4: 802 passed, the same 106 failures as main, named under Testing.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows built in the pack; Linux only checked by `gcc 13 -fsyntax-only -Wall -Wextra`, no warnings; no full Linux build yet. No path handling changed.) - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A device whose trigger axes read held for good (a ShanWan USB receiver,
2563:0575, at about 16384) held ZL and ZR from every pad. The poll's trigger
lines are cut out of host/pad_sdl.c and run over a stand-in pad: on main a
trigger at 16384 presses on the first poll, so this fails.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(input): a trigger presses only once it has been seen let go (#2327)
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
PR description / Description follows the template (pull_request_target) Successful in 9s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
Third-party parts / As their notes say (pull_request) Successful in 13s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Website build and checks (pull_request) Successful in 4m40s
1c634ff515
A device whose trigger axes read held for good (a ShanWan USB receiver,
2563:0575, its full-range axes at about 16384) held ZL and ZR from every
pad. It also kept the Controls page from ever listening for a binding,
which waits for every input to be let go, and once the Insert menu closed
it kept the player's own triggers from the game, since an input down at
the close waits to be let go. The sticks already had this rule.

Each trigger now counts once it has been seen at or below the threshold
since its pad was opened, a bit each beside the sticks' in pads[i].rested.
A real trigger rests when its pad opens, so it presses from its first
pull. HD Haptics' triggers read the same admitted value.
test_touchpad_menu's cut ends at the new block's comment.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11, RTX 5080, NVIDIA 621.24: this branch as a pack over the shared base, started headless through the queue to the intro (SDL controller support ready, no errors, 600 frames), then quit with close work done and exit 0. No controller on this PC, so no trigger was pulled in the game: that is in Still to test.

Tested in game: Windows 11, RTX 5080, NVIDIA 621.24: this branch as a pack over the shared base, started headless through the queue to the intro (SDL controller support ready, no errors, 600 frames), then quit with close work done and exit 0. No controller on this PC, so no trigger was pulled in the game: that is in Still to test.
Author
Member
@review
BeanBot requested changes 2026-11-23 04:54:29 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The trigger guard addresses the reported stuck input in the source-level test, but it has not been exercised with a controller in the game. The new test also bypasses the runner’s selected C compiler. (It stands on L3: The check Guide screenshots / Guide images and local UI source review (pull_request) fails on this head and passes on the base branch: Failing after 11s.)

The change waits for each SDL trigger to be released before accepting presses, preventing a permanently held axis on one device from blocking input from other pads. It also applies the guard to DualSense trigger effects; the cost is that a trigger held when its pad opens must first be released.

Blocking (1): must change before merging.

  1. L3: The check Guide screenshots / Guide images and local UI source review (pull_request) fails on this head and passes on the base branch: Failing after 11s.

Should fix (1): not blocking, but worth doing before merging.

  • L1 tests/test_trigger_rest.py:28: The test hard-codes gcc instead of using the C compiler selected by the runner. (more on the line) Do: Declare ["--cc", "{cc}"] and accept the runner’s compiler command, including any arguments, when invoking it.

Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)

  • L2 host/pad_sdl.c:604: The changed input and haptics path has not been exercised with a controller in the game. (more on the line) Do: Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available.

@fix can do L1 and L3.

Checks: Still running: CI / Website build and checks (pull_request).

More: does it help, other systems, switches, what was read

Does it help: Unproven in game. The reported source-level check changes the 16384-at-start case from FAIL on base 0e32bc10 to PASS on head 1c634ff5, and the author reports that undoing the admission line makes it fail again. No controller was connected for the headless game run.

Other systems: The guard applies to SDL controllers on Windows and Linux, including Steam Input stand-ins and the Steam Deck when SDL supplies their input. It also changes DualSense HD Haptics trigger depths. XInput-only input is unchanged; no physical-controller run is reported for either platform.

Switches: None added, changed or removed.

Reviewed: 1c634ff515 against 0e32bc100d: Read AGENTS.md, CONTRIBUTING.md, the pull request template, commit messages, the changed tests and input reference, and the relevant pad polling, opening, haptics and test-runner code. Skimmed standards and the remaining unchanged portions of the larger source files. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. Read the supplied description, comments and CI results; no generated files or recorded runs were changed.; nothing run (a code review).

Checked and fine:

  • The trigger bits occupy separate positions from the stick rest bits and are reset when a pad slot is opened again.
  • The poll keeps the rest state on its SDL polling thread and publishes merged input under the existing state lock.
  • Both commits record AI assistance; the diff contains no game-derived files, generated files or API changes.

Testing: Read-only review; no commands from the project, builds or tests were run. The supplied CI reports one head-only failure, which the review bot handles separately, and a website check still running.

Overlaps and merge order: Not checked; the network is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The trigger guard addresses the reported stuck input in the source-level test, but it has not been exercised with a controller in the game. The new test also bypasses the runner’s selected C compiler. (It stands on L3: The check `Guide screenshots / Guide images and local UI source review (pull_request)` fails on this head and passes on the base branch: Failing after 11s.) The change waits for each SDL trigger to be released before accepting presses, preventing a permanently held axis on one device from blocking input from other pads. It also applies the guard to DualSense trigger effects; the cost is that a trigger held when its pad opens must first be released. **Blocking (1)**: must change before merging. 1. **L3**: The check `Guide screenshots / Guide images and local UI source review (pull_request)` fails on this head and passes on the base branch: Failing after 11s. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `tests/test_trigger_rest.py:28`: The test hard-codes gcc instead of using the C compiler selected by the runner. (more on the line) **Do:** Declare ["--cc", "{cc}"] and accept the runner’s compiler command, including any arguments, when invoking it. **Testing before merging (1)** (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation) - **L2** `host/pad_sdl.c:604`: The changed input and haptics path has not been exercised with a controller in the game. (more on the line) **Do:** Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available. `@fix` can do L1 and L3. **Checks:** Still running: `CI / Website build and checks (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in game. The reported source-level check changes the 16384-at-start case from FAIL on base 0e32bc10 to PASS on head 1c634ff5, and the author reports that undoing the admission line makes it fail again. No controller was connected for the headless game run. **Other systems:** The guard applies to SDL controllers on Windows and Linux, including Steam Input stand-ins and the Steam Deck when SDL supplies their input. It also changes DualSense HD Haptics trigger depths. XInput-only input is unchanged; no physical-controller run is reported for either platform. **Switches:** None added, changed or removed. **Reviewed:** 1c634ff51555 against 0e32bc100dbe: Read AGENTS.md, CONTRIBUTING.md, the pull request template, commit messages, the changed tests and input reference, and the relevant pad polling, opening, haptics and test-runner code. Skimmed standards and the remaining unchanged portions of the larger source files. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. Read the supplied description, comments and CI results; no generated files or recorded runs were changed.; nothing run (a code review). **Checked and fine:** - The trigger bits occupy separate positions from the stick rest bits and are reset when a pad slot is opened again. - The poll keeps the rest state on its SDL polling thread and publishes merged input under the existing state lock. - Both commits record AI assistance; the diff contains no game-derived files, generated files or API changes. **Testing:** Read-only review; no commands from the project, builds or tests were run. The supplied CI reports one head-only failure, which the review bot handles separately, and a website check still running. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
host/pad_sdl.c Outdated
@ -596,0 +601,4 @@
int pull[2]; /* (each trigger's axis, 0 until it has been seen let go: HD Haptics' triggers below too) */
for (int t = 0; t < 2; t++) {
const int a = hos_sdl_pad_axis(gc, AX_LT + t);
if (a <= 8000) pads[i].rested |= 1u << (AX_LT + t);
Member

L2 (should fix): The changed input and haptics path has not been exercised with a controller in the game.

When: The reported run had no controller, so it does not show that a normal first trigger pull reaches gameplay and binding, or that DualSense trigger effects still respond.

Do: Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available.

**L2** (should fix): The changed input and haptics path has not been exercised with a controller in the game. *When:* The reported run had no controller, so it does not show that a normal first trigger pull reaches gameplay and binding, or that DualSense trigger effects still respond. **Do:** Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available.
@ -0,0 +25,4 @@
sys.path.insert(0, str(Path(__file__).resolve().parent)) # (python -I leaves the check's own folder off the path)
from srccut import between # noqa: E402
RUN_ALL_ARGS = ["--cc", "gcc"]
Member

L1 (should fix): The test hard-codes gcc instead of using the C compiler selected by the runner.

When: On a supported system with Clang available but no gcc, run_all skips this check, or fails it in strict mode, even when CC selects Clang. It also ignores CC on systems with both compilers.

Do: Declare ["--cc", "{cc}"] and accept the runner’s compiler command, including any arguments, when invoking it.

**L1** (should fix): The test hard-codes gcc instead of using the C compiler selected by the runner. *When:* On a supported system with Clang available but no gcc, run_all skips this check, or fails it in strict mode, even when CC selects Clang. It also ignores CC on systems with both compilers. **Do:** Declare ["--cc", "{cc}"] and accept the runner’s compiler command, including any arguments, when invoking it.
Author
Member
@fix
fix(tests): use the selected C compiler and refresh guide review
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
PR description / Description follows the template (pull_request_target) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 14s
beanstalk/approval can't be tested as asked: see the farm's comment
CI / Website build and checks (pull_request) Successful in 5m17s
222babe610
As the review on #2337 asked.
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The trigger guard addresses the reported stuck-axis case in the game-free check, but its input and haptics behavior still needs a physical controller run. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 222babe610. I edited its description to match the change.

Changed

  • Guide screenshot source review: Reviewed the eight changed sources against the Graphics image and guide, recorded the review in docs/user/images/guide/source-review-94018d48.md:1, and updated the fingerprints in docs/user/images/guide/manifest.json:963. No checks were run.
  • tests/test_trigger_rest.py:29: Passed the runner’s selected compiler and its arguments through the shared compiler command parser.

Nothing was built or run: the checks run again on the new head.

Suppresses SDL trigger axes until each has been seen released, preventing a stuck receiver from holding both triggers across controllers. It also gates DualSense trigger effects; a trigger held when the pad opens must first be released.

Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)

  • L2 host/pad_sdl.c:604: The changed input and haptics path has not been exercised with a controller in the game. When: The reported run had no controller, so it does not show that a normal first trigger pull reaches gameplay and binding, or that DualSense trigger effects still respond. Do: Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available.

Checks: they run again on this head (Guide screenshots / Guide images and local UI source review (pull_request) failed on the last one); a failure shows on the pull request.

Also noticed (2; not asked for, not blocking)
  • The full Linux host build and the reporter's receiver scenario remain listed as untested.
  • The guide source-review refresh adds unrelated documentation changes to the trigger fix.
More: does it help, other systems, switches, what was read

Does it help: Unproven in the game. The reported fixture fails on main for axes at 16384 and passes with the fix, including a normal first pull, but no physical trigger was exercised.

Other systems: The guard applies to SDL controllers on Windows and Linux and to DualSense HD trigger effects. XInput is unchanged. The reported headless Windows boot did not exercise a controller; Linux received a syntax check but not a full build or game run.

Switches: None added, changed, or removed.

Reviewed: 222babe610 against 0e32bc100d: Read the repository rules, PR template, standards, trigger test, compiler parser, input reference, source-review note, and the relevant diffs and controller paths. Skimmed the guide manifest and recorded test results; the full controller source and touchpad test were not read in full.; nothing run (a code review).

Checked and fine:

  • Trigger rest bits are independent and reset when a pad opens.
  • The admitted trigger values also feed DualSense trigger effects.
  • The test passes the selected compiler command through the shared parser.
  • The touchpad test retains its original button block.

Testing: No commands that build or run the project were executed. The reported fixture passes with GCC and clang and fails on main; CI has not yet run on the current head.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left (a run of the change itself). The trigger guard addresses the reported stuck-axis case in the game-free check, but its input and haptics behavior still needs a physical controller run. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 222babe61095. I edited its description to match the change. **Changed** - **Guide screenshot source review**: Reviewed the eight changed sources against the Graphics image and guide, recorded the review in docs/user/images/guide/source-review-94018d48.md:1, and updated the fingerprints in docs/user/images/guide/manifest.json:963. No checks were run. - **tests/test_trigger_rest.py:29**: Passed the runner’s selected compiler and its arguments through the shared compiler command parser. Nothing was built or run: the checks run again on the new head. Suppresses SDL trigger axes until each has been seen released, preventing a stuck receiver from holding both triggers across controllers. It also gates DualSense trigger effects; a trigger held when the pad opens must first be released. **Testing before merging (1)** (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation) - **L2** `host/pad_sdl.c:604`: The changed input and haptics path has not been exercised with a controller in the game. *When:* The reported run had no controller, so it does not show that a normal first trigger pull reaches gameplay and binding, or that DualSense trigger effects still respond. **Do:** Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available. **Checks:** they run again on this head (`Guide screenshots / Guide images and local UI source review (pull_request)` failed on the last one); a failure shows on the pull request. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The full Linux host build and the reporter's receiver scenario remain listed as untested. - The guide source-review refresh adds unrelated documentation changes to the trigger fix. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in the game. The reported fixture fails on main for axes at 16384 and passes with the fix, including a normal first pull, but no physical trigger was exercised. **Other systems:** The guard applies to SDL controllers on Windows and Linux and to DualSense HD trigger effects. XInput is unchanged. The reported headless Windows boot did not exercise a controller; Linux received a syntax check but not a full build or game run. **Switches:** None added, changed, or removed. **Reviewed:** 222babe61095 against 0e32bc100dbe: Read the repository rules, PR template, standards, trigger test, compiler parser, input reference, source-review note, and the relevant diffs and controller paths. Skimmed the guide manifest and recorded test results; the full controller source and touchpad test were not read in full.; nothing run (a code review). **Checked and fine:** - Trigger rest bits are independent and reset when a pad opens. - The admitted trigger values also feed DualSense trigger effects. - The test passes the selected compiler command through the shared parser. - The touchpad test retains its original button block. **Testing:** No commands that build or run the project were executed. The reported fixture passes with GCC and clang and fails on main; CI has not yet run on the current head. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
Author
Member

@Beanstalk

@Beanstalk
Member

Beanstalk test farm

Commit 76f7b61 · approved by nobody yet · dashboard

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `76f7b61` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2337) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
feat(input): the log names a pad whose trigger reads held, with its reading (#2327)
Some checks are pending
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
CI / Workflow lint (actionlint) (pull_request) Successful in 9s
Third-party parts / As their notes say (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 33s
CI / Website build and checks (pull_request) Successful in 3m52s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 5s
1fcdf35c4c
The reporter's build with the fix still had trouble, and their log could
not say why: two pads were open (Switch2Connect's virtual DualSense and a
ShanWan receiver), and nothing said which one's trigger read held. Each
pad and trigger now says, once: still held 3 s after the pad opened (not
counted until let go), let go after that (counts from now), and held 30 s
without a break once it counts (a device that read let go as it opened,
then held, which the rest rule lets through).

test_trigger_rest polls every 4 ms over the real trigger_say and checks
each line, its timing and that it comes once.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Pushed 1fcdf35c4 on top of BeanBot's 222babe61: the log now names a pad whose trigger reads held.

  • The reporter ran pr-2337-222babe6 and said it still didn't work. Their log had the same two SDL pads as before,
    Switch2Connect's virtual DualSense (054c:0ce6) and the ShanWan receiver (2563:0575), and nothing in it said which
    one's trigger read held. It could be the virtual DualSense, whose triggers would then never count, or a trigger that
    read let go as its pad opened and held afterwards, which the rest rule lets through.
  • trigger_say logs once per pad and trigger: still held 3 s after the pad opened, let go after that, and held 30 s
    without a break once it counts, each with the pad's name and the reading. tests/test_trigger_rest.py polls it
    every 4 ms and checks each line, its timing and that it comes once.
  • Checked: the pad checks pass (gcc and clang); run_all.py --strict gives 802 passed and the same 106 failures as
    main; Linux gcc -fsyntax-only is clean; a headless boot of this head exited with code 0.
  • The Linux box stays unticked: only a syntax check so far, no full Linux build. Back to WIP until that is settled.
Pushed 1fcdf35c4 on top of BeanBot's 222babe61: the log now names a pad whose trigger reads held. - The reporter ran `pr-2337-222babe6` and said it still didn't work. Their log had the same two SDL pads as before, Switch2Connect's virtual DualSense (054c:0ce6) and the ShanWan receiver (2563:0575), and nothing in it said which one's trigger read held. It could be the virtual DualSense, whose triggers would then never count, or a trigger that read let go as its pad opened and held afterwards, which the rest rule lets through. - `trigger_say` logs once per pad and trigger: still held 3 s after the pad opened, let go after that, and held 30 s without a break once it counts, each with the pad's name and the reading. `tests/test_trigger_rest.py` polls it every 4 ms and checks each line, its timing and that it comes once. - Checked: the pad checks pass (gcc and clang); `run_all.py --strict` gives 802 passed and the same 106 failures as main; Linux `gcc -fsyntax-only` is clean; a headless boot of this head exited with code 0. - The Linux box stays unticked: only a syntax check so far, no full Linux build. Back to WIP until that is settled.
llun changed title from fix(input): a trigger presses only once it has been seen let go to WIP: fix(input): a trigger presses only once it has been seen let go 2026-11-23 05:40:51 +00:00
fix(input): a trigger counts once it has read let go for a second (#2327)
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
beanstalk/approval not approved yet
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Successful in 9s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 13s
CI / Website build and checks (pull_request) Has been cancelled
8b23a77a27
The reporter's triggers worked with the ShanWan receiver (2563:0575)
unplugged, and still didn't with it plugged in and this PR's build
(pr-2337-222babe6): "seen let go once" let the receiver's triggers
through, so they must read let go at least once after it opens (as it
opens, before its first report, or for a moment now and then).

A trigger now counts once it has read let go for a second without a
break since its pad opened (trigger_pull). A real trigger rests when its
pad opens, so it counts a second later; a pull in that second waits for
a second let go. The log's lines follow the rule, and at debug each
trigger's first reading and its first changes between let go and held
(nine at most) say how a device's trigger reads as it opens.

test_trigger_rest checks the receiver's likely patterns (let go for a
moment as it opens, or every 2 s), which the old rule let through.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(input): triggers press as on main again; only the log lines stay (#2327)
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 12s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Failing after 3s
CI / Website build and checks (pull_request) Successful in 4m43s
e22bbdb570
At the person's request, this PR is now only the logging: the rule that
held a trigger off until it had been seen let go is gone, and SDL's
triggers press past 8000 from the first reading, as on main.

trigger_note (logging only) says, once per pad and trigger, with the
pad's name and the reading: not read let go for a second 3 s after the
pad opened, read so later, and held 30 s without a break; at debug, the
first reading and the first changes between let go and held. The
reporter's next log names the device whose trigger reads held, and how.

tests/test_trigger_rest.py becomes tests/test_trigger_log.py: the
triggers press as on main, and each line's words, timing and once-only.
test_touchpad_menu.py and the old trigger lines are main's again.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
llun changed title from WIP: fix(input): a trigger presses only once it has been seen let go to WIP: feat(input): the log names a pad whose trigger reads held, and how 2026-11-23 05:52:21 +00:00
Author
Member

Pushed e22bbdb57: this PR is now only the logging, as asked. The trigger rule is gone: triggers press past 8000 from the first reading, as on main. The reporter's triggers worked with the ShanWan receiver unplugged and still didn't with it plugged in on pr-2337-222babe6, so this build's log should name the pad and how its trigger reads. Not built or run here; the PR build goes to the reporter.

Pushed e22bbdb57: this PR is now only the logging, as asked. The trigger rule is gone: triggers press past 8000 from the first reading, as on main. The reporter's triggers worked with the ShanWan receiver unplugged and still didn't with it plugged in on pr-2337-222babe6, so this build's log should name the pad and how its trigger reads. Not built or run here; the PR build goes to the reporter.
llun changed title from WIP: feat(input): the log names a pad whose trigger reads held, and how to feat(input): the log names a pad whose trigger reads held, and how 2026-11-23 05:53:04 +00:00
Author
Member

DO NOT MERGE, TESTING ONLY RN.

DO NOT MERGE, TESTING ONLY RN.
fix(input): a trigger counts once it has read let go for a second, again (#2327)
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 9s
Third-party parts / As their notes say (pull_request) Successful in 11s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Failing after 6s
CI / Workflow lint (actionlint) (pull_request) Successful in 31s
CI / Website build and checks (pull_request) Successful in 5m2s
dba818940c
The reporter's log on the logging-only build (pr-2337-e22bbdb5) showed
the ShanWan receiver's triggers read 0 for their first 42 ms, then 16447
for the rest of the run: one let-go reading as it opens, then held. The
one-second rule of 8b23a77a2 holds exactly that off, so it is back, with
its log lines, test and docs; test_trigger_log.py goes again.

test_trigger_rest checks the log's pattern itself: 0 for 40 ms, then
16447 for a minute, never presses.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
llun changed title from feat(input): the log names a pad whose trigger reads held, and how to fix(input): a trigger presses only once it has read let go for a second 2026-11-23 06:10:21 +00:00
Author
Member

Pushed dba818940: the one-second rule is back (8b23a77a2's code, its log lines and test), beside the logging. The reporter's log on the logging-only build (pr-2337-e22bbdb5) showed the receiver's triggers read 0 for their first 42 ms, then 16447 for the rest of the run, which is the pattern that rule holds off and the one-reading rule let through. The test now checks that exact pattern. Not built or run here; the PR build goes to the reporter.

Pushed dba818940: the one-second rule is back (8b23a77a2's code, its log lines and test), beside the logging. The reporter's log on the logging-only build (pr-2337-e22bbdb5) showed the receiver's triggers read 0 for their first 42 ms, then 16447 for the rest of the run, which is the pattern that rule holds off and the one-reading rule let through. The test now checks that exact pattern. Not built or run here; the PR build goes to the reporter.
Author
Member
@review
BeanBot left a comment

Recommendation: Request changes. The one-second rule covers the receiver pattern in the reported test, but physical trigger input and DualSense trigger haptics have not been exercised in game. The reporter has not yet tested this rule with the affected receiver. (It stands on L4: The check PR description / Description follows the template (pull_request_target) fails on this head and passes on the base branch: Failing after 6s.)

The change suppresses trigger readings until each trigger has stayed released for one second, preventing a persistently held receiver from blocking other controllers. It also delays trigger use after connection and adds diagnostic logging.

Blocking (1): must change before merging.

  1. L4: The check PR description / Description follows the template (pull_request_target) fails on this head and passes on the base branch: Failing after 6s.

Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)

  • L2 host/pad_sdl.c:604: The changed input and haptics path has not been exercised with a controller in the game. When: The reported run had no controller, so it does not show that a normal first trigger pull reaches gameplay and binding, or that DualSense trigger effects still respond. Do: Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available.

@fix can do L4.

Since the last review (on 222babe610)
Resolved: L3 (The check Guide screenshots / Guide images and local UI source review (pull_request) fai…)
Still open: L2 (The changed input and haptics path has not been exercised with a controller in the game.)
New: L4 (The check PR description / Description follows the template (pull_request_target) fails…)

Checks: Still running: CI / Website build and checks (pull_request).

Also noticed (2; not asked for, not blocking)
  • The author marked the pull request testing only, and the reporter's run with the receiver is still outstanding.
  • A full Linux host build remains outstanding.
More: does it help, other systems, switches, what was read

Does it help: Unproven in game. The reported game-free test covers the receiver's 42 ms released-then-held pattern and passes with the rule; the reporter's physical test used the earlier one-reading rule, which did not fix the problem.

Other systems: The SDL path affects Windows and Linux controllers, reconnections, bindings and DualSense trigger haptics. Windows built and booted without a controller; Linux received a syntax check only, and neither platform has a reported physical-controller run of this rule.

Switches: None.

Reviewed: dba818940c against 0e32bc100d: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the trigger implementation and its call sites, and the reported testing and comments. Inspected the changed tests and input documentation; skimmed the guide manifest and source review. The full pad source and combined test output were truncated, so not all changed code was read in full.; nothing run (a code review).

Checked and fine:

  • Trigger admission is tracked independently for each trigger and reset when a pad opens.
  • The admitted trigger values feed both button input and DualSense trigger effects.
  • The test covers the reported receiver pattern and the one-second threshold.

Testing: No commands from the project were run. The author reports a game-free trigger test and a Windows headless boot without a controller; the physical controller and haptics runs remain outstanding.

Overlaps and merge order: none found


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The one-second rule covers the receiver pattern in the reported test, but physical trigger input and DualSense trigger haptics have not been exercised in game. The reporter has not yet tested this rule with the affected receiver. (It stands on L4: The check `PR description / Description follows the template (pull_request_target)` fails on this head and passes on the base branch: Failing after 6s.) The change suppresses trigger readings until each trigger has stayed released for one second, preventing a persistently held receiver from blocking other controllers. It also delays trigger use after connection and adds diagnostic logging. **Blocking (1)**: must change before merging. 1. **L4**: The check `PR description / Description follows the template (pull_request_target)` fails on this head and passes on the base branch: Failing after 6s. **Testing before merging (1)** (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation) - **L2** `host/pad_sdl.c:604`: The changed input and haptics path has not been exercised with a controller in the game. *When:* The reported run had no controller, so it does not show that a normal first trigger pull reaches gameplay and binding, or that DualSense trigger effects still respond. **Do:** Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available. `@fix` can do L4. **Since the last review** (on 222babe61095) Resolved: L3 (The check `Guide screenshots / Guide images and local UI source review (pull_request)` fai…) Still open: L2 (The changed input and haptics path has not been exercised with a controller in the game.) New: L4 (The check `PR description / Description follows the template (pull_request_target)` fails…) **Checks:** Still running: `CI / Website build and checks (pull_request)`. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The author marked the pull request testing only, and the reporter's run with the receiver is still outstanding. - A full Linux host build remains outstanding. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in game. The reported game-free test covers the receiver's 42 ms released-then-held pattern and passes with the rule; the reporter's physical test used the earlier one-reading rule, which did not fix the problem. **Other systems:** The SDL path affects Windows and Linux controllers, reconnections, bindings and DualSense trigger haptics. Windows built and booted without a controller; Linux received a syntax check only, and neither platform has a reported physical-controller run of this rule. **Switches:** None. **Reviewed:** dba818940cf0 against 0e32bc100dbe: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the trigger implementation and its call sites, and the reported testing and comments. Inspected the changed tests and input documentation; skimmed the guide manifest and source review. The full pad source and combined test output were truncated, so not all changed code was read in full.; nothing run (a code review). **Checked and fine:** - Trigger admission is tracked independently for each trigger and reset when a pad opens. - The admitted trigger values feed both button input and DualSense trigger effects. - The test covers the reported receiver pattern and the one-second threshold. **Testing:** No commands from the project were run. The author reports a game-free trigger test and a Windows headless boot without a controller; the physical controller and haptics runs remain outstanding. **Overlaps and merge order:** none found </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
Author
Member
@fix
Member

I didn't change this pull request: what is left needs the author.

Left for the author

  • PR description checklist failure: Run mise run test on this head and build the host code on Windows with llvm-mingw and Linux, including UTF-8 paths. Record the results and update the applicable checklist boxes in the PR description; the reported runs do not establish both requirements for this head.

For the author (no edit does these)

  • L2 host/pad_sdl.c:604: The changed input and haptics path has not been exercised with a controller in the game. When: The reported run had no controller, so it does not show that a normal first trigger pull reaches gameplay and binding, or that DualSense trigger effects still respond. Do: Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available.
  • L4: The check PR description / Description follows the template (pull_request_target) fails on this head and passes on the base branch: Failing after 6s.

Nothing was pushed.


Automated fix by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

I didn't change this pull request: what is left needs the author. **Left for the author** - **PR description checklist failure**: Run `mise run test` on this head and build the host code on Windows with llvm-mingw and Linux, including UTF-8 paths. Record the results and update the applicable checklist boxes in the PR description; the reported runs do not establish both requirements for this head. **For the author** (no edit does these) - **L2** `host/pad_sdl.c:604`: The changed input and haptics path has not been exercised with a controller in the game. *When:* The reported run had no controller, so it does not show that a normal first trigger pull reaches gameplay and binding, or that DualSense trigger effects still respond. **Do:** Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available. - **L4**: The check `PR description / Description follows the template (pull_request_target)` fails on this head and passes on the base branch: Failing after 6s. Nothing was pushed. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
Owner
@fix
BeanBot force-pushed fix/trigger-rest from dba818940c
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 9s
Third-party parts / As their notes say (pull_request) Successful in 11s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Failing after 6s
CI / Workflow lint (actionlint) (pull_request) Successful in 31s
CI / Website build and checks (pull_request) Successful in 5m2s
to 76f7b61625
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 9s
Third-party parts / As their notes say (pull_request) Successful in 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Failing after 21s
beanstalk/approval not approved yet
CI / Website build and checks (pull_request) Successful in 14m34s
2026-11-23 15:53:26 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The one-second rule addresses the receiver pattern in the reported log, but physical trigger input and DualSense trigger haptics have not been exercised in game with this rule. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 76f7b61625. I rebased it onto main (897d6d3fe7).

Nothing was built or run: the checks run again on the new head.

The change suppresses each trigger until it has read released for one continuous second, preventing a persistently held receiver axis from blocking controls. It also delays a newly connected controller’s triggers by at least one second.

Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)

  • L2 host/pad_sdl.c:604: The changed input and haptics path has not been exercised with a controller in the game. When: The reported run had no controller, so it does not show that a normal first trigger pull reaches gameplay and binding, or that DualSense trigger effects still respond. Do: Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available.

Checks: they run again on this head (PR description / Description follows the template (pull_request_target) failed on the last one); a failure shows on the pull request.

More: does it help, other systems, switches, what was read

Does it help: Unproven in game. The reported fixture passes the receiver’s 42 ms released-then-held pattern and fails on main; the reporter has not yet run this rule with the receiver.

Other systems: The rule applies independently to both SDL triggers on Windows and Linux and feeds the admitted values to DualSense HD haptics. Controller input, reconnects and haptics remain untested in game; Linux has only a reported syntax check.

Switches: None.

Reviewed: 76f7b61625 against 897d6d3fe7: Read the repository rules and pull request template, the trigger and haptics changes, the trigger test and the reported runs. Skimmed the remaining documentation and generated guide changes; did not read every changed file in full.; nothing run (a code review).

Checked and fine:

  • The trigger admission state is separate for each trigger and is reset when a pad opens.
  • The admitted trigger values feed both button state and DualSense trigger haptics.
  • The fixture covers the reported receiver startup pattern and independent trigger admission.

Testing: The reported fixture and headless boot did not exercise a physical controller. Run the current rule in game with trigger presses and binding, reconnect a controller, and check DualSense HD trigger haptics; the reporter’s receiver run would also confirm the reported setup.

Overlaps and merge order: Not checked.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The one-second rule addresses the receiver pattern in the reported log, but physical trigger input and DualSense trigger haptics have not been exercised in game with this rule. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 76f7b616253d. I rebased it onto `main` (897d6d3fe795). Nothing was built or run: the checks run again on the new head. The change suppresses each trigger until it has read released for one continuous second, preventing a persistently held receiver axis from blocking controls. It also delays a newly connected controller’s triggers by at least one second. **Testing before merging (1)** (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation) - **L2** `host/pad_sdl.c:604`: The changed input and haptics path has not been exercised with a controller in the game. *When:* The reported run had no controller, so it does not show that a normal first trigger pull reaches gameplay and binding, or that DualSense trigger effects still respond. **Do:** Run the stated controller checks in game, including first pulls, binding and DualSense haptics, and exercise the reporter’s receiver alongside a working pad if available. **Checks:** they run again on this head (`PR description / Description follows the template (pull_request_target)` failed on the last one); a failure shows on the pull request. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in game. The reported fixture passes the receiver’s 42 ms released-then-held pattern and fails on main; the reporter has not yet run this rule with the receiver. **Other systems:** The rule applies independently to both SDL triggers on Windows and Linux and feeds the admitted values to DualSense HD haptics. Controller input, reconnects and haptics remain untested in game; Linux has only a reported syntax check. **Switches:** None. **Reviewed:** 76f7b616253d against 897d6d3fe795: Read the repository rules and pull request template, the trigger and haptics changes, the trigger test and the reported runs. Skimmed the remaining documentation and generated guide changes; did not read every changed file in full.; nothing run (a code review). **Checked and fine:** - The trigger admission state is separate for each trigger and is reset when a pad opens. - The admitted trigger values feed both button state and DualSense trigger haptics. - The fixture covers the reported receiver startup pattern and independent trigger admission. **Testing:** The reported fixture and headless boot did not exercise a physical controller. Run the current rule in game with trigger presses and binding, reconnect a controller, and check DualSense HD trigger haptics; the reporter’s receiver run would also confirm the reported setup. **Overlaps and merge order:** Not checked. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/trigger-rest 2026-11-23 15:59:34 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
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
MagicBeanDev/Longshot!2337
No description provided.