WIP: perf(lift): RX_POLL_PRESERVE=1, the interrupt poll's call keeps the caller's registers (compile only, off) #1985

Draft
siantm wants to merge 5 commits from siantm/Longshot:perf/lift-poll-preserve into main
Contributor

Summary

A lifted loop's back-edge poll calls a64_poll_cur() only when the interrupt flag is set, but under the C convention
every polled loop moves its live values to callee-saved registers or spills them for that rare call. With
RX_POLL_PRESERVE=1 the generated a64.h declares the poll with clang's preserve_most (x86-64): the call keeps every
general-purpose integer register but R11 for its caller. The lifted code and the host's files include that header, and
host/mkw_glue.c's definition takes the convention from the declaration, so caller and callee cannot disagree. The
native build only (the emulator-hosted DLL polls through a64_poll(c)). Unset or off, a64.h is main's byte for
byte, so no lifted object's key changes. Compile only; the build's log names the mode, and dev.py pack builds the
game when it is on. From 2a831341 on a local performance branch, reworked in review.

Read first: rt_header and host_flags in nx2/build.py, POLL_PRESERVE in nx2/rtgen.py,
docs/dev/reference/poll-convention.md, tests/test_poll_preserve.py.

Testing

Tested: Windows 11, i7-9700, RTX 4060, llvm-mingw clang 23.1.5, Python 3.14.7 (the Builder's); game-free checks
only. This change has not run in the game on this PC yet, with the switch on or off (Still to test). Each check ran in
a hidden console of its own, through the PC's job queue (job fb2-1985-final), at 8e9d1c21 on main @ f1f2dc5b, the
test run with no arguments (its compiler found through LONGSHOT_MINGW, as tests/run_all.py gives it):

  • python -I -B tests/test_poll_preserve.py: exit 0, "all passed": the header main's for every off value and different
    in the poll's declaration alone for every on value; seeds 1 to 3, O1 and O2, bitmap off and on, the same digest, polls
    and marks with the switch off and on (e.g. "seed 3, O2, bitmap on: off 3b699ce7951861dc 7657 3701, on 3b699ce7951861dc
    7657 3701"); "a definition without preserve_most under callers with it: caught in 12 of 12 programs".
  • python -I -B tests/test_vk_pgo.py (pack routes), tests/test_split_giants.py and tests/test_light_passes.py
    (both import nx2/build.py and write the guest model): exit 0 each.

Earlier, at 7de00eaf (the first form, -DA64_POLL_PRESERVE on both sides), python -I -B tests/run_all.py --strict --changed origin/main on main @ 2e1f6c32: 102 passed, 22 failed, 7 skipped; the 21 failures that fail on main too
and the one tests/test_prepare_stall.py failure that did not repeat are named in the comment of that run. That run
was not repeated on this head. Two of those 21, test_pipeline_states.py and test_recorder_sync.py, had found no Vulkan headers in that run (RX_CPM unset) and compiled nothing on either side; run again with the headers at 8e9d1c21 and on main @ f1f2dc5b, test_pipeline_states.py passes on both and test_recorder_sync.py fails on main too with the same lines.

Round 2 (dev.py base and the shared base): the base is keyed by its commit alone, and dev.py base passed the
caller's environment to its build, so a base first built with RX_POLL_PRESERVE=1 became the off side of every later A/B. Now
the shared base's build leaves the switch out (scripts/devtools/build.py cmd_base, packs.GAME_COMPILE_SWITCHES).
The branch was rebased unchanged onto main @ 9dd41326 (git range-diff: "=" for the PR's commit). Through the PC's job
queue (job fb2-lift-r2, RX_CPM set, each check in a hidden console of its own, 20 minutes at most):

  • python -I -B tests/test_poll_preserve.py at the test commit b7311dc7: exit 1, "1 failed": "dev.py base, RX_POLL_PRESERVE=1 then unset: its
    build leaves RX_POLL_PRESERVE out, as main builds it"; at the fix, head ba4c0cac: exit 0, "all passed" (both orders, one base build,
    without the switch).
  • tests/test_vk_pgo.py and tests/test_light_passes.py at ba4c0cac: exit 0 each.

Round 3 (dev.py packs base and a base you name): round 2 left the switch out only in dev.py base. The
documented dev.py packs base runs packs.cmd_base directly, whose build still took RX_POLL_PRESERVE from the caller's
environment, so a named base built with it on was what a later dev.py packs rt with it unset copied. Now
packs.cmd_base, where both commands converge, builds with the game's compile-only experiments
(GAME_COMPILE_SWITCHES) taken out of the environment after packs.run merges the caller's; the wrapper's own strip is
gone. A pack with the switch on still builds its own game in that mode. On main @ 9dd41326 (main has not moved; the
earlier commits are unchanged), through the PC's job queue (job fb2-lift-r3b, light, two checks at once at most,
RX_CPM set, each check in a hidden console of its own, 20 minutes at most):

  • python -I -B tests/test_poll_preserve.py at the test commit 2f2b979d: exit 1, "2 failed": "dev.py packs base, RX_POLL_PRESERVE=1 first,
    unset second: the base's build (make_game.py's environment) has no RX_POLL_PRESERVE, as main builds it" and "...: dev.py packs
    rt with the switch unset and no pack runs a game built off (got on)"; at the fix, head 5c1c3a6c: exit 0, "all passed"
    (dev.py packs base and dev.py base, each with the switch on first and unset second and the other way round, then
    dev.py packs rt with no pack, and dev.py packs pack and rt with the switch on).
  • tests/test_dev_packs.py and tests/test_dev_build.py at 5c1c3a6c: one failure each, the same on main @ 9dd41326
    in the same job ("every file the renderer keeps beside the game is classified (unknown:
    ['longshot_fsr4_pipelines.bin'])"; Linux.test_folders: C:\Users\User\Games against C:\Users\User/Games).

In the game, on this PC (Windows 11, i7-9700, RTX 4060), 2026-11-22: Kokiri Forest 800x600, RX_POLL_PRESERVE unset against
set at build, both at 5c1c3a6c, a warm-up a side then 8 interleaved runs a side, every run in the same scene state: median
calm game time a frame 9.99 against 10.12 ms with it on, 1.3 % higher, no gain shown (Measurements).

Still to test:

  • Windows 11, this PC (i7-9700): a clean build of the game with RX_POLL_PRESERVE unset and with it set, its build time and the
    executable's size, expecting figures for Measurements (by hand)
  • Linux: python3 -I -B tests/test_poll_preserve.py, expecting it to pass; and the game built with the switch unset and set, played in
    Kokiri Forest, expecting no crash and frame times alike (by hand)
  • Steam Deck: the game with RX_POLL_PRESERVE unset and set, Kokiri Forest or the Market, a few interleaved runs a side, expecting
    no crash and frame times alike (by hand)
  • Windows and Linux (Test Farm): the existing request, default lifted C and lift timing with the switch unset against
    main @ 9dd41326, expecting the same lifted code; held until the farm pairs this head with 9dd41326 (the Test Farm request already on this PR)

Measurements

