refactor(menu): every Insert menu row in a feature module, built through a menu model (#1633) #1774

Merged
HumanBean merged 37 commits from dyst/Longshot:refactor/menu-model into main 2026-11-19 21:57:46 +00:00
Member

Type: refactor · Risk: medium · Tested on: Windows 11, RTX 3080 · Needs: Linux, any GPU

TL;DR

Every row of the Insert (F1) menu lived in one long table in one file, so any change to the menu touched the same lines as
every other menu change, and a renamed row could lose a player's saved setting. This PR moves each feature's rows, and the
code behind them, into a small module of its own, built through a menu model that a future in-game menu can also draw.
The menu looks and behaves as before: every tab was gone through in the game, the saved settings file kept every key, and
the game-free checks pass, with new ones for the model and the modules.

Breakdown

  • Who it helps: anyone changing or adding a menu row, and players, whose saved settings can no longer be lost to a rename.
  • What was wrong: all rows sat in one table in gpu/vk/vk_menu.cpp (59 open PRs touched that file), special cases were matched by label, and a row's saved key was made from its label.
  • What changes: each feature's rows live in their own file under gpu/vk/menu/, placed relative to other rows, with their own saved key; nothing a player sees changes.
  • What does not change: every row, its text, its order, its saved key and its default; the options file's keys; the renderer's interface.
  • How it was checked: in the game on every tab with rows changed and the options file compared (same keys and values); tests/run_all.py with no new failure; new checks for the model, the modules' order, the frozen keys and the table's room.
  • What is still open: a run on Linux and one with a controller; the menu's custom-drawn panels (Debug tools, the bindings grid, Custom output size) stay as they are until the panels' rework.
  • Risk: medium: it moves every row of the menu; a row out of place, a lost text or a lost key would show there, and the checks look for each.

Why

The Insert menu is the most-changed part of the renderer, and all of it was one table and the functions around it, so
menu PRs conflicted with each other constantly and every special row needed edits in several places, found by its label.
A row's line in longshot_options.ini was made from its label, so renaming a row silently dropped that setting from
players' files. Issue #1633 asks for the menu to be built through a model, by feature, so rows can be added in one place
and the menu can later be drawn by the game's own menu too.

Fixes #1633

What changed

The menu is described by a model (gpu/vk/menu_model.h, no ImGui or Vulkan in it) and 31 feature modules
(gpu/vk/menu/*.cpp); the ImGui menu in vk_menu.cpp draws what the model builds. vk_menu.cpp goes from 6,942 to
4,868 lines; host/ changes only in comments naming where a row is now.

  • model: gpu/vk/menu_model.h, menu_model.cpp: Setting (key, label, help, kind, value, range, choices, and hooks:
    shown, locked, text, hint, step_fn, on_change, on_activate, verb, confirm), tab/page/heading/
    section/row/custom, and placement by after/before/first/last/order, worked out once whatever order the
    modules register in.
  • modules: gpu/vk/menu/*.cpp, one feature each (display, output, upscaler, framegen, HDR, detail, GPU, audio,
    controller, camera, motion, walk, bindings, NFC, preset, session, bug report, pipeline list, debug tools, ...). A module
    takes its feature's code with it: its texts and hints, its state, its engine (output.cpp, preset.cpp,
    pipeline_list.cpp). Code that needs the renderer is under #ifndef MENU_LAYOUT_ONLY and its hooks MENU_HOOK(...),
    so the checks build every module without Vulkan; what modules ask the renderer is declared in one section of
    gpu/vk/menu_module.h.
  • gpu/vk/vk_menu.cpp: row_table builds the rows from the model (room for 256 module rows, kModuleRowsMax); a
    module's buttons, pages, sliders and locked rows are drawn and pressed generically, so the label-matched special cases
    (is_share_row, is_laptop_row, is_vibration_test_row, ...) are gone. Its own table keeps only the core's three
    section headings and the menu's custom section (bespoke_row: the Debug tools' panel, Custom output size's text
    field, the Controls row's bindings grid), which the model has as Custom; the Mods tab's list is custom code too.
  • saved keys: every saved row has its key written down (its module's .key); tests/test_menu_ini_keys.py freezes the
    100 keys players' files hold.
  • #405's Vibration, Vibration strength and Test vibration rows (merged while this was open) are the controller module's.
  • #134's Mods tab (merged while this was open) is a tab of the model with no rows: its lines are the host's, drawn and
    pressed by draw_mods and mods_tick, the menu's own code, as the Debug tools' panel is.
  • a cold review of the branch (a second agent, reading only) found these, each fixed with a check that failed before
    its fix:
    • Sharpness had stopped at 0% and 100% (every Slider held at its ends); it goes round again, as on main
      (Setting.wraps, test_menu_slider_ends);
    • gpu/vk/menu/audio.cpp includes host/audio_output_devices.h, which only re-keyed vk_menu.cpp's object: a change
      to it would have reused a stale object (nx2/build.py, test_shader_stamp_cache);
    • a tab with no row shown would divide by its row count (menu_tick, the tuning bar, debug_step;
      test_menu_empty_tab); none is empty today;
    • the row table could pass kMaxRows through headings, which take a row but no text slot (restart_slot written past
      its end), and a module row's value texts were written by the drawing and the control bridge's thread at once: the
      table stops at either limit and the buffers are thread_local (test_menu_module_slots);
    • a locked module button fell through to the bindings page on Enter: it ends the chain (test_menu_locked_button);
    • test_menu_ini_keys compared only the set of keys: it ties each key to the value its row saves, and asks ini_key to
      give a module row's own key first (a swap of two rows' keys, or that line taken out, now fails it).
  • checks: tests/menu_model_fixture.py (builds the menu from the modules, no game), test_menu_model, test_menu_modules,
    test_menu_ini_keys, test_menu_module_slots, test_menu_slider_ends, test_menu_empty_tab,
    test_menu_locked_button; the checks that read a row's fields read it from its module.
  • docs: docs/development.md, "A row of the Insert menu", says how a row is built now; AGENTS.md's two menu rules.

How a menu row is defined now

Before, a row was a positional entry in vk_menu.cpp's one table, and anything more was matched by its label elsewhere:

{TAB_GRAPHICS, "Frame generation", &opts.framegen, 0, 8, 1, tx_framegen,
 "Makes frames between the game's own, ...", hn_framegen, false, true},
...
bool is_laptop_row(const Row& r) { return !r.value && r.tab == TAB_DEBUG && !strcmp(r.name, "Set up for a weak laptop"); }

Now a feature's rows are described once, in its own module, by named fields, with their hooks and their place. A section
and its rows (gpu/vk/menu/framegen.cpp):

MENU_MODULE(framegen) {
    menu::tab("graphics")
        .heading("framegen", "Frame generation and latency", menu::after("resolution"))   // (a section, after the core's)
        .row({.key = "frame_generation",          // (its line in longshot_options.ini, frozen)
              .label = "Frame generation",
              .help = "Makes frames between the game's own, ...",
              .value = &opts.framegen,
              .lo = 0, .hi = 8,
              .preset_exempt = true,
              .text = MENU_HOOK([](int v) { return std::string(tx_framegen(v)); }),
              .hint = MENU_HOOK(hn_framegen),
              .step_fn = MENU_HOOK(framegen_step)})
        .row({.key = "frame_generation_by", ...});
}

A button whose hooks ask the renderer, fenced so the checks can build the module without Vulkan
(gpu/vk/menu/laptop.cpp, the whole module):

#ifndef MENU_LAYOUT_ONLY
#include "vk_internal.h"   // (dev: the GPU's type)
bool laptop_row() { return dev.props.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU; }
#endif

MENU_MODULE(laptop) {
    menu::tab("debug")
        .row({.key = "weak_laptop",
              .label = "Set up for a weak laptop",
              .help = "For integrated graphics with 4 CPU threads or fewer ...",
              .kind = menu::Kind::Action,
              .choices = {"Apply", "Applied"},   // (its cell's texts: the cell as wide as the widest)
              .shown = MENU_HOOK(laptop_row),
              .text = MENU_HOOK([](int) { return std::string(laptop_applied ? "Applied" : "Apply"); }),
              .on_activate = MENU_HOOK(weak_laptop_apply)}, menu::after("save_pipeline_list").order(100));
}

A new feature's rows are a new file like these: the build compiles every gpu/vk/menu/*.cpp, and nothing in
vk_menu.cpp changes. Placement is relative (after(key), before(key), first(), last(), order(n), or
.section(id) to start a section's rows), so modules don't fight over positions. The full guide is
docs/development.md, "A row of the Insert menu".

Measurements

Verdict: nothing to measure for speed: every change in menu_tick is on its open-menu paths and the row table is built once at start, so the game's frames run as on main; the in-game check is in Testing.

Flags and settings

None: no switch, menu row or ini key is added or changed (every saved row keeps its key, frozen by tests/test_menu_ini_keys.py); longshot_options.ini's lines come in another order, read by key as before.

Testing

Tested: Windows 11, NVIDIA GeForce RTX 3080, driver 621.14, a runtime packed from this branch over the base
47430e81 (dev_build.py):

  • went through every tab and page of the Insert menu, changed rows on them (Autosave on the Debug tab among them) and
    quit; longshot_options.ini before and after held the same 166 lines with the same keys and values but the rows
    changed (the line order differs: the Motion, FPS counter details and Controls pages' rows now follow the tabs' rows;
    the file is read by key);
  • the first run of the branch crashed opening the NFC tab: the table had room for 64 module rows and the modules
    describe 110, so 46 were left out and the NFC tab had none (a divide by zero in menu_tick). Fixed here with room for
    256, and tests/test_menu_module_slots.py, which fails without it;
  • the branch rebased on main @ a5fbd680 (with #405), packed and run again: the Controls tab shows Vibration, Vibration
    strength and Test vibration between Stick dead zone and Motion, Test vibration's cell says No controller with none
    connected, no menu row is left out (the log), and the options file's first save adds vibration=0 beside the keys it had.
  • rebased again on main @ 3653c9c5 (with #134's Mods tab, which moved Debug to the seventh place), packed and run: on
    the Debug tab, in its new place, the Debug tools switched on and Autosave off, and the options file saved both under their
    keys (debug_tools=1, autosave:=0), nothing else changed; no menu row left out (the log).
  • then rebased onto main @ a433db32, whose two commits since (#1778, #1747: RenHDrum packaging, NFC) touch none of
    this PR's files.
  • after a cold review's fixes (What changed), rebased on main @ 621dae50 and run again: Sharpness goes round at 100% and
    0% as on main, the other sliders stop at their ends, and the options file saved the steps (quality_preset=0, as a
    change of Sharpness gives on main); no menu row left out (the log).
  • python -I -B tests/run_all.py on Windows (llvm-mingw first on PATH), after the fixes, on main @ a433db32: 696 passed, 52 failed, 126 skipped, beside a shader preparation; main @ 3653c9c5 on the same PC: 688 passed, 51 failed. The 52: the same 51, and test_mesh_args_cleanup, which passes alone here (a timeout under the run's load). The 51: test_auto_handheld, test_bug_report_defaults, test_build_long_paths, test_capture_read_once, test_crash_dialog, test_crt_options, test_damage_debug_menu, test_dev_packs, test_discover, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_fastfp_fma, test_fma_soft, test_fpx_sticky, test_game_menu_mouse_buttons, test_guest_imported, test_high_fps_fixes, test_host_guest_writes, test_hud_layout_row, test_job_queue, test_libc_hooks, test_lift_lookups, test_linux_preflight, test_linux_pressure, test_longshot_ctl, test_make_game_cache, test_missing_nup, test_mods_list, test_pads_after_menu, test_pending_guest_import, test_pipeline_play_cache, test_prepare_cache_save, test_prepare_stall, test_present_thread, test_profiling_mode, test_psychov35_fsr3_fg, test_readback_timeout_source, test_release, test_sdiv_overflow, test_seed_reader, test_slow_frames, test_song_note_cue, test_spawn_emit, test_tested_configurations, test_upscaler_rows, test_vbytes, test_vcore_escape, test_vfpx_elem, test_walk, test_walk_key.

Not tested: Linux (no Linux PC here); Test vibration's buzz and its cell with a controller connected (no controller
here; its texts for every report the host gives are run by tests/test_vibration_menu.py); the menu on other GPUs.

Must be tested:

  • Windows or Linux, with a controller: on the Controls tab, select Test vibration and press Enter or A, expecting its
    cell to name what plays the controller (Motors, HD rumble, ...), its help line to say the same, the prompt to say Test,
    and the controller to buzz once (by hand: anyone with a controller)
  • Linux, any GPU: open the Insert menu, go through every tab, change a row on each and restart, expecting the same rows
    in the same order as on main and the changed rows kept (Test Farm: @Beanstalk linux, go through every tab of the
    Insert menu and compare with main)

Risks

What could break: a row out of place, a text lost (the translations match texts exactly) or a key lost; the checks
look for each (test_menu_modules, test_readme_menu_rows, test_menu_ini_keys, menu_texts_kept.py during the port).
A module row past the table's 256 would be left out and logged, and test_menu_module_slots fails. The table is built
tab by tab, so three listings come in another order (the Motion, FPS counter details and Controls pages' rows after the
tabs' rows): the options file's lines, the restart line's and question's names, and the control bridge's
menu_setting(index) enumeration (by key, as before, it is the same).

Turning it off: revert the PR.

Compatibility: nothing changes for a player: the same rows, texts, defaults and keys; longshot_options.ini's lines
come in another order. MKWVK_API_VERSION is unchanged (vk_api.h untouched).

Issues

Fixes #1633

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.

🤖 Generated with Claude Code

**Type:** refactor · **Risk:** medium · **Tested on:** Windows 11, RTX 3080 · **Needs:** Linux, any GPU ## TL;DR Every row of the Insert (F1) menu lived in one long table in one file, so any change to the menu touched the same lines as every other menu change, and a renamed row could lose a player's saved setting. This PR moves each feature's rows, and the code behind them, into a small module of its own, built through a menu model that a future in-game menu can also draw. The menu looks and behaves as before: every tab was gone through in the game, the saved settings file kept every key, and the game-free checks pass, with new ones for the model and the modules. ## Breakdown - **Who it helps:** anyone changing or adding a menu row, and players, whose saved settings can no longer be lost to a rename. - **What was wrong:** all rows sat in one table in `gpu/vk/vk_menu.cpp` (59 open PRs touched that file), special cases were matched by label, and a row's saved key was made from its label. - **What changes:** each feature's rows live in their own file under `gpu/vk/menu/`, placed relative to other rows, with their own saved key; nothing a player sees changes. - **What does not change:** every row, its text, its order, its saved key and its default; the options file's keys; the renderer's interface. - **How it was checked:** in the game on every tab with rows changed and the options file compared (same keys and values); `tests/run_all.py` with no new failure; new checks for the model, the modules' order, the frozen keys and the table's room. - **What is still open:** a run on Linux and one with a controller; the menu's custom-drawn panels (Debug tools, the bindings grid, Custom output size) stay as they are until the panels' rework. - **Risk:** medium: it moves every row of the menu; a row out of place, a lost text or a lost key would show there, and the checks look for each. ## Why The Insert menu is the most-changed part of the renderer, and all of it was one table and the functions around it, so menu PRs conflicted with each other constantly and every special row needed edits in several places, found by its label. A row's line in `longshot_options.ini` was made from its label, so renaming a row silently dropped that setting from players' files. Issue #1633 asks for the menu to be built through a model, by feature, so rows can be added in one place and the menu can later be drawn by the game's own menu too. Fixes #1633 ## What changed The menu is described by a model (`gpu/vk/menu_model.h`, no ImGui or Vulkan in it) and 31 feature modules (`gpu/vk/menu/*.cpp`); the ImGui menu in `vk_menu.cpp` draws what the model builds. `vk_menu.cpp` goes from 6,942 to 4,868 lines; host/ changes only in comments naming where a row is now. - model: `gpu/vk/menu_model.h`, `menu_model.cpp`: `Setting` (key, label, help, kind, value, range, choices, and hooks: `shown`, `locked`, `text`, `hint`, `step_fn`, `on_change`, `on_activate`, `verb`, `confirm`), `tab`/`page`/`heading`/ `section`/`row`/`custom`, and placement by `after`/`before`/`first`/`last`/`order`, worked out once whatever order the modules register in. - modules: `gpu/vk/menu/*.cpp`, one feature each (display, output, upscaler, framegen, HDR, detail, GPU, audio, controller, camera, motion, walk, bindings, NFC, preset, session, bug report, pipeline list, debug tools, ...). A module takes its feature's code with it: its texts and hints, its state, its engine (`output.cpp`, `preset.cpp`, `pipeline_list.cpp`). Code that needs the renderer is under `#ifndef MENU_LAYOUT_ONLY` and its hooks `MENU_HOOK(...)`, so the checks build every module without Vulkan; what modules ask the renderer is declared in one section of `gpu/vk/menu_module.h`. - `gpu/vk/vk_menu.cpp`: `row_table` builds the rows from the model (room for 256 module rows, `kModuleRowsMax`); a module's buttons, pages, sliders and locked rows are drawn and pressed generically, so the label-matched special cases (`is_share_row`, `is_laptop_row`, `is_vibration_test_row`, ...) are gone. Its own table keeps only the core's three section headings and the menu's custom section (`bespoke_row`: the Debug tools' panel, Custom output size's text field, the Controls row's bindings grid), which the model has as `Custom`; the Mods tab's list is custom code too. - saved keys: every saved row has its key written down (its module's `.key`); `tests/test_menu_ini_keys.py` freezes the 100 keys players' files hold. - #405's Vibration, Vibration strength and Test vibration rows (merged while this was open) are the controller module's. - #134's Mods tab (merged while this was open) is a tab of the model with no rows: its lines are the host's, drawn and pressed by `draw_mods` and `mods_tick`, the menu's own code, as the Debug tools' panel is. - a cold review of the branch (a second agent, reading only) found these, each fixed with a check that failed before its fix: - Sharpness had stopped at 0% and 100% (every Slider held at its ends); it goes round again, as on `main` (`Setting.wraps`, `test_menu_slider_ends`); - `gpu/vk/menu/audio.cpp` includes `host/audio_output_devices.h`, which only re-keyed `vk_menu.cpp`'s object: a change to it would have reused a stale object (`nx2/build.py`, `test_shader_stamp_cache`); - a tab with no row shown would divide by its row count (`menu_tick`, the tuning bar, `debug_step`; `test_menu_empty_tab`); none is empty today; - the row table could pass `kMaxRows` through headings, which take a row but no text slot (`restart_slot` written past its end), and a module row's value texts were written by the drawing and the control bridge's thread at once: the table stops at either limit and the buffers are `thread_local` (`test_menu_module_slots`); - a locked module button fell through to the bindings page on Enter: it ends the chain (`test_menu_locked_button`); - `test_menu_ini_keys` compared only the set of keys: it ties each key to the value its row saves, and asks `ini_key` to give a module row's own key first (a swap of two rows' keys, or that line taken out, now fails it). - checks: `tests/menu_model_fixture.py` (builds the menu from the modules, no game), `test_menu_model`, `test_menu_modules`, `test_menu_ini_keys`, `test_menu_module_slots`, `test_menu_slider_ends`, `test_menu_empty_tab`, `test_menu_locked_button`; the checks that read a row's fields read it from its module. - docs: `docs/development.md`, "A row of the Insert menu", says how a row is built now; AGENTS.md's two menu rules. ### How a menu row is defined now Before, a row was a positional entry in `vk_menu.cpp`'s one table, and anything more was matched by its label elsewhere: ```cpp {TAB_GRAPHICS, "Frame generation", &opts.framegen, 0, 8, 1, tx_framegen, "Makes frames between the game's own, ...", hn_framegen, false, true}, ... bool is_laptop_row(const Row& r) { return !r.value && r.tab == TAB_DEBUG && !strcmp(r.name, "Set up for a weak laptop"); } ``` Now a feature's rows are described once, in its own module, by named fields, with their hooks and their place. A section and its rows (`gpu/vk/menu/framegen.cpp`): ```cpp MENU_MODULE(framegen) { menu::tab("graphics") .heading("framegen", "Frame generation and latency", menu::after("resolution")) // (a section, after the core's) .row({.key = "frame_generation", // (its line in longshot_options.ini, frozen) .label = "Frame generation", .help = "Makes frames between the game's own, ...", .value = &opts.framegen, .lo = 0, .hi = 8, .preset_exempt = true, .text = MENU_HOOK([](int v) { return std::string(tx_framegen(v)); }), .hint = MENU_HOOK(hn_framegen), .step_fn = MENU_HOOK(framegen_step)}) .row({.key = "frame_generation_by", ...}); } ``` A button whose hooks ask the renderer, fenced so the checks can build the module without Vulkan (`gpu/vk/menu/laptop.cpp`, the whole module): ```cpp #ifndef MENU_LAYOUT_ONLY #include "vk_internal.h" // (dev: the GPU's type) bool laptop_row() { return dev.props.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU; } #endif MENU_MODULE(laptop) { menu::tab("debug") .row({.key = "weak_laptop", .label = "Set up for a weak laptop", .help = "For integrated graphics with 4 CPU threads or fewer ...", .kind = menu::Kind::Action, .choices = {"Apply", "Applied"}, // (its cell's texts: the cell as wide as the widest) .shown = MENU_HOOK(laptop_row), .text = MENU_HOOK([](int) { return std::string(laptop_applied ? "Applied" : "Apply"); }), .on_activate = MENU_HOOK(weak_laptop_apply)}, menu::after("save_pipeline_list").order(100)); } ``` A new feature's rows are a new file like these: the build compiles every `gpu/vk/menu/*.cpp`, and nothing in `vk_menu.cpp` changes. Placement is relative (`after(key)`, `before(key)`, `first()`, `last()`, `order(n)`, or `.section(id)` to start a section's rows), so modules don't fight over positions. The full guide is `docs/development.md`, "A row of the Insert menu". ## Measurements **Verdict:** nothing to measure for speed: every change in `menu_tick` is on its open-menu paths and the row table is built once at start, so the game's frames run as on `main`; the in-game check is in Testing. ### Flags and settings None: no switch, menu row or ini key is added or changed (every saved row keeps its key, frozen by `tests/test_menu_ini_keys.py`); `longshot_options.ini`'s lines come in another order, read by key as before. ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 3080, driver 621.14, a runtime packed from this branch over the base 47430e81 (`dev_build.py`): - went through every tab and page of the Insert menu, changed rows on them (Autosave on the Debug tab among them) and quit; `longshot_options.ini` before and after held the same 166 lines with the same keys and values but the rows changed (the line order differs: the Motion, FPS counter details and Controls pages' rows now follow the tabs' rows; the file is read by key); - the first run of the branch crashed opening the NFC tab: the table had room for 64 module rows and the modules describe 110, so 46 were left out and the NFC tab had none (a divide by zero in `menu_tick`). Fixed here with room for 256, and `tests/test_menu_module_slots.py`, which fails without it; - the branch rebased on `main` @ a5fbd680 (with #405), packed and run again: the Controls tab shows Vibration, Vibration strength and Test vibration between Stick dead zone and Motion, Test vibration's cell says No controller with none connected, no menu row is left out (the log), and the options file's first save adds `vibration=0` beside the keys it had. - rebased again on `main` @ 3653c9c5 (with #134's Mods tab, which moved Debug to the seventh place), packed and run: on the Debug tab, in its new place, the Debug tools switched on and Autosave off, and the options file saved both under their keys (`debug_tools=1`, `autosave:=0`), nothing else changed; no menu row left out (the log). - then rebased onto `main` @ a433db32, whose two commits since (#1778, #1747: RenHDrum packaging, NFC) touch none of this PR's files. - after a cold review's fixes (What changed), rebased on `main` @ 621dae50 and run again: Sharpness goes round at 100% and 0% as on `main`, the other sliders stop at their ends, and the options file saved the steps (`quality_preset=0`, as a change of Sharpness gives on `main`); no menu row left out (the log). - `python -I -B tests/run_all.py` on Windows (llvm-mingw first on PATH), after the fixes, on `main` @ a433db32: 696 passed, 52 failed, 126 skipped, beside a shader preparation; `main` @ 3653c9c5 on the same PC: 688 passed, 51 failed. The 52: the same 51, and `test_mesh_args_cleanup`, which passes alone here (a timeout under the run's load). The 51: `test_auto_handheld`, `test_bug_report_defaults`, `test_build_long_paths`, `test_capture_read_once`, `test_crash_dialog`, `test_crt_options`, `test_damage_debug_menu`, `test_dev_packs`, `test_discover`, `test_display_startup_failure`, `test_dlss_feature_size`, `test_failed_compile_keeps_objects`, `test_fastfp_fma`, `test_fma_soft`, `test_fpx_sticky`, `test_game_menu_mouse_buttons`, `test_guest_imported`, `test_high_fps_fixes`, `test_host_guest_writes`, `test_hud_layout_row`, `test_job_queue`, `test_libc_hooks`, `test_lift_lookups`, `test_linux_preflight`, `test_linux_pressure`, `test_longshot_ctl`, `test_make_game_cache`, `test_missing_nup`, `test_mods_list`, `test_pads_after_menu`, `test_pending_guest_import`, `test_pipeline_play_cache`, `test_prepare_cache_save`, `test_prepare_stall`, `test_present_thread`, `test_profiling_mode`, `test_psychov35_fsr3_fg`, `test_readback_timeout_source`, `test_release`, `test_sdiv_overflow`, `test_seed_reader`, `test_slow_frames`, `test_song_note_cue`, `test_spawn_emit`, `test_tested_configurations`, `test_upscaler_rows`, `test_vbytes`, `test_vcore_escape`, `test_vfpx_elem`, `test_walk`, `test_walk_key`. **Not tested:** Linux (no Linux PC here); Test vibration's buzz and its cell with a controller connected (no controller here; its texts for every report the host gives are run by `tests/test_vibration_menu.py`); the menu on other GPUs. **Must be tested:** - Windows or Linux, with a controller: on the Controls tab, select Test vibration and press Enter or A, expecting its cell to name what plays the controller (Motors, HD rumble, ...), its help line to say the same, the prompt to say Test, and the controller to buzz once (by hand: anyone with a controller) - Linux, any GPU: open the Insert menu, go through every tab, change a row on each and restart, expecting the same rows in the same order as on `main` and the changed rows kept (Test Farm: @Beanstalk linux, go through every tab of the Insert menu and compare with main) ## Risks **What could break:** a row out of place, a text lost (the translations match texts exactly) or a key lost; the checks look for each (`test_menu_modules`, `test_readme_menu_rows`, `test_menu_ini_keys`, `menu_texts_kept.py` during the port). A module row past the table's 256 would be left out and logged, and `test_menu_module_slots` fails. The table is built tab by tab, so three listings come in another order (the Motion, FPS counter details and Controls pages' rows after the tabs' rows): the options file's lines, the restart line's and question's names, and the control bridge's `menu_setting(index)` enumeration (by key, as before, it is the same). **Turning it off:** revert the PR. **Compatibility:** nothing changes for a player: the same rows, texts, defaults and keys; `longshot_options.ini`'s lines come in another order. `MKWVK_API_VERSION` is unchanged (`vk_api.h` untouched). ## Issues Fixes #1633 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
dyst added 25 commits 2026-11-19 18:49:19 +00:00
A row's line in longshot_options.ini (and its name over the control bridge)
was made from its label, so renaming a row moved its setting and a player's
value was lost. ini_key now takes the key from a table of every saved row's
label and key, exactly as today's keys are (98, odd ones included); a label
not in it still gets the key made from it. tests/test_menu_ini_keys.py
fails on a saved row with no entry, a stale entry, a shared key, a frozen
key gone or changed, and a new key not added on purpose. Step 1 of #1633.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Step 2 of #1633, its first half: gpu/vk/menu_model.h and .cpp, beside the menu and not used by it yet.

- A Setting describes a row once: its frozen ini key, its text ids, its value and range, and its own hooks (shown, locked,
  text, hint, step_fn, on_change, on_activate) instead of checks by pointer elsewhere.
- A module registers its own rows (MENU_MODULE, run sorted by name) on a tab or page, in sections under headings, and says
  where they go: after(key), before(key), first(), last(), order(weight), at(n). build() collects everything, then works the
  order out once: a row with an anchor goes right beside it (into its section), the rest by pin, weight, the order described
  and key, so the same build gives the same menu whatever order modules come in. place() lets one layout file override a
  module's wish.
- What build() finds wrong is diagnosed and logged: a missing anchor (the row goes to the end), a cycle (broken at its first
  item), a doubled key or host option, a saved row with no key, a page or section no module made.
- A presenter reads snapshot(page) (shown rows only, a heading only over something shown, text translated through
  set_translator) and hands input() Up/Down/Left/Right/Activate/Back; a Custom item draws itself for a presenter that can
  and shows a fallback elsewhere.

tests/test_menu_model.py compiles tests/test_menu_model.cpp with it and runs it (no game), and checks the model includes
nothing from the renderer, ImGui or Vulkan. run_all: the 69 checks that fail here fail the same on the branch before it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Step 2 of #1633, its second half. vk_menu.cpp's own rows become the core module (MENU_MODULE(core)): each tab's order
is the model's now, so a module's rows (menu_model.h) are drawn where they ask, and with no module the menu is as it was.

- `rows` is a table built the first time anything asks (never while the DLL starts, when modules in other files are
  still registering): core::rows (the table as it was, by its own text) at the same indices, so kQuitRow and the rest,
  the restart slots and the options file's order stay as they were, then the modules' rows. tab_row_count and
  tab_row_to_global walk each tab's order (row_order) instead of the table.
- A module's row has Row.setting: row_shown asks its shown(), is_slider and stops_at_ends its kind, set_row its locked(),
  step_fn and on_change, ini_key its key. Its text and hint are this file's function pointers, one pair a slot.
- A kind the menu doesn't draw yet (a button, page, line or custom item) is left out and logged.
- The model: Setting.tag (the describer's own), layout(page) (the order, shown or not).
- kTop is top_rows(), counted the first time; kRows is std::size(rows).

tests/test_menu_rows_model.py compiles the real MenuTab, Row and the rows-as-drawn block over a table of its own: with no
module each tab's order is the table's own, row for row; with one, its rows are where it asked, with their own text, hint
and key, and a button is left out and logged. The checks that compile Row or ini_key include the model's header first
(tests/menu_model_fixture.py). run_all: the 69 checks that failed before still fail, nothing else (three slow ones time
out under load and pass alone).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first feature moved out of vk_menu.cpp into a module, as #1633 plans for every one: its rows described once with the
hooks that are theirs, placed by the module itself. Nothing a player sees or saves changes.

- gpu/vk/menu/hdr.cpp: the HDR section, after the core's Screen; its five rows with the keys, labels, help, ranges,
  steps and texts they had (the texts to the character, the value texts by the same printf formats the translations
  match), and their shown hooks (the levels with HDR on, the tone mapper with Native) in place of row_shown's two lines.
  tx_hdr lives there, and the pipeline share's line still names it.
- gpu/vk/menu_module.h: what a module includes (the model and Options); nx2/build.py builds gpu/vk/menu/*.cpp with the
  renderer.
- The core's sections have ids (resolution, framegen, screen, detail, gpu, developer) for modules to place theirs by.
- vk_menu.cpp: the rows, their row_shown lines, their ini_key entries and tx_tonemap and tx_nits are gone from it.

Checks: tests/test_menu_modules.py builds every module over a stand-in for the core made from vk_menu.cpp's own text
(tests/menu_model_fixture.py) and fails on a missing anchor, a cycle or a doubled key, and checks HDR's place, rows,
shown and texts. test_readme_menu_rows.py and test_menu_sections.py read the menu as built (its order is the model's
now); test_menu_ini_keys.py, test_menu_i18n.py, test_hdr_encode.py and test_pipeline_share.py read the module's text
too. A misplaced HDR section (after Detail) fails the three that read the order. run_all: 580 passed, the 69 that failed
before fail the same, nothing else.

docs/development.md: "A row of the Insert menu", and the options file's keys as they are now; AGENTS.md: a new menu row
goes in a module.

Not yet run in the game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What a module's row needs to stand for any of vk_menu.cpp's own, before they move:

- Buttons (Kind::Action): Enter calls on_activate (unless locked), ahead of the fallback that opens the Controls page;
  the prompt says the row's verb.
- Rows that open a page (Kind::Page, opens "motion" or "fps_details"): row_opens; is_motion_row and is_fps_dev_row ask it
  first, the table's rows by name as before.
- Locked: row_fixed asks a module's row with that value (module_locked), so every place that draws or steps a row by
  row_fixed(r.value) holds a module's row too.
- A restart's value of its own (restart_value: two values that run the same, as Mono and Stereo).
- Lines and custom items are still left out and logged.

test_menu_rows_model.py: a module's button (pressed, its verb) and page row (row_opens) drawn, a line left out;
test_menu_tune.py and test_menu_text_field.py follow the prompt's and Row's new text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three more features' rows out of vk_menu.cpp's table into gpu/vk/menu/, their texts as written (the C literals copied,
not retyped: every literal vk_menu.cpp had is still in the menu's sources), their keys as players' files hold them:

- detail.cpp: the Detail section after HDR, Anisotropic filtering and Shadow resolution, with their text and hint
  functions (and their comments).
- volume.cpp: Volume (a slider, no longer in is_slider and stops_at_ends) and Mute in background, before Output device.
- fps_counter.cpp: the FPS counter's level, corner and size and the row that opens its details page (a module's page
  row now, not by name), before Menu size; the details page's version row and its twelve Dev lines.

menu_module.h: menu_text::percent ("%d%%", the translations' format) and MODULE_HINTS for the modules' hints.
set_row's cases by value (the samplers made again for Anisotropic filtering) hold for a module's row as they did.

Checks: test_fps_stats, test_audio_volume, test_oot_shadow and test_hdr_encode read the rows' modules; the menu as built
(tests/menu_model_fixture.py) compiles the modules with gpu/vk on the include path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Eight features' rows out of vk_menu.cpp's table into gpu/vk/menu/, their texts copied as written (every literal
vk_menu.cpp had is still in the menu's sources), their keys as players' files hold them, their tx_/hn_ functions with
them:

- gameplay.cpp (Game speed, Field of view, Text speed, Text size, Skip title screen, Skip opening), language.cpp (Game
  and Menu language), discord.cpp, menu_settings.cpp (Menu size; the menu's shortcut, controller button and compact key);
- controller.cpp (Controller in background, Stick dead zone, Rumble strength), camera.cpp (the mouse camera, its
  sensitivity and inversion, the camera's centering, inversion and speed), walk.cpp, motion.cpp (the row that opens the
  Motion page, and the page's six rows).

Order: a tab's moved rows sit before a row that stays (Bug report, the Controls bindings) by weight, Place::order(w) on an
anchor, so rows from several modules keep the menu's order exactly (test_readme_menu_rows and test_menu_sections read the
menu as built). The sliders are module sliders (is_slider and stops_at_ends lose their cases); Rumble strength stops at
its ends by its own stops_at_ends.

What modules ask the renderer is declared in menu_module.h's section of it (the Motion row's gyro text, the languages'
names): vk_menu.cpp defines motion_gyro_text, and tests/menu_model_fixture.py stands in for them. menu_text: the menu's
sources and the modules' rows as table lines, for the checks that read a row by its text; fourteen checks read it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Seven of the Screen section's rows out of vk_menu.cpp's table into gpu/vk/menu/, their texts as written, their keys as
players' files hold them, around Fullscreen monitor (which stays vk_menu.cpp's with its monitor list: after it by weight):

- display.cpp: Fullscreen, V-Sync, Window scaling filter. tx_vsync lives there now, and Threaded rendering still uses it
  (menu_module.h).
- crt.cpp: CRT filter and CRT lines, the lines shown with a filter on by their own shown() (row_shown's case gone).
- widescreen.cpp: Ultrawide menus and HUD layout.

What they ask the renderer goes through forwarders in vk_menu.cpp, listed in menu_module.h's section of it: the run's
V-Sync switch, whether the window needs scaling and a filter's name, whether the game presents Native HDR. row_fixed's
cases by value (the window scaling filter, HUD layout) hold for a module's row as they did. test_vsync_row reads the menu
with its modules (menu_text).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/framegen.cpp holds the Graphics tab's Frame generation and latency section whole: its heading (after Resolution
and upscaling), its five rows (Frame generation, Frame generation by, Game frame rate cap, NVIDIA Reflex, AMD Anti-Lag 2),
their texts as written and keys as players' files hold them, and their code: the texts and hints, DLSS FG's reasons, the
Frame generation by row's two flags, and the step past DLSS FG's top (set_row's before, now the row's step_fn). Reflex's and
Anti-Lag 2's rows are shown where they run by their own shown() (row_shown's two cases gone). What the rest of the menu
still uses is gpu/vk/menu/framegen.h (the pipeline share's line, set_row, row_fixed); why DLSS does not run comes through a
forwarder (menu_dlss_why_text).

A module may now hold code that needs the renderer: it is fenced with MENU_LAYOUT_ONLY and its hooks wrapped in MENU_HOOK
(menu_module.h), and tests/menu_model_fixture.py compiles every module with MENU_LAYOUT_ONLY (no Vulkan): the rows, keys,
texts, sections and order checked, the hooks not. menu_module.h includes what modules' texts commonly need (algorithm,
cstdlib, cstring, iterator), which llvm-mingw's libc++ asks for.

set_row calls a module row's step_fn for an arrow's step alone (the value one step from the row's), as the step past DLSS
FG's top was: a value set as it is, or a jump, is kept as asked (test_framegen_preset caught it).

Checks: test_framegen_preset (the row's step_fn, its key in its module), test_framegen_dlss_cap, test_framegen_by_row,
test_frame_rate_cap_step, test_pipeline_share, test_pipeline_tour, test_audio_output_menu, test_menu_sections and
test_upscaler_round_trip read the module, or the menu with its modules (menu_text, which reads a MENU_HOOK as what it
wraps).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/gpu.cpp describes the Graphics tab's last section, its heading after Detail, and the GPU device row with
its text (tx_gpu, the card names vk_main.cpp counted: fenced from a layout-only build) and hint. vk_menu.cpp keeps
the card bookkeeping (menu_set_gpu_count, the saved gpu_device_id=), which reaches the row through the table.

kCoreSections keeps the core's own sections only (resolution, screen, developer); menu_module.h says which module
owns framegen, hdr, detail and gpu. test_menu_restart and test_bug_report_defaults read the modules' rows too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/audio.cpp describes Output device, Speaker layout, Microphone, Microphone gain and Test microphone, with
what was vk_menu.cpp's for them: the host's playback devices and microphones listed, the choice kept by endpoint ID or
by name and told to the host (output_chosen and mic_chosen as the rows' on_change), Speaker layout's restart value
(Mono and Stereo one layout), Microphone gain a Slider, and Test microphone a button whose text and press are its own,
the test's state and tick with them. The host parts are fenced from a layout-only build.

vk_menu.cpp keeps the options file's device lines and the test's meter (gpu/vk/menu/audio.h), and draws a module's
button with a text of its own as its value. The module asks the renderer two things: a row's top (menu_row_top, the
lists counted again) and whether the menu is on a tab (menu_on_tab, the test's lifetime). The checks that cut the
moved code read it from the module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under Save my pipeline list, in the order they had: Frame pacing joins the frame generation module and Robust buffers
and ASTC as RGBA8 the GPU and memory module, as rows those add on the Debug tab. Threaded rendering and Present queue
are gpu/vk/menu/threads.cpp's, Descriptor reuse and Sampler cache replay_cache.cpp's (a change told to the renderer,
menu_debug_rows, through a fenced hook), and the two Intel rows intel.cpp's, with the code that decides Intel's
compiles (intel_compiler_row as their shown, intel_compiles_side_by_side, intel_quick_compute). A row a switch holds
for the run (RX_VK_PRESENT_QUEUE, RX_VK_ASTC_RGBA8, RX_VK_NO_INTEL_SERIAL) is locked by its own locked(), its line
the reason; row_shown and row_fixed lose those cases.

Save my pipeline list and Set up for a weak laptop stay vk_menu.cpp's, with the other buttons tied to its drawing.
The checks that read these rows read the modules too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The display module (gpu/vk/menu/display.cpp) has the Screen section's Fullscreen monitor row too, in the core's Screen
section, and its code: the host's monitors listed, the choice kept by its ID and name and told to the host (the row's
on_change), the row's text and hint. vk_menu.cpp keeps the options file's lines and follows the window's screen
(gpu/vk/menu/display.h). The list's refresh asks the renderer for the row's top and, new, a redraw (menu_redraw).

The microphone's comment main had left above refresh_monitors is back above mic_tell_host, in the Audio module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/nfc.cpp describes the NFC tab: the tag row, Tap tag, Remove tag and Scan tag on controller, with what was
vk_menu.cpp's for them: the tags of the player's folder (listed by the host, the choice kept within the list), what a
tap or a removal did, the scan and what it says. The three buttons are Actions with their verbs (Tap, Remove, Scan)
and their lines as their hints. vk_menu.cpp lists the tags again when the menu opens and asks each tick whether a scan
moved (gpu/vk/menu/nfc.h); it shows a module button's own hint under its help, in place of the NFC rows' special cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/upscaler.cpp describes the Upscaler, DLSS model, DLAA before the bloom, Render resolution and Sharpness
rows (after Profile, in Resolution and upscaling), with their texts and hints, the switches that hold two of them for
the run (RX_VK_DLSS_PRESET, RX_VK_DLSS_PRE_BLOOM), and row_shown's and row_fixed's cases for them as the rows' own
shown() and locked() (the reason: the row's line). Sharpness is a Slider.

What runs stays the renderer's: upscaler(), upscalers_available() and game_size() are out of vk_menu.cpp's anonymous
namespace, declared in menu_module.h's "what modules ask the renderer"; the Render resolution's Native size is
game_size at the whole output, without vk_menu.cpp's Out. tx_upscaler, tx_resolution and dlss_preset_env are the
module's, used again by the pipeline share's line and the bug report (gpu/vk/menu/upscaler.h). set_row's cases for
these rows stay (by value: they follow a module's row too). vk_menu.cpp's tx_percent, unused now, goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/output.cpp has the output engine that was vk_menu.cpp's, as it was: the screen's sizes and display modes,
the Output resolution's choices (the game's own, the sizes offered, the player's own, those found while running), the
shapes and the Aspect ratio's values, the picture each choice makes, the size shown and the 3D's size at a share of it
(game_size, the upscaler rows'). With it the Aspect ratio, Output resolution and Profile rows, their texts and hints;
Custom output size, a text field, stays vk_menu.cpp's between them. The engine is fenced from a layout-only build;
gpu/vk/menu/output.h is what the options file, the bug report, the pipeline share, the window followed between
screens and the upscaler module use of it.

The checks that compiled a span of the engine from vk_menu.cpp take it from the module through one helper,
tests/menu_model_fixture.py output_engine; test_menu_restart reads a row's restart flag as its field.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/preset.cpp describes the Graphics tab's first row, the Quality preset, with its text and hint, and has the
engine that was vk_menu.cpp's: the rows each preset sets (apply_preset), Auto (this PC) (apply_auto, the profile chosen
for this PC and the tuning measured in play), fenced from a layout-only build. gpu/vk/menu/preset.h is what vk_menu.cpp
uses of it: menu_init and menu_auto_for_gpu, save, menu_auto_tune, the bug report, Set up for a weak laptop and
set_row's preset case (by value, where it was). env_release, which a preset asks, is out of vk_menu.cpp's anonymous
namespace; its breaks out of it are marked at both ends, and tests/menu_model_fixture.py unbroken takes them out of a
span a check compiles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/bindings.cpp describes the Controls page's Layout preset and Button prompts rows, with their texts and
hints, and the engine the Layout preset applies: can_bind, the Switch pad's own buttons, apply_pad_layout and
detect_pad_layout. set_row's case for the row is its own step_fn (round the four presets; Custom shown only) and
on_change (the preset bound, then the row read back). The bindings grid, the Controls row that opens the page, the
options file's pad_/key_ lines and prompts_at_once stay vk_menu.cpp's (gpu/vk/menu/bindings.h).

vk_menu.cpp's hint_in and MENU_HINTS had these rows for their last users: every table hint is a module's now
(menu_module.h's MODULE_HINTS); test_audio_output_menu has a MENU_HINTS of its own for the hints it compiles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
menu_model.h's Setting has confirm: an Action that asks for a second Activate before it acts ("Press again to
confirm"; Esc or B cancels). gpu/vk/menu/session.cpp describes Restart and Quit with it, after Bug report, their
Activate the menu's own (menu_restart_game, menu_quit_game: vk_menu.cpp's, after its save and the pipeline cache's,
as before). vk_menu.cpp no longer finds them by their place in its table (kRestartRow, kQuitRow): a row confirms when
its setting says so, and Bug report is the table's last row (kBugReportRow).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/bug_report.cpp describes the Gameplay tab's Bug report, before Restart and Quit: its value cell (how the
last report went), its line under the help (where it was saved, or why not), its verb Save and its press. The report
is gathered from the whole menu, so bug_report_save stays vk_menu.cpp's, out of its anonymous namespace (menu_module.h).

vk_menu.cpp's cases for the row by its place (kBugReportRow) are a module button's own now: its text, hint, verb and
on_activate; the help's height takes every line a module button can say (hint(0, k)), the Bug report's longest saved
one as before. The rows placed before it take its key, bug_report.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/pipeline_list.cpp is Save my pipeline list with its engine (the zip, the report, the clipboard, the issue
opened on a worker: what was vk_menu.cpp's), first in the Developer section; it asks the menu for this build's version
(menu_version: nx2/build.py gives LONGSHOT_VERSION to vk_menu.cpp alone). gpu/vk/menu/laptop.cpp is Set up for a weak
laptop, shown on integrated graphics, its action vk_menu.cpp's weak_laptop_apply (out of its anonymous namespace).

vk_menu.cpp's cases for the two by their names are a module button's own now: its cell's texts (choices) size the
Debug tab's cell, its text draws it, its hint is its line (measured for the help's height), its verb Save, its press
on_activate. The rows placed after Save my pipeline list take its key, save_pipeline_list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu/vk/menu/debug_tools.cpp describes the Debug tab's switch, Autosave and Damage taken, where the table had them (the
tools' panel lays them out: draw_debug_rows). vk_menu.cpp's table is left with the core's section headings and the
ImGui menu's custom section: the rows it draws and presses with its own code until the panels' rework (the Debug
tools' panel, Custom output size's text field, the Controls row's bindings grid). The core module gives the model
those as menu::Kind::Custom (bespoke_row), their label a fallback for another presenter.

Every saved row is a module's, its key its own: ini_key's table of labels, empty now, goes, and the checks that read
it read none when there is none. The 99 keys players' files hold are the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
vk_menu.cpp's row table takes at most kModuleRowsMax (64) rows from the modules; with every row a module's there are
110, and the 46 past it were left out: the NFC tab had none, and opening it divided by zero in menu_tick and took the
game down. The check builds the menu as the fixture does and counts its items past vk_menu.cpp's own rows against the
limit. Fails here: 114 against 64.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With every row a module's the modules describe 110 rows and headings; the table took 64 and left the rest out, the NFC
tab with none (opening it divided by zero in menu_tick: the game crashed), Controls without its motion, walk and
menu-key rows, Debug without its developer rows. tests/test_menu_module_slots.py keeps the menu within the slots.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(menu): how a menu row is built now that every row is a module's (#1633)
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
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 21s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 30s
CI / Workflow lint (actionlint) (pull_request) Successful in 33s
Third-party parts / As their notes say (pull_request) Successful in 39s
PR description / Description follows the template (pull_request_target) Successful in 20s
98ab32f327
The development guide's "A row of the Insert menu" as the menu stands: every row a module's, a new feature a new file
of gpu/vk/menu/, the kinds the menu draws (buttons and pages too), the MENU_LAYOUT_ONLY fence and MENU_HOOK, what
modules ask the renderer, the 256 slots, the custom section left in vk_menu.cpp, and the fixture's helpers for a check.
The options file's keys and AGENTS.md's two menu rules without ini_key's label table, which is gone.

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

Tested in game: Windows 11, NVIDIA RTX 3080, driver 621.14, a runtime packed from this branch: went through every tab and page of the Insert menu, changed rows and quit; longshot_options.ini kept the same 166 keys and values except the rows changed. Rebased on a5fbd680 (with #405): the Controls tab's Vibration, Vibration strength and Test vibration rows in main's order, Test vibration's cell No controller with none connected, no menu row left out.

Tested in game: Windows 11, NVIDIA RTX 3080, driver 621.14, a runtime packed from this branch: went through every tab and page of the Insert menu, changed rows and quit; longshot_options.ini kept the same 166 keys and values except the rows changed. Rebased on a5fbd680 (with #405): the Controls tab's Vibration, Vibration strength and Test vibration rows in main's order, Test vibration's cell No controller with none connected, no menu row left out.
Author
Member

Description: added How a menu row is defined now under What changed: a row as the old table had it, then the same kind of rows as a module describes them (a section with its rows, and a button whose hooks ask the renderer, fenced for the game-free build). No code change.

Description: added *How a menu row is defined now* under What changed: a row as the old table had it, then the same kind of rows as a module describes them (a section with its rows, and a button whose hooks ask the renderer, fenced for the game-free build). No code change.
dyst force-pushed refactor/menu-model from 98ab32f327
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
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 21s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 30s
CI / Workflow lint (actionlint) (pull_request) Successful in 33s
Third-party parts / As their notes say (pull_request) Successful in 39s
PR description / Description follows the template (pull_request_target) Successful in 20s
to 7198ef3ecc
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 22s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 35s
CI / Workflow lint (actionlint) (pull_request) Successful in 37s
Third-party parts / As their notes say (pull_request) Successful in 43s
PR description / Description follows the template (pull_request_target) Successful in 20s
2026-11-19 19:34:50 +00:00
Compare
Author
Member

Rebased onto main a433db32, over #134's Mods tab (7198ef3e).

  • The Mods tab is a tab of the model with no rows: its list stays draw_mods/mods_tick, the menu's own code. The model's tab ids, the fixture's and test_menu_sections' page lists now have mods in its place (they had six tabs: Mods would have been called debug, every later page one off); each fix is in the commit that made the list.
  • Checks on 3653c9c5: 694 passed, 50 failed; main on the same PC fails the same 50 (and test_prepare_stall, under load).
  • In game (Windows, RTX 3080): the Debug tab in its new place saved its rows under their keys; no menu row left out. #1778 and #1747, since, touch none of this PR's files.
Rebased onto main a433db32, over #134's Mods tab (7198ef3e). - The Mods tab is a tab of the model with no rows: its list stays draw_mods/mods_tick, the menu's own code. The model's tab ids, the fixture's and test_menu_sections' page lists now have mods in its place (they had six tabs: Mods would have been called debug, every later page one off); each fix is in the commit that made the list. - Checks on 3653c9c5: 694 passed, 50 failed; main on the same PC fails the same 50 (and test_prepare_stall, under load). - In game (Windows, RTX 3080): the Debug tab in its new place saved its rows under their keys; no menu row left out. #1778 and #1747, since, touch none of this PR's files.
HumanBean approved these changes 2026-11-19 19:36:49 +00:00
Dismissed
dyst force-pushed refactor/menu-model from 7198ef3ecc
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 22s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 35s
CI / Workflow lint (actionlint) (pull_request) Successful in 37s
Third-party parts / As their notes say (pull_request) Successful in 43s
PR description / Description follows the template (pull_request_target) Successful in 20s
to 144ba4dcc7
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 22s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 33s
CI / Workflow lint (actionlint) (pull_request) Successful in 35s
Third-party parts / As their notes say (pull_request) Successful in 39s
PR description / Description follows the template (pull_request_target) Successful in 19s
2026-11-19 21:50:47 +00:00
Compare
dyst dismissed HumanBean's review 2026-11-19 21:50:47 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Author
Member

A cold review of the branch (a second agent, reading only) found six problems; each is fixed now with a check that failed before its fix (144ba4dc, on main 621dae50):

  • Sharpness had stopped at 0% and 100% (the model holds every Slider at its ends); it goes round again as on main: Setting.wraps, test_menu_slider_ends. Run in game: it wraps, the other sliders stop.
  • gpu/vk/menu/audio.cpp includes host/audio_output_devices.h, which re-keyed only vk_menu.cpp's object: nx2/build.py now re-keys both (test_shader_stamp_cache).
  • A tab with no row shown would divide by its row count in menu_tick, the tuning bar and debug_step: guarded (test_menu_empty_tab). No tab is empty today.
  • The row table could pass kMaxRows through headings (restart_slot written past its end), and a module row's value texts were written by the drawing and the control bridge's threads at once: the table stops at either limit, the buffers are thread_local (test_menu_module_slots).
  • A locked module button fell through to the bindings page on Enter: it ends the chain (test_menu_locked_button).
  • test_menu_ini_keys compared only the set of keys; it ties each key to the value its row saves and asks ini_key to give a module row's own key first. Swapping Invert camera X and Y's keys, or taking that line out, now fails it.
    Checks: 696 passed, 52 failed: main's 51, and test_mesh_args_cleanup, which passes alone (a timeout under load). Three listings come in another order (the options file's lines, the restart line's names, menu_setting(index)): in Risks.
A cold review of the branch (a second agent, reading only) found six problems; each is fixed now with a check that failed before its fix (144ba4dc, on main 621dae50): - Sharpness had stopped at 0% and 100% (the model holds every Slider at its ends); it goes round again as on main: Setting.wraps, test_menu_slider_ends. Run in game: it wraps, the other sliders stop. - gpu/vk/menu/audio.cpp includes host/audio_output_devices.h, which re-keyed only vk_menu.cpp's object: nx2/build.py now re-keys both (test_shader_stamp_cache). - A tab with no row shown would divide by its row count in menu_tick, the tuning bar and debug_step: guarded (test_menu_empty_tab). No tab is empty today. - The row table could pass kMaxRows through headings (restart_slot written past its end), and a module row's value texts were written by the drawing and the control bridge's threads at once: the table stops at either limit, the buffers are thread_local (test_menu_module_slots). - A locked module button fell through to the bindings page on Enter: it ends the chain (test_menu_locked_button). - test_menu_ini_keys compared only the set of keys; it ties each key to the value its row saves and asks ini_key to give a module row's own key first. Swapping Invert camera X and Y's keys, or taking that line out, now fails it. Checks: 696 passed, 52 failed: main's 51, and test_mesh_args_cleanup, which passes alone (a timeout under load). Three listings come in another order (the options file's lines, the restart line's names, menu_setting(index)): in Risks.
dyst changed title from WIP: refactor(menu): every Insert menu row in a feature module, built through a menu model (#1633) to refactor(menu): every Insert menu row in a feature module, built through a menu model (#1633) 2026-11-19 21:55:06 +00:00
Author
Member

Ready for review. The checklist's box for host code on both platforms is taken out at the maintainer's word: the menu's modules are no platform's code (no host or renderer API of Windows or Linux in them). A Linux run is still in Must be tested, for the menu as players see it.

Ready for review. The checklist's box for host code on both platforms is taken out at the maintainer's word: the menu's modules are no platform's code (no host or renderer API of Windows or Linux in them). A Linux run is still in Must be tested, for the menu as players see it.
HumanBean deleted branch refactor/menu-model 2026-11-19 21:57:46 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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!1774
No description provided.