WIP: perf(linux): the guest memory window at 0x70000000 by default on Linux, so a guest load takes the base in its displacement; Windows opt-in #2711

Draft
klimovich008 wants to merge 9 commits from klimovich008/Longshot:perf/low-memory-base into main
Member

Summary

Every guest memory access in the lifted code adds the guest window's base, and at 16 TB that base needs a 64-bit
constant, so LLVM keeps it in a register or rebuilds it with movabs. With the window at 0x70000000 (under 2 GB) the
base fits in the access's own 32-bit displacement, so a guest load is one instruction with no base register.

What changes, per OS:

  • Linux: the window moves to 0x70000000 by default. The lifted units of a low window are compiled with LLVM's
    constant hoisting off (-mllvm -disable-constant-hoisting); with it on, LLVM kept the base in a register anyway. The
    window is reserved with MAP_FIXED_NOREPLACE, with 1 MB of no-access memory below it, so a guest address just under 0
    still faults. host/posix/win32_posix.c (also built into longshot_vk.so) now asks the executable where the window
    is (hos_posix_guest_window()), instead of assuming 16 TB.
  • Windows: unchanged by default (16 TB). LONGSHOT_MEMORY_BASE=low is opt-in. There it reserves the window in two
    parts, around Windows' own page at 0x7ffe0000 (KUSER_SHARED_DATA), and links the exe with /highentropyva:no:
    with high-entropy ASLR, Windows put heaps inside the window's range in about half of the starts. HOS_LARGE_PAGES is
    not used at the low base.
  • The switch, at build time: LONGSHOT_MEMORY_BASE=low|high|<hex> (builder/crates/build-driver/src/stages.rs
    memory_base_for). Default: low on Linux, high on Windows. A bad value stops the build with bad_memory_base.
    The build log names the base: the guest window's base: 0x70000000 (...). The build, dev lift and compile alone
    all read the same switch.
  • A refused window is a failed start. If the address can't be reserved, the game logs
    fatal: guest_window_refused: ... with the reason, prints cannot reserve the guest window (...) and exits 1. The
    crash window reads that as a start that couldn't get its memory. On Linux the reason names the mapping in the way,
    vm.mmap_min_addr, vm.overcommit_memory=2 or ulimit -v; on Windows, the region in the way. There is no runtime
    fallback, because the lifted code is built for one address.
  • The Linux exe must be position-independent. A fixed-address (non-PIE) program's heap can start inside the window.
    At a low base the link refuses an ELF of type ET_EXEC (link::not_pie_at_low_base). The game is PIE today; this
    enforces it.

Read first: stages.rs (memory_base_for), host/hos_main.c (reserve_guest, guest_refused_why,
guard_below_guest), build-compile/src/plan.rs (window_flags), build-compile/src/link.rs
(not_pie_at_low_base).

Testing

