From 5cd48ea6960bbc9dccdffe287c834451840c8cff Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Fri, 6 Nov 2026 19:07:38 +0100 Subject: [PATCH 1/5] Describe probe_movie_bench in docs/settings.md tests/settings_doc_check.py failed on dev since 3cd2410 added TOTK_PROBE_MOVIE_BENCH to known[] without a row. Co-Authored-By: Claude Opus 5.5 --- docs/settings.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/settings.md b/docs/settings.md index eb7cee24..ae22bfcd 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -74,6 +74,7 @@ Many rows below are developer tools that only act together with another setting | `menu_test_set` | `:=[,...][;...]` changes settings live at that frame, with or without the menu open; `SAVE=1` also writes `totk.ini`. | Settings change during play without input, and `SAVE=1` rewrites the file. | Caution | | `probe_movie` | Text that picks the movie for `totk.exe --probe-movie`: the first file whose path contains it. | Only used by the movie decoder probe; ignored in normal play. | Safe | | `probe_movie_shot` | Path of a `.ppm` file that the movie probe writes the middle frame to. | Only used by the movie decoder probe. | Safe | +| `probe_movie_bench` | `1` makes the movie probe also time the resampler that fits a movie to a game resolution of another shape, and print the time per frame. | Only used by the movie decoder probe. | Safe | | `swkbd_answer` | ``, `` or ``: answers the on-screen keyboard (for example a horse name) without opening a window. | The game gets that answer every time it asks for text. | Caution | | `swkbd_test` | `ok` or `cancel` opens the keyboard window and presses OK or Cancel on the first timer tick. | The keyboard window closes by itself. | Caution | | `test_pad` | `,,,` attaches a virtual gamepad whose sticks rest at these raw SDL axis values (-32768 to 32767). | The game sees a controller with that drift or deflection; a malformed value is logged and ignored. | Caution | From 9233322aa83e5854cddfa94305de4bccfc6565a5 Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Fri, 6 Nov 2026 19:08:11 +0100 Subject: [PATCH 2/5] Ignore every linked file in the worktree test's scratch repository tools/worktree.py links config.local.toml and CLAUDE.local.md since e3e72df, but the test's .gitignore listed only the first, so git status in the new worktree showed CLAUDE.local.md and the test failed. Co-Authored-By: Claude Opus 5.5 --- tests/worktree_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/worktree_test.py b/tests/worktree_test.py index e4c06ef7..de162b79 100644 --- a/tests/worktree_test.py +++ b/tests/worktree_test.py @@ -18,7 +18,7 @@ ROOT = Path(__file__).resolve().parent.parent sys.path.insert(0, str(ROOT / 'tools')) import worktree # noqa: E402 -IGNORED = '\n'.join('/' + d + '/' for d in worktree.LINK_DIRS) + '\n/' + worktree.LINK_FILES[0] + '\n/.worktrees/\n' +IGNORED = ''.join(f'/{p}\n' for p in [d + '/' for d in worktree.LINK_DIRS] + worktree.LINK_FILES + ['.worktrees/']) def git(cwd, *a): From 1d89570ba86b1f4c90883c42ebfe2a03a8b0b130 Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Fri, 6 Nov 2026 19:19:47 +0100 Subject: [PATCH 3/5] Translate the speaker setting into Brazilian Portuguese and Simplified Chinese 963901c added the Speakers row (stereo or 5.1) in English and Russian only, so --probe-services failed: menu text ids 189 to 193 lacked pt-BR and zh-Hans, and the menu showed them in English in those languages. Co-Authored-By: Claude Opus 5.5 --- runtime/ui_text.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/ui_text.c b/runtime/ui_text.c index f4e033c5..d9769360 100644 --- a/runtime/ui_text.c +++ b/runtime/ui_text.c @@ -1100,6 +1100,10 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = { [UI_MENU_MODE_DOCKED] = "Modo TV", [UI_MENU_MODE_HANDHELD] = "Modo portátil", [UI_MENU_VOLUME] = "Volume", [UI_MENU_VOLUME_DESC] = "Volume geral do jogo.", + [UI_MENU_AUDIO_CHANNELS] = "Alto-falantes", + [UI_MENU_AUDIO_CHANNELS_DESC] = "Saída estéreo ou surround 5.1. Automático escolhe 5.1 quando a configuração de " + "alto-falantes do Windows tem seis canais ou mais. Vale após reiniciar.", + [UI_MENU_CHANNELS_AUTO] = "Automático", [UI_MENU_CHANNELS_STEREO] = "Estéreo", [UI_MENU_CHANNELS_51] = "Surround 5.1", [UI_MENU_MOTION] = "Controles de movimento", [UI_MENU_MOTION_DESC] = "Mirar com o giroscópio do controle.", [UI_MENU_RUMBLE_STRENGTH] = "Intensidade da vibração", @@ -1647,6 +1651,9 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = { "这样被打断的读取可能会永久卡住。", [UI_MENU_VOLUME] = "音量", [UI_MENU_VOLUME_DESC] = "游戏的主音量。", + [UI_MENU_AUDIO_CHANNELS] = "扬声器", + [UI_MENU_AUDIO_CHANNELS_DESC] = "立体声或 5.1 环绕声输出。选择自动时,若 Windows 扬声器设置有六个或更多声道则使用 5.1。重启后生效。", + [UI_MENU_CHANNELS_AUTO] = "自动", [UI_MENU_CHANNELS_STEREO] = "立体声", [UI_MENU_CHANNELS_51] = "5.1 环绕声", [UI_MENU_MOTION] = "体感操作", [UI_MENU_MOTION_DESC] = "用手柄的陀螺仪瞄准。", [UI_MENU_RUMBLE_STRENGTH] = "振动强度", From 1dfe05679e2b53fcd7c9ecf1143fbab2cb6ad14f Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Fri, 6 Nov 2026 19:20:20 +0100 Subject: [PATCH 4/5] Expect the base language in the probe's automatic menu language check resolve_menu_lang falls back from a region tag the catalog lacks to its base language (ru-RU: ru), but probe_menu_text expected English for such a tag, so --probe-services failed on any Windows whose UI language is ru-RU, de-DE and the like; en-US maps directly and passed. Co-Authored-By: Claude Opus 5.5 --- runtime/ov_probe.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/ov_probe.c b/runtime/ov_probe.c index 3d1a4327..15026546 100644 --- a/runtime/ov_probe.c +++ b/runtime/ov_probe.c @@ -929,8 +929,14 @@ static void probe_menu_text(void) { cfg_set("TOTK_MENU_LANG", "zh-Hans"); CHECK(menu_text(UI_MENU_TITLE) == ui_text_in("zh-Hans", UI_MENU_TITLE), "menu_text ignores MENU_LANG=zh-Hans"); cfg_set("TOTK_MENU_LANG", ""); + // the system language as ui_text.c resolve_menu_lang takes it: the tag, else its base language (ru-RU: ru), else en const char *sys_lang = ui_text_lang(plat_ui_language()); - const char *auto_lang = ui_text_defined(sys_lang, UI_MENU_TITLE) ? sys_lang : "en"; + char sys_base[16] = ""; + size_t base_n = strcspn(sys_lang, "-"); + if (sys_lang[base_n] && base_n < sizeof sys_base) memcpy(sys_base, sys_lang, base_n); + const char *auto_lang = ui_text_defined(sys_lang, UI_MENU_TITLE) ? sys_lang + : *sys_base && ui_text_defined(sys_base, UI_MENU_TITLE) ? sys_base + : "en"; CHECK(menu_text(UI_MENU_CONTINUE) == ui_text_in(auto_lang, UI_MENU_CONTINUE), "menu_text auto ignores the system language"); } From b317f1c37e46435c68a3a64fda0838fc9a236c90 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 22:33:24 +0000 Subject: [PATCH 5/5] Order overlapping uniform overlay copies with a transfer barrier vk_exec_ub_flush recorded the copies of a pass's overlaid uniform updates back to back behind one barrier. Copies with no barrier between them may run in any order, and ov_add only drops an older pending copy of exactly the same range, so two updates that overlap in part could leave the older bytes in the buffer where they overlap. A copy that overlaps one recorded since the last barrier now waits for it behind a transfer-to-transfer barrier; the perf line counts those barriers. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BspNcezsiV8zT8wcnXrrME --- runtime/vk_exec_draw.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/runtime/vk_exec_draw.c b/runtime/vk_exec_draw.c index dafa05f1..4507d8d9 100644 --- a/runtime/vk_exec_draw.c +++ b/runtime/vk_exec_draw.c @@ -175,7 +175,7 @@ static struct { struct { uint64_t dst; VkBuffer src; VkDeviceSize soff; VkMemSpan sp; uint64_t size; } p[OV_N]; // to copy struct { uint64_t lo, hi; } f[OV_FOREIGN]; // GPU writes of other kinds // since the last perf line (vk_exec_ub_perf) - uint64_t c_update, c_overlaid, c_flush, c_bind, c_merged, c_mixed, c_inpass, c_outside, c_early; + uint64_t c_update, c_overlaid, c_flush, c_bind, c_merged, c_mixed, c_inpass, c_outside, c_early, c_order; } OV = {.mode = -1}; // A binding without a size reaches to the end of its backing: as far as the overlays go, for ov_at. @@ -3349,7 +3349,22 @@ void vk_exec_ub_flush(VkExec *ex) { VkDependencyInfo di = {.sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO, .memoryBarrierCount = 1, .pMemoryBarriers = &mb}; vkCmdPipelineBarrier2(ex->cb, &di); ex->recorded++; + // Copies without a barrier between them may run in any order, and ov_add only drops an older copy of exactly the + // same range: a copy that overlaps one recorded since the last barrier waits for it, so the newer bytes land last. + VkMemoryBarrier2 ww = {.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .srcStageMask = VK_PIPELINE_STAGE_2_COPY_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_COPY_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT}; + VkDependencyInfo wdi = {.sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO, .memoryBarrierCount = 1, .pMemoryBarriers = &ww}; + uint32_t since = 0; // the first copy recorded after the last barrier for (uint32_t i = 0; i < OV.np; i++) { + for (uint32_t k = since; k < i; k++) + if (OV.p[i].dst < OV.p[k].dst + OV.p[k].size && OV.p[k].dst < OV.p[i].dst + OV.p[i].size) { + vkCmdPipelineBarrier2(ex->cb, &wdi); + ex->recorded++; + OV.c_order++; + since = i; + break; + } VkBufferCopy cp = {OV.p[i].soff, OV.p[i].sp.offset, OV.p[i].size}; vkCmdCopyBuffer(ex->cb, OV.p[i].src, OV.p[i].sp.buffer, 1, &cp); ex->recorded++; @@ -3365,11 +3380,11 @@ void vk_exec_ub_perf(void) { const double k = 1 / 600.0; rt_log("perf: uniform updates per submission %.1f: %.1f overlaid in a pass (copied in %.2f batches), %.1f copied " "in a pass, %.1f outside one; bindings from an overlay %.1f (%.1f merged, %.1f over other GPU writes), %.2f " - "batches brought forward for a storage write", + "batches brought forward for a storage write, %.2f barriers between overlapping copies", OV.c_update * k, OV.c_overlaid * k, OV.c_flush * k, OV.c_inpass * k, OV.c_outside * k, OV.c_bind * k, - OV.c_merged * k, OV.c_mixed * k, OV.c_early * k); + OV.c_merged * k, OV.c_mixed * k, OV.c_early * k, OV.c_order * k); OV.c_update = OV.c_overlaid = OV.c_flush = OV.c_bind = OV.c_merged = OV.c_mixed = 0; - OV.c_inpass = OV.c_outside = OV.c_early = 0; + OV.c_inpass = OV.c_outside = OV.c_early = OV.c_order = 0; } // The scratch bytes of a uniform or storage binding [addr, addr+n) an overlay of this submission touches: 1 with *out