Verdict: RX_POLL_PRESERVE ships off (the maintainer's request, while the enabled and disabled results are gathered). In play,
no gain: the median calm game time a frame is 1.3 % higher with the switch on (10.12 against 9.99 ms), inside the spread. Eight runs a side resolve roughly 1.5 to 2 % on the median (an estimate: identical runs of one build spread
about 5 % end to end in calm game time). The switch stays off.

In play: Kokiri Forest, off against on at 5c1c3a6c, 8 runs a side (the current reading)

Setup: Windows 11, i7-9700, RTX 4060, run alone on the PC on 2026-11-22, 07:33 to 08:22 UTC; Kokiri Forest (child), 800x600
(CPU-paced), frame cap off, 60 s a run; a warm-up a side, then 8 interleaved runs a side (off on on off, four times). The
teleport into the scene checked as taken in every run, so every run is in the same (light) scene state; the GPU cooled
to 70 °C before each run, its median clock over each measured stretch its full 2,745 to 2,760 MHz (the few dips are in
the clk_min column). Calm game time: the measured 60 s in six
10 s windows, each window whose median game time is more than 20 % above the run's lowest dropped (a burst), then the
median game time of the frames left; blocked: the game thread's wait over the same frames.

Baseline: this PR with RX_POLL_PRESERVE unset (off), which builds with main's flags and header, so it stands for main @ 9dd41326
(the merge base); on = set at build.

Kokiri Forest, 8 runs a side, median (range) Before, switch unset: this PR @ 5c1c3a6c After, RX_POLL_PRESERVE=1: this PR @ 5c1c3a6c
calm game ms a frame 9.99 (9.84 to 10.41) 10.12 (9.90 to 10.34)
fps 88.1 (79.2 to 91.3) 88.8 (76.2 to 92.0)
p99 frame ms 17.9 (15.8 to 47.1) 17.2 (15.7 to 40.8)
blocked ms a frame 8.29 (8.11 to 8.49) 8.33 (8.03 to 8.68)
burst windows dropped 2 runs, 3 windows 2 runs, 3 windows

Each run (the run's table; game and calm in ms a frame; clock in MHz over the measured stretch):

tag           runtime   fps   med_ms  p99_ms  low1  class  game   calm   bursts  blocked  gpu_start  gpu_max  slowed  cool_wait  clock  clk_min  idle_s
pp4-warm-off  poll-off  86.5  10.79   36.18   27.6  light  10.14  10.14  0       8.24     72         76       0.00    10 s       2760   2760     0
pp4-warm-on   poll-on   79.1  11.35   39.31   25.4  light  10.64  10.21  2       8.62     72         77       0.00    5 s        2760   2760     0
pp4-off1      poll-off  88.9  10.84   16.30   61.4  light  10.30  10.30  0       8.22     73         82       0.00    5 s        2760   2760     0
pp4-on2       poll-on   76.2  11.37   40.76   24.5  light  10.63  10.33  2       8.68     74         76       0.00    10 s       2760   2760     0
pp4-on3       poll-on   91.2  10.63   16.28   61.4  light  10.14  10.14  0       8.10     73         84       0.01    5 s        2760   2760     0
pp4-off4      poll-off  79.2  11.29   33.01   30.3  light  10.42  9.94   2       8.49     72         78       0.00    5 s        2760   2760     0
pp4-off5      poll-off  91.3  10.59   15.80   63.3  light  9.85   9.85   0       8.13     73         84       0.00    10 s       2760   2760     0
pp4-on6       poll-on   92.0  10.53   15.72   63.6  light  10.02  10.02  0       8.03     73         81       0.00    5 s        2760   2760     0
pp4-on7       poll-on   90.6  10.65   16.12   62.0  light  9.90   9.90   0       8.20     74         83       0.00    10 s       2760   2760     0
pp4-off8      poll-off  88.0  10.97   16.96   59.0  light  10.12  10.12  0       8.36     74         82       0.00    5 s        2760   2760     0
pp4-off9      poll-off  79.2  10.61   47.07   21.2  light  9.93   9.84   1       8.11     74         82       0.00    10 s       2760   1575     11
pp4-on10      poll-on   82.5  11.08   34.01   29.4  light  10.29  10.09  1       8.45     72         76       0.00    5 s        2760   2760     0
pp4-on11      poll-on   91.1  10.59   16.77   59.6  light  10.03  10.03  0       8.10     70         83       0.00    0 s        2760   2760     0
pp4-off12     poll-off  89.6  10.70   17.73   56.4  light  9.91   9.91   0       8.20     74         80       0.00    10 s       2760   2760     0
pp4-off13     poll-off  88.2  10.89   17.97   55.6  light  10.04  10.04  0       8.35     74         81       0.00    10 s       2760   2760     0
pp4-on14      poll-on   87.0  11.03   17.72   56.5  light  10.34  10.34  0       8.46     74         82       0.00    10 s       2760   2760     0
pp4-on15      poll-on   82.5  11.09   39.10   25.6  light  10.25  10.25  0       8.49     73         83       0.00    10 s       2760   2760     0
pp4-off16     poll-off  87.7  10.96   18.41   54.3  light  10.41  10.41  0       8.35     73         77       0.00    5 s        2760   2760     0

Clean build time and size, Linux and the Steam Deck are not measured.

Game-free checks

Setup: Windows 11, i7-9700, llvm-mingw clang 23.1.5; tests/test_poll_preserve.py through the PC's job queue

Before: main @ 51f5f9da (the first form's test file copied in) After: this PR @ 8e9d1c21
tests/test_poll_preserve.py fails (no poll_cc_flags) all passed: seeds 1 to 3, O1 and O2, bitmap off and on, off and on alike; a mismatched definition caught in 12 of 12 programs

Risks

Caller and callee must agree on the convention: both take it from the one generated a64.h, and the test shows a
definition built without it going wrong under callers built with it. Off by default: unset, the build and its header are
main's. Turning it off is unsetting it and building again: an executable keeps what it was built with. Changing it
compiles the lifted code and the host's files again, and translates the game again where the translated C is gone (a
player's build folder; a development checkout and LONGSHOT_KEEP_BUILD_FILES=1 keep it). Nothing a player keeps
(saves, longshot_options.ini) changes.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary A lifted loop's back-edge poll calls `a64_poll_cur()` only when the interrupt flag is set, but under the C convention every polled loop moves its live values to callee-saved registers or spills them for that rare call. With `RX_POLL_PRESERVE=1` the generated `a64.h` declares the poll with clang's `preserve_most` (x86-64): the call keeps every general-purpose integer register but R11 for its caller. The lifted code and the host's files include that header, and `host/mkw_glue.c`'s definition takes the convention from the declaration, so caller and callee cannot disagree. The native build only (the emulator-hosted DLL polls through `a64_poll(c)`). Unset or off, `a64.h` is main's byte for byte, so no lifted object's key changes. Compile only; the build's log names the mode, and `dev.py pack` builds the game when it is on. From 2a831341 on a local performance branch, reworked in review. Read first: `rt_header` and `host_flags` in `nx2/build.py`, `POLL_PRESERVE` in `nx2/rtgen.py`, `docs/dev/reference/poll-convention.md`, `tests/test_poll_preserve.py`. ## Testing **Tested:** Windows 11, i7-9700, RTX 4060, llvm-mingw clang 23.1.5, Python 3.14.7 (the Builder's); game-free checks only. This change has not run in the game on this PC yet, with the switch on or off (Still to test). Each check ran in a hidden console of its own, through the PC's job queue (job fb2-1985-final), at 8e9d1c21 on `main` @ f1f2dc5b, the test run with no arguments (its compiler found through `LONGSHOT_MINGW`, as `tests/run_all.py` gives it): - `python -I -B tests/test_poll_preserve.py`: exit 0, "all passed": the header main's for every off value and different in the poll's declaration alone for every on value; seeds 1 to 3, O1 and O2, bitmap off and on, the same digest, polls and marks with the switch off and on (e.g. "seed 3, O2, bitmap on: off 3b699ce7951861dc 7657 3701, on 3b699ce7951861dc 7657 3701"); "a definition without preserve_most under callers with it: caught in 12 of 12 programs". - `python -I -B tests/test_vk_pgo.py` (pack routes), `tests/test_split_giants.py` and `tests/test_light_passes.py` (both import `nx2/build.py` and write the guest model): exit 0 each. Earlier, at 7de00eaf (the first form, `-DA64_POLL_PRESERVE` on both sides), `python -I -B tests/run_all.py --strict --changed origin/main` on `main` @ 2e1f6c32: 102 passed, 22 failed, 7 skipped; the 21 failures that fail on `main` too and the one `tests/test_prepare_stall.py` failure that did not repeat are named in the comment of that run. That run was not repeated on this head. Two of those 21, `test_pipeline_states.py` and `test_recorder_sync.py`, had found no Vulkan headers in that run (`RX_CPM` unset) and compiled nothing on either side; run again with the headers at 8e9d1c21 and on `main` @ f1f2dc5b, `test_pipeline_states.py` passes on both and `test_recorder_sync.py` fails on `main` too with the same lines. **Round 2** (`dev.py base` and the shared base): the base is keyed by its commit alone, and `dev.py base` passed the caller's environment to its build, so a base first built with `RX_POLL_PRESERVE=1` became the off side of every later A/B. Now the shared base's build leaves the switch out (`scripts/devtools/build.py` `cmd_base`, `packs.GAME_COMPILE_SWITCHES`). The branch was rebased unchanged onto `main` @ 9dd41326 (`git range-diff`: "=" for the PR's commit). Through the PC's job queue (job fb2-lift-r2, `RX_CPM` set, each check in a hidden console of its own, 20 minutes at most): - `python -I -B tests/test_poll_preserve.py` at the test commit b7311dc7: exit 1, "1 failed": "dev.py base, RX_POLL_PRESERVE=1 then unset: its build leaves RX_POLL_PRESERVE out, as main builds it"; at the fix, head ba4c0cac: exit 0, "all passed" (both orders, one base build, without the switch). - `tests/test_vk_pgo.py` and `tests/test_light_passes.py` at ba4c0cac: exit 0 each. **Round 3** (`dev.py packs base` and a base you name): round 2 left the switch out only in `dev.py base`. The documented `dev.py packs base` runs `packs.cmd_base` directly, whose build still took `RX_POLL_PRESERVE` from the caller's environment, so a named base built with it on was what a later `dev.py packs rt` with it unset copied. Now `packs.cmd_base`, where both commands converge, builds with the game's compile-only experiments (`GAME_COMPILE_SWITCHES`) taken out of the environment after `packs.run` merges the caller's; the wrapper's own strip is gone. A pack with the switch on still builds its own game in that mode. On `main` @ 9dd41326 (main has not moved; the earlier commits are unchanged), through the PC's job queue (job fb2-lift-r3b, light, two checks at once at most, `RX_CPM` set, each check in a hidden console of its own, 20 minutes at most): - `python -I -B tests/test_poll_preserve.py` at the test commit 2f2b979d: exit 1, "2 failed": "dev.py packs base, RX_POLL_PRESERVE=1 first, unset second: the base's build (make_game.py's environment) has no RX_POLL_PRESERVE, as main builds it" and "...: dev.py packs rt with the switch unset and no pack runs a game built off (got on)"; at the fix, head 5c1c3a6c: exit 0, "all passed" (`dev.py packs base` and `dev.py base`, each with the switch on first and unset second and the other way round, then `dev.py packs rt` with no pack, and `dev.py packs pack` and `rt` with the switch on). - `tests/test_dev_packs.py` and `tests/test_dev_build.py` at 5c1c3a6c: one failure each, the same on `main` @ 9dd41326 in the same job ("every file the renderer keeps beside the game is classified (unknown: ['longshot_fsr4_pipelines.bin'])"; `Linux.test_folders`: `C:\Users\User\Games` against `C:\Users\User/Games`). In the game, on this PC (Windows 11, i7-9700, RTX 4060), 2026-11-22: Kokiri Forest 800x600, `RX_POLL_PRESERVE` unset against set at build, both at 5c1c3a6c, a warm-up a side then 8 interleaved runs a side, every run in the same scene state: median calm game time a frame 9.99 against 10.12 ms with it on, 1.3 % higher, no gain shown (Measurements). **Still to test:** - Windows 11, this PC (i7-9700): a clean build of the game with `RX_POLL_PRESERVE` unset and with it set, its build time and the executable's size, expecting figures for Measurements (by hand) - Linux: `python3 -I -B tests/test_poll_preserve.py`, expecting it to pass; and the game built with the switch unset and set, played in Kokiri Forest, expecting no crash and frame times alike (by hand) - Steam Deck: the game with `RX_POLL_PRESERVE` unset and set, Kokiri Forest or the Market, a few interleaved runs a side, expecting no crash and frame times alike (by hand) - Windows and Linux (Test Farm): the existing request, default lifted C and lift timing with the switch unset against `main` @ 9dd41326, expecting the same lifted code; held until the farm pairs this head with 9dd41326 (the Test Farm request already on this PR) ## Measurements **Verdict:** `RX_POLL_PRESERVE` ships off (the maintainer's request, while the enabled and disabled results are gathered). In play, no gain: the median calm game time a frame is 1.3 % higher with the switch on (10.12 against 9.99 ms), inside the spread. Eight runs a side resolve roughly 1.5 to 2 % on the median (an estimate: identical runs of one build spread about 5 % end to end in calm game time). The switch stays off. **In play: Kokiri Forest, off against on at 5c1c3a6c, 8 runs a side (the current reading)** Setup: Windows 11, i7-9700, RTX 4060, run alone on the PC on 2026-11-22, 07:33 to 08:22 UTC; Kokiri Forest (child), 800x600 (CPU-paced), frame cap off, 60 s a run; a warm-up a side, then 8 interleaved runs a side (off on on off, four times). The teleport into the scene checked as taken in every run, so every run is in the same (light) scene state; the GPU cooled to 70 °C before each run, its median clock over each measured stretch its full 2,745 to 2,760 MHz (the few dips are in the clk_min column). Calm game time: the measured 60 s in six 10 s windows, each window whose median game time is more than 20 % above the run's lowest dropped (a burst), then the median game time of the frames left; blocked: the game thread's wait over the same frames. Baseline: this PR with `RX_POLL_PRESERVE` unset (off), which builds with `main`'s flags and header, so it stands for `main` @ 9dd41326 (the merge base); on = set at build. | Kokiri Forest, 8 runs a side, median (range) | Before, switch unset: this PR @ 5c1c3a6c | After, RX_POLL_PRESERVE=1: this PR @ 5c1c3a6c | |---|---|---| | calm game ms a frame | 9.99 (9.84 to 10.41) | 10.12 (9.90 to 10.34) | | fps | 88.1 (79.2 to 91.3) | 88.8 (76.2 to 92.0) | | p99 frame ms | 17.9 (15.8 to 47.1) | 17.2 (15.7 to 40.8) | | blocked ms a frame | 8.29 (8.11 to 8.49) | 8.33 (8.03 to 8.68) | | burst windows dropped | 2 runs, 3 windows | 2 runs, 3 windows | Each run (the run's table; game and calm in ms a frame; clock in MHz over the measured stretch): ``` tag runtime fps med_ms p99_ms low1 class game calm bursts blocked gpu_start gpu_max slowed cool_wait clock clk_min idle_s pp4-warm-off poll-off 86.5 10.79 36.18 27.6 light 10.14 10.14 0 8.24 72 76 0.00 10 s 2760 2760 0 pp4-warm-on poll-on 79.1 11.35 39.31 25.4 light 10.64 10.21 2 8.62 72 77 0.00 5 s 2760 2760 0 pp4-off1 poll-off 88.9 10.84 16.30 61.4 light 10.30 10.30 0 8.22 73 82 0.00 5 s 2760 2760 0 pp4-on2 poll-on 76.2 11.37 40.76 24.5 light 10.63 10.33 2 8.68 74 76 0.00 10 s 2760 2760 0 pp4-on3 poll-on 91.2 10.63 16.28 61.4 light 10.14 10.14 0 8.10 73 84 0.01 5 s 2760 2760 0 pp4-off4 poll-off 79.2 11.29 33.01 30.3 light 10.42 9.94 2 8.49 72 78 0.00 5 s 2760 2760 0 pp4-off5 poll-off 91.3 10.59 15.80 63.3 light 9.85 9.85 0 8.13 73 84 0.00 10 s 2760 2760 0 pp4-on6 poll-on 92.0 10.53 15.72 63.6 light 10.02 10.02 0 8.03 73 81 0.00 5 s 2760 2760 0 pp4-on7 poll-on 90.6 10.65 16.12 62.0 light 9.90 9.90 0 8.20 74 83 0.00 10 s 2760 2760 0 pp4-off8 poll-off 88.0 10.97 16.96 59.0 light 10.12 10.12 0 8.36 74 82 0.00 5 s 2760 2760 0 pp4-off9 poll-off 79.2 10.61 47.07 21.2 light 9.93 9.84 1 8.11 74 82 0.00 10 s 2760 1575 11 pp4-on10 poll-on 82.5 11.08 34.01 29.4 light 10.29 10.09 1 8.45 72 76 0.00 5 s 2760 2760 0 pp4-on11 poll-on 91.1 10.59 16.77 59.6 light 10.03 10.03 0 8.10 70 83 0.00 0 s 2760 2760 0 pp4-off12 poll-off 89.6 10.70 17.73 56.4 light 9.91 9.91 0 8.20 74 80 0.00 10 s 2760 2760 0 pp4-off13 poll-off 88.2 10.89 17.97 55.6 light 10.04 10.04 0 8.35 74 81 0.00 10 s 2760 2760 0 pp4-on14 poll-on 87.0 11.03 17.72 56.5 light 10.34 10.34 0 8.46 74 82 0.00 10 s 2760 2760 0 pp4-on15 poll-on 82.5 11.09 39.10 25.6 light 10.25 10.25 0 8.49 73 83 0.00 10 s 2760 2760 0 pp4-off16 poll-off 87.7 10.96 18.41 54.3 light 10.41 10.41 0 8.35 73 77 0.00 5 s 2760 2760 0 ``` Clean build time and size, Linux and the Steam Deck are not measured. **Game-free checks** Setup: Windows 11, i7-9700, llvm-mingw clang 23.1.5; `tests/test_poll_preserve.py` through the PC's job queue | | Before: main @ 51f5f9da (the first form's test file copied in) | After: this PR @ 8e9d1c21 | |---|---|---| | `tests/test_poll_preserve.py` | fails (no `poll_cc_flags`) | all passed: seeds 1 to 3, O1 and O2, bitmap off and on, off and on alike; a mismatched definition caught in 12 of 12 programs | ## Risks Caller and callee must agree on the convention: both take it from the one generated `a64.h`, and the test shows a definition built without it going wrong under callers built with it. Off by default: unset, the build and its header are main's. Turning it off is unsetting it and building again: an executable keeps what it was built with. Changing it compiles the lifted code and the host's files again, and translates the game again where the translated C is gone (a player's build folder; a development checkout and `LONGSHOT_KEEP_BUILD_FILES=1` keep it). Nothing a player keeps (saves, `longshot_options.ini`) changes. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [ ] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
perf(lift): RX_POLL_PRESERVE=1, the interrupt poll's call keeps the caller's registers (compile only, off)
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
81db088d5f
A lifted loop's back-edge poll calls a64_poll_cur() only when the interrupt flag is set, but under the C convention
the call clobbers the caller-saved registers, so every polled loop moves its live values to callee-saved registers or
spills them for a call that is almost never made. With RX_POLL_PRESERVE=1 nx2/build.py gives the lifted code and the
host's files -DA64_POLL_PRESERVE, and rtgen's a64.h declares the poll A64_POLL_CC, clang's preserve_most on x86-64;
host/mkw_glue.c defines it with the same macro, so caller and callee agree. Off by default (the C convention, as
main); compile only, so a build that sets it keeps the lift (make_game.py and dev.py's COMPILE_ONLY_ENV).
docs/dev/reference/poll-convention.md, with the branch's static counts labelled as such.

tests/test_poll_preserve.py: the flags and header text, the poll's declaration and call in a lifted-shaped loop's IR
at -O1/-O2, and the loop built into a program (its poll calling into the C library) run from the same random states
with the switch off and on: same registers, memory, marks and polls taken.

From 2a831341 on exp/x86-asm-sync (where it was on by default, RX_POLL_PRESERVE=0 to disable), as split from the local
trial 7326db9f/92123e22.

Assisted-by: Claude Code
Member

Possibly related, for context:

  • PR #1981 WIP: perf(lift): A64_PIN_REGS, guest registers in host registers across calls (experiment, off: measured no-go) — Overlapping experiment on register preservation in lifted calls
Possibly related, for context: - PR #1981 WIP: perf(lift): A64_PIN_REGS, guest registers in host registers across calls (experiment, off: measured no-go) — Overlapping experiment on register preservation in lifted calls
BeanBot left a comment

Recommendation: Request changes. The generated header invalidates every cached lifted object on the first update even with the switch off. The ABI test can also pass with mismatched production flags, and the in-game gain remains unproven.

An opt-in Clang calling convention lets lifted loops keep more integer registers live across an interrupt poll. It may reduce spills in those loops, at the cost of extra register saves when a poll is taken and a new ABI contract between separately compiled objects.

@fix will do (10)

  1. L1 nx2/rtgen.py:28: The generated a64.h changes even with the switch unset. (more on the line)
  2. L2 (minor) nx2/build.py:1755: The enabled define enters the emulator DLL's object keys even though A64_POLL_CTX calls a64_poll(c) with the C convention. The define also reaches every host source. Scope the variant to the native callers and the host translation unit that defines the poll so an A/B rebuild can reuse unaffected objects.
  3. L3 (minor): The commit says enabling the switch keeps the lift, and Risks says unsetting it leaves caches alone. A normal Builder run discards the lifted C. Changing the switch then invalidates the retained objects and triggers translation again. Explain both cases and document LONGSHOT_KEEP_BUILD_FILES=1 for repeated A/B builds.
  4. L4 docs/dev/reference/poll-convention.md:26: The committed benchmark section includes output sampled from the game and static counts from lifted game functions. (more on the line)
  5. L5 (minor) docs/dev/reference/poll-convention.md:11: The note attributes register preservation to a fiber switch inside the poll. (more on the line)
  6. L6 tests/test_poll_preserve.py:190: Both fixture files use build.flags and the driver supplies its own poll definition. (more on the line)
  7. L7 tests/test_poll_preserve.py:149: The fixture modifies c->poll through cur_ while the running loop accesses the same member through its restrict-qualified context pointer. (more on the line)
  8. L8 tests/test_poll_preserve.py:35: The suite always passes --cc clang, bypassing CC and the configured Builder toolchain. (more on the line)
  9. L9 tests/test_poll_preserve.py:32: The test imports build before isolating its configuration. (more on the line)
  10. L10 (its part an edit can do): Keep the default object keys reusable and scope the mode to the callers and callee. If taken polls show a cost, check whether doing the no-kick check in the attributed wrapper can avoid the ordinary C call for stale requests.

For the author (1) (a run, a measurement or a decision)

  • L10 (minor): The PR opened before the required in-game run. Compare the merge base with the head off and on using interleaved runs in the same scenes, on the same settings and hardware. Report average FPS, 1% lows, median and p99 frame times and taken-poll frequency. Include a busy scheduler scene, Windows and Linux Tier 1 coverage including Deck, and clean build time and size plus the cost of updating a retained build.

Checks: Still running: CI / Conventional Commit title (pull_request), CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request), CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request), CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request), CI / Workflow lint (actionlint) (pull_request), CI / Website build and checks (pull_request), Guide screenshots / Guide images and local UI source review (pull_request), Third-party parts / As their notes say (pull_request), Third-party parts / The same as upstream (pull_request), Website / Website on Cloudflare (pull_request).