Tested: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2. Built as a pack over main 9eabf8bc3 with
LONGSHOT_MEMORY_BASE=low, then played. Market child and Lost Woods child, the standard test: every low run logged
mem: the guest window: 512 GB at 0x70000000, and none logged a missing guard. The logs had no error line that a
control run lacks.

  • Starts on Windows: 1,000 of 1,000 starts of the real exe reserved the window (it stops before game code, at an
    empty image). 10 of 10 real starts reached the title as a player, with AMD Adrenalin's hook, OBS's and Overwolf's
    Vulkan hooks loaded: no refusal, no FATAL.
  • Windows' default lift unchanged: with main's builder and this branch's, built in the same folder, every unit's
    text, lift.key, a64_config.h and the other lift outputs are identical.
  • Linux reservation (WSL, a stand-in exe with an 800 MB image): PIE 1,000/1,000 starts with a memfd window, and
    200/200 with each of: anonymous, SDL/Vulkan/GL/ALSA loaded first, clang-built. ASLR off, the legacy layout and
    bubblewrap: 100/100 each. Non-PIE: 195/200 (the heap was already in the window), which is why the link refuses one.
  • tests/test_lifter_semantics.py (Windows port), --bases low,high, low with the build's window flags: ok.
    126,846 runs over 42,375 words, 2,988 edge states and 11,066 sequence runs at the low base; 19,197 memory-word runs at
    16 TB.
  • tests/test_posix_guest_window.py (new, Linux; WSL gcc and clang): pass. The real win32_posix.c with a
    stand-in exe whose window is low, high or absent. The broken variant (16 TB fixed, as on main) fails, and main's file
    fails it.
  • Rust: cargo fmt --all --check and cargo clippy --workspace --all-targets --locked -- -D warnings clean over
    main 742cf39dd (main's needless_borrow in play.rs was fixed by #2698). New tests pass: build-driver stages::tests,
    build-compile a_low_window_turns_constant_hoisting_off_in_the_lifted_units_alone and
    a_low_window_refuses_a_fixed_address_linux_executable, and crash's refusal cases. build-driver's codes test passes
    (bad_memory_base added to build-events.md). The other failures on this PC also fail on main here: build-driver lib
    8, build-compile 2 toolchain tests and compile_link's rebuild test, longshot-builder 7.
  • Host syntax: Windows (llvm-mingw) 97/98 and Linux (WSL clang) 100/104 at both bases, on this head; the same files fail on main
    (ffmpeg or dav1d headers, Windows-only files). -Wall on hos_main.c: no new warnings.
  • tests/run_all.py (mise run test's suite), the whole of it over main 742cf39dd with llvm-mingw: 812 checks, 21 failed, 52 skipped. The same 21 fail on main 742cf39dd here: test_auto_handheld, test_bug_report, test_builder_channel, test_control_picture, test_coverage_run, test_crash_record, test_dev_ab, test_dev_build, test_dev_migrate, test_env_file, test_fs_path_utf8, test_job_queue, test_longshot_ctl, test_oot_menu_mouse, test_oot_state_tap, test_parity_gates, test_perf_send, test_run_all_mingw, test_screensaver, test_switch_table, test_xinput_thread. mise run lint: pass.
  • This head is the same commits rebased on main 4380fe96b, whose new commits touch no file of this PR and nothing
    under builder/; host syntax, run_all --changed and lint ran again on it.
  • Reviews: gpt-6.2-sol, two rounds. Its first refusal finding (a refused window read as an unknown crash) is fixed.
    The open points are in Risks.

Still to test:

  • Linux and the Steam Deck: this PR against main, Market child, uncapped, expecting no fps loss and the
    mem: the guest window: 512 GB at 0x70000000 line on every start (@Beanstalk, the request in the comments).
  • Linux with NVIDIA's proprietary driver, Intel ANV, MangoHud, the Steam overlay and gamescope, the Steam Linux Runtime
    and Flatpak: the game starts and logs the window line. On Linux the display, the Vulkan loader and the Discord thread
    start before the window is reserved, so something mapped low first would stop the start (@Beanstalk where the farm
    has it, by hand otherwise).
  • The one-time full re-lift and recompile on a Linux player's update, timed on the Deck's 4 cores (by hand).

Measurements

Verdict: no gain is claimed. Windows stays opt-in with no claimed gain; Linux is not measured yet.

Setup: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2; Market child, uncapped (HOS_FPS_MAX=240), the render
thread on; main 9eabf8bc3 at 16 TB against this branch built with LONGSHOT_MEMORY_BASE=low, alternating pairs.

Before: main @ 9eabf8bc3 After: this PR @ fa75502bd, low via the switch
CPU ms, the implementer's 2 pairs 48.15 44.65 (−7.3 %)
CPU ms, the checker's 3 pairs 44.20 44.00 (−0.2 ms)
CPU ms, the checker's 2 more pairs 46.48 46.36 (−0.1 ms)
  • The checker's 5 pairs did not reproduce the implementer's −7.3 %. The implementer's control arm was slow, so that
    number is not trusted.
  • Linux: no in-game measurement yet. The Steam Deck was out of reach, so the Test Farm is asked to run it on Linux.

Risks

  • Every Linux player's lift key changes once: the whole game is lifted and compiled again on the update that ships
    this (host objects too, through a64_config.h). The shader caches are not touched.
  • PIE is required on Linux at the low base; the link refuses a non-PIE exe.
  • No runtime fallback. If something already maps memory in 1.75–514 GB before the window is reserved (a driver, an
    overlay, an LD_PRELOAD library), the game doesn't start. It says why and names LONGSHOT_MEMORY_BASE=high.
  • Lost safety nets at the low base: host code that used a raw guest address as a host pointer used to fault at
    16 TB; now it could land inside the window. No such path was found. Guest addresses from 2^64 − 0x70000000 to 2^64 −
    1 MB reach host memory under the guard.
  • Windows, only with low: the exe loses high-entropy ASLR; the guest's 64 KB at 0x0FFE0000 reads Windows' system
    page instead of faulting; HOS_LARGE_PAGES is unavailable. A hand-set hex base that starts in that page (0x7ffe0000) is refused by the
    builder (bad_memory_base, since e3004442d), and a window running across the page is reserved in two parts.
  • Related open PRs: #2100 (WIP, reserve_guest's memfd condition) merges cleanly with this one and its test
    passes on the merge. #2692 (WIP, AArch64 Linux) touches hos_posix_guest_discard, win32_posix.c and
    test_lifter_semantics.py too, so whichever lands second rebases. The displacement gain is an x86-64 one.
  • Kill switch: build with LONGSHOT_MEMORY_BASE=high. It gives main's lifted code exactly (the same base, no
    hoisting flag).
  • What to look for in a log: mem: the guest window: 512 GB at 0x70000000 (a low base: ...) at every start on
    Linux. guest_window_refused, cannot reserve the guest window or mem: no guard below the guest window mean a
    problem.

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

  • 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.

🤖 Generated with Claude Code

## Summary Every guest memory access in the lifted code adds the guest window's base, and at 16 TB that base needs a 64-bit constant, so LLVM keeps it in a register or rebuilds it with `movabs`. With the window at 0x70000000 (under 2 GB) the base fits in the access's own 32-bit displacement, so a guest load is one instruction with no base register. **What changes, per OS:** - **Linux: the window moves to 0x70000000 by default.** The lifted units of a low window are compiled with LLVM's constant hoisting off (`-mllvm -disable-constant-hoisting`); with it on, LLVM kept the base in a register anyway. The window is reserved with `MAP_FIXED_NOREPLACE`, with 1 MB of no-access memory below it, so a guest address just under 0 still faults. `host/posix/win32_posix.c` (also built into `longshot_vk.so`) now asks the executable where the window is (`hos_posix_guest_window()`), instead of assuming 16 TB. - **Windows: unchanged by default (16 TB).** `LONGSHOT_MEMORY_BASE=low` is opt-in. There it reserves the window in two parts, around Windows' own page at 0x7ffe0000 (KUSER_SHARED_DATA), and links the exe with `/highentropyva:no`: with high-entropy ASLR, Windows put heaps inside the window's range in about half of the starts. `HOS_LARGE_PAGES` is not used at the low base. - **The switch, at build time:** `LONGSHOT_MEMORY_BASE=low|high|<hex>` (`builder/crates/build-driver/src/stages.rs` `memory_base_for`). Default: `low` on Linux, `high` on Windows. A bad value stops the build with `bad_memory_base`. The build log names the base: `the guest window's base: 0x70000000 (...)`. The build, `dev lift` and `compile` alone all read the same switch. - **A refused window is a failed start.** If the address can't be reserved, the game logs `fatal: guest_window_refused: ...` with the reason, prints `cannot reserve the guest window (...)` and exits 1. The crash window reads that as a start that couldn't get its memory. On Linux the reason names the mapping in the way, `vm.mmap_min_addr`, `vm.overcommit_memory=2` or `ulimit -v`; on Windows, the region in the way. There is no runtime fallback, because the lifted code is built for one address. - **The Linux exe must be position-independent.** A fixed-address (non-PIE) program's heap can start inside the window. At a low base the link refuses an ELF of type ET_EXEC (`link::not_pie_at_low_base`). The game is PIE today; this enforces it. Read first: `stages.rs` (`memory_base_for`), `host/hos_main.c` (`reserve_guest`, `guest_refused_why`, `guard_below_guest`), `build-compile/src/plan.rs` (`window_flags`), `build-compile/src/link.rs` (`not_pie_at_low_base`). ## Testing **Tested:** Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2. Built as a pack over main 9eabf8bc3 with `LONGSHOT_MEMORY_BASE=low`, then played. Market child and Lost Woods child, the standard test: every low run logged `mem: the guest window: 512 GB at 0x70000000`, and none logged a missing guard. The logs had no error line that a control run lacks. - **Starts on Windows:** 1,000 of 1,000 starts of the real exe reserved the window (it stops before game code, at an empty image). 10 of 10 real starts reached the title as a player, with AMD Adrenalin's hook, OBS's and Overwolf's Vulkan hooks loaded: no refusal, no FATAL. - **Windows' default lift unchanged:** with main's builder and this branch's, built in the same folder, every unit's text, `lift.key`, `a64_config.h` and the other lift outputs are identical. - **Linux reservation (WSL, a stand-in exe with an 800 MB image):** PIE 1,000/1,000 starts with a memfd window, and 200/200 with each of: anonymous, SDL/Vulkan/GL/ALSA loaded first, clang-built. ASLR off, the legacy layout and bubblewrap: 100/100 each. Non-PIE: 195/200 (the heap was already in the window), which is why the link refuses one. - **`tests/test_lifter_semantics.py`** (Windows port), `--bases low,high`, low with the build's window flags: ok. 126,846 runs over 42,375 words, 2,988 edge states and 11,066 sequence runs at the low base; 19,197 memory-word runs at 16 TB. - **`tests/test_posix_guest_window.py`** (new, Linux; WSL gcc and clang): pass. The real `win32_posix.c` with a stand-in exe whose window is low, high or absent. The broken variant (16 TB fixed, as on main) fails, and main's file fails it. - **Rust:** `cargo fmt --all --check` and `cargo clippy --workspace --all-targets --locked -- -D warnings` clean over main 742cf39dd (main's `needless_borrow` in `play.rs` was fixed by #2698). New tests pass: build-driver `stages::tests`, build-compile `a_low_window_turns_constant_hoisting_off_in_the_lifted_units_alone` and `a_low_window_refuses_a_fixed_address_linux_executable`, and crash's refusal cases. build-driver's `codes` test passes (`bad_memory_base` added to `build-events.md`). The other failures on this PC also fail on main here: build-driver lib 8, build-compile 2 toolchain tests and `compile_link`'s rebuild test, longshot-builder 7. - **Host syntax:** Windows (llvm-mingw) 97/98 and Linux (WSL clang) 100/104 at both bases, on this head; the same files fail on main (ffmpeg or dav1d headers, Windows-only files). `-Wall` on `hos_main.c`: no new warnings. - **`tests/run_all.py`** (`mise run test`'s suite), the whole of it over main 742cf39dd with llvm-mingw: 812 checks, 21 failed, 52 skipped. The same 21 fail on main 742cf39dd here: test_auto_handheld, test_bug_report, test_builder_channel, test_control_picture, test_coverage_run, test_crash_record, test_dev_ab, test_dev_build, test_dev_migrate, test_env_file, test_fs_path_utf8, test_job_queue, test_longshot_ctl, test_oot_menu_mouse, test_oot_state_tap, test_parity_gates, test_perf_send, test_run_all_mingw, test_screensaver, test_switch_table, test_xinput_thread. `mise run lint`: pass. - **This head** is the same commits rebased on main 4380fe96b, whose new commits touch no file of this PR and nothing under `builder/`; host syntax, `run_all --changed` and lint ran again on it. - **Reviews:** gpt-6.2-sol, two rounds. Its first refusal finding (a refused window read as an unknown crash) is fixed. The open points are in Risks. **Still to test:** - Linux and the Steam Deck: this PR against main, Market child, uncapped, expecting no fps loss and the `mem: the guest window: 512 GB at 0x70000000` line on every start (@Beanstalk, the request in the comments). - Linux with NVIDIA's proprietary driver, Intel ANV, MangoHud, the Steam overlay and gamescope, the Steam Linux Runtime and Flatpak: the game starts and logs the window line. On Linux the display, the Vulkan loader and the Discord thread start before the window is reserved, so something mapped low first would stop the start (@Beanstalk where the farm has it, by hand otherwise). - The one-time full re-lift and recompile on a Linux player's update, timed on the Deck's 4 cores (by hand). ## Measurements **Verdict:** no gain is claimed. Windows stays opt-in with no claimed gain; Linux is not measured yet. Setup: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2; Market child, uncapped (`HOS_FPS_MAX=240`), the render thread on; main 9eabf8bc3 at 16 TB against this branch built with `LONGSHOT_MEMORY_BASE=low`, alternating pairs. | | Before: main @ 9eabf8bc3 | After: this PR @ fa75502bd, low via the switch | |---|---|---| | CPU ms, the implementer's 2 pairs | 48.15 | 44.65 (−7.3 %) | | CPU ms, the checker's 3 pairs | 44.20 | 44.00 (−0.2 ms) | | CPU ms, the checker's 2 more pairs | 46.48 | 46.36 (−0.1 ms) | - The checker's 5 pairs did not reproduce the implementer's −7.3 %. The implementer's control arm was slow, so that number is not trusted. - **Linux: no in-game measurement yet.** The Steam Deck was out of reach, so the Test Farm is asked to run it on Linux. ## Risks - **Every Linux player's lift key changes once:** the whole game is lifted and compiled again on the update that ships this (host objects too, through `a64_config.h`). The shader caches are not touched. - **PIE is required on Linux** at the low base; the link refuses a non-PIE exe. - **No runtime fallback.** If something already maps memory in 1.75–514 GB before the window is reserved (a driver, an overlay, an LD_PRELOAD library), the game doesn't start. It says why and names `LONGSHOT_MEMORY_BASE=high`. - **Lost safety nets at the low base:** host code that used a raw guest address as a host pointer used to fault at 16 TB; now it could land inside the window. No such path was found. Guest addresses from 2^64 − 0x70000000 to 2^64 − 1 MB reach host memory under the guard. - **Windows, only with `low`:** the exe loses high-entropy ASLR; the guest's 64 KB at 0x0FFE0000 reads Windows' system page instead of faulting; `HOS_LARGE_PAGES` is unavailable. A hand-set hex base that starts in that page (0x7ffe0000) is refused by the builder (`bad_memory_base`, since e3004442d), and a window running across the page is reserved in two parts. - **Related open PRs:** #2100 (WIP, `reserve_guest`'s memfd condition) merges cleanly with this one and its test passes on the merge. #2692 (WIP, AArch64 Linux) touches `hos_posix_guest_discard`, `win32_posix.c` and `test_lifter_semantics.py` too, so whichever lands second rebases. The displacement gain is an x86-64 one. - **Kill switch:** build with `LONGSHOT_MEMORY_BASE=high`. It gives main's lifted code exactly (the same base, no hoisting flag). - **What to look for in a log:** `mem: the guest window: 512 GB at 0x70000000 (a low base: ...)` at every start on Linux. `guest_window_refused`, `cannot reserve the guest window` or `mem: no guard below the guest window` mean a problem. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] 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] 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. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A Linux build lifts with the guest window at 0x70000000 instead of 16 TB. Under 2 GB the base fits the
load's 32-bit displacement with the guest's own, so a guest load with a displacement is [guest register +
disp32] instead of [base register + guest register + disp], with no 10-byte constant and a register freed.
Windows keeps the lifter's default (16 TB): its lift options, key and IR are what they were.

- build-driver: LOW_MEMORY_BASE / HIGH_MEMORY_BASE and memory_base_for; LONGSHOT_MEMORY_BASE=low|high|<hex>
  at build time (high turns it off on Linux); the build log names the base. The base is in the lift's options,
  so a change lifts and compiles every unit again. dev lift and dev words take --memory-base.
- host: reserve_guest's refusal stops the game with guest_window_refused and the reason (the mapping in the
  way, vm.mmap_min_addr, vm.overcommit_memory=2, ulimit -v); the start logs "mem: the guest window: 512 GB at
  <base>"; a 1 MB guard below a low window keeps a guest access just under address 0 faulting.
