feat(runtime): HOS_DEV_DLL_SWAP, a renderer built alone taken at the next start, checked against the game first #183

Open
dyst wants to merge 5 commits from dyst/Longshot:feat/renderer-swap into main
Member

Type: feat · Risk: low · Tested on: Windows 11, RTX 3080 (NVIDIA 621.14), in the game; Linux (Docker), game-free · Needs: Linux, any GPU, in the game

Why

Trying a change to the renderer means quitting the game, building the whole game folder again and starting it, or copying the DLL in by hand with nothing to say whether it pairs with the executable. On Linux the renderer reaches the host through weak hos_* symbols, so one from another tree fails at dlopen, or calls through NULL. This builds the renderer alone while the game keeps running, checks it against the game, and has the game take it at its next start.

This is the dev-loop proposal's B1, its second part (https://github.com/NotRexed/Hookshot/pull/2636). There is no Longshot issue for it. The loop restarts the game with longshot_ctl.py relaunch, which #97 added and which is on main now.

What changed

With HOS_DEV_DLL_SWAP=1, the game renames a staged <renderer>.new over its renderer at the start, before loading it, when the staged file is built for the game's vk interface, and keeps the old renderer as <renderer>.old so a bad one can be undone. scripts/stage_renderer.py stages a renderer there only when it is built for the executable's vk interface (both export their MKWVK_API_VERSION, read from the files) and every symbol it needs from the executable is one the executable exports. Off, nothing is looked for. The loop: build the renderer alone, stage it, longshot_ctl.py relaunch (the game started again with the same environment, the switch included).