More: does it help, other systems, switches, what was read

Does it help: Unproven. The reported Windows fixture on 7de00eaf matched digests and poll counts for three seeds at O1 and O2. The older branch reports 2.2% fewer weighted static instructions and 0.5–1.2% fewer dynamic instructions in a scratch probe. There are no matched gameplay or build measurements for 81db088d against 6e1521a7.

Other systems: Windows and Linux use the changed lifted caller and host wrapper. Hot, cold and split lifted code inherit the flag, so the Steam Deck and other Tier 1 systems need coverage. The wrapper reaches virtual-core scheduling, where latency can affect pacing regardless of GPU vendor. The emulator DLL still uses its context-taking poll but inherits a needless cache-key change when the switch is set. The diff does not change the renderer interface, shader cache inputs, save format, audio or input code.

Switches: RX_POLL_PRESERVE is a build-only A/B switch, off when unset. A64_POLL_PRESERVE is its internal compiler define. The build reference is the correct table for build-only switches. The developer-only scope is appropriate, but measurements have yet to establish a shipping default. Where the translated C was discarded, turning the switch off requires translating and building again.

Reviewed: 81db088d5f against 6e1521a70a: Read all eight diffs, both changed reference pages, the new test and nx2/rtgen.py in full, and the repository rules, standards and PR template. Read the relevant surrounding functions in the larger changed files and traced the scheduler, emulator shim, compiler selection, test runner, object keys and retained translation. Reviewed the reported runs and CI status. Unrelated portions of the larger modules and unrelated historical run records were outside the review. No review-checklist.md or adjacent Tooling checkout was present.; nothing run (a code review).

