refactor(vk)!: the old menu's leftovers removed; - and = set the mouse sensitivity through the settings #2877
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2877
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:cleanup/area1-old-menu"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The Insert menu's rows moved to the system mods'
mod.tomland the TS menu mod, but the renderer and the host still carried the old C++ menu:#ifndef MENU_LAYOUT_ONLYguards around code that always built (the macro is defined nowhere), empty and write-only modules, 32Optionsfields only an applier wrote, helpers only the old rows called, option ids nothing answers,HOS_SETTING's ignored id,MkwVkHostslots no renderer code calls, andhost->versiongates that can never be false. This deletes them (area 1 of the mod-api cleanup survey, 1a and 1b together). It changes no behaviour except one bug:-and=keys did nothing. They calledrx_option_set(7, …), which only moved the renderer'sopts.mouse_sens(read by nothing); at the next readhost/nn_hid.ctook the game's value back. They now setsystem/controls'mouse_sensitivitythroughgame_setting_set, as the flight shortcut does, rounded to the setting's steps of 10 (the game refuses a value off them). A press not at the end moves at least one step (at 10 %,=gives 20 %, where 125 % would round back to 10 %). Onmain/mod-api: in play with the mouse captured, press=; Controls' Mouse sensitivity stays at 100.What went, by area:
gpu/vk/menu/: the guards;camera,motion,controller_speaker,volume,headset,autosave,detail.cpp; the write-only appliers inmenu_settings,controller,gpu,gameplay,threads,audio;apply_preset/apply_auto;output.cpp's walkers;Dlss5Preset.upscaler_rows.h's steppers and fixed-stop block,framegen_rows.hdown tofixed_top,vk_menu_hit.hdown to what the ReShade bar uses,vk_ui_theme.h's prompts, banner, paragraphs, shadows and unused palette,i18n::plural,fmt_into, the transition autosave's dead copy,resolution_auto,mods_now_ns,kMicLevelHelp,env_release;hos_reset_binding,host_guest_alloc.HOS_SETTING(field, otherwise)(49 call sites); every option id but the jitter's and the host's four notices;game/options.h.MkwVkHost:tex_layout,guest_alloc,gyro_status,nfc_dir,reset_binding,rebind_control,binding_is_default,game_settings_generation,game_setting_text,game_setting_hint(MKWVK_API_VERSION82);vk_hostfilled with designated initialisers (every member maps to the function it did); the game's exports only those named (game_settings_generation,game_setting_hint,game_camera_scale,game_movie_age).host->version >= Ngates: the renderer takes a host of its own version only (vk_main.cppinit_body), as architecture.md already said.view.tslaidOut) instead of parsing C++ rows that no longer exist.Kept, being live:
hos_rebind_control,hos_binding_is_default,hos_sdl_gyro_status,hos_nfc_dir,hos_guest_word(the game's Rust calls them);game_setting_text/_row/_get/_set(host and renderer);upscaler_rows.h's step tables (snap, Auto's tuning);Map/Hitfor the ReShade comparison bar;aspect_started;kTierResolution.Read first:
host/nn_hid.cmouse_sens_set,host/game_settings.h,gpu/vk/vk_api.h's ids,host/rx_backend.cvk_host,tests/area_settings.py,tests/vk_host_members.py.See #2822.
Testing
Tested: in the game on this PC (Linux, RTX 3090), a pack and runtime of this branch on
cb37f5ab(rebased since onto12f42db5, #2861: the conflicts were docs,layout.tsand a website test's expected order, no C/C++), under gamescope: reached play from kokiri-start; the control bridge readmouse_sensitivity100, after=130, after--80 (option get); Insert opened the menu on Graphics (menu_open: true, hostedsystem/menu). Game-free:tests/run_all.py834 passed, 3 failed;test_lifter.pyfails on mod-api@origin too,test_drs.pyandtest_stick_inversion_rest.pywere this branch's and are fixed (re-run through the queue: all three pass).cargo test/clippy -D warnings/fmt --checkonlongshot-game: pass. Windows: rendererdev compile --only rendererwith llvm-mingw: pass; host C with llvm-mingw: 79 of 80 units,host/nn_video.cfailing onlibavcodec/avcodec.hnot found (FFmpeg not on this PC's Windows tools; the file is untouched).tests/test_mouse_settings.pyrunsmouse_sens_keysover a stand-in game that refuses off-step values: it fails on mod-api@origin ("- and = hand the sensitivity to the renderer…") and on each mutation (off the steps, 70 % for-, another key, the call removed). Its ends case (10 %=gives 20 %, 20 %-gives 10 %) fails at95dcd124and passes at433d3b2b, with gcc and clang (--ccnow defaults fromCC);host/nn_hid.cat433d3b2bpasses-fsyntax-onlywith llvm-mingw and gcc. Every rewritten check was run against its mutation. Website (after the rebase):node --test97 pass, 1 fail (publication.test.ts, a fixture unrelated to this);astro buildpasses;check-site.tspasses (the Debug tab's ammunition lines reworded to name no game items).Still to test:
=/-change Mouse sensitivity (@Beanstalksmoke on Windows NVIDIA).Measurements
Nothing to measure: deletions, and a fix shown by its test above.
Risks
A renderer and host from different commits no longer start together (82), as before for any layout change. Input recordings name settings by the declarations'
legacyIds, which this does not touch (test_option_ids.pynow holds them distinct). Players notice only that-and=work, in steps of 10 %. A revert is enough.Checklist
Ready for review
mod-api; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named):test_lifter.pyfails on mod-api@origin too.main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.MKWVK_API_VERSIONbumped (MkwVkHostorMkwVkRendereringpu/vk/vk_api.hchanged).Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
Possibly related, for context:
3e9fd5f6ce45b9f6ae66Rebased onto mod-api
cb37f5ab; game run passed (RTX 3090, Linux): play reached, mouse sensitivity 100 → 130 (=) → 80 (- twice) read over the bridge, menu opened. Website drift fixed (restart column, volume and turf help).The Debug tab's ammunition lines in graphics-and-controls.md no longer name game items, so the site check passes (21 pages).
c56d4cbc0f95dcd12470Rebased onto mod-api
12f42db5(#2861): conflicts only in docs, layout.ts and a website test; light checks pass.Windows host compile (llvm-mingw, with tools.lock's FFmpeg 9.0.2 headers): every host unit compiles at this head; box ticked.
WIP: refactor(vk)!: the old menu's leftovers removed; - and = set the mouse sensitivity through the settingsto refactor(vk)!: the old menu's leftovers removed; - and = set the mouse sensitivity through the settingsRecommendation: Request changes. At the lowest sensitivity,
=rounds back to the same value, so the shortcut cannot raise it. The pull request also combines a fix with a refactor, contrary to the repository’s one-topic rule.The change removes the old renderer menu code and routes mouse-sensitivity shortcuts through the game’s settings. The cleanup reduces dead code, but the shortcut has a lower-bound regression and the change spans a large host and renderer interface.
Blocking (2): must change before merging.
host/nn_hid.c:125: Rounding the multiplicative shortcut to the nearest step can leave it at the same value even though the key asks to change it. (more on the line) Do: When a shortcut is not already at the relevant bound, ensure rounding advances at least one 10% step in the requested direction, and cover both cases in the behavioral test.host/nn_hid.c:126: The mouse shortcut fix is combined with the old-menu refactor, although the repository’s code rules require a fix and a refactor to be separate changes. (more on the line) Do: Separate the shortcut fix and the menu cleanup into focused pull requests, with the necessary ordering between them.Should fix (1): not blocking, but worth doing before merging.
tests/test_mouse_settings.py:133: The new test defaults directly togccinstead of honoringCCwhen invoked on its own. (more on the line) Do: Default--ccfromCC, with the repository’s normal compiler fallback.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
=and-change Mouse sensitivity.@fixcan do L1, L2 and L3.More: does it help, other systems, switches, what was read
Does it help: Yes, for the tested values: the reported Linux game run changed sensitivity from 100 to 130 with
=, then to 80 with two presses of-. The fix does not work at every supported value: at 10,=leaves it at 10.Other systems: The host and renderer ABI changes affect both Windows and Linux and all GPU vendors. The reported in-game run covers Linux on an RTX 3090; the Windows host and renderer compiled, but the Windows game smoke run and other Tier 1 hardware runs remain outstanding.
Switches: No switches added, changed or removed.
Reviewed:
95dcd12470against12f42db5c1: Read AGENTS.md, CONTRIBUTING.md, the PR template and standards; docs/review-checklist.md is absent. Read the commits and inspected the input fix, settings interface, selected renderer cleanup, Rust changes and website settings parser. The remaining changed files, tests, translations and generated-file implications were not all read in full, so this review is incomplete.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run project code were executed, as requested. The review relies on the author’s reported runs and the supplied CI results.
Overlaps and merge order: Not checked; network access was excluded.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as HumanBean took it out of WIP. Nothing was run; a maintainer decides.
@ -123,0 +122,4 @@replaced by it again at a later start */static void mouse_sens_set(double sens) {/* (on the setting's steps, 10 to 500 in tens: game/mods/controls/mod.toml; the game refuses a value off them) */const long percent = lround(sens * 10) * 10;L1 (blocking): Rounding the multiplicative shortcut to the nearest step can leave it at the same value even though the key asks to change it.
When: With Mouse sensitivity at its minimum of 10%,
=computes 12.5%, which rounds back to 10%; repeated presses can never increase it. At 20%,-similarly rounds 16% back to 20%.Do: When a shortcut is not already at the relevant bound, ensure rounding advances at least one 10% step in the requested direction, and cover both cases in the behavioral test.
@ -123,0 +123,4 @@static void mouse_sens_set(double sens) {/* (on the setting's steps, 10 to 500 in tens: game/mods/controls/mod.toml; the game refuses a value off them) */const long percent = lround(sens * 10) * 10;game_setting_set("mouse_sensitivity", percent < 10 ? 10 : percent > 500 ? 500 : (int)percent);L2 (blocking): The mouse shortcut fix is combined with the old-menu refactor, although the repository’s code rules require a fix and a refactor to be separate changes.
When: This pull request changes shortcut behavior while also deleting the menu modules and changing the host-renderer ABI, so neither topic can be reviewed or reverted independently.
Do: Separate the shortcut fix and the menu cleanup into focused pull requests, with the necessary ordering between them.
@ -37,2 +132,2 @@if "HOS_SETTING(mouse_sensitivity, 7, 100)" not in keys or "rx_option_set(7," not in keys:raise SystemExit("- and = do not change the menu's sensitivity")parser = argparse.ArgumentParser(description=__doc__)parser.add_argument("--cc", default="gcc")L3 (should fix): The new test defaults directly to
gccinstead of honoringCCwhen invoked on its own.When: On a supported developer setup with Clang selected through
CCand nogccexecutable, running this test directly fails before checking the fix.Do: Default
--ccfromCC, with the repository’s normal compiler fallback.L1: fixed in
433d3b2b. A press not at the end now moves at least one 10 % step (10 %=gives 20 %, 20 %-gives 10 %). The test commit2b1131e4covers both ends and fails without the fix.L2: kept together. The cleanup deletes the old renderer option path (
rx_option_settoopts.mouse_sens) that the keys called, so the keys must move togame_setting_setin the same change. A fix-only PR first would have to rewrite the same code the cleanup removes.L3: fixed,
--ccdefaults fromCC, then gcc.L4: still to test on Windows, as the description says.