Main also has scripts/dev_packs.py (#147), which builds a renderer-only change as a pack over a base and runs it from a fresh runtime copied from that base, so the game and the renderer always come from one base's build; it suits comparing a change against a base. HOS_DEV_DLL_SWAP instead swaps the renderer in place, in the game folder you are already running, after checking it against that folder's executable; the two don't depend on each other.

  • runtime: dev_dll_swap in host/rx_backend.c, called by load_vulkan before LoadLibraryA. With HOS_DEV_DLL_SWAP=1, a <renderer>.new beside the game (longshot_vk.dll.new, longshot_vk.so.new on Linux, the name LoadLibraryA's shim opens) is renamed over the renderer first, logged either way. The old process has ended by then (a restart waits for it: HOS_RESTART_OF), so nothing holds the old file. Off, nothing is looked for: a release never swaps.
  • version: the renderer exports const unsigned mkwvk_api_version (gpu/vk/vk_main.cpp) and the executable mkwvk_host_api_version (host/rx_backend.c; on Linux through nx2/build.py's --export-dynamic-symbol, beside hos_posix_* in the link run_link runs), the MKWVK_API_VERSION each was built with. They are new exports, not members of MkwVkHost or MkwVkRenderer, so MKWVK_API_VERSION stays as it is (vk_api.h says so beside mkwvk_init; its only change is that comment). exported_u32 in host/rx_backend.c and in scripts/stage_renderer.py reads such a constant from a file without loading it: a PE file's export table (a DLL or an EXE) or an ELF64 file's dynamic symbols.
  • swap: dev_dll_swap reads the staged file's mkwvk_api_version before anything moves. Another version, or none (a renderer from before the export), is left where it is, and the old renderer loads, logged with the version found. Otherwise the old renderer is moved to <renderer>.old first, then the staged one over it; if that move fails, the old one is put back. stage_renderer.py --undo GAME_DIR moves .old back over the renderer.
  • script: scripts/stage_renderer.py GAME_DIR [RENDERER] (new, standard library) copies the renderer (default: the work folder's sa/build/ one) whole to <name>.new beside the executable (bin/ when the game has one), only when it pairs. On both platforms it refuses a renderer whose mkwvk_api_version differs from the executable's mkwvk_host_api_version, or either missing (version_problem), before it looks at the symbols. Linux: every name it leaves for the loader (nm -D --undefined-only), weak ones too, unless versioned (the C and C++ runtime's) or the start files' own (__gmon_start__, _ITM_*...), is one the executable exports. Windows: every function it imports from the executable is one the executable exports (llvm-objdump -p); today the renderer imports none (the host hands it a table), so on Windows the version is the check that matters. One that doesn't pair isn't staged, and the names are said. build.py's check_vk_symbols checks the renderer alone at build time; this pairs it with the executable it will run under.
  • docs: docs/development.md: the switch's row in Running a test, and Trying a renderer change in place after Testing a change against a base: the steps (the renderer built alone, staged, the game started once with the switch, then longshot_ctl.py relaunch each time after), what the pairing check refuses, what the log says when the move fails, --undo, and when a pack is the better tool.
  • tests: tests/test_stage_renderer.py (new): the readers on nm and llvm-objdump output, the staging, the versions read from a real DLL and EXE (Windows) or shared object and executable (Linux), the refusals, --undo, and dev_dll_swap cut out of host/rx_backend.c and run with the switch on and off, a renderer staged and not, of the same version, another and none: on Windows with the real Win32 calls, on Linux over host/posix/win32_posix.c, where it swaps the .so.

Measurements

Verdict: faster: a renderer edit to in play again in 51.6 s against 73.2 s on main (median of 3), about 22 s a loop, with the building itself about the same (16.2 s against 16.9 s); no errors in the PR runs' logs. Measured at the PR's first head (2a333461, on main f41db065), before the version check and .old and before the rebases; the timed runs below on this head are coming.

Timed runs on this head (6575b590, on main @ d9486a08), main vs this PR: to come.

Hardware: RTX 3080 (NVIDIA 621.14), Ryzen 9 3900X, 64 GB, Windows 11
Scene: Kokiri Forest from a save (the title's Continue), headless, muted; both builds from one work folder
Method: from a comment added to gpu/vk/vk_menu.cpp while the game is in play to being in play again on the new renderer, by the script's clock, rounds interleaved (main, PR, main, PR...). main: quit, make_game.py (the game folder built again; the lift skipped), launch, Continue. This PR: RX_VK_ONLY=1 nx2/build.py --standalone (the renderer alone) while the game plays on, scripts/stage_renderer.py, longshot_ctl.py relaunch (the game started with HOS_DEV_DLL_SWAP=1), Continue. The PR side was the PR's first commit on #97's branch @ 0fa72f49 (the same patch), since relaunch was not on main then.
How to reproduce: as the method, with a save copied into each game folder.

Before: main @ f41db065 After: this PR @ 2a333461
renderer edit to in play again (s), median of 3 73.2 51.6
of it, building (s), median of 3 16.9 16.2
main 1: edit to play 266.2 s (the game folder built in 223.9 s, the lift run again)
pr 1:   edit to play 177.4 s (the renderer built in 137.3 s, every renderer file compiled; staged; relaunched: answering again after 1.8 s)
main 2: edit to play 73.9 s (the game folder built in 16.9 s)
pr 2:   edit to play 47.3 s (the renderer built in 13.1 s; staged; relaunched: answering again after 1.4 s)
main 3: edit to play 73.2 s (the game folder built in 16.4 s)
pr 3:   edit to play 51.6 s (the renderer built in 16.8 s; staged; relaunched: answering again after 1.6 s)
main 4: edit to play 69.0 s (the game folder built in 17.2 s)
pr 4:   edit to play 56.8 s (the renderer built in 16.2 s; staged; relaunched: answering again after 1.8 s)
the log: "HOS_DEV_DLL_SWAP: ...longshot_vk.dll.new took the old renderer's place"; errors in the PR runs' logs: 0

The medians are of rounds 2 to 4. Round 1 is left out on both sides: main's build ran the lift again, because the PR's first build from the other checkout had changed the shared work folder's lift key, and the PR's was its first RX_VK_ONLY build there, which compiles every renderer file once. In a warm work folder building the renderer alone is no faster than the game folder's build (everything else is cached); the ~22 s a loop saved is the game left running through the build and relaunched over the bridge, against quit, launch and wait.

Why the numbers should still hold on this head: since 2a333461 the swap reads a few hundred bytes of the staged file's headers before it moves anything (the version check), and keeps the old renderer as .old (one more rename); both are at the start, well under the timer's resolution. Main's build has moved on both sides since f41db065 (one object store, #371; a lift reused across work folders, #372; a renderer header edit compiling only the files that read it, #37; a link skipped when nothing it reads changed, #30; an update copying no unchanged exe, #631), which can lower main's game-folder build and the PR's renderer build alike; the part this PR saves, the game kept running through the build and started again over the bridge, doesn't depend on them. The timed runs above will say.

Flags and settings

One developer switch, HOS_DEV_DLL_SWAP, off by default, documented in docs/development.md (its row in Running a test, and Trying a renderer change in place).

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
HOS_DEV_DLL_SWAP At the start, a staged <renderer>.new beside the game, built for the game's vk interface, takes the renderer's place before it is loaded; the old one is kept as .old - (no such switch) off (unset) With 1, the next start renames the staged renderer over the old one and loads it, logged either way; off, no file is looked for Helps: trying a renderer change without quitting the game for a whole game-folder build (measured above). Doesn't help: players (nothing staged). Untested: Linux, in the game (should help the same: the swap's code ran there over the POSIX shim) Off by default: a developer switch

Testing

Tested:

  • In the game, Windows PC above, at the PR's first head (2a333461): the loop, four rounds, the log saying the staged renderer took the old one's place, play in Kokiri Forest, no errors in the logs. Not run in the game on this head yet (the timed runs above will).
  • On this head (6575b590, on main @ d9486a08), Windows with the Builder's llvm-mingw, 8 at once: the 130 checks that read this diff (every tests/ and nx2/test_*.py check whose text names a changed file, the PR's own test among them), not the whole suite: 111 passed, 6 skipped (tools this PC lacks: the Vulkan and SPIR-V headers, spirv-val), 13 failed, each also failing on main @ d9486a08 the same way (run there on a clean checkout): nx2/test_dll, test_appimage_player_build, test_auto_handheld, test_crash_dialog, test_driver_cache_folder, test_driver_env_choose, test_fpx_sticky, test_linux_preflight, test_pads_after_menu, test_pipeline_tour, test_vk_occlusion_queries, test_vk_pgo, test_walk_key. tests/test_stage_renderer.py passed.
  • tests/test_stage_renderer.py on Linux too, on this head (Docker python:3.12, gcc 14.2 and binutils: a real shared object and executable with the exports, dev_dll_swap over the POSIX shim, swapping the .so): passed.
  • Host build, on this head: host/rx_backend.c compiled to an object with the Builder's llvm-mingw clang (x86_64-w64-mingw32, -Wall -Wextra: no warning in the new code; the object carries -export:mkwvk_host_api_version,data) and with gcc 14.2 on Linux (host/posix on the include path; mkwvk_host_api_version defined in it). The lift's two runtime headers taken from a local work folder. It covers this file, not a whole game build or link.
  • Before this rebase (45fa6e42, on main @ bbe6fdf2): gpu/vk/vk_main.cpp compiled with llvm-mingw clang++ and, on Linux, clang++ 19; the Python reader read a real longshot_vk.dll and longshot.exe from before the change (mkwvk_close_asked found, no mkwvk_api_version, as expected). The rebase changed neither file's new code; nx2/build.py's one conflict was main's run_link (#30) in the Linux executable's link, which now carries the extra --export-dynamic-symbol.
The 130 checks run

The checks under tests/ and nx2/test_*.py whose text names development.md, vk_api.h, vk_main.cpp, rx_backend.c, build.py, stage_renderer.py or test_stage_renderer, picked with grep -l and run with tests/run_all.py --exact.

Not tested: the swap in the game on Linux (its code ran there over the shim, not in a game build); a game folder with a launcher (bin/), where the script stages beside bin/longshot; the loop in the game on this head, and the exports in a whole game build (a DLL and EXE linked by build.py).

Must be tested:

  • Linux, any GPU (by hand, test request T-PZ2F): a game started with HOS_DEV_DLL_SWAP=1, a renderer staged with scripts/stage_renderer.py, then longshot_ctl.py relaunch, expecting "HOS_DEV_DLL_SWAP: ... took the old renderer's place" in the log and the game playing (by hand: that log line, and play continuing)
  • Windows, any GPU (by hand, the author): a whole build of this PR, then scripts/stage_renderer.py <game> with a renderer from main (expecting it refused: exports no mkwvk_api_version) and with this PR's (staged), the game started with HOS_DEV_DLL_SWAP=1 (expecting "took the old renderer's place (kept as ...old)" in the log, and play), then stage_renderer.py --undo <game> (expecting the old renderer back) (by hand: the script's lines and the log)

Risks

What could break: with the switch set and a stale or wrong .new beside the game, that renderer loads in place of the old one if it is built for the same vk interface: the game itself refuses one of another version (or none) before anything moves, and the script refuses one that doesn't pair; a bad one of the same version is undone with --undo (the old one is kept as .old). Each swap replaces the last .old, so only one step back is kept. Without the switch nothing changes: no file is looked for.

Turning it off: unset HOS_DEV_DLL_SWAP (or delete the .new); to go back after a swap, python -I scripts/stage_renderer.py --undo <game folder>; reverting the commits removes it.

Compatibility: Nothing changes for a player: the switch is off and nothing is staged; saves, longshot_options.ini and the caches are untouched. The vk ABI (MKWVK_API_VERSION, MkwVkHost, MkwVkRenderer) is unchanged: the two new exports sit beside mkwvk_init, and a renderer and an executable from before them still load each other as before (only the swap and the script need the exports).

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).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • 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.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • 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.
  • Docs updated.

🤖 Generated with Claude Code

**Type:** feat · **Risk:** low · **Tested on:** Windows 11, RTX 3080 (NVIDIA 621.14), in the game; Linux (Docker), game-free · **Needs:** Linux, any GPU, in the game ## Why Trying a change to the renderer means quitting the game, building the whole game folder again and starting it, or copying the DLL in by hand with nothing to say whether it pairs with the executable. On Linux the renderer reaches the host through weak `hos_*` symbols, so one from another tree fails at `dlopen`, or calls through NULL. This builds the renderer alone while the game keeps running, checks it against the game, and has the game take it at its next start. This is the dev-loop proposal's B1, its second part (https://github.com/NotRexed/Hookshot/pull/2636). There is no Longshot issue for it. The loop restarts the game with `longshot_ctl.py relaunch`, which #97 added and which is on main now. ## What changed With `HOS_DEV_DLL_SWAP=1`, the game renames a staged `<renderer>.new` over its renderer at the start, before loading it, when the staged file is built for the game's vk interface, and keeps the old renderer as `<renderer>.old` so a bad one can be undone. `scripts/stage_renderer.py` stages a renderer there only when it is built for the executable's vk interface (both export their `MKWVK_API_VERSION`, read from the files) and every symbol it needs from the executable is one the executable exports. Off, nothing is looked for. The loop: build the renderer alone, stage it, `longshot_ctl.py relaunch` (the game started again with the same environment, the switch included). Main also has `scripts/dev_packs.py` (#147), which builds a renderer-only change as a pack over a base and runs it from a fresh runtime copied from that base, so the game and the renderer always come from one base's build; it suits comparing a change against a base. `HOS_DEV_DLL_SWAP` instead swaps the renderer in place, in the game folder you are already running, after checking it against that folder's executable; the two don't depend on each other. - runtime: `dev_dll_swap` in `host/rx_backend.c`, called by `load_vulkan` before `LoadLibraryA`. With `HOS_DEV_DLL_SWAP=1`, a `<renderer>.new` beside the game (`longshot_vk.dll.new`, `longshot_vk.so.new` on Linux, the name `LoadLibraryA`'s shim opens) is renamed over the renderer first, logged either way. The old process has ended by then (a restart waits for it: `HOS_RESTART_OF`), so nothing holds the old file. Off, nothing is looked for: a release never swaps. - version: the renderer exports `const unsigned mkwvk_api_version` (`gpu/vk/vk_main.cpp`) and the executable `mkwvk_host_api_version` (`host/rx_backend.c`; on Linux through `nx2/build.py`'s `--export-dynamic-symbol`, beside `hos_posix_*` in the link `run_link` runs), the `MKWVK_API_VERSION` each was built with. They are new exports, not members of `MkwVkHost` or `MkwVkRenderer`, so `MKWVK_API_VERSION` stays as it is (`vk_api.h` says so beside `mkwvk_init`; its only change is that comment). `exported_u32` in `host/rx_backend.c` and in `scripts/stage_renderer.py` reads such a constant from a file without loading it: a PE file's export table (a DLL or an EXE) or an ELF64 file's dynamic symbols. - swap: `dev_dll_swap` reads the staged file's `mkwvk_api_version` before anything moves. Another version, or none (a renderer from before the export), is left where it is, and the old renderer loads, logged with the version found. Otherwise the old renderer is moved to `<renderer>.old` first, then the staged one over it; if that move fails, the old one is put back. `stage_renderer.py --undo GAME_DIR` moves `.old` back over the renderer. - script: `scripts/stage_renderer.py GAME_DIR [RENDERER]` (new, standard library) copies the renderer (default: the work folder's `sa/build/` one) whole to `<name>.new` beside the executable (`bin/` when the game has one), only when it pairs. On both platforms it refuses a renderer whose `mkwvk_api_version` differs from the executable's `mkwvk_host_api_version`, or either missing (`version_problem`), before it looks at the symbols. Linux: every name it leaves for the loader (`nm -D --undefined-only`), weak ones too, unless versioned (the C and C++ runtime's) or the start files' own (`__gmon_start__`, `_ITM_*`...), is one the executable exports. Windows: every function it imports from the executable is one the executable exports (`llvm-objdump -p`); today the renderer imports none (the host hands it a table), so on Windows the version is the check that matters. One that doesn't pair isn't staged, and the names are said. `build.py`'s `check_vk_symbols` checks the renderer alone at build time; this pairs it with the executable it will run under. - docs: `docs/development.md`: the switch's row in *Running a test*, and *Trying a renderer change in place* after *Testing a change against a base*: the steps (the renderer built alone, staged, the game started once with the switch, then `longshot_ctl.py relaunch` each time after), what the pairing check refuses, what the log says when the move fails, `--undo`, and when a pack is the better tool. - tests: `tests/test_stage_renderer.py` (new): the readers on `nm` and `llvm-objdump` output, the staging, the versions read from a real DLL and EXE (Windows) or shared object and executable (Linux), the refusals, `--undo`, and `dev_dll_swap` cut out of `host/rx_backend.c` and run with the switch on and off, a renderer staged and not, of the same version, another and none: on Windows with the real Win32 calls, on Linux over `host/posix/win32_posix.c`, where it swaps the `.so`. ## Measurements **Verdict:** faster: a renderer edit to in play again in 51.6 s against 73.2 s on main (median of 3), about 22 s a loop, with the building itself about the same (16.2 s against 16.9 s); no errors in the PR runs' logs. Measured at the PR's first head (2a333461, on main f41db065), before the version check and `.old` and before the rebases; the timed runs below on this head are coming. **Timed runs on this head (6575b590, on main @ d9486a08), main vs this PR: to come.** Hardware: RTX 3080 (NVIDIA 621.14), Ryzen 9 3900X, 64 GB, Windows 11 Scene: Kokiri Forest from a save (the title's Continue), headless, muted; both builds from one work folder Method: from a comment added to `gpu/vk/vk_menu.cpp` while the game is in play to being in play again on the new renderer, by the script's clock, rounds interleaved (main, PR, main, PR...). main: quit, `make_game.py` (the game folder built again; the lift skipped), launch, Continue. This PR: `RX_VK_ONLY=1 nx2/build.py --standalone` (the renderer alone) while the game plays on, `scripts/stage_renderer.py`, `longshot_ctl.py relaunch` (the game started with `HOS_DEV_DLL_SWAP=1`), Continue. The PR side was the PR's first commit on #97's branch @ 0fa72f49 (the same patch), since `relaunch` was not on main then. How to reproduce: as the method, with a save copied into each game folder. | | Before: main @ f41db065 | After: this PR @ 2a333461 | |---|---|---| | renderer edit to in play again (s), median of 3 | 73.2 | 51.6 | | of it, building (s), median of 3 | 16.9 | 16.2 | ``` main 1: edit to play 266.2 s (the game folder built in 223.9 s, the lift run again) pr 1: edit to play 177.4 s (the renderer built in 137.3 s, every renderer file compiled; staged; relaunched: answering again after 1.8 s) main 2: edit to play 73.9 s (the game folder built in 16.9 s) pr 2: edit to play 47.3 s (the renderer built in 13.1 s; staged; relaunched: answering again after 1.4 s) main 3: edit to play 73.2 s (the game folder built in 16.4 s) pr 3: edit to play 51.6 s (the renderer built in 16.8 s; staged; relaunched: answering again after 1.6 s) main 4: edit to play 69.0 s (the game folder built in 17.2 s) pr 4: edit to play 56.8 s (the renderer built in 16.2 s; staged; relaunched: answering again after 1.8 s) the log: "HOS_DEV_DLL_SWAP: ...longshot_vk.dll.new took the old renderer's place"; errors in the PR runs' logs: 0 ``` The medians are of rounds 2 to 4. Round 1 is left out on both sides: main's build ran the lift again, because the PR's first build from the other checkout had changed the shared work folder's lift key, and the PR's was its first `RX_VK_ONLY` build there, which compiles every renderer file once. In a warm work folder building the renderer alone is no faster than the game folder's build (everything else is cached); the ~22 s a loop saved is the game left running through the build and relaunched over the bridge, against quit, launch and wait. Why the numbers should still hold on this head: since 2a333461 the swap reads a few hundred bytes of the staged file's headers before it moves anything (the version check), and keeps the old renderer as `.old` (one more rename); both are at the start, well under the timer's resolution. Main's build has moved on both sides since f41db065 (one object store, #371; a lift reused across work folders, #372; a renderer header edit compiling only the files that read it, #37; a link skipped when nothing it reads changed, #30; an update copying no unchanged exe, #631), which can lower main's game-folder build and the PR's renderer build alike; the part this PR saves, the game kept running through the build and started again over the bridge, doesn't depend on them. The timed runs above will say. ### Flags and settings One developer switch, `HOS_DEV_DLL_SWAP`, off by default, documented in docs/development.md (its row in *Running a test*, and *Trying a renderer change in place*). | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `HOS_DEV_DLL_SWAP` | At the start, a staged `<renderer>.new` beside the game, built for the game's vk interface, takes the renderer's place before it is loaded; the old one is kept as `.old` | - (no such switch) | off (unset) | With `1`, the next start renames the staged renderer over the old one and loads it, logged either way; off, no file is looked for | Helps: trying a renderer change without quitting the game for a whole game-folder build (measured above). Doesn't help: players (nothing staged). Untested: Linux, in the game (should help the same: the swap's code ran there over the POSIX shim) | Off by default: a developer switch | ## Testing **Tested:** - In the game, Windows PC above, at the PR's first head (2a333461): the loop, four rounds, the log saying the staged renderer took the old one's place, play in Kokiri Forest, no errors in the logs. Not run in the game on this head yet (the timed runs above will). - On this head (6575b590, on main @ d9486a08), Windows with the Builder's llvm-mingw, 8 at once: the 130 checks that read this diff (every `tests/` and `nx2/test_*.py` check whose text names a changed file, the PR's own test among them), not the whole suite: 111 passed, 6 skipped (tools this PC lacks: the Vulkan and SPIR-V headers, spirv-val), 13 failed, each also failing on main @ d9486a08 the same way (run there on a clean checkout): `nx2/test_dll`, `test_appimage_player_build`, `test_auto_handheld`, `test_crash_dialog`, `test_driver_cache_folder`, `test_driver_env_choose`, `test_fpx_sticky`, `test_linux_preflight`, `test_pads_after_menu`, `test_pipeline_tour`, `test_vk_occlusion_queries`, `test_vk_pgo`, `test_walk_key`. `tests/test_stage_renderer.py` passed. - `tests/test_stage_renderer.py` on Linux too, on this head (Docker `python:3.12`, gcc 14.2 and binutils: a real shared object and executable with the exports, `dev_dll_swap` over the POSIX shim, swapping the `.so`): passed. - Host build, on this head: `host/rx_backend.c` compiled to an object with the Builder's llvm-mingw clang (`x86_64-w64-mingw32`, `-Wall -Wextra`: no warning in the new code; the object carries `-export:mkwvk_host_api_version,data`) and with gcc 14.2 on Linux (`host/posix` on the include path; `mkwvk_host_api_version` defined in it). The lift's two runtime headers taken from a local work folder. It covers this file, not a whole game build or link. - Before this rebase (45fa6e42, on main @ bbe6fdf2): `gpu/vk/vk_main.cpp` compiled with llvm-mingw clang++ and, on Linux, clang++ 19; the Python reader read a real `longshot_vk.dll` and `longshot.exe` from before the change (`mkwvk_close_asked` found, no `mkwvk_api_version`, as expected). The rebase changed neither file's new code; `nx2/build.py`'s one conflict was main's `run_link` (#30) in the Linux executable's link, which now carries the extra `--export-dynamic-symbol`. <details><summary>The 130 checks run</summary> The checks under `tests/` and `nx2/test_*.py` whose text names `development.md`, `vk_api.h`, `vk_main.cpp`, `rx_backend.c`, `build.py`, `stage_renderer.py` or `test_stage_renderer`, picked with `grep -l` and run with `tests/run_all.py --exact`. </details> **Not tested:** the swap in the game on Linux (its code ran there over the shim, not in a game build); a game folder with a launcher (`bin/`), where the script stages beside `bin/longshot`; the loop in the game on this head, and the exports in a whole game build (a DLL and EXE linked by build.py). **Must be tested:** - Linux, any GPU (by hand, test request T-PZ2F): a game started with `HOS_DEV_DLL_SWAP=1`, a renderer staged with `scripts/stage_renderer.py`, then `longshot_ctl.py relaunch`, expecting "HOS_DEV_DLL_SWAP: ... took the old renderer's place" in the log and the game playing (by hand: that log line, and play continuing) - Windows, any GPU (by hand, the author): a whole build of this PR, then `scripts/stage_renderer.py <game>` with a renderer from main (expecting it refused: `exports no mkwvk_api_version`) and with this PR's (staged), the game started with `HOS_DEV_DLL_SWAP=1` (expecting "took the old renderer's place (kept as ...old)" in the log, and play), then `stage_renderer.py --undo <game>` (expecting the old renderer back) (by hand: the script's lines and the log) ## Risks **What could break:** with the switch set and a stale or wrong `.new` beside the game, that renderer loads in place of the old one if it is built for the same vk interface: the game itself refuses one of another version (or none) before anything moves, and the script refuses one that doesn't pair; a bad one of the same version is undone with `--undo` (the old one is kept as `.old`). Each swap replaces the last `.old`, so only one step back is kept. Without the switch nothing changes: no file is looked for. **Turning it off:** unset `HOS_DEV_DLL_SWAP` (or delete the `.new`); to go back after a swap, `python -I scripts/stage_renderer.py --undo <game folder>`; reverting the commits removes it. **Compatibility:** Nothing changes for a player: the switch is off and nothing is staged; saves, `longshot_options.ini` and the caches are untouched. The vk ABI (`MKWVK_API_VERSION`, `MkwVkHost`, `MkwVkRenderer`) is unchanged: the two new exports sit beside `mkwvk_init`, and a renderer and an executable from before them still load each other as before (only the swap and the script need the exports). ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Trying a renderer change meant building the whole game again (the lift checked, everything linked) or copying the DLL in
by hand while the game was closed, with nothing to say whether it paired with the executable: on Linux the renderer
reaches the host through weak hos_* symbols, so one from another tree fails at dlopen or calls through NULL.
scripts/stage_renderer.py checks the pairing (Linux: every name the renderer leaves for the loader, weak ones too, is one
the executable exports; Windows: its imports from the executable) and copies it whole beside the game as <name>.new;
with HOS_DEV_DLL_SWAP=1 the game takes it in the old one's place as it starts (host/rx_backend.c dev_dll_swap), so
longshot_ctl.py relaunch runs it. Off, nothing is looked for. The dev-loop proposal's B1, its second part
(NotRexed/Hookshot#2636).

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
test(stage_renderer): dev_dll_swap run on Linux too, over the POSIX shim, swapping the .so
All checks were successful
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
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
91c5273355
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Author
Member

Test request T-PZ2F opened for the Linux run (it needs the 'testing wanted' label to be claimed).

Test request T-PZ2F opened for the Linux run (it needs the 'testing wanted' label to be claimed).
dyst changed title from WIP: feat(runtime): HOS_DEV_DLL_SWAP, a renderer built alone taken at the next start, checked against the game first to feat(runtime): HOS_DEV_DLL_SWAP, a renderer built alone taken at the next start, checked against the game first 2026-11-13 11:44:06 +00:00
dyst force-pushed feat/renderer-swap from 91c5273355
All checks were successful
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
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
to 7480ea3f14
All checks were successful
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 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
Third-party parts / As their notes say (pull_request) Successful in 8s
PR description / Description follows the template (pull_request_target) Successful in 3s
2026-11-15 02:39:35 +00:00
Compare
Author
Member

Rebased onto main 6c9edffe with no conflicts (head now 7480ea3f), and the description moved to the new template (#571). tests/run_all.py, the whole suite, again on this branch and on main @ 6c9edffe (Windows, the Builder's llvm-mingw): no failure main doesn't have; the details are under Testing. The measurements are kept under the commits they were taken at, with a line on what main changed since.

What changed now says how this relates to scripts/dev_packs.py (#147): a renderer pack runs from a fresh runtime copied from its base, where HOS_DEV_DLL_SWAP swaps the renderer into the folder you are running, after checking it against that folder's game. The measured loop still uses #97's relaunch, which needs a rebase of its own.

Rebased onto main 6c9edffe with no conflicts (head now 7480ea3f), and the description moved to the new template (#571). `tests/run_all.py`, the whole suite, again on this branch and on main @ 6c9edffe (Windows, the Builder's llvm-mingw): no failure main doesn't have; the details are under Testing. The measurements are kept under the commits they were taken at, with a line on what main changed since. What changed now says how this relates to scripts/dev_packs.py (#147): a renderer pack runs from a fresh runtime copied from its base, where HOS_DEV_DLL_SWAP swaps the renderer into the folder you are running, after checking it against that folder's game. The measured loop still uses #97's relaunch, which needs a rebase of its own.
docs(development): HOS_DEV_DLL_SWAP and stage_renderer.py, a renderer change tried in place
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
PR description / Description follows the template (pull_request_target) Has been cancelled
CI / Conventional Commit title (pull_request) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
Third-party parts / As their notes say (pull_request) Successful in 7s
8aa2bf43c9
The switch gets its row in "Running a test", and "Trying a renderer
change in place" (after "Testing a change against a base") gives the
three steps: the renderer built alone, staged with stage_renderer.py
(checked against the folder's executable first), and the game started
again with the switch set; what the check refuses, what the game logs
when the move fails, and when a pack is the better tool.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Author
Member

Pushed 8aa2bf43: HOS_DEV_DLL_SWAP is documented in docs/development.md, its row in Running a test and a short section, Trying a renderer change in place (the three steps, what stage_renderer.py's check refuses, what the log says when the move fails, and when a dev_packs pack is the better tool). The checks that read docs/development.md pass here, apart from four that fail on main too (test_crash_dialog, test_oot_state_tap, test_vk_pgo, test_walk_key).

Pushed 8aa2bf43: HOS_DEV_DLL_SWAP is documented in docs/development.md, its row in *Running a test* and a short section, *Trying a renderer change in place* (the three steps, what stage_renderer.py's check refuses, what the log says when the move fails, and when a dev_packs pack is the better tool). The checks that read docs/development.md pass here, apart from four that fail on main too (test_crash_dialog, test_oot_state_tap, test_vk_pgo, test_walk_key).
HumanBean force-pushed feat/renderer-swap from 8aa2bf43c9
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
PR description / Description follows the template (pull_request_target) Has been cancelled
CI / Conventional Commit title (pull_request) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
Third-party parts / As their notes say (pull_request) Successful in 7s
to 0fde8ca222
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 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 5s
Third-party parts / As their notes say (pull_request) Successful in 11s
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
2026-11-15 18:44:32 +00:00
Compare
Owner

Rebased onto main @ bbe6fdf2: one conflict, in docs/development.md: main dropped the RX_BACKEND row from the switch table; kept that removal and this PR's HOS_DEV_DLL_SWAP row. No tests were run here; the test boxes stay yours.

Rebased onto `main` @ bbe6fdf2: one conflict, in `docs/development.md`: main dropped the `RX_BACKEND` row from the switch table; kept that removal and this PR's `HOS_DEV_DLL_SWAP` row. No tests were run here; the test boxes stay yours.
Author
Member

Tested HumanBean's rebase onto main bbe6fdf2 (head 0fde8ca2), unchanged: the 31 checks that read this diff, not the whole suite (the agreed process now): 25 passed, 6 failed, each failing on main too (test_crash_dialog, test_oot_state_tap, test_vk_pgo, test_walk_key at 1310ecc6; test_pipeline_tour, test_vk_occlusion_queries at 7bacf846), test_stage_renderer passing. The description now says this needs #97 (longshot_ctl.py relaunch) and merges after it.

Tested HumanBean's rebase onto main bbe6fdf2 (head 0fde8ca2), unchanged: the 31 checks that read this diff, not the whole suite (the agreed process now): 25 passed, 6 failed, each failing on main too (test_crash_dialog, test_oot_state_tap, test_vk_pgo, test_walk_key at 1310ecc6; test_pipeline_tour, test_vk_occlusion_queries at 7bacf846), test_stage_renderer passing. The description now says this needs #97 (longshot_ctl.py relaunch) and merges after it.
HumanBean left a comment

Code-only review of 0fde8ca2 (nothing run). The branch stands alone: four files, none of #97's commits. The only tie to it is that the comments and docs name longshot_ctl.py relaunch, so merge after it.

What is right: the switch is off unless set (env_on), nothing is looked for when off, and the only thing taken is <renderer>.new beside the executable's own renderer, never a path from the environment. stage_renderer.py copies whole and replaces atomically; a failed move is logged and the old renderer loads.

Points, none blocking on their own:

  1. The check does not look at MKWVK_API_VERSION. The docs say the trees "must have the same MKWVK_API_VERSION", but stage_renderer.py only pairs symbols. The runtime does refuse a renderer whose version differs (load_vulkan), but only after the swap has already replaced the old file, and then it draws nothing, with no way back. On Windows the check is also vacuous: the renderer imports nothing from the executable, so missing() returns the empty set and anything is staged. That is the platform the PR was measured on. A renderer from a tree with another vk ABI is exactly what the PR text promises to refuse, and on Windows it won't be. Suggest reading the version out of the staged file (the mkwvk_init result is the only place it lives, so either export a mkwvk_api_version constant or compare against a string the build bakes in) or saying plainly in the docs and in the description that the pairing check is Linux-only and the ABI version is checked at load.
  2. dev_dll_swap deletes the old renderer by MoveFileEx(..., REPLACE_EXISTING), so a bad .new leaves no renderer to fall back to. Keeping the old one as .old would make the "turning it off" line true.
  3. Test T-PZ2F (Linux, in the game) is the PR's own Must be tested and is still open; so it stays a comment, not an approval.

Verdict: comment. Safe by default; the version-check gap in (1) is worth a decision from the author before merge.

Code-only review of 0fde8ca2 (nothing run). The branch stands alone: four files, none of https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/97's commits. The only tie to it is that the comments and docs name `longshot_ctl.py relaunch`, so merge after it. What is right: the switch is off unless set (`env_on`), nothing is looked for when off, and the only thing taken is `<renderer>.new` beside the executable's own renderer, never a path from the environment. `stage_renderer.py` copies whole and replaces atomically; a failed move is logged and the old renderer loads. Points, none blocking on their own: 1. The check does not look at `MKWVK_API_VERSION`. The docs say the trees "must have the same MKWVK_API_VERSION", but `stage_renderer.py` only pairs symbols. The runtime does refuse a renderer whose `version` differs (`load_vulkan`), but only after the swap has already replaced the old file, and then it draws nothing, with no way back. On Windows the check is also vacuous: the renderer imports nothing from the executable, so `missing()` returns the empty set and anything is staged. That is the platform the PR was measured on. A renderer from a tree with another vk ABI is exactly what the PR text promises to refuse, and on Windows it won't be. Suggest reading the version out of the staged file (the `mkwvk_init` result is the only place it lives, so either export a `mkwvk_api_version` constant or compare against a string the build bakes in) or saying plainly in the docs and in the description that the pairing check is Linux-only and the ABI version is checked at load. 2. `dev_dll_swap` deletes the old renderer by `MoveFileEx(..., REPLACE_EXISTING)`, so a bad `.new` leaves no renderer to fall back to. Keeping the old one as `.old` would make the "turning it off" line true. 3. Test T-PZ2F (Linux, in the game) is the PR's own Must be tested and is still open; so it stays a comment, not an approval. Verdict: comment. Safe by default; the version-check gap in (1) is worth a decision from the author before merge.
feat(runtime): HOS_DEV_DLL_SWAP takes only a renderer of the game's vk interface, and keeps the old one as .old
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
CI / Conventional Commit title (pull_request) Failing after 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 5s
Third-party parts / As their notes say (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Successful in 3s
45fa6e422f
HumanBean's review: stage_renderer.py paired symbols only, which on Windows
checks nothing (the renderer imports nothing from the executable), and a
renderer of another MKWVK_API_VERSION was refused only by mkwvk_init, after
the swap had deleted the old one. The renderer now exports
mkwvk_api_version and the executable mkwvk_host_api_version (on Linux
through build.py's --export-dynamic-symbol), the MKWVK_API_VERSION each was
built with; neither is part of MkwVkHost or MkwVkRenderer, so the version
stays. stage_renderer.py reads both from the files without loading them
(exported_u32: a PE export table or an ELF file's dynamic symbols) and
refuses another version, or none, on both platforms. dev_dll_swap reads
the staged file's version the same way before anything moves, leaves
another one where it is, and keeps the old renderer as <name>.old, put
back if the move fails; stage_renderer.py --undo moves it back by hand.
docs/development.md says how. tests/test_stage_renderer.py: the versions
read from a real DLL and EXE (Windows) or shared object and executable
(Linux), the refusals, --undo, and the swap with a staged renderer of the
same version, another and none.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Author
Member

Thanks for the review. Pushed 45fa6e42 (one commit on your 0fde8ca2; it still merges cleanly with main). Your points, in order:

  1. No MKWVK_API_VERSION check, and vacuous on Windows. The version is exported now.

    • The renderer exports const unsigned mkwvk_api_version (gpu/vk/vk_main.cpp) and the executable mkwvk_host_api_version (host/rx_backend.c; on Linux through nx2/build.py's --export-dynamic-symbol), each the MKWVK_API_VERSION it was built with. These are new exports, not changes to MkwVkHost or MkwVkRenderer, so the version itself doesn't move; vk_api.h says so beside mkwvk_init.
    • stage_renderer.py reads both from the files without loading them: a PE export table, or an ELF file's dynamic symbols. It refuses, on Windows too, a renderer of another version, or either file without the export, before it looks at symbols.
    • dev_dll_swap reads the staged file's version the same way before anything moves. One of another version, or with none, is left where it is, and the old renderer loads, with the version found in the log.
    • The docs now say what each check covers, including that on Windows the version is the check that matters.
  2. The old renderer was deleted. It's kept as <renderer>.old now: the old one is moved aside first, then the staged one over it, and if that second move fails the old one is put back. stage_renderer.py --undo <game folder> moves .old back by hand. docs/development.md (Trying a renderer change in place, the switch's row) and the Risks section's "Turning it off" line say how.

  3. Testing. tests/test_stage_renderer.py builds real binaries with the exports: a DLL and EXE on Windows, a shared object and executable on Linux. It checks:

    • the versions read from them;
    • refusals for another version, no version, and an executable from before the export;
    • --undo;
    • dev_dll_swap with a staged renderer of the same version (taken, old one kept as .old), another version and none (both left where they are).

    It passes on Windows (real Win32 calls) and Linux (Docker, over the POSIX shim). The reader also finds mkwvk_close_asked in the local work folder's real longshot_vk.dll, and no version in it, as expected for a build from before. host/rx_backend.c and gpu/vk/vk_main.cpp compile on this head and on main for Windows (llvm-mingw) and Linux (gcc, clang 19). The checks that read the diff: 104 passed, 5 skipped, 10 failed, each failing on main too. T-PZ2F (Linux, in the game) is still open, and I've added a Windows check of a whole build under Must be tested.

This still merges after #97.

Thanks for the review. Pushed 45fa6e42 (one commit on your 0fde8ca2; it still merges cleanly with main). Your points, in order: 1. **No `MKWVK_API_VERSION` check, and vacuous on Windows.** The version is exported now. - The renderer exports `const unsigned mkwvk_api_version` (`gpu/vk/vk_main.cpp`) and the executable `mkwvk_host_api_version` (`host/rx_backend.c`; on Linux through `nx2/build.py`'s `--export-dynamic-symbol`), each the `MKWVK_API_VERSION` it was built with. These are new exports, not changes to `MkwVkHost` or `MkwVkRenderer`, so the version itself doesn't move; `vk_api.h` says so beside `mkwvk_init`. - `stage_renderer.py` reads both from the files without loading them: a PE export table, or an ELF file's dynamic symbols. It refuses, on Windows too, a renderer of another version, or either file without the export, before it looks at symbols. - `dev_dll_swap` reads the staged file's version the same way **before anything moves**. One of another version, or with none, is left where it is, and the old renderer loads, with the version found in the log. - The docs now say what each check covers, including that on Windows the version is the check that matters. 2. **The old renderer was deleted.** It's kept as `<renderer>.old` now: the old one is moved aside first, then the staged one over it, and if that second move fails the old one is put back. `stage_renderer.py --undo <game folder>` moves `.old` back by hand. `docs/development.md` (*Trying a renderer change in place*, the switch's row) and the Risks section's "Turning it off" line say how. 3. **Testing.** `tests/test_stage_renderer.py` builds real binaries with the exports: a DLL and EXE on Windows, a shared object and executable on Linux. It checks: - the versions read from them; - refusals for another version, no version, and an executable from before the export; - `--undo`; - `dev_dll_swap` with a staged renderer of the same version (taken, old one kept as `.old`), another version and none (both left where they are). It passes on Windows (real Win32 calls) and Linux (Docker, over the POSIX shim). The reader also finds `mkwvk_close_asked` in the local work folder's real `longshot_vk.dll`, and no version in it, as expected for a build from before. `host/rx_backend.c` and `gpu/vk/vk_main.cpp` compile on this head and on main for Windows (llvm-mingw) and Linux (gcc, clang 19). The checks that read the diff: 104 passed, 5 skipped, 10 failed, each failing on main too. T-PZ2F (Linux, in the game) is still open, and I've added a Windows check of a whole build under Must be tested. This still merges after #97.
dyst force-pushed feat/renderer-swap from 45fa6e422f
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
CI / Conventional Commit title (pull_request) Failing after 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 5s
Third-party parts / As their notes say (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Successful in 3s
to 6575b59043
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 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 6s
Third-party parts / As their notes say (pull_request) Successful in 9s
PR description / Description follows the template (pull_request_target) Successful in 4s
2026-11-16 01:00:28 +00:00
Compare
Author
Member

Rebased onto main d9486a08 and pushed (head now 6575b590). One conflict, in nx2/build.py: main's #30 moved the Linux executable's link to run_link; kept that and this PR's extra --export-dynamic-symbol=mkwvk_host_api_version in it. The four earlier commits now carry the dyst identity as author too. Nothing else in them changed.

One new commit, 6575b590 (docs): #97 has merged, so longshot_ctl.py relaunch is on main. Trying a renderer change in place now gives it as the step after the first start: the game is started once with HOS_DEV_DLL_SWAP=1, then relaunch starts it again with the same environment. The description no longer says this PR waits for #97.

Thanks again for the review, HumanBean. Where your points stand on this head:

  1. The MKWVK_API_VERSION check, and the Windows gap. Done in 45fa6e42 and unchanged by the rebase. The renderer exports mkwvk_api_version and the executable mkwvk_host_api_version. stage_renderer.py refuses a mismatch, or a missing export, on both platforms. dev_dll_swap checks the staged file's version before anything moves.
  2. The old renderer was deleted. Also done in 45fa6e42. It's kept as <renderer>.old, it goes back if the second move fails, and stage_renderer.py --undo restores it.
  3. T-PZ2F (Linux, in the game). Still open. It stays under Must be tested, and I'm not asking for approval until it has run.

Checks on this head: the 130 checks that read this diff, not the whole suite. 111 passed, 6 were skipped for missing tools, and 13 failed. All 13 fail the same way on a clean checkout of main d9486a08; the names are under Testing. tests/test_stage_renderer.py passed on Windows and on Linux (Docker, gcc 14.2). host/rx_backend.c compiles clean on both. The Measurements are still from the PR's first head. Timed runs of main against this head are coming and will go in the description.

Rebased onto main d9486a08 and pushed (head now 6575b590). One conflict, in `nx2/build.py`: main's #30 moved the Linux executable's link to `run_link`; kept that and this PR's extra `--export-dynamic-symbol=mkwvk_host_api_version` in it. The four earlier commits now carry the dyst identity as author too. Nothing else in them changed. One new commit, 6575b590 (docs): #97 has merged, so `longshot_ctl.py relaunch` is on main. *Trying a renderer change in place* now gives it as the step after the first start: the game is started once with `HOS_DEV_DLL_SWAP=1`, then `relaunch` starts it again with the same environment. The description no longer says this PR waits for #97. Thanks again for the review, HumanBean. Where your points stand on this head: 1. **The `MKWVK_API_VERSION` check, and the Windows gap.** Done in 45fa6e42 and unchanged by the rebase. The renderer exports `mkwvk_api_version` and the executable `mkwvk_host_api_version`. `stage_renderer.py` refuses a mismatch, or a missing export, on both platforms. `dev_dll_swap` checks the staged file's version before anything moves. 2. **The old renderer was deleted.** Also done in 45fa6e42. It's kept as `<renderer>.old`, it goes back if the second move fails, and `stage_renderer.py --undo` restores it. 3. **T-PZ2F (Linux, in the game).** Still open. It stays under Must be tested, and I'm not asking for approval until it has run. Checks on this head: the 130 checks that read this diff, not the whole suite. 111 passed, 6 were skipped for missing tools, and 13 failed. All 13 fail the same way on a clean checkout of main d9486a08; the names are under Testing. `tests/test_stage_renderer.py` passed on Windows and on Linux (Docker, gcc 14.2). `host/rx_backend.c` compiles clean on both. The Measurements are still from the PR's first head. Timed runs of main against this head are coming and will go in the description.
dyst force-pushed feat/renderer-swap from 6575b59043
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 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 6s
Third-party parts / As their notes say (pull_request) Successful in 9s
PR description / Description follows the template (pull_request_target) Successful in 4s
to d1aef96699
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 13s
PR description / Description follows the template (pull_request_target) Successful in 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
Third-party parts / As their notes say (pull_request) Successful in 24s
2026-11-16 07:28:42 +00:00
Compare
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 13s
PR description / Description follows the template (pull_request_target) Successful in 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
Third-party parts / As their notes say (pull_request) Successful in 24s
This pull request has changes conflicting with the target branch.
  • docs/development.md
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/renderer-swap:dyst-feat/renderer-swap'
git switch 'dyst-feat/renderer-swap'
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!183
No description provided.