feat(console): a Quake-style Debug tools console that drops from the top of the screen, over one command registry #1641

Open
mooki wants to merge 18 commits from mooki/Longshot:feat/console into main
Member

Type: feat · Risk: medium · Tested on: Linux (Arch, kernel 7.2.15): game-free checks and one windowless game run on an RTX 4090, with pictures · Needs: Windows, any GPU, a real controller

Stacked on #1351 (head 3a191e809, !pos X Y Z, on main 430eef4f2): its commit is the base of this branch. Review only the 17 commits above it: the command registry (8), the console's font and drop-down (9). If #1351 changes in review, this branch is rebased onto its new head.

TL;DR

The live input file's ! lines had no answer, and no command could be typed in the game. This PR puts one command registry behind the file (an answer for every line in the log, a 10 s deadline on a request Link never takes, handlers for pos, age, teleport, time, give, take, items, status) and adds a Quake-style console on it: with Debug tools on, the key above Tab drops a monospace console from the top of the screen in 200 ms, with Tab completion, history, a controller's picker and the last lines left at the top after it closes. Game-free tests, mutation runs and one windowless run (pictures below) show it working.

Breakdown

  • Who it helps: testers, bug triage and the automated test player, who get an answer for each line and one table that says what a build can do; and anyone with Debug tools on, who can type pos, mark, give Item_Bomb 5 or help in the game and read the answer.
  • What was wrong: each live-file command was its own strncmp and parser, with no answer and no deadline; the Debug tab's rows had no name; nothing in the game took a typed line.
  • What changes: the live reader hands every ! line to host/console.c, which checks it against a table (gpu/vk/console_schema.h) and either runs it or queues a request that Link's update takes and answers by ticket. The console is a second door on the same registry: a plate that slides down from the top edge, an output, a ] line, Tab, history, scrolling, notify lines, a picker for a controller.
  • What does not change: the lines the test player parses (hid: live command at ..., cheats: ...), the Debug tab's actions, the bridge, saves and options; nothing opens without Debug tools; the Insert menu works as before and the console gives it the screen.
  • How it was checked: a golden test of 138 live-file polls, the registry's gate matrix, ThreadSanitizer and ASan/UBSan, mutation runs of the registry, the handlers, the console's model, drawing, wiring and picker (below), the Windows-target syntax check, the whole suite against main's, and one windowless run of this exact head.
  • What is still open: Windows execution, a real controller, a real window, overlay (needs #1358), the bridge's own console command (the bridge has none yet: the run opens the console with the menu script's key), the co-op room hook (the room refusal is checked game-free only).
  • Risk: medium: the live reader and the Debug tab's path take the registry; menu_tick polls two more keys and the console takes the game's input while it is open; MKWVK_API_VERSION goes from 33 to 34, the number #1408 (head f08b5eece) also takes, so whichever of the two lands second renumbers.

Why

A tester or a script that writes !pos, !cheat 122 or !shots 500 into the live file gets no answer but a log line, cannot ask what exists, and loses lines (two !cheat lines in one 30 ms poll keep only the last; a line sent at the title fires when play starts, minutes later). Each new command added a parser of its own. The registry puts one table and one queue behind the file; the handlers are the rows testers asked for first (where Link is, his age, the clock to the minute, items by name, the state of a run); and the console is the way to use them by hand in the game, the way Quake's console is. The design (the drop-down, the monospace face, the open questions and their defaults) is in the developer console report.

What changed

Three parts, in this order.

The registry (4f7cb68a4 to 818ce6ff4): test(input) pins every ! line of the live file (138 polls) before anything moves; gpu/vk/console_core.h and console_schema.h are the table, the tokenizer, the argument checks, help, completion and the room gate; host/console.c is the queue with tickets (32 waiting, a request Link does not take within 10 s is withdrawn), the log line (console: live: !pos 1 2 3 -> ok: returned to 1.00 2.00 3.00) and the three doors (the live file, the console, the bridge's later console); docs/console.md lists the table.

The handlers (50e207e00 to 3e605b5d0): pos, age and teleport read when called with no argument; time reads and sets H[:MM], noon, midnight; give, take and items change the Inventory page's items by name; status. Link's update samples what the reads answer from twice a second (oot_console_sample); the Windows-target drivers build.

The console (nine commits from 948b15912):

  • Font: third_party/fonts/libertinus/LibertinusMono-Regular.ttf (Libertinus 7.051, the release the folder already has; the zip's sha256 is checked against PROVENANCE.md and OFL.txt is the one in the folder), nx2/ui_fonts.py, gpu/vk/vk_imgui.cpp. Its own commit.
  • Model: gpu/vk/console_ui.h (slide, line, history, Tab, scrolled output, notify lines, the picker's lists) and console_layout.h (the frame, the plate from the bottom up, the notify strip); no drawing and no game in them.
  • Drawing: gpu/vk/console_draw.h (the draw calls on a sink), vk_console.cpp (the ImGui sink, called from menu_record and menu_record_image after the FPS counter, so the open console covers the HUD).
  • Registry link: MKWVK_API_VERSION 34 with MkwVkHost.console_run, console_result, console_name, console_feed, console_room; host/console.c keeps the other doors' lines (8 a second, 32 held; the bridge's and the live file's lines show in the output and the notify strip) and answers the maps' names; gpu/vk/console_pump.h is the console's half.
  • Input: menu_tick polls two more keys (the one above Tab, and L) and hands the console its presses, text, pointer and pad; menu_is_open() includes the console, so the host drops the game's input while it is open; the Debug tab's Developer rows get Console, Console height and Notify time (con_height, con_notifytime). The switches are read-only in this version (get and set are not rows of the table yet).
  • The picker: a controller gets Recent and Suggested lists in the plate; a description longer than its box is cut with ... and the chosen one shows its whole text on up to two lines under the choices (the last commit).
  • Test aids and docs: RX_VK_MENU_SCRIPT takes CONSOLE, TAB, PGUP and the like, RX_VK_MENU_SCRIPT_GO=<file> starts its clock when a file exists, the console's clock is 1/60 s a tick during a headless burst of shots; docs/console.md, the README's rows.

Measurements

Verdict: no speed is claimed. With Debug tools off the closed console does nothing per frame (the console's tick returns before it touches the model); with Debug tools on it costs a few nanoseconds a frame (timed in isolation, below); closed, with no slide running and no notify line alive, it draws nothing (a test pins the empty call list).

Hardware: Linux (Arch, kernel 7.2.15); the closed frame on the host's CPU, the slides on an NVIDIA RTX 4090 with the headless renderer (no window), one run.
Scene: the closed frame in isolation: Pump::poll, Console::tick and the draw side's wants_frame test with the registry's real feed and room calls from host/console.c, 20 million frames, the best of five runs, on a machine at load 30 (other work running). The slides: the field of a library save (a child Link in the grass), 1280x720, FPS counter on, Debug tools on; Console height Half, Third, Full, then Half with a controller's picker.
Method: the closed frame is timed in isolation, not in the game: a paired in-game run is not part of this PR. The slides are measured from the pixels of a burst of shots (a shot of every present, the console's clock fixed at 1/60 s a tick, so the frames repeat exactly): the gold line's bottom edge on ticks 1 to 11 of every slide in and out (px at 720p), against the eased-out formula at that tick's time within 1 ms (the clock counts whole milliseconds), 2 px of slack; the first slides on the real clock, from the log.
How to reproduce: Debug tools on (HOS_OOT_CHEATS=1), a library save, RX_VK_SHOT_MENU=1, RX_VK_SHOT_GO=<file>, RX_VK_MENU_SCRIPT_GO=<file> and RX_VK_MENU_SCRIPT=1:CONSOLE,2.6:CONSOLE,5:CONSOLE,... (the keys are listed in docs/development.md), touch the files, read the gold line's row in the shots.

What Before: main @ c507b98c8 After: this PR @ 84532af32
One frame of the closed console, Debug tools on (poll, tick, wants_frame) no console 6.5 ns for the poll, 9.7 ns in all
One frame of the closed console, Debug tools off no console the tick returns at its first test (not timed)
Slide in, real clock, 43 presents a second no console 9 ticks, 203 ms
Slide out, real clock no console 8 ticks, 220 ms
Half (360 px): the gold line's bottom edge, ticks 1 to 11 in, then out no console 84 150 208 254 288 315 334 346 354 358 360, then the same
Third (240 px), in, then out no console 53 100 139 168 192 210 222 231 236 239 240, then the same
Full (720 px), in, then out no console 168 308 416 508 580 630 669 694 709 717 720, then 168 301 416 508 576 630 669 693 709 717 720
Half again (the picker), in, then out no console 84 150 208 254 288 315 334 346 354 358 360, then 80 150 208 252 288 315 333 346 354 358 360
Readings outside the formula's window no console 0 of 88 (4 slides in, 4 out, 11 ticks each)

The real-clock lengths are the design's 200 ms plus the tick that sees the slide finished (at 43 presents a second a tick is 23 ms, so 9 ticks; at 60 an earlier run of this stack measured 12 ticks, 216 ms).

Flags and settings

This PR adds one environment switch to the registry (HOS_CONSOLE_ROOM), two options (con_height, con_notifytime) and one test switch (RX_VK_MENU_SCRIPT_GO), and RX_VK_SHOT_GO now also fixes the console's clock during a headless burst of shots.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
HOS_CONSOLE_ROOM=allow lets the live input file and (later) the bridge run world commands (the clock, the save) in a co-op room does not exist unset: world commands are refused in a room at every door the co-op runner's proof drivers use the clock and item grants in rooms untested: this build has no co-op code, so no game is ever in a room; the override is tested with a stand-in room unset for everyone; the co-op runner sets it
con_height (Debug tab, Developer: Console height) The open console's height: Third, Half, Full none Half how much of the picture it covers Third, Half and Full tried in the picture run Half
con_notifytime (Developer: Notify time) How long the last lines stay at the top with the console closed: Off, 3, 5, 8 s none 5 s the strip at the top edge 5 s in the picture run 5 s
RX_VK_MENU_SCRIPT_GO=<file> The menu script's clock starts when the file exists none unset test runs only used by the picture run not for players
RX_VK_SHOT_GO=<file> A headless burst of shots of every present starts when the file exists; now the console's clock is 1/60 s a tick while it does shots only shots, and the console's fixed clock pictures that repeat exactly used by the picture run not for players

Testing

Tested: Linux (Arch, kernel 7.2.15), game-free unless said:

  1. The registry and handlers: python -I -B tests/test_console_registry.py (the table, the tokenizer, the checks, the gate's 1,584 lines over every row, door, Debug tools and room state, each handler's cases), tests/test_console_legacy_lines.py (the golden test of 138 live-file polls), tests/test_console_queue.py (ThreadSanitizer with a sampler thread writing while the reads run, then ASan and UBSan; the feed and the names).
  2. The console: python -I -B tests/test_console_ui.py runs three programs with 416 checks (the model and layout: slide timing and reversal, the line, the history file, wrapping, scrolling, notify clocks, Tab, the picker, two_lines and the layout's rows, a sweep of over 1,000 window, size, height, pad and scroll cases; the draw calls on a fake sink; the registry link against a fake host); tests/test_console_wiring.py reads the wiring from the source (the keys, the Debug tools gate, host signals, drawing order, rows, history file, host calls, font); the menu tests that read menu_tick (test_menu_keys.py, test_menu_text_field.py, test_fps_overlay_order.py) and two fixtures that cut ini_key() out of the menu (test_audio_output_menu.py, test_stick_dead_zone.py) are brought to the new code, none removed.
  3. Mutation runs, each mutant one deliberate break of one line made in a copy of the tree, which a test must fail: the registry and handlers, 114 mutants (63 of the registry, 35 of the handlers, 16 of the count store and the !shots answer), all killed; the 58 of them in host/console.c, the one registry file this branch added code to (the feed and the names), re-run on this head: 58 killed, 0 survived; the other 56 are in files this branch does not change and are carried from the registry's runs. The console: 155 mutants of the model, layout and drawing (console_ui.h, console_layout.h, console_draw.h, console_pump.h), 34 of the picker's cut and whole-text lines, 34 of the wiring: all 223 killed, re-run on this head.
  4. The defect the first game runs of the handlers found, as a test first, and its fix (give and take read the counts through rx_option, which the Vulkan back end answers 0 for): the registry keeps its own copy of the counts, tests/console_host_test.c stands in for the getter as the back end answers it.
  5. Each commit alone, in a scratch worktree: the console's, the registry's and the menu fixtures that read the code it touches (test_console_ui, test_console_registry, test_console_queue, test_console_legacy_lines, test_console_wiring, test_console_docs, test_menu_keys, test_menu_text_field, test_fps_overlay_order, test_audio_output_menu, test_stick_dead_zone, test_pos_handoff; one that does not exist yet is skipped): all 17 commits above #1351 pass at their own commit. The two fixtures that cut ini_key() out of the menu are in the commit that adds the keys they name; before that they failed in three commits. Under a load of 60 the threaded test_console_queue and test_pos_handoff timed out once each and pass when run alone.
  6. Windows-target syntax: the Windows-target fixture check judged the registry, console and menu fixtures (PASS); test_console_queue.py declares itself Linux-only (the sanitizers); the model, drawing, pump and registry-host programs were compiled by hand for the mingw target against its libc++ (all four OK); two older menu fixtures this PR touched for their stub options (test_audio_output_menu.py, test_stick_dead_zone.py) stop at the Windows CRT's deprecation warnings under -Werror in their own fopen and getenv calls and in two headers' getenv and sscanf (the same lines are on main). Windows execution is not tested.
  7. The whole suite, python -I -B tests/run_all.py --strict, 4 at once: this branch 728 passed, 42 failed, 17 skipped; forge main (c507b98c8) 725 passed, 46 failed, 17 skipped. Every one of this branch's 42 failures also fails on main (main fails four more under the same load: test_bug_report, test_crash_groups, test_hardware_report, test_prepare_cache_save), so none is this branch's; the console, registry and menu tests all pass. The 42: test_bug_report_defaults, test_capture_readback_visibility, test_cpu_report, test_crash_record (a 10 s wait for a child on a loaded machine; passes alone), test_crt_options, test_damage_debug_menu, test_dev_packs, test_display_startup_failure, test_dlss_feature_size, test_draw_stream_visibility, test_failed_compile_keeps_objects, test_fsr_image_retirement, test_fsr_uniform_ownership, test_guest_imported, test_hud_layout_row, test_invalidate_quick, test_invalidate_vcore, test_libc_hooks, test_linux_preflight, test_linux_pressure, test_linux_update, test_log_open_failure, test_mirror_budget, test_missing_nup, test_mods_size_table, test_nonuniform_image_arrays, test_parallel_init_order, test_pending_guest_import, test_pipeline_play_cache, test_present_source_crop, test_present_thread, test_profiling_mode, test_psychov35_fsr3_fg, test_readback_timeout_source, test_replay_write_order, test_run_all_changed, test_slow_frames, test_staging_burst, test_switch_table, test_upscaler_rows, test_vk_occlusion_queries, test_walk_key. The suite ran on the head before the last history change (the same tree).

The picture run: one windowless run in the side lane, run caf8a3d9df5d03e6edb2a6793a875c27 of the exact head of this branch, 84532af32 (the game's first log line is longshot v3.0.0-rc.7-99-g84532af32 (source 9ab32666); RTX 4090, 1280x720, a library save in the field, Debug tools on, the FPS counter on; the machine was at load 45 to 65, so the game ran at about 43 presents a second before the script, not 60). The control bridge has no console command yet, so the menu script's CONSOLE key opens the console and the bridge sets the Console height and the FPS counter. The script opened and closed the console at Half, Third, Full and Half again (the controller's picker) and typed help, items bomb, give Item_Bomb 5, take Item_Bomb 5, status, pos 1 2 (a usage error), Tab and PgUp; the live file ran !mark, !status and !pos 1 2 with the console closed. The log has each answer (console: ui: give Item_Bomb 5 -> ok: inventory Item_Bomb +5 (had 0, now 0, event status 2), take, items bomb, status). exit=0 fatal=0 crash=0 devlost=0 nocore=0 kernel=0 nvrm=0 journal=complete, no kmemsysDoCacheOp or NVRM: Xid line in the journal, 1724 shots. An earlier run of this stack, before its last commit, showed help cutting the give row in two mid-word (world comm / and [world]: the output kept lines of 160 bytes, the row is 175); that commit fixes it, test first, and this run shows it fixed (Full). The same tree ran before the last history change (the fixtures' commit folded into the input commit) with the same pictures. Each picture below is a shot of the real rendering, read against the design's four mockups.

the console closed, the FPS counter on (the first shot of the burst)
tick 6 of 12 of the slide in (100 ms): the plate half way down, the gold line at 315 px (the formula says 315.0), the opening line and ) already in it
Half: give and take answered, status, pos 1 2 and its usage error, the command list from Tab, te typed; the game runs below the plate
Full (90 % opaque): help twice; the long give row wraps on a second row at a blank; the FPS counter and hearts under the plate
scrolled back by PgUp: the row of ^ above the ) line, teleport  completed by Tab
the controller's picker inside the plate: Recent (LB) and Suggested (RB), help chosen with its description cut with ..., its whole text on two lines under the lists, the button row at the bottom
console closed: the live file's !mark and !status answers in the top strip (27 % to 78 % of the width), left of the FPS counter
Third (240 px): the output in the smaller plate

Known differences from the mockups: none that matter: the plate colour, the gold line, the ] line and caret, the monospace output, the version, the ^ row, the picker's boxes and chips and the notify strip match. Two things the mockups do not show: a Suggested description longer than its box is cut with ... (the registry's help strings are full sentences) and the chosen one's whole text sits on two lines under the lists (a later request); and the notify strip's oldest line was not caught fading (the shot is 3 s after the lines).

Not testable by hand: nothing.

Not tested: Windows execution (the key is the layout's on Windows), a real controller, a real window, ultrawide in the game, the Debug tab rows' look in the game (only their source and the tests), the room refusal in a real co-op room, a bomb count changing through give and take (the small bag starts full once unlocked).

Must be tested:

  • Windows, any GPU: open the console with the key above Tab with Debug tools on, type help, press Tab, scroll with PgUp, close with Esc, expecting a plate that drops in about 200 ms, the answer in the output, no Insert menu opening when Esc closes it, and the key being the one above Tab on this layout (by hand).
  • A real controller on any PC: Debug tab, Developer, Console, expecting the console to open with Recent and Suggested lists, a long description cut with ..., the chosen one whole under the lists, A to run the chosen line and B to close (by hand, or the Test Farm).
  • Linux, an AMD GPU: a windowless run with HOS_INPUT_LIVE=<file> appending !give Item_BombBag_Small, then !take Item_BombBag_Small and !time 19:30, expecting ok answers in the log and the clock set (by hand, the log).

Risks

What could break: the live reader and oot_update_player_cheats are the path of every test-player line and of the Debug tab's actions, so a mistake there would stop !cheat or !pos (the old lines are pinned by the golden test; the update itself runs only in the game). A script that relied on the old reader's looseness (!dumpfoo, !cheat 3x, extra arguments) now gets usage in the log. menu_tick polls two more keys and the console takes the game's input while open (the host's "a menu is open" signal): a wrong state there would leave the game without input, and the pictures show it closing. MKWVK_API_VERSION is 34 and is numbered last on merge. The sample taken twice a second inside Link's update is about ten guest reads, read from the code, not measured.

Turning it off: Debug tools off closes the console and nothing else uses it; or revert the commits (the registry's first, then the handlers, then the console, in reverse).

Compatibility: one more file in the player's folder, longshot_console_history.txt, written only while Debug tools is on; two new options-file keys; a font file (153,992 bytes) in the build; the shader and pipeline caches are not touched (the translator's stamp does not change: test_shader_stamp_inputs.py passes). Nothing else changes for a player: the live file only a test run sets up.

Cost: the closed console costs nothing with Debug tools off and 6.5 to 9.7 ns a frame with it on (the registry's feed and room calls and the model's tick, timed in isolation: Measurements); it draws nothing while closed with no notify line alive; the sample in Link's update is about ten guest reads twice a second (read from the code, not timed). A paired in-game run was not made; the console adds one font file (153,992 bytes) to the build and, while open, the draw calls of one plate.

Issues

None found that this fixes (the tracker was searched for #1351, #1358, #1408 and #1411, which become rows of the table).

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.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • MKWVK_API_VERSION bumped (gpu/vk/vk_api.h's MkwVkHost or MkwVkRenderer changed).
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Docs updated.

New on this forge; not opened on GitHub.

**Type:** feat · **Risk:** medium · **Tested on:** Linux (Arch, kernel 7.2.15): game-free checks and one windowless game run on an RTX 4090, with pictures · **Needs:** Windows, any GPU, a real controller **Stacked on #1351** (head `3a191e809`, `!pos X Y Z`, on main `430eef4f2`): its commit is the base of this branch. Review only the 17 commits above it: the command registry (8), the console's font and drop-down (9). If #1351 changes in review, this branch is rebased onto its new head. ## TL;DR The live input file's `!` lines had no answer, and no command could be typed in the game. This PR puts one command registry behind the file (an answer for every line in the log, a 10 s deadline on a request Link never takes, handlers for `pos`, `age`, `teleport`, `time`, `give`, `take`, `items`, `status`) and adds a Quake-style console on it: with Debug tools on, the key above Tab drops a monospace console from the top of the screen in 200 ms, with Tab completion, history, a controller's picker and the last lines left at the top after it closes. Game-free tests, mutation runs and one windowless run (pictures below) show it working. ## Breakdown - **Who it helps:** testers, bug triage and the automated test player, who get an answer for each line and one table that says what a build can do; and anyone with Debug tools on, who can type `pos`, `mark`, `give Item_Bomb 5` or `help` in the game and read the answer. - **What was wrong:** each live-file command was its own `strncmp` and parser, with no answer and no deadline; the Debug tab's rows had no name; nothing in the game took a typed line. - **What changes:** the live reader hands every `!` line to `host/console.c`, which checks it against a table (`gpu/vk/console_schema.h`) and either runs it or queues a request that Link's update takes and answers by ticket. The console is a second door on the same registry: a plate that slides down from the top edge, an output, a `]` line, Tab, history, scrolling, notify lines, a picker for a controller. - **What does not change:** the lines the test player parses (`hid: live command at ...`, `cheats: ...`), the Debug tab's actions, the bridge, saves and options; nothing opens without Debug tools; the Insert menu works as before and the console gives it the screen. - **How it was checked:** a golden test of 138 live-file polls, the registry's gate matrix, ThreadSanitizer and ASan/UBSan, mutation runs of the registry, the handlers, the console's model, drawing, wiring and picker (below), the Windows-target syntax check, the whole suite against main's, and one windowless run of this exact head. - **What is still open:** Windows execution, a real controller, a real window, `overlay` (needs #1358), the bridge's own `console` command (the bridge has none yet: the run opens the console with the menu script's key), the co-op room hook (the room refusal is checked game-free only). - **Risk:** medium: the live reader and the Debug tab's path take the registry; `menu_tick` polls two more keys and the console takes the game's input while it is open; `MKWVK_API_VERSION` goes from 33 to 34, the number #1408 (head `f08b5eece`) also takes, so whichever of the two lands second renumbers. ## Why A tester or a script that writes `!pos`, `!cheat 122` or `!shots 500` into the live file gets no answer but a log line, cannot ask what exists, and loses lines (two `!cheat` lines in one 30 ms poll keep only the last; a line sent at the title fires when play starts, minutes later). Each new command added a parser of its own. The registry puts one table and one queue behind the file; the handlers are the rows testers asked for first (where Link is, his age, the clock to the minute, items by name, the state of a run); and the console is the way to use them by hand in the game, the way Quake's console is. The design (the drop-down, the monospace face, the open questions and their defaults) is in the developer console report. ## What changed Three parts, in this order. **The registry** (`4f7cb68a4` to `818ce6ff4`): `test(input)` pins every `!` line of the live file (138 polls) before anything moves; `gpu/vk/console_core.h` and `console_schema.h` are the table, the tokenizer, the argument checks, `help`, completion and the room gate; `host/console.c` is the queue with tickets (32 waiting, a request Link does not take within 10 s is withdrawn), the log line (`console: live: !pos 1 2 3 -> ok: returned to 1.00 2.00 3.00`) and the three doors (the live file, the console, the bridge's later `console`); `docs/console.md` lists the table. **The handlers** (`50e207e00` to `3e605b5d0`): `pos`, `age` and `teleport` read when called with no argument; `time` reads and sets H[:MM], `noon`, `midnight`; `give`, `take` and `items` change the Inventory page's items by name; `status`. Link's update samples what the reads answer from twice a second (`oot_console_sample`); the Windows-target drivers build. **The console** (nine commits from `948b15912`): - Font: `third_party/fonts/libertinus/LibertinusMono-Regular.ttf` (Libertinus 7.051, the release the folder already has; the zip's sha256 is checked against `PROVENANCE.md` and `OFL.txt` is the one in the folder), `nx2/ui_fonts.py`, `gpu/vk/vk_imgui.cpp`. Its own commit. - Model: `gpu/vk/console_ui.h` (slide, line, history, Tab, scrolled output, notify lines, the picker's lists) and `console_layout.h` (the frame, the plate from the bottom up, the notify strip); no drawing and no game in them. - Drawing: `gpu/vk/console_draw.h` (the draw calls on a sink), `vk_console.cpp` (the ImGui sink, called from `menu_record` and `menu_record_image` after the FPS counter, so the open console covers the HUD). - Registry link: `MKWVK_API_VERSION` 34 with `MkwVkHost.console_run`, `console_result`, `console_name`, `console_feed`, `console_room`; `host/console.c` keeps the other doors' lines (8 a second, 32 held; the bridge's and the live file's lines show in the output and the notify strip) and answers the maps' names; `gpu/vk/console_pump.h` is the console's half. - Input: `menu_tick` polls two more keys (the one above Tab, and L) and hands the console its presses, text, pointer and pad; `menu_is_open()` includes the console, so the host drops the game's input while it is open; the Debug tab's Developer rows get Console, Console height and Notify time (`con_height`, `con_notifytime`). The switches are read-only in this version (`get` and `set` are not rows of the table yet). - The picker: a controller gets Recent and Suggested lists in the plate; a description longer than its box is cut with `...` and the chosen one shows its whole text on up to two lines under the choices (the last commit). - Test aids and docs: `RX_VK_MENU_SCRIPT` takes `CONSOLE`, `TAB`, `PGUP` and the like, `RX_VK_MENU_SCRIPT_GO=<file>` starts its clock when a file exists, the console's clock is 1/60 s a tick during a headless burst of shots; `docs/console.md`, the README's rows. ## Measurements **Verdict:** no speed is claimed. With Debug tools off the closed console does nothing per frame (the console's tick returns before it touches the model); with Debug tools on it costs a few nanoseconds a frame (timed in isolation, below); closed, with no slide running and no notify line alive, it draws nothing (a test pins the empty call list). Hardware: Linux (Arch, kernel 7.2.15); the closed frame on the host's CPU, the slides on an NVIDIA RTX 4090 with the headless renderer (no window), one run. Scene: the closed frame in isolation: `Pump::poll`, `Console::tick` and the draw side's `wants_frame` test with the registry's real feed and room calls from `host/console.c`, 20 million frames, the best of five runs, on a machine at load 30 (other work running). The slides: the field of a library save (a child Link in the grass), 1280x720, FPS counter on, Debug tools on; Console height Half, Third, Full, then Half with a controller's picker. Method: the closed frame is timed in isolation, not in the game: a paired in-game run is not part of this PR. The slides are measured from the pixels of a burst of shots (a shot of every present, the console's clock fixed at 1/60 s a tick, so the frames repeat exactly): the gold line's bottom edge on ticks 1 to 11 of every slide in and out (px at 720p), against the eased-out formula at that tick's time within 1 ms (the clock counts whole milliseconds), 2 px of slack; the first slides on the real clock, from the log. How to reproduce: Debug tools on (`HOS_OOT_CHEATS=1`), a library save, `RX_VK_SHOT_MENU=1`, `RX_VK_SHOT_GO=<file>`, `RX_VK_MENU_SCRIPT_GO=<file>` and `RX_VK_MENU_SCRIPT=1:CONSOLE,2.6:CONSOLE,5:CONSOLE,...` (the keys are listed in `docs/development.md`), touch the files, read the gold line's row in the shots. | What | Before: main @ c507b98c8 | After: this PR @ 84532af32 | |---|---|---| | One frame of the closed console, Debug tools on (poll, tick, `wants_frame`) | no console | 6.5 ns for the poll, 9.7 ns in all | | One frame of the closed console, Debug tools off | no console | the tick returns at its first test (not timed) | | Slide in, real clock, 43 presents a second | no console | 9 ticks, 203 ms | | Slide out, real clock | no console | 8 ticks, 220 ms | | Half (360 px): the gold line's bottom edge, ticks 1 to 11 in, then out | no console | 84 150 208 254 288 315 334 346 354 358 360, then the same | | Third (240 px), in, then out | no console | 53 100 139 168 192 210 222 231 236 239 240, then the same | | Full (720 px), in, then out | no console | 168 308 416 508 580 630 669 694 709 717 720, then 168 301 416 508 576 630 669 693 709 717 720 | | Half again (the picker), in, then out | no console | 84 150 208 254 288 315 334 346 354 358 360, then 80 150 208 252 288 315 333 346 354 358 360 | | Readings outside the formula's window | no console | 0 of 88 (4 slides in, 4 out, 11 ticks each) | The real-clock lengths are the design's 200 ms plus the tick that sees the slide finished (at 43 presents a second a tick is 23 ms, so 9 ticks; at 60 an earlier run of this stack measured 12 ticks, 216 ms). ### Flags and settings This PR adds one environment switch to the registry (`HOS_CONSOLE_ROOM`), two options (`con_height`, `con_notifytime`) and one test switch (`RX_VK_MENU_SCRIPT_GO`), and `RX_VK_SHOT_GO` now also fixes the console's clock during a headless burst of shots. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `HOS_CONSOLE_ROOM=allow` | lets the live input file and (later) the bridge run world commands (the clock, the save) in a co-op room | does not exist | unset: world commands are refused in a room at every door | the co-op runner's proof drivers use the clock and item grants in rooms | untested: this build has no co-op code, so no game is ever in a room; the override is tested with a stand-in room | unset for everyone; the co-op runner sets it | | `con_height` (Debug tab, Developer: Console height) | The open console's height: Third, Half, Full | none | Half | how much of the picture it covers | Third, Half and Full tried in the picture run | Half | | `con_notifytime` (Developer: Notify time) | How long the last lines stay at the top with the console closed: Off, 3, 5, 8 s | none | 5 s | the strip at the top edge | 5 s in the picture run | 5 s | | `RX_VK_MENU_SCRIPT_GO=<file>` | The menu script's clock starts when the file exists | none | unset | test runs only | used by the picture run | not for players | | `RX_VK_SHOT_GO=<file>` | A headless burst of shots of every present starts when the file exists; now the console's clock is 1/60 s a tick while it does | shots only | shots, and the console's fixed clock | pictures that repeat exactly | used by the picture run | not for players | ## Testing **Tested:** Linux (Arch, kernel 7.2.15), game-free unless said: 1. The registry and handlers: `python -I -B tests/test_console_registry.py` (the table, the tokenizer, the checks, the gate's 1,584 lines over every row, door, Debug tools and room state, each handler's cases), `tests/test_console_legacy_lines.py` (the golden test of 138 live-file polls), `tests/test_console_queue.py` (ThreadSanitizer with a sampler thread writing while the reads run, then ASan and UBSan; the feed and the names). 2. The console: `python -I -B tests/test_console_ui.py` runs three programs with 416 checks (the model and layout: slide timing and reversal, the line, the history file, wrapping, scrolling, notify clocks, Tab, the picker, `two_lines` and the layout's rows, a sweep of over 1,000 window, size, height, pad and scroll cases; the draw calls on a fake sink; the registry link against a fake host); `tests/test_console_wiring.py` reads the wiring from the source (the keys, the Debug tools gate, host signals, drawing order, rows, history file, host calls, font); the menu tests that read `menu_tick` (`test_menu_keys.py`, `test_menu_text_field.py`, `test_fps_overlay_order.py`) and two fixtures that cut `ini_key()` out of the menu (`test_audio_output_menu.py`, `test_stick_dead_zone.py`) are brought to the new code, none removed. 3. Mutation runs, each mutant one deliberate break of one line made in a copy of the tree, which a test must fail: the registry and handlers, 114 mutants (63 of the registry, 35 of the handlers, 16 of the count store and the `!shots` answer), all killed; the 58 of them in `host/console.c`, the one registry file this branch added code to (the feed and the names), re-run on this head: 58 killed, 0 survived; the other 56 are in files this branch does not change and are carried from the registry's runs. The console: 155 mutants of the model, layout and drawing (`console_ui.h`, `console_layout.h`, `console_draw.h`, `console_pump.h`), 34 of the picker's cut and whole-text lines, 34 of the wiring: all 223 killed, re-run on this head. 4. The defect the first game runs of the handlers found, as a test first, and its fix (`give` and `take` read the counts through `rx_option`, which the Vulkan back end answers 0 for): the registry keeps its own copy of the counts, `tests/console_host_test.c` stands in for the getter as the back end answers it. 5. Each commit alone, in a scratch worktree: the console's, the registry's and the menu fixtures that read the code it touches (`test_console_ui`, `test_console_registry`, `test_console_queue`, `test_console_legacy_lines`, `test_console_wiring`, `test_console_docs`, `test_menu_keys`, `test_menu_text_field`, `test_fps_overlay_order`, `test_audio_output_menu`, `test_stick_dead_zone`, `test_pos_handoff`; one that does not exist yet is skipped): all 17 commits above #1351 pass at their own commit. The two fixtures that cut `ini_key()` out of the menu are in the commit that adds the keys they name; before that they failed in three commits. Under a load of 60 the threaded `test_console_queue` and `test_pos_handoff` timed out once each and pass when run alone. 6. Windows-target syntax: the Windows-target fixture check judged the registry, console and menu fixtures (PASS); `test_console_queue.py` declares itself Linux-only (the sanitizers); the model, drawing, pump and registry-host programs were compiled by hand for the mingw target against its libc++ (all four OK); two older menu fixtures this PR touched for their stub options (`test_audio_output_menu.py`, `test_stick_dead_zone.py`) stop at the Windows CRT's deprecation warnings under `-Werror` in their own `fopen` and `getenv` calls and in two headers' `getenv` and `sscanf` (the same lines are on main). Windows execution is not tested. 7. The whole suite, `python -I -B tests/run_all.py --strict`, 4 at once: this branch 728 passed, 42 failed, 17 skipped; forge main (`c507b98c8`) 725 passed, 46 failed, 17 skipped. Every one of this branch's 42 failures also fails on main (main fails four more under the same load: `test_bug_report`, `test_crash_groups`, `test_hardware_report`, `test_prepare_cache_save`), so none is this branch's; the console, registry and menu tests all pass. The 42: `test_bug_report_defaults`, `test_capture_readback_visibility`, `test_cpu_report`, `test_crash_record` (a 10 s wait for a child on a loaded machine; passes alone), `test_crt_options`, `test_damage_debug_menu`, `test_dev_packs`, `test_display_startup_failure`, `test_dlss_feature_size`, `test_draw_stream_visibility`, `test_failed_compile_keeps_objects`, `test_fsr_image_retirement`, `test_fsr_uniform_ownership`, `test_guest_imported`, `test_hud_layout_row`, `test_invalidate_quick`, `test_invalidate_vcore`, `test_libc_hooks`, `test_linux_preflight`, `test_linux_pressure`, `test_linux_update`, `test_log_open_failure`, `test_mirror_budget`, `test_missing_nup`, `test_mods_size_table`, `test_nonuniform_image_arrays`, `test_parallel_init_order`, `test_pending_guest_import`, `test_pipeline_play_cache`, `test_present_source_crop`, `test_present_thread`, `test_profiling_mode`, `test_psychov35_fsr3_fg`, `test_readback_timeout_source`, `test_replay_write_order`, `test_run_all_changed`, `test_slow_frames`, `test_staging_burst`, `test_switch_table`, `test_upscaler_rows`, `test_vk_occlusion_queries`, `test_walk_key`. The suite ran on the head before the last history change (the same tree). **The picture run:** one windowless run in the side lane, run `caf8a3d9df5d03e6edb2a6793a875c27` of the exact head of this branch, `84532af32` (the game's first log line is `longshot v3.0.0-rc.7-99-g84532af32 (source 9ab32666)`; RTX 4090, 1280x720, a library save in the field, Debug tools on, the FPS counter on; the machine was at load 45 to 65, so the game ran at about 43 presents a second before the script, not 60). The control bridge has no `console` command yet, so the menu script's `CONSOLE` key opens the console and the bridge sets the Console height and the FPS counter. The script opened and closed the console at Half, Third, Full and Half again (the controller's picker) and typed `help`, `items bomb`, `give Item_Bomb 5`, `take Item_Bomb 5`, `status`, `pos 1 2` (a usage error), Tab and PgUp; the live file ran `!mark`, `!status` and `!pos 1 2` with the console closed. The log has each answer (`console: ui: give Item_Bomb 5 -> ok: inventory Item_Bomb +5 (had 0, now 0, event status 2)`, `take`, `items bomb`, `status`). `exit=0 fatal=0 crash=0 devlost=0 nocore=0 kernel=0 nvrm=0 journal=complete`, no `kmemsysDoCacheOp` or `NVRM: Xid` line in the journal, 1724 shots. An earlier run of this stack, before its last commit, showed `help` cutting the `give` row in two mid-word (`world comm` / `and [world]`: the output kept lines of 160 bytes, the row is 175); that commit fixes it, test first, and this run shows it fixed (Full). The same tree ran before the last history change (the fixtures' commit folded into the input commit) with the same pictures. Each picture below is a shot of the real rendering, read against the design's four mockups. ![the console closed, the FPS counter on (the first shot of the burst)](https://git.magicbean.dev/attachments/b34770c7-55b9-41a0-831d-82d8114f4620) ![tick 6 of 12 of the slide in (100 ms): the plate half way down, the gold line at 315 px (the formula says 315.0), the opening line and `)` already in it](https://git.magicbean.dev/attachments/909f6bb0-5812-4633-a438-0cb42a6d6b8b) ![Half: `give` and `take` answered, `status`, `pos 1 2` and its usage error, the command list from Tab, `te` typed; the game runs below the plate](https://git.magicbean.dev/attachments/68ed7256-c1f3-40c7-b9d2-506798b2dd0e) ![Full (90 % opaque): `help` twice; the long `give` row wraps on a second row at a blank; the FPS counter and hearts under the plate](https://git.magicbean.dev/attachments/eb6f813f-bf8c-4166-8815-75193effd6b8) ![scrolled back by PgUp: the row of `^` above the `)` line, `teleport ` completed by Tab](https://git.magicbean.dev/attachments/dffae47b-e69a-4c2d-8a71-a5e2af2bc65a) ![the controller's picker inside the plate: Recent (LB) and Suggested (RB), `help` chosen with its description cut with `...`, its whole text on two lines under the lists, the button row at the bottom](https://git.magicbean.dev/attachments/33dd192d-42fc-4a49-b977-bfeaedff4a56) ![console closed: the live file's `!mark` and `!status` answers in the top strip (27 % to 78 % of the width), left of the FPS counter](https://git.magicbean.dev/attachments/c51b7482-d848-48c0-986d-495a77f1e43e) ![Third (240 px): the output in the smaller plate](https://git.magicbean.dev/attachments/648271c7-4aee-4bc6-a45e-300408117e71) **Known differences from the mockups:** none that matter: the plate colour, the gold line, the `]` line and caret, the monospace output, the version, the `^` row, the picker's boxes and chips and the notify strip match. Two things the mockups do not show: a Suggested description longer than its box is cut with `...` (the registry's help strings are full sentences) and the chosen one's whole text sits on two lines under the lists (a later request); and the notify strip's oldest line was not caught fading (the shot is 3 s after the lines). **Not testable by hand:** nothing. **Not tested:** Windows execution (the key is the layout's on Windows), a real controller, a real window, ultrawide in the game, the Debug tab rows' look in the game (only their source and the tests), the room refusal in a real co-op room, a bomb count changing through `give` and `take` (the small bag starts full once unlocked). **Must be tested:** - Windows, any GPU: open the console with the key above Tab with Debug tools on, type `help`, press Tab, scroll with PgUp, close with Esc, expecting a plate that drops in about 200 ms, the answer in the output, no Insert menu opening when Esc closes it, and the key being the one above Tab on this layout (by hand). - A real controller on any PC: Debug tab, Developer, Console, expecting the console to open with Recent and Suggested lists, a long description cut with `...`, the chosen one whole under the lists, A to run the chosen line and B to close (by hand, or the Test Farm). - Linux, an AMD GPU: a windowless run with `HOS_INPUT_LIVE=<file>` appending `!give Item_BombBag_Small`, then `!take Item_BombBag_Small` and `!time 19:30`, expecting `ok` answers in the log and the clock set (by hand, the log). ## Risks **What could break:** the live reader and `oot_update_player_cheats` are the path of every test-player line and of the Debug tab's actions, so a mistake there would stop `!cheat` or `!pos` (the old lines are pinned by the golden test; the update itself runs only in the game). A script that relied on the old reader's looseness (`!dumpfoo`, `!cheat 3x`, extra arguments) now gets `usage` in the log. `menu_tick` polls two more keys and the console takes the game's input while open (the host's "a menu is open" signal): a wrong state there would leave the game without input, and the pictures show it closing. `MKWVK_API_VERSION` is 34 and is numbered last on merge. The sample taken twice a second inside Link's update is about ten guest reads, read from the code, not measured. **Turning it off:** Debug tools off closes the console and nothing else uses it; or revert the commits (the registry's first, then the handlers, then the console, in reverse). **Compatibility:** one more file in the player's folder, `longshot_console_history.txt`, written only while Debug tools is on; two new options-file keys; a font file (153,992 bytes) in the build; the shader and pipeline caches are not touched (the translator's stamp does not change: `test_shader_stamp_inputs.py` passes). Nothing else changes for a player: the live file only a test run sets up. **Cost:** the closed console costs nothing with Debug tools off and 6.5 to 9.7 ns a frame with it on (the registry's feed and room calls and the model's tick, timed in isolation: Measurements); it draws nothing while closed with no notify line alive; the sample in Link's update is about ten guest reads twice a second (read from the code, not timed). A paired in-game run was not made; the console adds one font file (153,992 bytes) to the build and, while open, the draw calls of one plate. ## Issues None found that this fixes (the tracker was searched for #1351, #1358, #1408 and #1411, which become rows of the table). ## Checklist ### Everyone - [x] One topic. - [x] 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). - [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. - [ ] Rebased on current `main`. - [ ] `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. - [ ] `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] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] `MKWVK_API_VERSION` bumped (`gpu/vk/vk_api.h`'s `MkwVkHost` or `MkwVkRenderer` changed). - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] Docs updated. --- New on this forge; not opened on GitHub.
feat(input): "!pos X Y Z" in the live input puts Link at a position in the map he is in
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
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 14s
PR description / Description follows the template (pull_request_target) Successful in 17s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by mooki (reviewed)
beanstalk/any 0/1 pass, 1 running, 0 queued
3a191e8094
A test run or a bug report that gives coordinates could only be followed by walking there, or by a teleport that
lands at the map's entrance. "!pos X Y Z" in HOS_INPUT_LIVE's file asks the host to put Link at that position
(metres, the frame of the control bridge's pos) by the Debug tab's Return to mark path: the asked position becomes the
mark and the return runs at Link's next update, so the log says "cheats: returned to X Y Z" and the game's own
position change moves him. Only exactly three finite numbers are taken (blanks, tabs and a CRLF line end around them
are fine); any other line is ignored, and a refused "!pos" line says so in the log ("hid: !pos takes exactly X Y Z
(three finite numbers, metres): line ignored"), so a test run sees why nothing moved. It needs neither HOS_OOT_CHEATS
nor the Debug tools row. It is a line of the live input file, not a switch: no new HOS_ name is read, so
gpu/vk/switches.def has nothing to add (HOS_INPUT_LIVE is its row already).

What is not in it: Link's facing and the camera's angles. They were tried as optional extra numbers on the same line
and run in the game: the position held, the facing did not (the game works out his heading again at his next update,
so the turn did not stay) and the camera could not be set (the camera object the host's hook is given has no view to
read). Rather than ship them half working, a line with more than three numbers is refused, and the position is the
whole command. The command was called "!place" while this change was open; that name is not read.

nn_hid.c reads the line (host/nn_hid.c, beside "!cheat"): parse_pos takes strtof's numbers one by one and stores
nothing unless all three are finite, each ends at a blank or the line's end, and nothing follows them. hos_main.c's
oot_update_player_cheats takes the ask as the return to mark's action when no other action is waiting.

tests/input_background_test.c, tests/test_input_background.py: the live-pos case runs the real read_input against a
live file. A good line stores its three numbers and asks once (blanks, tabs, a CRLF, exponents). It refuses, stores
nothing and, for a "!pos" line, logs the refusal for: 0, 1, 2, 4, 5, 6 and 7 numbers, nan, inf, -inf, an overflowing
number, letters, text after the numbers, "1 2 3,4", two numbers glued together ("1-2 3", "4 5.5.5"); another command's
name ("!posx", "!position", "!pos1 2 3") and the old name "!place 1 2 3" are neither acted on nor logged as a refused
"!pos". A refused line does not stop the next good one. It fails on main (the ask is never set).

docs/development.md: the HOS_INPUT_LIVE row.

Handoff (review of the first head): the reader (a game thread) and Link's update (another) shared three volatile floats and a flag
raised with a release store, and Link's update cleared the flag first and copied the floats after, so a second "!pos" line read in
between could leave X from one request with Y and Z from the next (and was a data race). The request now crosses as one value: one
spin lock around "write the numbers and raise the flag" (hos_oot_pos_ask) and around "copy the numbers and clear the flag" (oot_pos_take),
the guest call made from Link's update's local copy after the lock is released. tests/test_pos_handoff.py compiles that section of
host/hos_main.c alone: of two requests the later is taken whole, and a producer publishing (k, k, k) against a consumer taking shows no
torn tuple in 3,000,000 requests; the old protocol (flag first, copy after) shown by the same driver tears, and so does a mutant of
the real code with the lock taken out (3,161 torn tuples). tests/input_background_test.c checks one hand-over per good line.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Stacked on #1351 (head 4e577d399, "!pos X Y Z").

tests/test_console_legacy_lines.py cuts the live reader (host/nn_hid.c live_input and its helpers) out of the source and runs 138
polls of the live file through it with every effect spied: the renderer's calls (!dump, !shots, !rdoc, !flasharm), the Controls
page's (!bind), the prompts row, the NVN sync log, and what Link's update would take from the request the reader leaves for it
(!cheat <n>, !pos X Y Z). The Debug tab's action table is written out once in the fixture (tests/console_legacy_lines_test.c) in
words, so the same table of lines can check any reader put behind the file. The log line each "!" line makes, and the refusal line
of a wrong "!pos", are compared too.

It passes on #1351's head as it is, with no registry code: it is the safety net for the change that follows. Thirteen mutants of the
reader (an off-by-one action, a dropped name check, four numbers taken, a removed log line, a dropped range, a removed command...) all
fail it.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Stacked on #1351 (head 4e577d399, "!pos X Y Z"); nothing uses it yet.

gpu/vk/console_schema.h is one table of commands, data only (no function pointers): a row per form of a command, with its arguments,
what it may touch (read, local or world: what a co-op room's sync would carry), what has to be so for it to run, whether a Go to
friend journey refuses it, and the live-file line it replaces. gpu/vk/console_core.h is plain C, header only, and compiles as C
and as C++, so the host and the renderer can include the same code: the tokenizer (an optional "!", a name, words, quotes, #
comments, 255 bytes and 16 arguments), the number and argument checks (decimal numbers only: nan, inf, hexadecimal and overflow are
refused), usage and help text built from the table, the table as JSON, completion (command names, a choice's words, names from a data
source), a hint for the line being typed, the status names with the control bridge's error codes, and the gate.

The gate is one function: the console needs Debug tools; a world command is refused in a co-op room unless the live file or the bridge
was told so by the environment (never the console); a position writer is refused while a Go to friend journey runs.

tests/console_registry_test.c runs the core as C and as C++ (tokenizer cases, 40 number cases, argument checks over a table of its
own with two forms of one name, help, completion, the hint). tests/test_console_registry.py compares the gate's 288 combinations
with the rules written again in Python, and the table printed as JSON with the design's.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Stacked on #1351 (head 4e577d399, "!pos X Y Z"): it replaces #1351's lock-protected hand-off with the registry's queue and moves
its "!pos" parser into the registry. The golden test of the previous commit passes before and after.

The live input file's "!" lines were a chain of strncmp calls in host/nn_hid.c, each command its own parser, with no answer but a
log line, a prefix match (!dumpfoo did !dump), an atoi that read "3x" as 3, one integer that kept only the last "!cheat" of a 30 ms
poll, and a request that waited for Link's update with no deadline (a "!cheat" sent at the title fired when play started).

Now the reader hands every "!" line to the registry (host/console.c), which parses it with the shared core, checks it against the
command table and the room gate, and runs its handler: the host's own old lines (!bind, !prompts, !shots, !rdoc, !dump, !synclog,
!flasharm) at once, and what has to happen in the game as a request in one queue of 32 with tickets. Link's update takes the oldest
request at each update (host/hos_main.c oot_update_player_cheats, through host/oot_console.c, which says what each request is as the
update runs it) and answers it by its ticket; the log line "console: live: <line> -> <status>: <what came of it>" is written when it
ends. A request not taken in 10 s is withdrawn (timeout), one taken and not answered in 10 s fails, answers are kept 30 s.

Commands: help, pos X Y Z, mark, return, teleport INDEX|MAP (tp), age child|adult|toggle, and the old "!cheat N" decoded to the
request its number stands for (so the clock, the pouch and the Inventory page are world commands the room gate sees; a position
writer is refused while a Go to friend journey runs). The room gate refuses world commands in a co-op room at every door unless the
environment says HOS_CONSOLE_ROOM=allow (the co-op runner's drivers use them); main has no co-op code, so hos_console_room() answers
"no room" until the co-op hook fills it in. HOS_CONSOLE_ROOM is read from the environment only: longshot_env.txt cannot set it.

The old lines the test player parses stay byte for byte: "hid: live command at ...", "hid: !pos takes exactly X Y Z ...", "cheats:
returned to ...", "cheats: marked position ...", "cheats: inventory ...", "cheats: teleport ...". What changes on purpose (listed
in tests/test_console_legacy_lines.py and docs/console.md): lines in one poll all run in order; a request is withdrawn after 10 s;
exact command words and numbers; case does not matter; a tab separates words; hexadecimal numbers are not numbers.

Tests: the golden table (138 polls) runs against the new reader and registry as it did against the old chain, with 21 listed
differences; tests/test_console_registry.py runs the registry as the host builds it (every command and its request, tickets, queue
order and bound, withdrawal, one log line per line, the gate's 1,152 combinations, every Debug tab action number from -50 to past
the Inventory page's last as the request and action number it decodes to); tests/test_console_queue.py runs it under
ThreadSanitizer and ASan/UBSan and shows that the queue without its lock is reported as a data race; tests/test_pos_handoff.py,
tests/test_input_background.py, tests/test_oot_song_inventory.py and tests/test_pipeline_tour.py are brought to the new code (none
removed); tests/test_console_docs.py keeps docs/console.md's table the registry's own.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Stacked on #1351 (head 4e577d399); S4's first handlers over the registry of the previous commit.

A command's forms are rows of the table told apart by their arguments: "pos" with no numbers now reads where Link is, "age" with no
word reads his age, "teleport" with no argument lists the destinations of the Debug tab's Teleport; each with its numbers or word still
does what it did. The reads answer on the caller's thread from a sample (host/oot_console.c) that Link's update takes twice a second
(host/hos_main.c oot_console_sample: the map, his age, whether a map loads or an event plays, and his position), so they touch no guest
memory, work with HOS_CONTROL off, and say how old the sample is when Link has not been updated for 2 s (the title, a load, a pause).

"pos" answers a line that is itself a command: "pos -52.50 149.90 180.20   # KokiriForest_Child child" (the comment is how the console
and the log's place line end), so what it prints can be pasted back to put Link there. The answer carries the same numbers as an object
for tools. A bare "!pos" used to be refused with the log line "hid: !pos takes exactly X Y Z ..."; it reads now (one more line in
the golden test's list of differences, docs/console.md says so).

Tests: tests/console_host_test.c checks every read (no sample, a sample, a position that cannot be read, a stale sample, the
paste-back round trip, the forms of one name and the usage that names both), that reads are allowed in a room and at the console only
with Debug tools, and, under ThreadSanitizer, that the sample is never read torn while Link's update writes it (11 million reads, none
torn). The checks that listed S1's rows know the new ones.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Stacked on #1351 (head 4e577d399); S4's time handlers over the registry.

"time" answers the clock as HH:MM from the sample Link's update takes twice a second (the world manager's clock, as the Debug tab's
hour row finds it; its seconds of the day are read at +0x28 as the Bug report's place line reads them in #1408), with the sample's age
when it is not fresh. "time H[:MM]", "time noon" and "time midnight" set it: a world command (shared day and night would hand it to
every player in the same map), so a co-op room refuses it with that reason at every door but the live file's and the bridge's with
HOS_CONSOLE_ROOM=allow, and never at the console. The Debug tab's hour row (and "!cheat 100..123") could only set whole hours because the
action number had no room for minutes; the request carries the second of the day and the game's own setter takes seconds
(oot_set_time), so minutes need nothing new there; a whole hour logs the same "cheats: requested HH:00" it always did.

A word that is no time of day (24, 12:60, 7:5, 123, 12:30:00, -1, noon2) is a usage error that says what a time is.

Tests: tests/console_host_test.c checks the read (a clock that could not be read, 13:20, 23:59, 00:00, a stale sample), 13 spellings that
set and 15 that do not, that the request reaches the game's update as the action number and the second it will set, that a room refuses
it and the override and the console behave, and the gate's matrix includes both forms. tests/test_pipeline_tour.py's check of the clock
action reads the changed dispatch.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Stacked on #1351 (head 4e577d399); S4's give and take handlers over the registry.

"give ITEM [N]" and "take ITEM [N]" change an Inventory page item by its pouch name (Item_Bomb) or its label on the page ("Bombs", quoted
when it has blanks; case and "-" for "_" do not matter), through the pouch edit the page already uses: a quantity item by N (1 to 63
given, 1 to 64 taken, 1 if left out); an item Link has or has not (equipment, songs, the quest items) is unlocked or relocked, whole, a
number for it is refused, and an item he already has (or has not got) is answered at once with nothing done. What he has comes from the
counts the game side publishes twice a second for the page, so the answer to "give Item_Longshot" when he has it needs no game
round trip. At Link's update the answer is the page's own: "inventory Item_Bomb +5 (had 3, now 8, event status 2)", with the log line
"cheats: inventory ..." as before. "items [FILTER]" lists the names the two take, with their labels and which are quantities.

Both are world commands (what a room's progress sync would hand to the other players): refused in a co-op room with that reason at
every door but the live file's and the bridge's with HOS_CONSOLE_ROOM=allow, and never at the console. The old "!cheat 3000+..." numbers
are the same requests: the test checks that "give Item_Bomb 5" reaches the update as the action number the old reader stored for it.

Tests: tests/console_host_test.c checks the names and labels, 12 spellings that are refused, the counts (an op of 0 to 127 changes the
count by op - 64), the unlock/relock rules for an item he has and has not, no save loaded, what a room refuses, items and its filter, and
the gate's matrix includes give, take and items.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Stacked on #1351 (head 4e577d399); S4's status handler over the registry.

"status" answers at once from the sample Link's update takes twice a second: the map and his age, whether he is in play, an event is
playing or a map is loading, his position, the game's clock and whether this game is in a co-op room (or a Go to friend journey
runs), with the sample's age when Link has not been updated for 2 s, and as an object for tools. What could not be read is left out;
with nothing sampled yet (the title, no save) it says so and still gives the room. It touches no guest memory and works with
HOS_CONTROL off. Life, hearts and rupees, which the control bridge's status.game reads, are not in it: those readers belong to
host/oot_state_tap.c.

Tests: tests/console_host_test.c checks a full status, an event, a loading map, a sample with nothing but the map, the two room
states, a stale sample, the usage with an argument, and that the console needs Debug tools for it; the gate's matrix and the checks
that list the table's rows know it.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Stacked on #1351 (head 4e577d399). The Windows-target syntax check (clang --target=x86_64-w64-mingw32 over the llvm-mingw
sysroot, -Wall -Wextra -Werror) found memcpy and snprintf deprecated in the registry's header and sources for the drivers that
did not define _CRT_SECURE_NO_WARNINGS, and the sanitizer driver asking Windows for -fsanitize=thread. The drivers and the song
inventory fixture define it before their first include; the sanitizer driver says it is a Linux check and skips on Windows.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Part of the Debug tools console (stacked on #1351 and the command registry). The console draws its columns, its Tab lists and its
"^" row in a monospace face (the user's decision of 2026-11-17), whatever font the Insert menu uses.

third_party/fonts/libertinus gets LibertinusMono-Regular.ttf, 153,992 bytes, from the same release the folder already pins
(Libertinus 7.051, Libertinus-7.051.zip, sha256 4d9be29b...: checked after the download, static/TTF/LibertinusMono-Regular.ttf, sha256
4e27caf6...), same family and the same SIL Open Font License 1.1 (OFL.txt is byte for byte the one already there). PROVENANCE.md
lists the file with its sha256 and carries the new tree-sha256; scripts/check_third_party.py passes. nx2/ui_fonts.py compiles it in
as longshot_font_mono, gpu/vk/vk_imgui.cpp loads it always (also when the menu uses the game's own font) into ui::Fonts::mono, which
nothing draws with yet. The shader translator's stamp and the program cache's keys do not move (tests/test_shader_stamp_inputs.py
passes); the one object that changes is the bundled fonts' own, vk_ui_fonts.o.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Part of the Quake-style Debug tools console (design: reports/DevConsole.md, section 5), stacked on #1351 and the command registry.
This is the console with no drawing, no window and no game in it, so that everything it does can be tested with a fake clock:

- gpu/vk/console_ui.h (header only; it takes the command table, usage and completion from gpu/vk/console_core.h): the slide
  (closed, opening, open, closing; 200 ms to any height, eased out, a press in mid-way turns it round from where it is; the press
  that opens it gives the keyboard to the console at once and the one that closes it gives it back at once); the input line (255
  bytes of printable ASCII, a caret, sideways scrolling; the toggle key's ` and ~ never go in); the history (the last 100, no
  repeat of the last, the unsent line comes back, and the file's text in and out: bad lines left out, a missing file is an empty
  history); the output (200 lines of at most 160 bytes, append only, wrapped when asked for at a width with the continuation
  rows two cells in, a view that stays on its line while output arrives and after a resize); the notify lines (the last 4, each
  with its own clock, a fade over the last half second, cleared when the console opens or closes); the keys (Enter, Esc that clears
  a line and then closes, Tab that prints the usage and the candidates and puts in the common prefix, cycles with Tab and
  Shift+Tab, PgUp and PgDn half a page, the wheel 3 rows, Ctrl+Home and Ctrl+End); the answers' colours and words; the picker
  a controller uses (Recent and Suggested).
- gpu/vk/console_layout.h: the 16:9 frame, the plate and what sits on it from the bottom up (the line, the bottom row, the "]" line, the
  picker, the "^" row, the output's rows and columns), and the notify strip's band at the top edge, clear of the FPS counter in each of
  its corners. Libertinus Mono's advance is 0.64 em, so Half at any 16:9 size is 16 rows of 131 columns.

tests/test_console_ui.py builds and runs tests/console_ui_test.cpp (about 270 checks, and two sweeps): the slide's timing and reversal, the line, the
history and its file, wrapping (nothing lost at any width), the ring, pinning, scrolling, the notify clocks and fade, Tab with a
data source, cycling, the usage alone, packed lists and the "N more" line, the replies, the picker, and the layout at 720p, 1080p,
1440p and 4K, ultrawide, the three Menu sizes and a sweep of over 1,000 window, Menu size, height, controller and scroll combinations from 640x360 to 5120x1440.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Part of the Quake-style Debug tools console (stacked on #1351, the command registry and the console's model). This draws what the
model says; nothing opens the console yet (the keys come next), so with the console closed it draws nothing and costs nothing:
menu_record's early-out gets one more term, console::wants_frame.

- gpu/vk/console_draw.h turns the model and the layout into draw calls on a Sink (fill, pill, text): the plate from the top edge of
  the 16:9 frame, 80 % opaque (90 % at Full), the output's rows from the bottom up with their colours (echo gold, replies ink,
  pending dim, refused amber, failed red; a Tab list's names bright and their summaries dim), the "^" row while scrolled back, the
  controller's two-box picker, the "]" line with a block caret that changes every 250 ms, the bottom row (button chips and the room
  badge at the left, the build's version at the right) and, last, a 2 px gold line at the plate's bottom edge with a dark hair
  under it. Every call moves with the plate's bottom edge, so the text travels as the plate slides. With the console closed the
  last 4 lines show in the free strip of the top edge (27 to 78 % of the width, 3.5 % down, clear of the FPS counter in each corner
  it can be put in), small, on a backing, each fading over its last half second.
- gpu/vk/vk_console.cpp draws it with Dear ImGui in the menu's pass (menu_record and menu_record_image call it after the FPS
  counter: an open console covers it) through an ImGui sink over Libertinus Mono, whose advance it measures, so the columns the
  layout counts are the ones the font draws. vk_imgui.cpp bakes the console's three sizes ahead with the menu's (no hitch on the
  first open). Options gets con_height and con_notifytime (the Debug tab's rows come with the wiring).
- tests/console_draw_test.cpp records the calls on a fake sink and checks them (order, places, colours, the plate sliding, the caret
  and its blink, the sideways scroll, the picker, the notify strip); tests/test_fps_overlay_order.py runs the real menu_record with
  the console's calls stubbed and checks the console is drawn last and costs nothing while it is closed.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Part of the Quake-style Debug tools console (stacked on #1351, the command registry and the console's model and drawing). The
renderer draws the console; the registry is on the host. This is the way between them, with nothing in it that opens the console yet.

- gpu/vk/vk_api.h, MKWVK_API_VERSION 34: MkwVkHost gets console_run (a line as the console's door: the status, the reply's text, the
  ticket of a request that waits for Link's update), console_result (what came of a ticket), console_name (the names completion
  offers), console_feed (the lines the other doors ran) and console_room (the room's bits). host/rx_backend.c binds them to
  host/console.c's hos_console_run, hos_console_result, hos_console_name, hos_console_feed and hos_console_room; the renderer's
  presenting thread asks and none of them waits. The number is the next free one and is numbered last on merge, as the other
  renderer API changes do.
- host/console.c keeps the lines the live file and the bridge ran, as the log says them without "console: " ("live: pos 1 2 3 -> ok:
  returned to 1.00 2.00 3.00"), 32 of them, at most 8 a second (the rest are only logged, as before), each reader with its own place
  that starts from now on and is put right when it fell behind; the console's own lines are not kept (it prints them itself).
  hos_console_name answers the maps' names (the teleport table's, each destination's child map then its adult map) and nothing for
  the kinds whose commands do not exist yet. The log lines are unchanged.
- gpu/vk/console_pump.h (header only, over a table of function pointers) is the console's half: a line goes to the host and its answer
  is printed in its status' colour, a request that waits is followed by its ticket and its result is printed as a new line (the
  output only appends), the other doors' lines are mirrored, at most 8 a frame, and the room's bits and the names reach the
  console. Debug tools off forgets what was waiting and starts the feed afresh.

Tests: tests/console_pump_test.cpp runs the pump against a fake host (statuses and colours, a pending request and its result, a
timeout, a ticket the host forgot, 16 followed at most, the feed from now on, 8 a frame, a resync, the room, the names in Tab);
tests/console_host_test.c gets the feed (from now on, whole lines, the console's own and a bridge's reads left out, a reader's own
place, 8 a second, 32 held, a cut buffer) and the names, and its thread case has a reader of the feed beside the writers
(ThreadSanitizer and ASan/UBSan runs of tests/test_console_queue.py pass); tests/test_console_ui.py runs the pump test too.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Part of the Quake-style Debug tools console (stacked on #1351, the command registry and the console's model, drawing and registry link).
This is what opens it and gives it the keyboard.

- menu_tick polls two more keys (the ` and ~ key, VK_OEM_3, and L) and hands the console each tick's presses, held keys, text, pointer and
  pad. The console acts only while Debug tools is on (the key goes to the game as before with it off, and turning it off closes the
  console) and never while the Insert menu is open. While it is open or opening, menu_is_open() is true, so the host drops the game's
  keyboard, pad and presses (the same signal the Insert menu uses) and the window lets the mouse go; the text queue is on, so typed
  characters and the editing keys (Left, Right, Home, End, Backspace, Delete, Enter, Esc) reach the line, and the line's own ` and ~
  never land in it. Home and End are the caret's here; Ctrl+Home and Ctrl+End scroll; Up and Down walk the history (a held key repeats),
  PgUp and PgDn move half a page, the wheel 3 rows, Tab completes (Shift+Tab goes back), Ctrl+L empties the output, a click on an
  output line copies it into the line, Esc clears a line and then closes. Insert (not Shift+Insert, which pastes), F1 and F10 close it and
  do nothing else, and the menu's own Esc, Enter, Home and F10 presses of those ticks (and 50 ms after) are not taken, so closing the
  console with Esc does not open the Insert menu.
- vk_console.cpp runs a line through the registry (console_pump.h and MkwVkHost's console calls), appends it to
  longshot_console_history.txt beside the options file (read and trimmed to 100 lines the first time the console opens in a run, only
  while Debug tools is on), follows a request's ticket and prints its result as a new line, mirrors the other doors' lines, and
  with a controller (the last input) shows the picker: the D-pad chooses, the button bound to the Switch's A runs the line, X copies it
  into the line and edits it there, Y clears, B closes, the shoulders switch lists.
- The Debug tab's Developer section gets Console (opens it, for a controller), Console height (Third, Half, Full) and Notify time (Off, 3,
  5, 8 s), shown with Debug tools on, in the options file as con_height and con_notifytime, exempt from the Quality preset.
- The console's clock is the present's; in a headless run of shots of every present (the RX_VK_SHOT_GO file is there) it moves 1/60 s a
  tick, so a picture of a frame is the same in every run. The menu logs how many ticks and milliseconds each slide took.
- RX_VK_MENU_SCRIPT gets CONSOLE, TAB, SHTAB, PGUP, PGDN and CTRLL, and the script's ENTER, ESC, LEFT, RIGHT, HOME, END, BACK, DEL and TYPE
  reach the console while it is open.
- tests/test_menu_keys.py and tests/test_menu_text_field.py are brought to the new key list and text focus (neither check is removed);
  tests/test_fps_overlay_order.py stubs the console's clock.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Part of the Quake-style Debug tools console (stacked on #1351 and the command registry).

- docs/console.md gets "The console in the game": how it opens, what the keys do, the notify lines, the controller's picker, the history
  file and the two settings; the README's Debug table gets Console, Console height and Notify time; docs/development.md's
  RX_VK_MENU_SCRIPT row gets CONSOLE, TAB, SHTAB, PGUP, PGDN and CTRLL and says the console's clock moves 1/60 s a tick in a headless
  run of shots of every present.
- tests/test_console_wiring.py reads the wiring from the source: menu_tick's key list is the console's in order; the console is ticked
  after the mouse and before the Esc and Home logic and takes the menu's Insert, Esc, F1, Enter, Home and F10 presses of its ticks with a
  50 ms guard; it acts only with Debug tools on and never over the Insert menu; menu_is_open() and the mouse release include it; it is drawn
  last, costs nothing while closed, and its clock moves once a tick; the three rows, their ini keys, Debug tools gate and preset
  exemption; the history file's place and its one read; MkwVkHost's console members and the host's positional table and console door;
  the font and the build's ImGui flags for vk_console.cpp. 34 deliberate breaks of that source, each caught.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Part of the Quake-style Debug tools console. Test runs have no controller and no keyboard focus, so the console's picker and its timing
need the menu script (RX_VK_MENU_SCRIPT):

- while the console is open the script takes PADS, PADE, PADW, PADN (the pad's face inputs by position), PADUP, PADDOWN, PADLB and PADRB
  as pad presses for the console and puts it in its controller mode;
- RX_VK_MENU_SCRIPT_GO=<file>: the script's seconds count from the moment that file exists, not from the first frame, so a run can reach
  the game's play first and the script then runs in step with a picture burst. Unset, nothing changes.

tests/test_console_queue.py defines _CRT_SECURE_NO_WARNINGS in its compile calls, as tests/test_console_registry.py does: the Windows-target
syntax check of the host files failed on memcpy's deprecation without it.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A choice in the controller's picker was one line that the box's edge clipped mid-word: the registry's help texts are longer than half the
width. Now a description (and a history line) longer than its line is cut with "..." at the box's edge, a label longer than its column is
cut the same way, and the chosen choice, when something of it was cut, shows its whole text on up to two lines under the choices, after a
thin line (a text longer than two lines ends with "..." on the second). At the Large Menu size a Half plate has no room for the two lines:
the layout drops them (the output keeps three rows) and the chosen one stays cut.

The picker is a title, six choices and two lines (9 rows, was 8). Tests: two_lines and the layout's choice of rows (a sweep and two
scales on either side of the threshold), and the draw calls on a fake sink (the cut lengths, the column, the lines under the choices,
the thin line, the six-choice window, Large). 34 deliberate breaks of the new lines are all caught.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
fix(console): an output line may be 320 bytes: the registry's longest help rows were cut in two mid-word
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 17s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 38s
CI / Workflow lint (actionlint) (pull_request) Successful in 39s
Third-party parts / As their notes say (pull_request) Successful in 44s
beanstalk/approval needs a second approval (sensitive paths)
PR description / Description follows the template (pull_request_target) Failing after 7s
84532af323
The output kept lines of at most 160 bytes and made a longer one several lines. The registry's help rows with a name column and a
description (give, take, time) are about 175 bytes, so in the game's first run of this stack `help` showed "world comm" at the end of one
row and "and [world]" at the start of the next. The ring now takes 320 bytes a line; the wrap puts a longer row on two rows at a blank, as
it does for any line that is wider than the plate.

Tests first (red: 2 checks failed with 160): a 700-byte line is 320 + 320 + 60, and the 175-byte help row is one line with its name split
kept that wraps into two rows cut at a blank with nothing lost. Found by reading the pictures of the combined head.

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

@Beanstalk

@Beanstalk
mooki changed title from WIP: feat(console): a Quake-style Debug tools console that drops from the top of the screen, over one command registry to feat(console): a Quake-style Debug tools console that drops from the top of the screen, over one command registry 2026-11-18 22:03:41 +00:00
Author
Member

@Beanstalk

@Beanstalk
Member

@mooki approval of 84532af recorded. This diff touches sensitive paths, so a second member of BigBeans must approve it too.

@mooki approval of `84532af` recorded. This diff touches sensitive paths, so a second member of `BigBeans` must approve it too.
Member

Beanstalk test farm

Commit 84532af · tier untrusted · approved by mooki · dashboard

This diff touches sensitive paths, so it needs two members of BigBeans: nx2/build.py, nx2/ui_fonts.py

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

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `84532af` · tier **untrusted** · approved by mooki · [dashboard](https://beanstalk.magicbean.dev/prs/1641) This diff touches sensitive paths, so it needs two members of `BigBeans`: `nx2/build.py`, `nx2/ui_fonts.py` A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
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 17s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 38s
CI / Workflow lint (actionlint) (pull_request) Successful in 39s
Third-party parts / As their notes say (pull_request) Successful in 44s
beanstalk/approval needs a second approval (sensitive paths)
PR description / Description follows the template (pull_request_target) Failing after 7s
This pull request has changes conflicting with the target branch.
  • gpu/vk/vk_api.h
  • host/rx_backend.c
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/console:mooki-feat/console'
git switch 'mooki-feat/console'
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!1641
No description provided.