Checked and fine:

  • The same Clang executable and target feed both halves of the normal native build. The poll flag is included in the object key, and the stale kept-object path prevents linking objects with mismatched flags.
  • The patch changes no poll state accesses, thread ownership, context layout or guest address arithmetic in production. The fixture's generated copy ranges fit its own guest buffer.
  • The experimental environment variable is correctly excluded from lift inputs and documented in the build switch table.
  • The commit carries an Assisted-by trailer. The diff leaves third-party sources, generated artifacts, shaders, menu keys and the renderer API version alone.
  • The substantive change is one topic. The reported isolated watchdog repeats passed twice on both head and base.

Testing: Read-only review. No project code or tests were run. The author reports the Windows fixture passed on an earlier equivalent patch. The broad run reported 102 passes, 22 failures and 7 skips. Twenty-one failures reproduced on the base, and the remaining watchdog failure did not reproduce in isolated repeats. The supplied head CI is still pending.

Overlaps and merge order: No overlap confirmed from the checkout or supplied discussion. The four other experiments appear in the test report without diffs or a demonstrated merge dependency.


Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The generated header invalidates every cached lifted object on the first update even with the switch off. The ABI test can also pass with mismatched production flags, and the in-game gain remains unproven. An opt-in Clang calling convention lets lifted loops keep more integer registers live across an interrupt poll. It may reduce spills in those loops, at the cost of extra register saves when a poll is taken and a new ABI contract between separately compiled objects. **`@fix` will do (10)** 1. **L1** `nx2/rtgen.py:28`: The generated a64.h changes even with the switch unset. (more on the line) 2. **L2** (minor) `nx2/build.py:1755`: The enabled define enters the emulator DLL's object keys even though A64_POLL_CTX calls a64_poll(c) with the C convention. The define also reaches every host source. Scope the variant to the native callers and the host translation unit that defines the poll so an A/B rebuild can reuse unaffected objects. 3. **L3** (minor): The commit says enabling the switch keeps the lift, and Risks says unsetting it leaves caches alone. A normal Builder run discards the lifted C. Changing the switch then invalidates the retained objects and triggers translation again. Explain both cases and document LONGSHOT_KEEP_BUILD_FILES=1 for repeated A/B builds. 4. **L4** `docs/dev/reference/poll-convention.md:26`: The committed benchmark section includes output sampled from the game and static counts from lifted game functions. (more on the line) 5. **L5** (minor) `docs/dev/reference/poll-convention.md:11`: The note attributes register preservation to a fiber switch inside the poll. (more on the line) 6. **L6** `tests/test_poll_preserve.py:190`: Both fixture files use build.flags and the driver supplies its own poll definition. (more on the line) 7. **L7** `tests/test_poll_preserve.py:149`: The fixture modifies c->poll through cur_ while the running loop accesses the same member through its restrict-qualified context pointer. (more on the line) 8. **L8** `tests/test_poll_preserve.py:35`: The suite always passes --cc clang, bypassing CC and the configured Builder toolchain. (more on the line) 9. **L9** `tests/test_poll_preserve.py:32`: The test imports build before isolating its configuration. (more on the line) 10. **L10** (its part an edit can do): Keep the default object keys reusable and scope the mode to the callers and callee. If taken polls show a cost, check whether doing the no-kick check in the attributed wrapper can avoid the ordinary C call for stale requests. **For the author (1)** (a run, a measurement or a decision) - **L10** (minor): The PR opened before the required in-game run. Compare the merge base with the head off and on using interleaved runs in the same scenes, on the same settings and hardware. Report average FPS, 1% lows, median and p99 frame times and taken-poll frequency. Include a busy scheduler scene, Windows and Linux Tier 1 coverage including Deck, and clean build time and size plus the cost of updating a retained build. **Checks:** Still running: `CI / Conventional Commit title (pull_request)`, `CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request)`, `CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request)`, `CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request)`, `CI / Workflow lint (actionlint) (pull_request)`, `CI / Website build and checks (pull_request)`, `Guide screenshots / Guide images and local UI source review (pull_request)`, `Third-party parts / As their notes say (pull_request)`, `Third-party parts / The same as upstream (pull_request)`, `Website / Website on Cloudflare (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The reported Windows fixture on 7de00eaf matched digests and poll counts for three seeds at O1 and O2. The older branch reports 2.2% fewer weighted static instructions and 0.5–1.2% fewer dynamic instructions in a scratch probe. There are no matched gameplay or build measurements for 81db088d against 6e1521a7. **Other systems:** Windows and Linux use the changed lifted caller and host wrapper. Hot, cold and split lifted code inherit the flag, so the Steam Deck and other Tier 1 systems need coverage. The wrapper reaches virtual-core scheduling, where latency can affect pacing regardless of GPU vendor. The emulator DLL still uses its context-taking poll but inherits a needless cache-key change when the switch is set. The diff does not change the renderer interface, shader cache inputs, save format, audio or input code. **Switches:** RX_POLL_PRESERVE is a build-only A/B switch, off when unset. A64_POLL_PRESERVE is its internal compiler define. The build reference is the correct table for build-only switches. The developer-only scope is appropriate, but measurements have yet to establish a shipping default. Where the translated C was discarded, turning the switch off requires translating and building again. **Reviewed:** 81db088d5f7c against 6e1521a70a32: Read all eight diffs, both changed reference pages, the new test and nx2/rtgen.py in full, and the repository rules, standards and PR template. Read the relevant surrounding functions in the larger changed files and traced the scheduler, emulator shim, compiler selection, test runner, object keys and retained translation. Reviewed the reported runs and CI status. Unrelated portions of the larger modules and unrelated historical run records were outside the review. No review-checklist.md or adjacent Tooling checkout was present.; nothing run (a code review). **Checked and fine:** - The same Clang executable and target feed both halves of the normal native build. The poll flag is included in the object key, and the stale kept-object path prevents linking objects with mismatched flags. - The patch changes no poll state accesses, thread ownership, context layout or guest address arithmetic in production. The fixture's generated copy ranges fit its own guest buffer. - The experimental environment variable is correctly excluded from lift inputs and documented in the build switch table. - The commit carries an Assisted-by trailer. The diff leaves third-party sources, generated artifacts, shaders, menu keys and the renderer API version alone. - The substantive change is one topic. The reported isolated watchdog repeats passed twice on both head and base. **Testing:** Read-only review. No project code or tests were run. The author reports the Windows fixture passed on an earlier equivalent patch. The broad run reported 102 passes, 22 failures and 7 skips. Twenty-one failures reproduced on the base, and the remaining watchdog failure did not reproduce in isolated repeats. The supplied head CI is still pending. **Overlaps and merge order:** No overlap confirmed from the checkout or supplied discussion. The four other experiments appear in the test report without diffs or a demonstrated merge dependency. </details> --- <sub>Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.</sub>
@ -0,0 +8,4 @@
`RX_POLL_PRESERVE=1` (a build switch, compile only: not in the lift key; off by default) declares `a64_poll_cur` with
clang's `preserve_most` (`A64_POLL_CC`, `nx2/rtgen.py`): the callee keeps every general register but R11.
- `host/mkw_glue.c`'s definition takes the convention from the declaration and saves the registers itself on its cold
Member

L5 (minor): The note attributes register preservation to a fiber switch inside the poll. The checkpoint can yield and reacquire a virtual core on the same host stack. The attributed wrapper is responsible for preserving integer registers. Correct this note and the corresponding comment in mkw_glue.c, and limit the register claim to the convention's integer registers.