- host/posix/win32_posix.c (also built into longshot_vk.so without the lift's headers) asks the executable
  where the window is (hos_posix_guest_window) instead of a fixed 16 TB, so decommits of guest pages still
  go through MADV_REMOVE on the memfd's window.
- tests: test_lifter_semantics runs at the low base and the memory words again at the high one;
  test_posix_guest_window (Linux); build-driver's stages tests compile a lifted load and store for Linux at
  each base and check the forms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
At 0x70000000 the base fits each guest access's displacement, but x86's cost model always hoists a GEP's constant
base, so LLVM kept the base in a register once per block and the access stayed [base register + guest register +
displacement], only with a 5-byte move of the base instead of a 10-byte one. build-compile now reads the lift's
A64_HOST_BASE (gen/rt/a64_config.h) and, under 2 GB, compiles the lifted units with -mllvm
-disable-constant-hoisting. Three hot units of the game, compiled for Linux: no move of the base left (2,116
before), three-part accesses 3,062 -> 991 (3,158 at 16 TB), 2.5 % fewer instructions. Windows (16 TB) and a Linux
build with LONGSHOT_MEMORY_BASE=high get no new flag.

- build-compile plan.rs: lift_base, window_flags, and the lifted units' flags; a unit test.
- build-driver's window test now writes a three-block function and checks, compiled for Linux: with the compile's
  flags every access takes the base in its displacement; without them the base is hoisted (the control); at 16 TB
  the base is a movabs.
- tests/test_posix_guest_window.py: an unused import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
For a Windows build lifted with LONGSHOT_MEMORY_BASE=low (Windows' default stays 16 TB): the window from
0x70000000 runs across KUSER_SHARED_DATA, the page Windows keeps at 0x7ffe0000 in every process, so
reserve_guest reserves it in two parts, below that page and above its 64 KB (the guest's 64 KB there lies
between its system region and its image, where nothing is handed out). HOS_LARGE_PAGES, one allocation,
says it is not used then. A refusal names the part and what is in its way.

With high-entropy ASLR Windows puts heaps and stacks in the window's range (1.75 GB to 514 GB) in about half
of the starts: a start-up probe of the game's image size reserved it in 52 of 100 starts, and in 1,000 of
1,000 linked without it. build-compile links the exe with /highentropyva:no when the lift's A64_HOST_BASE
(gen/rt/a64_config.h) is under 2 GB, and only then.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The checker's review (sol, m3 phase 1): the refusal went through hos_fatal, whose FATAL line and crash record
the crash window shows as "closed unexpectedly", cause unknown; it read the old "cannot reserve the guest
window" line as a start that could not have its memory. Now, as the save folder's refusal: the reason in the
log ("fatal: guest_window_refused: ..."), then "cannot reserve the guest window (<size> at <base>): <why>" on
stderr, a flush, exit 1. The crash facts read both lines (tests). And from the same review:
- the highest LONGSHOT_MEMORY_BASE leaves the window under 0x7fff_ffff_0000 (0x7f8000000000 ended at 128 TB,
  past Linux's TASK_SIZE on four-level paging);
- `compile` alone remakes unit texts at the base of the lift gen/ holds (its a64_config.h), not the
  environment's, so the key check does not refuse a lift made with another base;
- dev packs build a pack asked with LONGSHOT_MEMORY_BASE even when no file changed;
- test_lifter_semantics compiles the low base's units with the build's window flags (read from plan.rs);
- the guard's warning says why it was refused (errno), not "in use".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The checker's probe (m3 phase 1): a fixed-address (non-PIE) program of the game's ~800 MB gets its brk heap
randomised up to 1 GB past its image, into the window at 0x70000000, in 5 of 200 starts, and those starts
fail; a PIE one is loaded at 0x55..., its heap with it (1,000 of 1,000). The game is PIE today (clang's
default), but nothing held it there. build-compile now refuses the link of a Linux game whose lift's base is
under 2 GB when the exe is an ELF ET_EXEC (link::not_pie_at_low_base, a test), and the host's refusal says
when the executable is not position-independent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(build): bad_memory_base in build-events.md's table of codes, as build-driver's codes test wants
Some checks reported errors
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Title and description (pull_request_target) Successful in 35s
beanstalk/approval approved by klimovich008 (reviewed)
beanstalk/linux+amd+radv 0/1 pass, 2 error
beanstalk/linux+nvidia 0/1 pass, 0 running, 2 queued
8a10967dfb
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in the game: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2: this branch built with LONGSHOT_MEMORY_BASE=low as a pack over main 9eabf8bc3, played in Market child and Lost Woods child (the standard test, alternating with main). Every low start logged mem: the guest window: 512 GB at 0x70000000 and no missing-guard line; no error line a main run lacks; 10 of 10 player starts to the title with AMD's, OBS's and Overwolf's hooks loaded. Linux (where this is the default) has not run in the game yet: the Steam Deck was out of reach, so the Test Farm is asked below.

**Tested in the game:** Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2: this branch built with `LONGSHOT_MEMORY_BASE=low` as a pack over main 9eabf8bc3, played in Market child and Lost Woods child (the standard test, alternating with main). Every low start logged `mem: the guest window: 512 GB at 0x70000000` and no missing-guard line; no error line a main run lacks; 10 of 10 player starts to the title with AMD's, OBS's and Overwolf's hooks loaded. Linux (where this is the default) has not run in the game yet: the Steam Deck was out of reach, so the Test Farm is asked below.
Author
Member
@review
Author
Member

@Beanstalk this PR's build against main's at the PR's base (baseline ref = main), Linux only. On Linux the PR moves the guest memory window to 0x70000000 by default (Windows is unchanged), so a Linux start runs different lifted code from main's; nothing needs a switch.

Targets, Linux only, 1-2 reports each, don't let the plan wait on any one of them:

  • the Steam Deck (steamdeck), LCD and OLED, if one is online;
  • Linux desktops with an AMD GPU (linux+amd, RADV) and with an NVIDIA GPU (linux+nvidia), on AMD and on Intel CPUs as the testers allow.

Settings, both sides: frame_rate_cap = 6 (Uncapped), vsync = 2 (Off), frame_generation = 0. Headless is fine (nothing in the present path changes).

Scenario: Market child, from the save market-entrance (no teleport needed), measure 30 s after 10 s of warm-up, holding the right stick to the right through the measure if the plan can. 3 game starts a side, alternating (2 if the time limit needs it).

Rules, PR against main: crash = false; fps_mean min_delta_pct = 3 (fails on an fps loss over 3 %); frametime_p99_ms max_delta_pct = 9 (fails on a p99 rise over about 9 %). Report-only: frametime_1pct_low_ms, frametime_max_ms, hitch_count, stutter_count, run_hitch_count, run_frametime_max_ms, and the one-start metrics (boot_time, shader_compile, load_time).

Log, log_match on the PR side: expected "mem: the guest window: 512 GB at 0x70000000" with log_expected_missing.max = 0 (main doesn't print it); forbidden "guest_window_refused", "cannot reserve the guest window" and "no guard below the guest window" with log_forbidden_hits.max = 0.

Each tester lifts and compiles the whole game for the PR side (the lift key changes on Linux), so allow the build time; the PR's Linux exe must be PIE, and its link refuses one that isn't.

@Beanstalk this PR's build against main's at the PR's base (baseline ref = main), Linux only. On Linux the PR moves the guest memory window to 0x70000000 by default (Windows is unchanged), so a Linux start runs different lifted code from main's; nothing needs a switch. Targets, Linux only, 1-2 reports each, don't let the plan wait on any one of them: - the Steam Deck (`steamdeck`), LCD and OLED, if one is online; - Linux desktops with an AMD GPU (`linux+amd`, RADV) and with an NVIDIA GPU (`linux+nvidia`), on AMD and on Intel CPUs as the testers allow. Settings, both sides: frame_rate_cap = 6 (Uncapped), vsync = 2 (Off), frame_generation = 0. Headless is fine (nothing in the present path changes). Scenario: Market child, from the save market-entrance (no teleport needed), measure 30 s after 10 s of warm-up, holding the right stick to the right through the measure if the plan can. 3 game starts a side, alternating (2 if the time limit needs it). Rules, PR against main: crash = false; fps_mean min_delta_pct = 3 (fails on an fps loss over 3 %); frametime_p99_ms max_delta_pct = 9 (fails on a p99 rise over about 9 %). Report-only: frametime_1pct_low_ms, frametime_max_ms, hitch_count, stutter_count, run_hitch_count, run_frametime_max_ms, and the one-start metrics (boot_time, shader_compile, load_time). Log, log_match on the PR side: expected "mem: the guest window: 512 GB at 0x70000000" with log_expected_missing.max = 0 (main doesn't print it); forbidden "guest_window_refused", "cannot reserve the guest window" and "no guard below the guest window" with log_forbidden_hits.max = 0. Each tester lifts and compiles the whole game for the PR side (the lift key changes on Linux), so allow the build time; the PR's Linux exe must be PIE, and its link refuses one that isn't.
Member
Beanstalk test farm · an earlier run: commit 8a10967 (the newer results are in a comment below)

Commit 8a10967 · approved by klimovich008 (reviewed) · dashboard

⚠️ Note: The step schema cannot hold the right stick during a measure, so the Market measurement is stationary; no teleport or age change is used, so load-time results may be unavailable.
⚠️ Note: Timed lift builds report build stages but do not isolate a player's one-time update cost; the plan does not exercise overlays, Flatpak, or the Windows opt-in path.
⚠️ Note: The normal low-base link enforces PIE, but this plan does not deliberately attempt a non-PIE link; CPU coverage depends on available testers.

Started at 01:16 UTC.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
linux+amd+radv ⚠️ couldn't be judged 2 1 2 — — none
linux+nvidia ⏳ queued 0 of 1 — — —

Couldn't be judged: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own.

  • linux+amd+radv, report 1: the main base failed (exit 1): The builder stopped on an error: cargo build -p longshot-rs failed: error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
  • linux+amd+radv, report 2: the main base failed (exit 1): The builder stopped on an error: cargo build -p longshot-rs failed: Updating crates.io index
What was tested

What will be tested · AI plan (gpt-6.1-terra)

Compare the PR with its base main build on Linux AMD RADV and NVIDIA PCs, using three alternating starts per side from the child Market entrance. Each start captures a still image and measures 30 seconds after a 10-second warm-up with uncapped rendering; lift and build stages are also timed. The PR fails on a crash, a missing low-window log, a reservation or guard error, an fps loss over 3%, a p99 frame-time increase over 9%, or a substantial picture difference. Steam Deck is omitted because none is listed online. No tester online now matches linux+nvidia: that target waits for one.

  • Where: linux+amd+radv (1-2 reports), linux+nvidia (1-2 reports).
  • market-child: from the repository's save market-entrance (settings vsync=2, frame_rate_cap=6, frame_generation=0), then take the picture market to compare with main, measure market for 30 s (after 10 s warm-up); 3 runs on each side.
  • Build times: main and the PR each built 2 times, alternating, each whole in a fresh folder: the lift again (no kept lift, main's compiled objects kept); every stage timed (shader preparation is not), and the lifted C compared.
  • Measured: crashes, frame times, stutters and hitches, draws and frame rate, boot time, shader preparation at start, load times, the game's log.
  • The PR fails if: it crashes; or frame rate is more than 3% below main; or a picture differs from main by more than 20%; or frame time (p99) is more than 9% above main; or forbidden log lines is above 0; or expected log lines missing is above 0.
  • Time: about 35 min of game runs per tester (6 game starts), plus the two builds and 4 timed builds (about 80 min).
Measurements on `linux+amd+radv`, for the PR description

Verdict: could not be judged on linux+amd+radv (2 reports).

Hardware: 1: linux+amd+radv+igpu AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.0.8 AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM
Scene: market-child, from the repository's save market-entrance (vsync=2, frame_rate_cap=6, frame_generation=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); market-child: 3 game starts a side, market 30 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

Before: main @ 4380fe9 After: this PR @ 8a10967
lift · lifted C main's not compared

Flags and settings

None: the plan varied no setting, switch or build option.

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on linux+amd+radv (2 reports).

Hardware: 1: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM`  
Scene: market-child, from the repository's save market-entrance (vsync=2, frame_rate_cap=6, frame_generation=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); market-child: 3 game starts a side, market 30 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

| | Before: main @ 4380fe9 | After: this PR @ 8a10967 |
|---|---|---|
| lift · lifted C | main's | not compared |

**Flags and settings**

None: the plan varied no setting, switch or build option.
The testers' hardware
Target Report Ran on
linux+amd+radv 1 linux+amd+radv+igpu AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM
linux+amd+radv 2 linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.0.8 AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>8a10967</code> (the newer results are in a comment below)</summary> Commit `8a10967` · approved by klimovich008 (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2711) ⚠️ **Note:** The step schema cannot hold the right stick during a measure, so the Market measurement is stationary; no teleport or age change is used, so load-time results may be unavailable. ⚠️ **Note:** Timed lift builds report build stages but do not isolate a player's one-time update cost; the plan does not exercise overlays, Flatpak, or the Windows opt-in path. ⚠️ **Note:** The normal low-base link enforces PIE, but this plan does not deliberately attempt a non-PIE link; CPU coverage depends on available testers. Started at 01:16 UTC. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `linux+amd+radv` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_8530bd038d84a0ea) [2](https://beanstalk.magicbean.dev/reports/rp_bb2d109d5502f658) | — | — | none | | `linux+nvidia` | ⏳ queued | 0 of 1 | — | — | — | **Couldn't be judged**: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own. - `linux+amd+radv`, [report 1](https://beanstalk.magicbean.dev/reports/rp_8530bd038d84a0ea): `the main base failed (exit 1): The builder stopped on an error: cargo build -p longshot-rs failed: error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.` - `linux+amd+radv`, [report 2](https://beanstalk.magicbean.dev/reports/rp_bb2d109d5502f658): `the main base failed (exit 1): The builder stopped on an error: cargo build -p longshot-rs failed: Updating crates.io index` <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) Compare the PR with its base main build on Linux AMD RADV and NVIDIA PCs, using three alternating starts per side from the child Market entrance. Each start captures a still image and measures 30 seconds after a 10-second warm-up with uncapped rendering; lift and build stages are also timed. The PR fails on a crash, a missing low-window log, a reservation or guard error, an fps loss over 3%, a p99 frame-time increase over 9%, or a substantial picture difference. Steam Deck is omitted because none is listed online. No tester online now matches linux+nvidia: that target waits for one. - **Where:** linux+amd+radv (1-2 reports), linux+nvidia (1-2 reports). - **market-child:** from the repository's save `market-entrance` (settings vsync=2, frame_rate_cap=6, frame_generation=0), then take the picture market to compare with main, measure market for 30 s (after 10 s warm-up); 3 runs on each side. - **Build times:** main and the PR each built 2 times, alternating, each whole in a fresh folder: the lift again (no kept lift, main's compiled objects kept); every stage timed (shader preparation is not), and the lifted C compared. - **Measured:** crashes, frame times, stutters and hitches, draws and frame rate, boot time, shader preparation at start, load times, the game's log. - **The PR fails if:** it crashes; or frame rate is more than 3% below main; or a picture differs from main by more than 20%; or frame time (p99) is more than 9% above main; or forbidden log lines is above 0; or expected log lines missing is above 0. - **Time:** about 35 min of game runs per tester (6 game starts), plus the two builds and 4 timed builds (about 80 min). </details> <details><summary>Measurements on `linux+amd+radv`, for the PR description</summary> **Verdict:** could not be judged on linux+amd+radv (2 reports). Hardware: 1: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` Scene: market-child, from the repository's save market-entrance (vsync=2, frame_rate_cap=6, frame_generation=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); market-child: 3 game starts a side, market 30 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 4380fe9 | After: this PR @ 8a10967 | |---|---|---| | lift · lifted C | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on linux+amd+radv (2 reports). Hardware: 1: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` Scene: market-child, from the repository's save market-entrance (vsync=2, frame_rate_cap=6, frame_generation=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); market-child: 3 game starts a side, market 30 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 4380fe9 | After: this PR @ 8a10967 | |---|---|---| | lift · lifted C | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `linux+amd+radv` | [1](https://beanstalk.magicbean.dev/reports/rp_8530bd038d84a0ea) | linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM` | | `linux+amd+radv` | [2](https://beanstalk.magicbean.dev/reports/rp_bb2d109d5502f658) | linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` | </details> </details>
BeanBot left a comment

Recommendation: Approve. A permitted Windows base can overlap the system page and produce a build that cannot start. The Linux default also has no in-game performance measurement yet, so its benefit remains unproven. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The change builds Linux guest accesses for a low memory window and offers the same layout as a Windows opt-in. It may reduce instruction and register use, but forces a full Linux re-lift and recompile and can refuse startup when the address range is occupied.

Should fix (1): not blocking, but worth doing before merging.

  • L1 host/hos_main.c:238: The split excludes a base equal to the Windows system page, although the builder accepts that base. (more on the line) Do: Reject Windows bases whose window begins in the system page, or handle that boundary explicitly when reserving the window.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L2 builder/crates/build-driver/src/stages.rs:290: The Linux default changes every lifted unit without a demonstrated in-game gain. (more on the line) Do: Run the requested interleaved game comparisons on Linux and Steam Deck, including average FPS, 1% lows and frame times, against the base.
  • L3 builder/crates/build-compile/src/plan.rs:906: The compile-time cost of the new lift and compiler flags has not been measured. (more on the line) Do: Compare clean and incremental build time and size against the base, including the one-time update on a Deck.

@fix can do L1.

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

Does it help: Unproven. The reported Windows checker runs changed CPU time from 44.20 to 44.00 ms over three pairs and 46.48 to 46.36 ms over two more pairs; the larger reported gain was not reproduced. There are no Linux in-game measurements, including for the default configuration.

Other systems: The low window changes Linux startup and lifted code across GPU vendors, drivers, overlays, containers and Steam Deck. The reported Linux reservation probes use stand-in executables; the real game has been played only on Windows with the opt-in. Windows defaults to the previous base.

Switches: LONGSHOT_MEMORY_BASE adds low, high and hexadecimal build-time choices; it defaults to low on Linux and high on Windows. The Linux default has not yet been supported by in-game measurements. The switch is documented in the build reference but has no row in gpu/vk/switches.def.

Reviewed: 8a10967dfb against 4380fe96b6: Read the repository rules and PR template, standards, the reservation changes and surrounding host code, the POSIX window lookup, the new POSIX test, the build-base selection and compiler-flag changes, and the supplied comments and measurements. Skimmed the remaining diff and commit history; the full contents of every changed code file and every dependent caller were not read.; nothing run (a code review).

Checked and fine:

  • The POSIX window range check avoids overflowing p + n.
  • The new POSIX lookup uses pthread_once for publication of the window bounds.
  • The supplied Windows player runs reached the title with the low-base opt-in.

Testing: No code, tests or project scripts were run, as requested. The PR reports Windows player runs and Linux stand-in reservation tests; the Linux game and hardware runs remain outstanding.

Overlaps and merge order: #2100 touches the reservation path; #2692 overlaps the POSIX guest discard and lifter semantics test. The PR reports that whichever of #2692 and this change lands second must rebase.


Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.

**Recommendation: Approve.** A permitted Windows base can overlap the system page and produce a build that cannot start. The Linux default also has no in-game performance measurement yet, so its benefit remains unproven. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The change builds Linux guest accesses for a low memory window and offers the same layout as a Windows opt-in. It may reduce instruction and register use, but forces a full Linux re-lift and recompile and can refuse startup when the address range is occupied. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `host/hos_main.c:238`: The split excludes a base equal to the Windows system page, although the builder accepts that base. (more on the line) **Do:** Reject Windows bases whose window begins in the system page, or handle that boundary explicitly when reserving the window. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2** `builder/crates/build-driver/src/stages.rs:290`: The Linux default changes every lifted unit without a demonstrated in-game gain. (more on the line) **Do:** Run the requested interleaved game comparisons on Linux and Steam Deck, including average FPS, 1% lows and frame times, against the base. - **L3** `builder/crates/build-compile/src/plan.rs:906`: The compile-time cost of the new lift and compiler flags has not been measured. (more on the line) **Do:** Compare clean and incremental build time and size against the base, including the one-time update on a Deck. `@fix` can do L1. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The reported Windows checker runs changed CPU time from 44.20 to 44.00 ms over three pairs and 46.48 to 46.36 ms over two more pairs; the larger reported gain was not reproduced. There are no Linux in-game measurements, including for the default configuration. **Other systems:** The low window changes Linux startup and lifted code across GPU vendors, drivers, overlays, containers and Steam Deck. The reported Linux reservation probes use stand-in executables; the real game has been played only on Windows with the opt-in. Windows defaults to the previous base. **Switches:** LONGSHOT_MEMORY_BASE adds low, high and hexadecimal build-time choices; it defaults to low on Linux and high on Windows. The Linux default has not yet been supported by in-game measurements. The switch is documented in the build reference but has no row in gpu/vk/switches.def. **Reviewed:** 8a10967dfb8d against 4380fe96b64b: Read the repository rules and PR template, standards, the reservation changes and surrounding host code, the POSIX window lookup, the new POSIX test, the build-base selection and compiler-flag changes, and the supplied comments and measurements. Skimmed the remaining diff and commit history; the full contents of every changed code file and every dependent caller were not read.; nothing run (a code review). **Checked and fine:** - The POSIX window range check avoids overflowing p + n. - The new POSIX lookup uses pthread_once for publication of the window bounds. - The supplied Windows player runs reached the title with the low-base opt-in. **Testing:** No code, tests or project scripts were run, as requested. The PR reports Windows player runs and Linux stand-in reservation tests; the Linux game and hardware runs remain outstanding. **Overlaps and merge order:** #2100 touches the reservation path; #2692 overlaps the POSIX guest discard and lifter semantics test. The PR reports that whichever of #2692 and this change lands second must rebase. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.</sub>
@ -888,0 +903,4 @@
/// base gone, 1,903 and 26 three-part accesses down to 148 and none, 3 % fewer instructions). At 16 TB the base cannot be
/// a displacement and hoisting saves a 10-byte move a use, so nothing changes there.
pub fn window_flags(base: Option<u64>) -> Vec<String> {
match base {
Member

L3 (should fix): The compile-time cost of the new lift and compiler flags has not been measured.

When: Every existing Linux installation changes lift key and recompiles on update; the time and resulting build size are unknown, particularly on the Deck.

Do: Compare clean and incremental build time and size against the base, including the one-time update on a Deck.

**L3** (should fix): The compile-time cost of the new lift and compiler flags has not been measured. *When:* Every existing Linux installation changes lift key and recompiles on update; the time and resulting build size are unknown, particularly on the Deck. **Do:** Compare clean and incremental build time and size against the base, including the one-time update on a Deck.
@ -264,0 +287,4 @@
let v = value.map(str::trim).unwrap_or_default();
let base = match v.to_ascii_lowercase().as_str() {
"" => return Ok(if windows { HIGH_MEMORY_BASE } else { LOW_MEMORY_BASE }),
"high" => HIGH_MEMORY_BASE,
Member

L2 (should fix): The Linux default changes every lifted unit without a demonstrated in-game gain.

When: Linux players receive the low-base code after a full rebuild, but no Linux game run compares its frame times or FPS with the high-base baseline.

Do: Run the requested interleaved game comparisons on Linux and Steam Deck, including average FPS, 1% lows and frame times, against the base.

**L2** (should fix): The Linux default changes every lifted unit without a demonstrated in-game gain. *When:* Linux players receive the low-base code after a full rebuild, but no Linux game run compares its frame times or FPS with the high-base baseline. **Do:** Run the requested interleaved game comparisons on Linux and Steam Deck, including average FPS, 1% lows and frame times, against the base.
@ -164,0 +235,4 @@
}
#endif
/* (Windows) the system's own page in every process, KUSER_SHARED_DATA, and whether a low window runs across it */
#define WINDOW_SYS_PAGE 0x7ffe0000ULL
Member

L1 (should fix): The split excludes a base equal to the Windows system page, although the builder accepts that base.

When: A Windows build with LONGSHOT_MEMORY_BASE=0x7ffe0000 passes memory_base_for, but WINDOW_SPLIT is false. The single VirtualAlloc then includes KUSER_SHARED_DATA and fails, so the resulting game cannot start.

Do: Reject Windows bases whose window begins in the system page, or handle that boundary explicitly when reserving the window.

**L1** (should fix): The split excludes a base equal to the Windows system page, although the builder accepts that base. *When:* A Windows build with LONGSHOT_MEMORY_BASE=0x7ffe0000 passes memory_base_for, but WINDOW_SPLIT is false. The single VirtualAlloc then includes KUSER_SHARED_DATA and fails, so the resulting game cannot start. **Do:** Reject Windows bases whose window begins in the system page, or handle that boundary explicitly when reserving the window.
Owner
@fix
Member

I didn't fix this pull request: it doesn't allow edits from maintainers (the author can turn on Allow edits from maintainers).


Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

I didn't fix this pull request: it doesn't allow edits from maintainers (the author can turn on *Allow edits from maintainers*). --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
fix(build): a Windows window can't start in the system's page at 0x7ffe0000
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Failing after 11s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Failing after 17s
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Successful in 6s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m57s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 3m30s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m34s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m52s
CI / Website build and checks (pull_request) Failing after 1m28s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
e3004442d7
LONGSHOT_MEMORY_BASE=0x7ffe0000 on Windows was accepted, but host/hos_main.c reserves in two parts only a
window that starts below the page: one starting in it is one VirtualAlloc over KUSER_SHARED_DATA, which fails,
and the game wouldn't start. The builder refuses that base (bad_memory_base) and hos_main.c stops with #error
if it gets one anyway. BeanBot L1 on #2711.

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

Beanstalk test farm

Commit 598793f · approved by nobody yet · dashboard

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

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `598793f` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2711) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
Author
Member

New head e3004442d: BeanBot's L1 fixed, since @fix couldn't edit this branch.

  • L1, fixed. On Windows the builder now refuses LONGSHOT_MEMORY_BASE=0x7ffe0000 with bad_memory_base. A window that starts inside Windows' own page has no part below the page, so the two-part reservation can't go around it. It is the only 64 KB-aligned base inside the page. host/hos_main.c also stops with #error if a Windows build gets that base some other way. Linux has no such page, so it still takes the base.
    • The stages:: test covers it: refused on Windows, taken on Linux, and taken on Windows at 0x7ffd0000 (a window across the page) and at 0x7fff0000 (right past it).
    • The Windows host syntax check (llvm-mingw) gives 97/98 at 0x70000000 and 0x7ffd0000, as before. At 0x7ffe0000, hos_main.c stops at the #error. The one other failure is nn_video.c, which needs ffmpeg's headers, as on main.
    • build.md's row for the switch says so.
    • fmt, stages:: 3/3 and clippy on build-driver are clean, and mise run lint passes.
  • L2, the Linux game comparison: waiting for the farm.
    • Both linux+amd+radv reports stopped before the game ran. Each stopped on the tester's side while building main's base: rustup had no default toolchain, and the second stopped while updating the crates.io index.
    • linux+nvidia is queued. No Steam Deck is online, and ours is out of reach today.
    • The PR stays WIP until a Linux run is in.
  • L3, the build cost: the farm's plan times main's build and this PR's, each twice. That also waits for a tester that gets past the build.
  • switches.def: LONGSHOT_MEMORY_BASE is a builder switch, read when building, not by the game, so its row is in build.md like the other LONGSHOT_* build switches. gpu/vk/switches.def lists the game's runtime switches.

🤖 Generated with Claude Code

New head `e3004442d`: BeanBot's L1 fixed, since `@fix` couldn't edit this branch. - **L1, fixed.** On Windows the builder now refuses `LONGSHOT_MEMORY_BASE=0x7ffe0000` with `bad_memory_base`. A window that starts inside Windows' own page has no part below the page, so the two-part reservation can't go around it. It is the only 64 KB-aligned base inside the page. `host/hos_main.c` also stops with `#error` if a Windows build gets that base some other way. Linux has no such page, so it still takes the base. - The `stages::` test covers it: refused on Windows, taken on Linux, and taken on Windows at `0x7ffd0000` (a window across the page) and at `0x7fff0000` (right past it). - The Windows host syntax check (llvm-mingw) gives 97/98 at `0x70000000` and `0x7ffd0000`, as before. At `0x7ffe0000`, `hos_main.c` stops at the `#error`. The one other failure is `nn_video.c`, which needs ffmpeg's headers, as on main. - `build.md`'s row for the switch says so. - fmt, `stages::` 3/3 and clippy on build-driver are clean, and `mise run lint` passes. - **L2, the Linux game comparison:** waiting for the farm. - Both `linux+amd+radv` reports stopped before the game ran. Each stopped on the tester's side while building main's base: rustup had no default toolchain, and the second stopped while updating the crates.io index. - `linux+nvidia` is queued. No Steam Deck is online, and ours is out of reach today. - The PR stays WIP until a Linux run is in. - **L3, the build cost:** the farm's plan times main's build and this PR's, each twice. That also waits for a tester that gets past the build. - **`switches.def`:** `LONGSHOT_MEMORY_BASE` is a builder switch, read when building, not by the game, so its row is in `build.md` like the other `LONGSHOT_*` build switches. `gpu/vk/switches.def` lists the game's runtime switches. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Member
@review
Author
Member

Description: the risk line on a hand-set Windows base in the system page now says it's refused (e3004442d, BeanBot L1).

Description: the risk line on a hand-set Windows base in the system page now says it's refused (e3004442d, BeanBot L1).
BeanBot left a comment

Recommendation: Request changes. It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (L4) The Windows system-page base is now refused, but the Linux default has no demonstrated in-game gain and its one-time rebuild cost is unmeasured. The Linux comparison and build timings are still needed.

The change moves Linux guest memory to a low address and changes compilation to make guest accesses cheaper; Windows retains the high address by default. It adds reservation and compatibility complexity, and every Linux player must re-lift and recompile once.

Blocking (1): must change before merging.

  1. L4: It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (for the author)

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L2 builder/crates/build-driver/src/stages.rs:290: The Linux default changes every lifted unit without a demonstrated in-game gain. When: Linux players receive the low-base code after a full rebuild, but no Linux game run compares its frame times or FPS with the high-base baseline. Do: Run the requested interleaved game comparisons on Linux and Steam Deck, including average FPS, 1% lows and frame times, against the base.
  • L3 builder/crates/build-compile/src/plan.rs:906: The compile-time cost of the new lift and compiler flags has not been measured. When: Every existing Linux installation changes lift key and recompiles on update; the time and resulting build size are unknown, particularly on the Deck. Do: Compare clean and incremental build time and size against the base, including the one-time update on a Deck.

Since the last review (on 8a10967dfb)
Resolved: L1 (The split excludes a base equal to the Windows system page, although the builder accepts t…)
Still open: L2 (The Linux default changes every lifted unit without a demonstrated in-game gain.); L3 (The compile-time cost of the new lift and compiler flags has not been measured.)
New: L4 (It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first).)

Checks: Failing on this head, which is behind its base, where it passes: CI / Third-party parts and guide screenshots (pull_request). @rebase (or @fix) brings it up to date and runs it again; not held against it. Still running: 8 checks.

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

Does it help: Unproven. The reported Windows checker measurements improved CPU time by only 0.2 ms and 0.1 ms across five pairs; the larger reported 7.3% result was not reproduced. There is no Linux in-game comparison yet.

Other systems: Linux drivers, overlays, Steam Deck and container environments can occupy the low address range and prevent startup; their game runs remain outstanding. Windows low-base play and starts were reported successful, while its default remains high.

Switches: LONGSHOT_MEMORY_BASE adds low, high and hexadecimal build-time choices: low by default on Linux and high on Windows. The Linux default is not yet supported by performance measurements. The build reference documents the switch and the Windows system-page exclusion.

Reviewed: e3004442d7 against 4380fe96b6: Read the changes since the ledger, the relevant base validation, reservation and caller sections, and the pull request's reported results. Skimmed the overall diff and commit list; the other changed files were not read in full. Read AGENTS.md, CONTRIBUTING.md and the pull request template; docs/review-checklist.md is absent.; nothing run (a code review).

Checked and fine:

  • The Windows base exclusion follows the existing 64 KB alignment validation and leaves the named neighboring bases available.
  • The documentation and tests describe the new Windows exclusion.

Testing: No commands from the project or tests were run. The author reports Windows game and reservation tests and Linux stand-in reservation tests; Linux game comparison and rebuild timings remain outstanding. CI is still running.

Overlaps and merge order: #2100 touches the reservation path and reportedly merges cleanly; #2692 overlaps host and test files, so whichever lands second needs a rebase.


Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). (L4) The Windows system-page base is now refused, but the Linux default has no demonstrated in-game gain and its one-time rebuild cost is unmeasured. The Linux comparison and build timings are still needed. The change moves Linux guest memory to a low address and changes compilation to make guest accesses cheaper; Windows retains the high address by default. It adds reservation and compatibility complexity, and every Linux player must re-lift and recompile once. **Blocking (1)**: must change before merging. 1. **L4**: It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). *(for the author)* **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2** `builder/crates/build-driver/src/stages.rs:290`: The Linux default changes every lifted unit without a demonstrated in-game gain. *When:* Linux players receive the low-base code after a full rebuild, but no Linux game run compares its frame times or FPS with the high-base baseline. **Do:** Run the requested interleaved game comparisons on Linux and Steam Deck, including average FPS, 1% lows and frame times, against the base. - **L3** `builder/crates/build-compile/src/plan.rs:906`: The compile-time cost of the new lift and compiler flags has not been measured. *When:* Every existing Linux installation changes lift key and recompiles on update; the time and resulting build size are unknown, particularly on the Deck. **Do:** Compare clean and incremental build time and size against the base, including the one-time update on a Deck. **Since the last review** (on 8a10967dfb8d) Resolved: L1 (The split excludes a base equal to the Windows system page, although the builder accepts t…) Still open: L2 (The Linux default changes every lifted unit without a demonstrated in-game gain.); L3 (The compile-time cost of the new lift and compiler flags has not been measured.) New: L4 (It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first).) **Checks:** Failing on this head, which is behind its base, where it passes: `CI / Third-party parts and guide screenshots (pull_request)`. `@rebase` (or `@fix`) brings it up to date and runs it again; not held against it. Still running: 8 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The reported Windows checker measurements improved CPU time by only 0.2 ms and 0.1 ms across five pairs; the larger reported 7.3% result was not reproduced. There is no Linux in-game comparison yet. **Other systems:** Linux drivers, overlays, Steam Deck and container environments can occupy the low address range and prevent startup; their game runs remain outstanding. Windows low-base play and starts were reported successful, while its default remains high. **Switches:** LONGSHOT_MEMORY_BASE adds low, high and hexadecimal build-time choices: low by default on Linux and high on Windows. The Linux default is not yet supported by performance measurements. The build reference documents the switch and the Windows system-page exclusion. **Reviewed:** e3004442d7f9 against 4380fe96b64b: Read the changes since the ledger, the relevant base validation, reservation and caller sections, and the pull request's reported results. Skimmed the overall diff and commit list; the other changed files were not read in full. Read AGENTS.md, CONTRIBUTING.md and the pull request template; docs/review-checklist.md is absent.; nothing run (a code review). **Checked and fine:** - The Windows base exclusion follows the existing 64 KB alignment validation and leaves the named neighboring bases available. - The documentation and tests describe the new Windows exclusion. **Testing:** No commands from the project or tests were run. The author reports Windows game and reservation tests and Linux stand-in reservation tests; Linux game comparison and rebuild timings remain outstanding. CI is still running. **Overlaps and merge order:** #2100 touches the reservation path and reportedly merges cleanly; #2692 overlaps host and test files, so whichever lands second needs a rebase. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.</sub>
Conflicts resolved, both sides kept:
- build-driver build.rs (compile_only): main's hot split check and Game/GameOnly-only
  lift_texts, with the memory base from gen/ (or the environment) read inside that arm
  and passed to alone_ask.
- build-driver stages.rs: the memory-base consts and functions beside main's
  lift_options/lift_options_from, which sets o.codegen.memory_base; main's tests moved
  into stages_tests.rs, their LiftAsk given Windows' base.
- longshot-builder dev/lift_cmd.rs, dev/words.rs: --memory-base and main's
  --fp-nan-mid*, --hot-split options and docs.
- tests/test_lifter_semantics.py: --bases and the window flags with main's
  --fp-nan-mid, --hot-flags, --hot-split, --march; the NaN cases' modules at the first base.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
style(builder): host_sources_tests.rs as rustfmt writes it (main 22d0d2009's cargo fmt --check fails on it)
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Successful in 10s
CI / What the change needs (pull_request) Successful in 10s
CI / Third-party parts and guide screenshots (pull_request) Failing after 14s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 16s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m23s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 3m35s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m49s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m50s
CI / Website build and checks (pull_request) Failing after 30s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 28m10s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 41m18s
598793f30d
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

New head 598793f30: main 22d0d2009 merged in (a merge, so the reviewed commits are unchanged), plus one rustfmt commit.

Conflicts, and how each was resolved (both sides kept):

  • build-driver/src/build.rs (compile_only): main's hot split check and its Game/GameOnly-only lift_texts kept; the memory base (from the lift in gen/, else the environment) is now read inside that arm and passed to alone_ask, so the renderer alone and a dry run don't read it either.
  • build-driver/src/stages.rs: the memory-base consts and functions sit beside main's lift_options/lift_options_from, which sets o.codegen.memory_base as before. Main's three new tests moved into stages_tests.rs, their LiftAsk given Windows' base. a_windows_lift_asks_what_it_asked_before now goes through lift_options_from with no environment and still checks a Windows lift's codegen options equal the lifter's default, so its key and IR are main's.
  • longshot-builder/src/dev/lift_cmd.rs, dev/words.rs: --memory-base and main's --fp-nan-mid, --fp-nan-mid-broken, --fp-nan-mid-skip, --hot-split options and docs all kept.
  • tests/test_lifter_semantics.py: --bases and the window flags kept with main's --fp-nan-mid, --hot-flags, --hot-split and --march. Every module (main's NaN-case modules too) is lifted at its base and compiled with compile_flags plus the window's flags. The NaN cases run at the first base, whose window the run maps. The inttoptr check runs only on modules that have memory words.
  • 598793f30: builder/crates/build-compile/src/host_sources_tests.rs rewritten as rustfmt writes it. On main 22d0d2009 itself, cargo fmt --all --check fails on that file. Glad to drop the commit if main fixes it first.

I checked every caller of alone_ask, lift_options, lift_texts and every LiftAsk construction after the merge, including main's new tests. Each one gets a memory base.

Rerun on the merge (Windows 11 PC, Rust 1.99.1 from mise.toml):

  • cargo fmt --all --check: passes with the rustfmt commit, and fails on main 22d0d2009 alone, in host_sources_tests.rs.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
  • cargo test --workspace --locked: the branch's failures are the same tests that fail on main 22d0d2009 here, all Windows-environment ones (toolchain, nup, longshot-builder's profile tests, an_unchanged_rebuild..., matches_llvm_mc). One more, a_lifted_unit_s_text_made_on_demand..., failed once on the branch. In 3 more runs each it passed every time on the branch and failed once on main. The two objects differ only in their COFF timestamp. The stages:: tests pass: memory base, window form, Windows lift and the float middle path.
  • The end-to-end test compiles to no tests on Windows, so it was not run here.
  • tests/test_lifter_semantics.py (this PC's Windows port of the test, llvm-mingw clang++, Unicorn 2.1.4) passed in three runs:
    • --bases low,high: 126,846 runs over 42,375 words, 19,197 runs of the memory words at 16 TB, the NaN cases at 0x70000000.
    • --bases low --fp-nan-mid --hot-flags --hot-split.
    • --bases low,high --fp-nan-mid --hot-flags --hot-split --march x86-64-v3.
  • The test's Linux form, which CI runs, was not run here: WSL has no cargo or Unicorn.
  • Host syntax, Windows (llvm-mingw): 99/100 at 0x70000000 and at 0x7ffd0000. At 0x7ffe0000, hos_main.c stops at the #error. The one other failure is nn_video.c, which needs ffmpeg's headers, as before.
  • Host syntax, Linux (WSL clang) at 0x70000000: 102/106. The same 4 files fail as before the merge (ffmpeg, dav1d and Windows-only headers).
  • tests/run_all.py --changed --jobs 4: 66 checks, covering the PR's files and the merge's. The 5 that fail fail the same way on main 22d0d2009 here: test_bug_report, test_crash_record, test_dev_build, test_builder_channel, test_oot_state_tap.
  • mise run lint: passes.
  • A second review of the conflict resolutions found no defects.

No game run was repeated for the merge. The PR stays WIP for the farm's Linux run.

🤖 Generated with Claude Code

New head `598793f30`: main `22d0d2009` merged in (a merge, so the reviewed commits are unchanged), plus one rustfmt commit. **Conflicts, and how each was resolved (both sides kept):** - `build-driver/src/build.rs` (`compile_only`): main's hot split check and its Game/GameOnly-only `lift_texts` kept; the memory base (from the lift in gen/, else the environment) is now read inside that arm and passed to `alone_ask`, so the renderer alone and a dry run don't read it either. - `build-driver/src/stages.rs`: the memory-base consts and functions sit beside main's `lift_options`/`lift_options_from`, which sets `o.codegen.memory_base` as before. Main's three new tests moved into `stages_tests.rs`, their `LiftAsk` given Windows' base. `a_windows_lift_asks_what_it_asked_before` now goes through `lift_options_from` with no environment and still checks a Windows lift's codegen options equal the lifter's default, so its key and IR are main's. - `longshot-builder/src/dev/lift_cmd.rs`, `dev/words.rs`: `--memory-base` and main's `--fp-nan-mid`, `--fp-nan-mid-broken`, `--fp-nan-mid-skip`, `--hot-split` options and docs all kept. - `tests/test_lifter_semantics.py`: `--bases` and the window flags kept with main's `--fp-nan-mid`, `--hot-flags`, `--hot-split` and `--march`. Every module (main's NaN-case modules too) is lifted at its base and compiled with `compile_flags` plus the window's flags. The NaN cases run at the first base, whose window the run maps. The inttoptr check runs only on modules that have memory words. - `598793f30`: `builder/crates/build-compile/src/host_sources_tests.rs` rewritten as rustfmt writes it. On main `22d0d2009` itself, `cargo fmt --all --check` fails on that file. Glad to drop the commit if main fixes it first. I checked every caller of `alone_ask`, `lift_options`, `lift_texts` and every `LiftAsk` construction after the merge, including main's new tests. Each one gets a memory base. **Rerun on the merge (Windows 11 PC, Rust 1.99.1 from mise.toml):** - `cargo fmt --all --check`: passes with the rustfmt commit, and fails on main `22d0d2009` alone, in host_sources_tests.rs. - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean. - `cargo test --workspace --locked`: the branch's failures are the same tests that fail on main `22d0d2009` here, all Windows-environment ones (toolchain, nup, longshot-builder's profile tests, `an_unchanged_rebuild...`, `matches_llvm_mc`). One more, `a_lifted_unit_s_text_made_on_demand...`, failed once on the branch. In 3 more runs each it passed every time on the branch and failed once on main. The two objects differ only in their COFF timestamp. The `stages::` tests pass: memory base, window form, Windows lift and the float middle path. - The end-to-end test compiles to no tests on Windows, so it was not run here. - `tests/test_lifter_semantics.py` (this PC's Windows port of the test, llvm-mingw clang++, Unicorn 2.1.4) passed in three runs: - `--bases low,high`: 126,846 runs over 42,375 words, 19,197 runs of the memory words at 16 TB, the NaN cases at 0x70000000. - `--bases low --fp-nan-mid --hot-flags --hot-split`. - `--bases low,high --fp-nan-mid --hot-flags --hot-split --march x86-64-v3`. - The test's Linux form, which CI runs, was not run here: WSL has no cargo or Unicorn. - Host syntax, Windows (llvm-mingw): 99/100 at 0x70000000 and at 0x7ffd0000. At 0x7ffe0000, `hos_main.c` stops at the `#error`. The one other failure is `nn_video.c`, which needs ffmpeg's headers, as before. - Host syntax, Linux (WSL clang) at 0x70000000: 102/106. The same 4 files fail as before the merge (ffmpeg, dav1d and Windows-only headers). - `tests/run_all.py --changed --jobs 4`: 66 checks, covering the PR's files and the merge's. The 5 that fail fail the same way on main `22d0d2009` here: test_bug_report, test_crash_record, test_dev_build, test_builder_channel, test_oot_state_tap. - `mise run lint`: passes. - A second review of the conflict resolutions found no defects. No game run was repeated for the merge. The PR stays WIP for the farm's Linux run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Successful in 10s
CI / What the change needs (pull_request) Successful in 10s
CI / Third-party parts and guide screenshots (pull_request) Failing after 14s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 16s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m23s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 3m35s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m49s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m50s
CI / Website build and checks (pull_request) Failing after 30s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 28m10s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 41m18s
This pull request is marked as a work in progress.
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/low-memory-base:klimovich008-perf/low-memory-base'
git switch 'klimovich008-perf/low-memory-base'
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!2711
No description provided.