**L5** (minor): The note attributes register preservation to a fiber switch inside the poll. The checkpoint can yield and reacquire a virtual core on the same host stack. The attributed wrapper is responsible for preserving integer registers. Correct this note and the corresponding comment in mkw_glue.c, and limit the register claim to the convention's integer registers.
@ -0,0 +23,4 @@
and other lift changes (flag fusion, loops' stores sunk to their exits) were in both sides; they are not measurements
of main with the switch.
A profile of the game (Kokiri Forest and Hyrule Field, 3 runs each) put the lifted code at 122 / 106 % of a core; its
Member

L4: The committed benchmark section includes output sampled from the game and static counts from lifted game functions. The repository rule covers those derived outputs. Remove the game-derived figures and keep measurements from an authored synthetic fixture plus the PR's permitted gameplay results.

**L4**: The committed benchmark section includes output sampled from the game and static counts from lifted game functions. The repository rule covers those derived outputs. Remove the game-derived figures and keep measurements from an authored synthetic fixture plus the PR's permitted gameplay results.
nx2/rtgen.py Outdated
@ -26,3 +26,3 @@
emulator-hosted DLL (nx2/rt/eden_shim.c), whose host's poll takes the context. */
void a64_poll(Ctx *A64_NOESC c);
void a64_poll_cur(void);
/* (nx2/rtgen.py) A64_POLL_CC under A64_POLL_PRESERVE (nx2/build.py poll_cc_flags): the call keeps every general register
Member

L1: The generated a64.h changes even with the switch unset. build.py hashes its full contents into every lifted object's key, so a player updating from the base gets KEPT_STALE and a full relift and lifted-code compile. Preserve the existing generated header bytes in the default mode and generate the alternate poll declaration only for enabled native builds, with both modes keyed separately.

**L1**: The generated a64.h changes even with the switch unset. build.py hashes its full contents into every lifted object's key, so a player updating from the base gets KEPT_STALE and a full relift and lifted-code compile. Preserve the existing generated header bytes in the default mode and generate the alternate poll declaration only for enabled native builds, with both modes keyed separately.
@ -0,0 +29,4 @@
sys.path.insert(0, os.path.join(ROOT, "nx2"))
sys.path.insert(0, HERE)
import kit # noqa: E402,F401 (a64-kit on the path)
import build # noqa: E402
Member

L9: The test imports build before isolating its configuration. An inherited RX_MARK_BITMAP=0 silently removes bitmap coverage. RX_MARCH can select instructions the local CPU lacks, and RX_TARGET=windows with LONGSHOT_MINGW on Linux produces an executable the test cannot run locally. Isolate the build import and fixture flags with an explicit native target, baseline CPU and mark mode. If cross-target IR coverage is wanted, keep execution native.

**L9**: The test imports build before isolating its configuration. An inherited RX_MARK_BITMAP=0 silently removes bitmap coverage. RX_MARCH can select instructions the local CPU lacks, and RX_TARGET=windows with LONGSHOT_MINGW on Linux produces an executable the test cannot run locally. Isolate the build import and fixture flags with an explicit native target, baseline CPU and mark mode. If cross-target IR coverage is wanted, keep execution native.
@ -0,0 +32,4 @@
import build # noqa: E402
import rtgen # noqa: E402
RUN_ALL_ARGS = ["--cc", "clang"]
Member

L8: The suite always passes --cc clang, bypassing CC and the configured Builder toolchain. A supported Windows setup with LLVM-MinGW available only through LONGSHOT_MINGW fails or skips before find_cc runs. Let the suite discover Clang through the same resolver as the standalone check, honor a Clang supplied via CC, and use target flags that match the resolved compiler.

**L8**: The suite always passes --cc clang, bypassing CC and the configured Builder toolchain. A supported Windows setup with LLVM-MinGW available only through LONGSHOT_MINGW fails or skips before find_cc runs. Let the suite discover Clang through the same resolver as the standalone check, honor a Clang supplied via CC, and use target flags that match the resolved compiler.
@ -0,0 +146,4 @@
A64_POLL_CC void a64_poll_cur(void) {
polls_++;
(void)rand(); /* (a C library call: the caller-saved registers change) */
if (++npoll_ %% 3) __atomic_store_n(&cur_->poll, 1, __ATOMIC_RELAXED);
Member

L7: The fixture modifies c->poll through cur_ while the running loop accesses the same member through its restrict-qualified context pointer. The atomic store still violates the C restrict contract. An optimized build is free to miss the rearm, and both binaries can agree with just one poll per round. Rearm from the loop through c in the fixture and check the expected poll count.

**L7**: The fixture modifies c->poll through cur_ while the running loop accesses the same member through its restrict-qualified context pointer. The atomic store still violates the C restrict contract. An optimized build is free to miss the rearm, and both binaries can agree with just one poll per round. Rearm from the loop through c in the fixture and check the expected poll count.
@ -0,0 +187,4 @@
with switch(value):
fl = build.flags(d, rt, opt, True)
fl += ["-DA64_HOST_BASE=((uintptr_t)guest_mem)", "-include", os.path.join(d, "pre.h")]
r = subprocess.run([cc] + fl + cflags + [os.path.join(d, "loop.c"), os.path.join(d, "driver.c"), "-o", exe],
Member

L6: Both fixture files use build.flags and the driver supplies its own poll definition. A host job that drops the define after host_fl is constructed would still pass the source check, IR check and digest comparison. Compile the real wrapper, or extract it using the existing source-cut helper, as a separate object with the flags from the production host job. Stub the checkpoint with a normal-ABI function that deliberately clobbers volatile integer registers. Check that removing the define from just the host flags fails the test.

**L6**: Both fixture files use build.flags and the driver supplies its own poll definition. A host job that drops the define after host_fl is constructed would still pass the source check, IR check and digest comparison. Compile the real wrapper, or extract it using the existing source-cut helper, as a separate object with the flags from the production host job. Stub the checkpoint with a normal-ABI function that deliberately clobbers volatile integer registers. Check that removing the define from just the host flags fails the test.
futondestroyer left a comment

Recommendation: Request changes. The development pack can silently run the base executable when you ask for the RX_POLL_PRESERVE=1 variant. That can make an on/off comparison measure the same calling convention twice.

Blocking

  • scripts/devtools/build.py:51 excludes the flag from the lift-key diagnostic. Pack selection still depends on source changes and the existing profile switches in scripts/devtools/packs.py:440. With a clean checkout matching a shared base built with the switch unset, RX_POLL_PRESERVE=1 plus dev.py pack makes an empty pack, and dev.py rt takes the base executable. A renderer-only diff also leaves the game executable at the base revision. Route the enabled flag to a game build, using the same on/off parsing as nx2/build.py, and cover both pack routes. Record the effective poll mode for the resulting build so the comparison can verify which ABI each arm used.

Does it help? Gameplay benefit remains unmeasured. In the normal native build, the lifted calls and host definition share the same flag and compiler target, and the object keys distinguish the two modes. The generated runtime header still changes with the flag unset, which invalidates retained object reuse on update. The current fixture exercises a stand-in poll. Extend it to exercise the production host and lifted flags, as the existing review describes. BeanBot’s review of this head

Testing. Reviewed 81db088d5f7c against 6e1521a70a32 with revision-matched source maps and direct source inspection. The author reports a passing Windows fixture on the earlier equivalent patch and two isolated watchdog passes each on the current head and base. Required head CI is pending. Before leaving WIP, use builds whose poll mode is verified to compare gameplay and frame times, clean build time and size, and off-mode update cost. The enabled Windows and Linux paths need a controlled compile-time comparison. Stock Test Farm variants cannot set RX_POLL_PRESERVE for compilation.

**Recommendation: Request changes.** The development pack can silently run the base executable when you ask for the `RX_POLL_PRESERVE=1` variant. That can make an on/off comparison measure the same calling convention twice. **Blocking** - `scripts/devtools/build.py:51` excludes the flag from the lift-key diagnostic. Pack selection still depends on source changes and the existing profile switches in `scripts/devtools/packs.py:440`. With a clean checkout matching a shared base built with the switch unset, `RX_POLL_PRESERVE=1` plus `dev.py pack` makes an empty pack, and `dev.py rt` takes the base executable. A renderer-only diff also leaves the game executable at the base revision. Route the enabled flag to a game build, using the same on/off parsing as `nx2/build.py`, and cover both pack routes. Record the effective poll mode for the resulting build so the comparison can verify which ABI each arm used. **Does it help?** Gameplay benefit remains unmeasured. In the normal native build, the lifted calls and host definition share the same flag and compiler target, and the object keys distinguish the two modes. The generated runtime header still changes with the flag unset, which invalidates retained object reuse on update. The current fixture exercises a stand-in poll. Extend it to exercise the production host and lifted flags, as the existing review describes. [BeanBot’s review of this head](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62620) **Testing.** Reviewed `81db088d5f7c` against `6e1521a70a32` with revision-matched source maps and direct source inspection. The author reports a passing Windows fixture on the earlier equivalent patch and two isolated watchdog passes each on the current head and base. Required head CI is pending. Before leaving WIP, use builds whose poll mode is verified to compare gameplay and frame times, clean build time and size, and off-mode update cost. The enabled Windows and Linux paths need a controlled compile-time comparison. Stock Test Farm variants cannot set `RX_POLL_PRESERVE` for compilation.
@ -49,1 +49,3 @@
COMPILE_ONLY_ENV = ("RX_HOT_OPT", "RX_PGO", "RX_VK_PGO", "RX_VK_PGO_FILE", "RX_A64_RT_O2", "RX_GAME_ONLY") # (make_game.py's: left out of the lift key)
# (make_game.py's: left out of the lift key)
COMPILE_ONLY_ENV = ("RX_HOT_OPT", "RX_PGO", "RX_VK_PGO", "RX_VK_PGO_FILE", "RX_A64_RT_O2", "RX_GAME_ONLY",
"RX_POLL_PRESERVE")
Member

This classifies the switch for the lift-key diagnostic. With a clean checkout and a matching shared base built with the switch unset, RX_POLL_PRESERVE=1 still leaves pack_route at None, so dev.py pack creates an empty pack and dev.py rt runs the base executable. A renderer-only diff also leaves the game at base. Have packs.py route the enabled flag to a game build using the same boolean parsing, and test both routes.

This classifies the switch for the lift-key diagnostic. With a clean checkout and a matching shared base built with the switch unset, RX_POLL_PRESERVE=1 still leaves pack_route at None, so dev.py pack creates an empty pack and dev.py rt runs the base executable. A renderer-only diff also leaves the game at base. Have packs.py route the enabled flag to a game build using the same boolean parsing, and test both routes.
siantm force-pushed perf/lift-poll-preserve from 81db088d5f
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 8e9d1c219d
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 26s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-21 03:43:19 +00:00
Compare
Author
Contributor

Pushed 8e9d1c21 (one commit, on main @ f1f2dc5b; it replaces 81db088d, squashed so that no pushed doc keeps the counts over the game's lifted functions, which are removed as asked). What changed: with the switch unset a64.h is main's byte for byte (the preserve_most declaration is emitted only with the switch on, native build only); the -DA64_POLL_PRESERVE flag is gone, host/mkw_glue.c takes the convention from the one declaration; dev.py pack builds the game when the switch is on; the build's log names the mode; the test links the real a64_poll_cur compiled with the host's flags over a register-clobbering checkpoint, and catches a mismatched definition in 12 of 12 programs. Tested on the new head: tests/test_poll_preserve.py (no arguments), test_vk_pgo.py, test_split_giants.py, test_light_passes.py, all exit 0, through the PC's job queue. Still to test: the in-game A/B and Linux.

Pushed 8e9d1c21 (one commit, on `main` @ f1f2dc5b; it replaces 81db088d, squashed so that no pushed doc keeps the counts over the game's lifted functions, which are removed as asked). What changed: with the switch unset `a64.h` is main's byte for byte (the `preserve_most` declaration is emitted only with the switch on, native build only); the `-DA64_POLL_PRESERVE` flag is gone, `host/mkw_glue.c` takes the convention from the one declaration; `dev.py pack` builds the game when the switch is on; the build's log names the mode; the test links the real `a64_poll_cur` compiled with the host's flags over a register-clobbering checkpoint, and catches a mismatched definition in 12 of 12 programs. Tested on the new head: `tests/test_poll_preserve.py` (no arguments), `test_vk_pgo.py`, `test_split_giants.py`, `test_light_passes.py`, all exit 0, through the PC's job queue. Still to test: the in-game A/B and Linux.
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62884: fixed in 8e9d1c21. scripts/devtools/packs.py pack_route now builds the game when RX_POLL_PRESERVE is on (nx2/kit.py env_on's rule, as nx2/build.py reads it), for an unchanged tree and for a renderer-only change alike; tests/test_poll_preserve.py checks both routes and that 0/off leave the route as it was. The build's log also prints build: RX_POLL_PRESERVE=1: ... when the executable has the convention.

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62884](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62884): fixed in 8e9d1c21. `scripts/devtools/packs.py` `pack_route` now builds the game when `RX_POLL_PRESERVE` is on (nx2/kit.py `env_on`'s rule, as `nx2/build.py` reads it), for an unchanged tree and for a renderer-only change alike; `tests/test_poll_preserve.py` checks both routes and that `0`/`off` leave the route as it was. The build's log also prints `build: RX_POLL_PRESERVE=1: ...` when the executable has the convention.
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62885: addressed in 8e9d1c21 (rebased on main @ f1f2dc5b). The pack route is fixed as in the inline reply (62884), and the build's log records the poll mode. With the switch unset the generated a64.h is now main's byte for byte (the convention is emitted only with the switch on, native build only), so retained objects keep their keys; and the fixture now links the real a64_poll_cur cut out of host/mkw_glue.c, compiled with build.host_flags, over a checkpoint stand-in that overwrites every caller-saved integer register: off and on agree, and a definition built without the switch under callers built with it is caught in 12 of 12 programs. The in-game A/B (merge base, off, on) is pending with the opener.

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62885](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62885): addressed in 8e9d1c21 (rebased on `main` @ f1f2dc5b). The pack route is fixed as in the inline reply ([62884](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62884)), and the build's log records the poll mode. With the switch unset the generated `a64.h` is now main's byte for byte (the convention is emitted only with the switch on, native build only), so retained objects keep their keys; and the fixture now links the real `a64_poll_cur` cut out of `host/mkw_glue.c`, compiled with `build.host_flags`, over a checkpoint stand-in that overwrites every caller-saved integer register: off and on agree, and a definition built without the switch under callers built with it is caught in 12 of 12 programs. The in-game A/B (merge base, off, on) is pending with the opener.
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62613 (L1): fixed in 8e9d1c21. rtgen.write emits the preserve_most declaration only with poll_preserve=True (nx2/build.py rt_header, switch on, native build); otherwise a64.h is main's byte for byte. tests/test_poll_preserve.py compares the header with rtgen.write's default for every off value and checks that the on header differs in that declaration alone.

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62613](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62613) (L1): fixed in 8e9d1c21. `rtgen.write` emits the `preserve_most` declaration only with `poll_preserve=True` (`nx2/build.py` `rt_header`, switch on, native build); otherwise `a64.h` is main's byte for byte. `tests/test_poll_preserve.py` compares the header with `rtgen.write`'s default for every off value and checks that the on header differs in that declaration alone.
Author
Contributor

(L2 in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62620): partly fixed in 8e9d1c21. The emulator-hosted DLL now gets main's header (rt_header(out, dll)), so its keys no longer change; the test checks it. The host's files still rebuild when the switch flips: the convention is on the one declaration every caller and the definition include, which is what keeps them from disagreeing (the define on the command line is gone), and the host is a few files beside the lifted chunks.

(L2 in [https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62620](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62620)): partly fixed in 8e9d1c21. The emulator-hosted DLL now gets main's header (`rt_header(out, dll)`), so its keys no longer change; the test checks it. The host's files still rebuild when the switch flips: the convention is on the one declaration every caller and the definition include, which is what keeps them from disagreeing (the define on the command line is gone), and the host is a few files beside the lifted chunks.
Author
Contributor

(L3 in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62620): fixed in 8e9d1c21. The commit message, docs/dev/reference/poll-convention.md, the build reference row and Risks now say a change of the switch translates the game again where the translated C is gone (a player's build folder), and that an A/B build uses LONGSHOT_KEEP_BUILD_FILES=1 or a development checkout, with the game folder copied between the two builds.

(L3 in [https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62620](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62620)): fixed in 8e9d1c21. The commit message, `docs/dev/reference/poll-convention.md`, the build reference row and Risks now say a change of the switch translates the game again where the translated C is gone (a player's build folder), and that an A/B build uses `LONGSHOT_KEEP_BUILD_FILES=1` or a development checkout, with the game folder copied between the two builds.
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62614 (L4): removed in 8e9d1c21 as asked. The profile-weighted and static counts over the game's lifted functions are gone from the docs, the commit message and the description; the page says the per-function counts were taken locally and are not published, and keeps only the synthetic probe's result, labelled with its branch and PC. The squashed commit replaces the earlier one so no pushed doc still carries them.

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62614](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62614) (L4): removed in 8e9d1c21 as asked. The profile-weighted and static counts over the game's lifted functions are gone from the docs, the commit message and the description; the page says the per-function counts were taken locally and are not published, and keeps only the synthetic probe's result, labelled with its branch and PC. The squashed commit replaces the earlier one so no pushed doc still carries them.
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62615 (L5): fixed in 8e9d1c21. The doc and the comment in host/mkw_glue.c now say the attributed wrapper saves the registers the convention keeps before it calls the checkpoint and restores them after, the checkpoint running on the same stack whether or not it yields; the register claim is limited to the general-purpose integer registers (vector and FP registers stay the caller's to save).

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62615](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62615) (L5): fixed in 8e9d1c21. The doc and the comment in `host/mkw_glue.c` now say the attributed wrapper saves the registers the convention keeps before it calls the checkpoint and restores them after, the checkpoint running on the same stack whether or not it yields; the register claim is limited to the general-purpose integer registers (vector and FP registers stay the caller's to save).
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62616 (L6): fixed in 8e9d1c21. The fixture cuts the real a64_poll_cur out of host/mkw_glue.c with tests/srccut.py, compiles it alone with build.host_flags and the generated header, and links it under a normal-ABI hos_vcore_checkpoint stand-in that overwrites rax, rcx, rdx, rsi, rdi and r8 to r11. Building that definition with main's header while the loops use the switch's goes wrong in 12 of 12 programs, and the test fails if none does.

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62616](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62616) (L6): fixed in 8e9d1c21. The fixture cuts the real `a64_poll_cur` out of `host/mkw_glue.c` with `tests/srccut.py`, compiles it alone with `build.host_flags` and the generated header, and links it under a normal-ABI `hos_vcore_checkpoint` stand-in that overwrites rax, rcx, rdx, rsi, rdi and r8 to r11. Building that definition with main's header while the loops use the switch's goes wrong in 12 of 12 programs, and the test fails if none does.
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62617 (L7): fixed in 8e9d1c21. The poll stand-in no longer touches the context; the copy loop raises the request itself through c every eighth iteration, and the driver checks the exact number of polls taken ((n-1)/8 per call) and the exact marks left after the last poll, with the switch off and on.

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62617](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62617) (L7): fixed in 8e9d1c21. The poll stand-in no longer touches the context; the copy loop raises the request itself through `c` every eighth iteration, and the driver checks the exact number of polls taken ((n-1)/8 per call) and the exact marks left after the last poll, with the switch off and on.
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62618 (L8): fixed in 8e9d1c21. RUN_ALL_ARGS is gone, so the test resolves the compiler itself: --cc, then CC, clang on PATH, then LONGSHOT_MINGW's clang; it uses that compiler's own target (build.target() is dropped from the flags), and a --target in --cflags runs the IR checks only. The final run took the Builder's clang through LONGSHOT_MINGW with no arguments.

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62618](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62618) (L8): fixed in 8e9d1c21. `RUN_ALL_ARGS` is gone, so the test resolves the compiler itself: `--cc`, then `CC`, clang on PATH, then `LONGSHOT_MINGW`'s clang; it uses that compiler's own target (`build.target()` is dropped from the flags), and a `--target` in `--cflags` runs the IR checks only. The final run took the Builder's clang through `LONGSHOT_MINGW` with no arguments.
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62619 (L9): fixed in 8e9d1c21. nx2/build.py is imported with the build's own variables (RX_*, LONGSHOT_*, OOT_*) cleared, RX_MARCH=x86-64 (a baseline every x86-64 CPU runs) and no process allowed to start while it loads; the native target comes from the compiler, and every program is built with the bitmap off and on explicitly.

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62619](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62619) (L9): fixed in 8e9d1c21. `nx2/build.py` is imported with the build's own variables (`RX_*`, `LONGSHOT_*`, `OOT_*`) cleared, `RX_MARCH=x86-64` (a baseline every x86-64 CPU runs) and no process allowed to start while it loads; the native target comes from the compiler, and every program is built with the bitmap off and on explicitly.
Author
Contributor

(L10 in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62620): the edit part is fixed in 8e9d1c21: default object keys stay main's (L1) and the mode is scoped to the native build (L2). Doing the no-kick check inside the attributed wrapper to skip the C call for stale requests depends on taken polls showing a cost, which needs the in-game run; it is pending with the opener, as is the A/B with taken-poll frequency.

(L10 in [https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62620](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-62620)): the edit part is fixed in 8e9d1c21: default object keys stay main's (L1) and the mode is scoped to the native build (L2). Doing the no-kick check inside the attributed wrapper to skip the C call for stale requests depends on taken polls showing a cost, which needs the in-game run; it is pending with the opener, as is the A/B with taken-poll frequency.
Author
Contributor

@Beanstalk This adds a compile switch, RX_POLL_PRESERVE, off by default: set, the lifted code's interrupt poll keeps the caller's registers (nx2/build.py, nx2/rtgen.py, host/mkw_glue.c). The farm cannot build with it set, so only the default build is to test: with the switch unset, the lift and its C must be main's. Please time the lift against main's and check the lifted C is the same, on a Windows PC and on a Linux PC. No game scenario is needed: unset, the game's code is main's.

@Beanstalk This adds a compile switch, RX_POLL_PRESERVE, off by default: set, the lifted code's interrupt poll keeps the caller's registers (nx2/build.py, nx2/rtgen.py, host/mkw_glue.c). The farm cannot build with it set, so only the default build is to test: with the switch unset, the lift and its C must be main's. Please time the lift against main's and check the lifted C is the same, on a Windows PC and on a Linux PC. No game scenario is needed: unset, the game's code is main's.
Member

@siantm only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for 8e9d1c2, and the PR has changed since (ba4c0ca), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@siantm only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `8e9d1c2`, and the PR has changed since (`ba4c0ca`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Author
Contributor

Tested corrected: an earlier run on this PC had no Vulkan headers for the renderer checks (RX_CPM unset), so the ones it listed as also failing on main had compiled nothing on either side. They ran again with the headers at 8e9d1c21 and on main (queue job fb2-vk-1); the description now gives those results. No check fails at this head alone; nothing in the branch changed.

Tested corrected: an earlier run on this PC had no Vulkan headers for the renderer checks (`RX_CPM` unset), so the ones it listed as also failing on `main` had compiled nothing on either side. They ran again with the headers at 8e9d1c21 and on `main` (queue job fb2-vk-1); the description now gives those results. No check fails at this head alone; nothing in the branch changed.
futondestroyer left a comment

Recommendation: Request changes. The revised pack builds the enabled variant, but the shared base can still be built with that variant and reused as the default by anyone working at the same commit.

  • scripts/devtools/packs.py:442 recognizes RX_POLL_PRESERVE when it chooses what a pack builds. Base creation inherits the same environment, and dev.py base selects and reuses its base by commit. On a fresh base at a revision containing this change, building with RX_POLL_PRESERVE=1 stores the enabled executable under the ordinary base directory. An unset dev.py rt --empty or unchanged pack then uses that executable for the supposed off arm. Force the default poll mode at shared-base creation or give differing modes distinct, verified base identities. Add a regression check that creating or reusing the default base under an enabled environment yields an off executable.

The prior pack-routing finding is fixed for a stock base. The revised source keeps the default header bytes, gives the emulator DLL the default header, and uses one declaration for the native caller and callee. The author reports the focused Windows checks passed on this head, and the real-wrapper fixture caught a mismatched ABI in all 12 test programs. Gameplay benefit and clean build cost remain unmeasured. Required head CI is pending.

Reviewed 8e9d1c219d44 against f1f2dc5bd282 and checked the changes since 81db088d5f7c in source and with revision-matched maps. The existing Test Farm request covers the default-mode lift only. The dashboard currently shows older base 6e1521a7; hold the request until the baseline is corrected and the default-mode inputs are explicit. It cannot validate the enabled build with its stock variants. Test Farm request · Test Farm status

**Recommendation: Request changes.** The revised pack builds the enabled variant, but the shared base can still be built with that variant and reused as the default by anyone working at the same commit. - `scripts/devtools/packs.py:442` recognizes `RX_POLL_PRESERVE` when it chooses what a pack builds. Base creation inherits the same environment, and `dev.py base` selects and reuses its base by commit. On a fresh base at a revision containing this change, building with `RX_POLL_PRESERVE=1` stores the enabled executable under the ordinary base directory. An unset `dev.py rt --empty` or unchanged pack then uses that executable for the supposed off arm. Force the default poll mode at shared-base creation or give differing modes distinct, verified base identities. Add a regression check that creating or reusing the default base under an enabled environment yields an off executable. The prior pack-routing finding is fixed for a stock base. The revised source keeps the default header bytes, gives the emulator DLL the default header, and uses one declaration for the native caller and callee. The author reports the focused Windows checks passed on this head, and the real-wrapper fixture caught a mismatched ABI in all 12 test programs. Gameplay benefit and clean build cost remain unmeasured. Required head CI is pending. Reviewed `8e9d1c219d44` against `f1f2dc5bd282` and checked the changes since `81db088d5f7c` in source and with revision-matched maps. The existing Test Farm request covers the default-mode lift only. The dashboard currently shows older base `6e1521a7`; hold the request until the baseline is corrected and the default-mode inputs are explicit. It cannot validate the enabled build with its stock variants. [Test Farm request](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-63137) · [Test Farm status](https://beanstalk.magicbean.dev/prs/1985)
@ -439,1 +439,4 @@
# (nx2/build.py) the game's compile-only experiments: one turned on (nx2/kit.py env_on's rule: unset, empty, 0, false, off or
# no is off) builds the game, whatever changed, so a pack of an unchanged tree or of a renderer change is not the base's game
GAME_COMPILE_SWITCHES = ("RX_POLL_PRESERVE",)
Member

This fixes routing for an enabled pack, but the same switch reaches the compiler from shared-base creation. Build a fresh base at a commit containing the switch with RX_POLL_PRESERVE=1, then run dev.py rt --empty with it unset. The commit-keyed base still supplies the enabled executable. Force the default mode when making shared bases or key and verify the base by its mode as well as commit. Cover fresh creation and reuse.

This fixes routing for an enabled pack, but the same switch reaches the compiler from shared-base creation. Build a fresh base at a commit containing the switch with RX_POLL_PRESERVE=1, then run dev.py rt --empty with it unset. The commit-keyed base still supplies the enabled executable. Force the default mode when making shared bases or key and verify the base by its mode as well as commit. Cover fresh creation and reuse.
siantm force-pushed perf/lift-poll-preserve from 8e9d1c219d
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 26s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to ba4c0caca8
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 6s
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-21 10:31:49 +00:00
Compare
Author
Contributor

Pushed ba4c0cac (on main @ 9dd41326; the PR's commit rebased unchanged): futondestroyer's second look. dev.py base now builds the commit-keyed shared base without RX_VK_MSYNC_PASS, so the base is the default executable whichever order the builds come in; the test commit b7311dc7 fails on it and the fix ba4c0cac passes (job fb2-lift-r2). Testing has the round's results.

Pushed ba4c0cac (on `main` @ 9dd41326; the PR's commit rebased unchanged): futondestroyer's second look. `dev.py base` now builds the commit-keyed shared base without `RX_VK_MSYNC_PASS`, so the base is the default executable whichever order the builds come in; the test commit b7311dc7 fails on it and the fix ba4c0cac passes (job fb2-lift-r2). Testing has the round's results.
Author
Contributor

A correction to 65894: the switch the shared base's build now leaves out is RX_POLL_PRESERVE (the comment named another variable by mistake); the description's Testing section has it right.

A correction to [65894](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-65894): the switch the shared base's build now leaves out is `RX_POLL_PRESERVE` (the comment named another variable by mistake); the description's Testing section has it right.
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-65507: fixed in ba4c0cac (the test first, failing, in b7311dc7). dev.py base (cmd_base) now forces the default mode when it makes a shared base: RX_POLL_PRESERVE (with the other packs.GAME_COMPILE_SWITCHES) is left out of the base's build, and it says so. tests/test_poll_preserve.py runs cmd_base at one revision with the switch on for the fresh creation and unset for the reuse, then the other way round: one build each time, without the switch, so dev.py rt --empty and an unchanged-tree pack with the switch unset get the default executable, and a pack with it set builds its own game. At the test commit the test fails ("dev.py base, RX_POLL_PRESERVE=1 then unset: its build leaves RX_POLL_PRESERVE out"); at ba4c0cac it passes (job fb2-lift-r2).

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-65507](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-65507): fixed in ba4c0cac (the test first, failing, in b7311dc7). `dev.py base` (`cmd_base`) now forces the default mode when it makes a shared base: `RX_POLL_PRESERVE` (with the other `packs.GAME_COMPILE_SWITCHES`) is left out of the base's build, and it says so. `tests/test_poll_preserve.py` runs `cmd_base` at one revision with the switch on for the fresh creation and unset for the reuse, then the other way round: one build each time, without the switch, so `dev.py rt --empty` and an unchanged-tree pack with the switch unset get the default executable, and a pack with it set builds its own game. At the test commit the test fails ("dev.py base, RX_POLL_PRESERVE=1 then unset: its build leaves RX_POLL_PRESERVE out"); at ba4c0cac it passes (job fb2-lift-r2).
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-65508: addressed in b7311dc7 (test) and ba4c0cac (fix), rebased unchanged onto main @ 9dd41326 (range-diff "=" for the PR's commit): shared bases are made in the default poll mode whatever the caller's environment, covered for fresh creation and reuse in both orders (inline 65507). #1978 and #1979 had the same defect and take the same fix this round. Gameplay and clean build cost stay pending with the opener; the farm request is to be redone for this head's merge base with the default-mode inputs stated.

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-65508](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-65508): addressed in b7311dc7 (test) and ba4c0cac (fix), rebased unchanged onto `main` @ 9dd41326 (range-diff "=" for the PR's commit): shared bases are made in the default poll mode whatever the caller's environment, covered for fresh creation and reuse in both orders (inline [65507](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-65507)). #1978 and #1979 had the same defect and take the same fix this round. Gameplay and clean build cost stay pending with the opener; the farm request is to be redone for this head's merge base with the default-mode inputs stated.
Author
Contributor

@Beanstalk This adds a compile switch, RX_POLL_PRESERVE, off by default: set, the lifted code's interrupt poll keeps the caller's registers (nx2/build.py, nx2/rtgen.py, host/mkw_glue.c). The farm cannot build with it set, so only the default build is to test: with the switch unset, the lift and its C must be main's. This head is on main 9dd41326: please compare with main at that merge base. Please time the lift against main's and check the lifted C is the same, on a Windows PC and on a Linux PC. No game scenario is needed: unset, the game's code is main's.

@Beanstalk This adds a compile switch, RX_POLL_PRESERVE, off by default: set, the lifted code's interrupt poll keeps the caller's registers (nx2/build.py, nx2/rtgen.py, host/mkw_glue.c). The farm cannot build with it set, so only the default build is to test: with the switch unset, the lift and its C must be main's. This head is on main 9dd41326: please compare with main at that merge base. Please time the lift against main's and check the lifted C is the same, on a Windows PC and on a Linux PC. No game scenario is needed: unset, the game's code is main's.
Member

@siantm only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for ba4c0ca, and the PR has changed since (5c1c3a6), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@siantm only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `ba4c0ca`, and the PR has changed since (`5c1c3a6`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
futondestroyer left a comment

Recommendation: Request changes. dev.py base now creates the default artifact correctly. The documented dev.py packs base command still builds an enabled executable when the caller has RX_POLL_PRESERVE=1.

  • scripts/devtools/build.py:397 clears the switch only in the wrapper. A direct dev.py packs base call reaches scripts/devtools/packs.py:600 without that cleanup and inherits the flag through make_game. Later, dev.py packs rt on that named base with the flag unset copies the already-enabled executable. An unchanged off-mode pack also supplies no executable override. Enforce the default in the base builder itself, where both commands converge, and extend the fixture to check the build environment from the direct entry point. Enabled packs should still build the game in the requested mode.

The author reports the new test fails before the wrapper fix and passes on ba4c0cac, with the enabled and unset wrapper calls in both orders. The earlier Windows ABI fixture caught all 12 deliberate mismatches. Gameplay benefit and clean build cost remain unmeasured. Required head CI is pending.

Reviewed ba4c0caca807 against 9dd41326e710 and checked the changes since 8e9d1c219d44 with revision-matched maps and direct source inspection. The requested Windows/Linux default-mode lift check is feasible once the Test Farm shows the correct base. Its dashboard currently shows f1f2dc5b. Stock Farm builds cannot enable the compiler switch. Test Farm request · Test Farm status

**Recommendation: Request changes.** `dev.py base` now creates the default artifact correctly. The documented `dev.py packs base` command still builds an enabled executable when the caller has `RX_POLL_PRESERVE=1`. - `scripts/devtools/build.py:397` clears the switch only in the wrapper. A direct `dev.py packs base` call reaches `scripts/devtools/packs.py:600` without that cleanup and inherits the flag through `make_game`. Later, `dev.py packs rt` on that named base with the flag unset copies the already-enabled executable. An unchanged off-mode pack also supplies no executable override. Enforce the default in the base builder itself, where both commands converge, and extend the fixture to check the build environment from the direct entry point. Enabled packs should still build the game in the requested mode. The author reports the new test fails before the wrapper fix and passes on `ba4c0cac`, with the enabled and unset wrapper calls in both orders. The earlier Windows ABI fixture caught all 12 deliberate mismatches. Gameplay benefit and clean build cost remain unmeasured. Required head CI is pending. Reviewed `ba4c0caca807` against `9dd41326e710` and checked the changes since `8e9d1c219d44` with revision-matched maps and direct source inspection. The requested Windows/Linux default-mode lift check is feasible once the Test Farm shows the correct base. Its dashboard currently shows `f1f2dc5b`. Stock Farm builds cannot enable the compiler switch. [Test Farm request](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-65913) · [Test Farm status](https://beanstalk.magicbean.dev/prs/1985)
@ -392,1 +394,4 @@
py, env = environment()
# (a shared base is keyed by its commit alone, and is the off side of every A/B on it: built as main builds it, without
# the game's compile-only experiments; a pack with one on builds its own game, packs.py pack_route)
left = [k for k in packs.GAME_COMPILE_SWITCHES if env.pop(k, None) is not None]
Member

This fixes dev.py base. The documented dev.py packs base entry point bypasses this wrapper and still inherits RX_POLL_PRESERVE=1 through packs.cmd_base → make_game. An unset dev.py packs rt then takes the enabled executable from that named base. Force the default at the base build in packs.py, and exercise the direct entry point in the regression check.

This fixes dev.py base. The documented dev.py packs base entry point bypasses this wrapper and still inherits RX_POLL_PRESERVE=1 through packs.cmd_base → make_game. An unset dev.py packs rt then takes the enabled executable from that named base. Force the default at the base build in packs.py, and exercise the direct entry point in the regression check.
Review of #1985 (futondestroyer): round 2 left the switch out only in the dev.py base wrapper. The documented dev.py packs
base runs packs.cmd_base directly, and its make_game.py build still took RX_POLL_PRESERVE from the caller's environment, so a
named base built with it on was what a later dev.py packs rt with it unset copied. The base check now drives both entry
points through dev.py's own command line, each with the switch on first and unset second and the other way round, then
dev.py packs rt with no pack and dev.py packs pack and rt with the switch on. A stand-in for make_game.py records the
environment the build gets after packs.run's merge and writes executables saying the mode they were built in. Fails
here: the direct command's base build gets the switch when it comes first.

Assisted-by: Claude Code
fix(devtools): dev.py packs base builds the named base without RX_POLL_PRESERVE
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 5s
5c1c3a6c98
Review of #1985 (futondestroyer): round 2 left the switch out only in the dev.py base wrapper (build.py cmd_base). The
documented dev.py packs base runs packs.cmd_base directly, whose make_game.py build took RX_POLL_PRESERVE from the caller's
environment through packs.run, so a named base built with it on was the executable a later dev.py packs rt with it
unset copied, and an unchanged off-mode pack supplies none of its own. The rule now sits where both commands converge:
packs.cmd_base builds with the game's compile-only experiments (GAME_COMPILE_SWITCHES) taken out of the environment
after packs.run merges the caller's, and says so; the wrapper's own strip is gone. A pack with one on still builds its
own game in that mode (pack_route; its make_game.py call keeps the caller's environment).

Assisted-by: Claude Code
Author
Contributor

Pushed 5c1c3a6c (on main @ 9dd41326; the earlier commits unchanged): futondestroyer's third look. dev.py packs base now builds a named base without RX_POLL_PRESERVE too: the rule sits in packs.cmd_base, where it and dev.py base converge, and the wrapper's own strip is gone. The test commit 2f2b979d fails without it and the fix 5c1c3a6c passes (job fb2-lift-r3b). Testing has the round's results; Measurements says the switch stays off by default at the maintainer's request.

Pushed 5c1c3a6c (on `main` @ 9dd41326; the earlier commits unchanged): futondestroyer's third look. `dev.py packs base` now builds a named base without `RX_POLL_PRESERVE` too: the rule sits in `packs.cmd_base`, where it and `dev.py base` converge, and the wrapper's own strip is gone. The test commit 2f2b979d fails without it and the fix 5c1c3a6c passes (job fb2-lift-r3b). Testing has the round's results; Measurements says the switch stays off by default at the maintainer's request.
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-67217: fixed in 5c1c3a6c (the test first, failing, in 2f2b979d). packs.cmd_base, which dev.py packs base runs directly and dev.py base through the queue, now builds the base with RX_POLL_PRESERVE taken out of the environment after packs.run merges the caller's, and the wrapper's strip in scripts/devtools/build.py is gone; a pack with the switch on still builds its own game in that mode. tests/test_poll_preserve.py now drives both entry points through dev.py's command line, enabled first then unset and the reverse, checking the base build's environment and that dev.py packs rt with no pack runs an off game while the enabled pack's runtime runs an on one: 2 failures at 2f2b979d, all passed at 5c1c3a6c (job fb2-lift-r3b).

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-67217](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-67217): fixed in 5c1c3a6c (the test first, failing, in 2f2b979d). `packs.cmd_base`, which `dev.py packs base` runs directly and `dev.py base` through the queue, now builds the base with `RX_POLL_PRESERVE` taken out of the environment after `packs.run` merges the caller's, and the wrapper's strip in `scripts/devtools/build.py` is gone; a pack with the switch on still builds its own game in that mode. `tests/test_poll_preserve.py` now drives both entry points through `dev.py`'s command line, enabled first then unset and the reverse, checking the base build's environment and that `dev.py packs rt` with no pack runs an off game while the enabled pack's runtime runs an on one: 2 failures at 2f2b979d, all passed at 5c1c3a6c (job fb2-lift-r3b).
Author
Contributor

https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-67218: addressed in 2f2b979d (test) and 5c1c3a6c (fix), on main @ 9dd41326 with the earlier commits unchanged. Round 2 covered only the dev.py base wrapper; this round covers the direct dev.py packs base command, with the default applied in packs.cmd_base where both converge (inline 67217). Testing in the description has the round's results (67301); the gameplay comparison and the Test Farm pairing are still open.

[https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-67218](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-67218): addressed in 2f2b979d (test) and 5c1c3a6c (fix), on `main` @ 9dd41326 with the earlier commits unchanged. Round 2 covered only the `dev.py base` wrapper; this round covers the direct `dev.py packs base` command, with the default applied in `packs.cmd_base` where both converge (inline [67217](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-67217)). Testing in the description has the round's results ([67301](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-67301)); the gameplay comparison and the Test Farm pairing are still open.
Author
Contributor

@Beanstalk This adds a compile switch, RX_POLL_PRESERVE, off by default: set, the lifted code's interrupt poll keeps the caller's registers (nx2/build.py, nx2/rtgen.py, host/mkw_glue.c). The farm cannot build with it set, so only the default build is to test: with the switch unset, the lift and its C must be main's. Please time the lift against main's and check the lifted C is the same, on a Windows PC and on a Linux PC. No game scenario is needed: unset, the game's code is main's.

@Beanstalk This adds a compile switch, RX_POLL_PRESERVE, off by default: set, the lifted code's interrupt poll keeps the caller's registers (nx2/build.py, nx2/rtgen.py, host/mkw_glue.c). The farm cannot build with it set, so only the default build is to test: with the switch unset, the lift and its C must be main's. Please time the lift against main's and check the lifted C is the same, on a Windows PC and on a Linux PC. No game scenario is needed: unset, the game's code is main's.
Member

@siantm only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@siantm only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Author
Contributor

Re #1985 (comment) ("Gameplay benefit ... remain unmeasured"): the warmed, interleaved in-game comparison has run at 5c1c3a6c, 8 runs a side in Kokiri Forest (800x600, CPU-paced), every run checked in the same scene state, GPU cooled before each, on this PC alone; off is the switch unset (main's flags and header). Calm game time a frame, median (range): off 9.99 ms (9.84 to 10.41), on 10.12 (9.90 to 10.34), 1.3 % higher with the switch on, inside the spread (eight a side resolve roughly 1.5 to 2 %, an estimate); fps 88.1 against 88.8, the tails alike. Play shows no gain for it. The switch stays off; whether it stays as an off-by-default experiment or is dropped is your call and the author's. Measurements has every run; clean build time and size, Linux and the Steam Deck are not measured.

Re https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1985#issuecomment-67218 ("Gameplay benefit ... remain unmeasured"): the warmed, interleaved in-game comparison has run at 5c1c3a6c, 8 runs a side in Kokiri Forest (800x600, CPU-paced), every run checked in the same scene state, GPU cooled before each, on this PC alone; off is the switch unset (main's flags and header). Calm game time a frame, median (range): off 9.99 ms (9.84 to 10.41), on 10.12 (9.90 to 10.34), 1.3 % higher with the switch on, inside the spread (eight a side resolve roughly 1.5 to 2 %, an estimate); fps 88.1 against 88.8, the tails alike. Play shows no gain for it. The switch stays off; whether it stays as an off-by-default experiment or is dropped is your call and the author's. Measurements has every run; clean build time and size, Linux and the Steam Deck are not measured.
Author
Contributor

Testing brought in line with Measurements: the Kokiri Forest off/on comparison of 2026-11-22 (8 a side at 5c1c3a6c, no gain shown) is now under Tested; Still to test lists what is still open: clean build time and size, Linux, the Steam Deck and the Test Farm run.

Testing brought in line with Measurements: the Kokiri Forest off/on comparison of 2026-11-22 (8 a side at 5c1c3a6c, no gain shown) is now under Tested; Still to test lists what is still open: clean build time and size, Linux, the Steam Deck and the Test Farm run.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 5s
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/lift-poll-preserve:siantm-perf/lift-poll-preserve'
git switch 'siantm-perf/lift-poll-preserve'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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!1985
No description provided.