perf(lift): the float slow paths' middle path off by default; LONGSHOT_FP_NAN_MID=1 brings it back #3081

Merged
HumanBean merged 3 commits from klimovich008/Longshot:perf/nan-mid-off into main 2026-12-04 19:15:10 +00:00
Member

Summary

Why: #2684's middle path for float operations with a NaN lane no longer pays. It was added for the cloth's NaN lane in Lost Woods; since the cloth runs natively (HOS_NATIVE_CLOTH), the lifted cloth no longer runs by default, and the middle path is only extra code: it makes the hot units 28 % bigger (58.6 → 42.0 MB with it off). Turned off, the game uses less CPU in every scene measured (Market −3.0 %, Fire Temple −2.3 %, Lost Woods −1.9 % CPU ms per frame; diagnostic, below).

What changes: LONGSHOT_FP_NAN_MID is now off by default; LONGSHOT_FP_NAN_MID=1 (or on, yes, true) turns the middle path back on, exactly as #2684 shipped it. Off, the lift is the lift before #2684: no middle path, nothing added to any key text. The middle path's code, its tests, the skip list and dev words --fp-nan-mid all stay.

Files, in reading order:

  • builder/crates/build-driver/src/stages.rs: the one place a build reads the switch. fp_nan_mid_on is on only for an on word of build_core::switch; unset, an off word or any other word is off. LONGSHOT_FP_NAN_MID_SKIP is looked up only when the switch is on, and a non-Unicode list is refused only then.
  • builder/crates/lift/src/whole/mod.rs: LiftOptions::new starts with fp_nan_mid: None (the default of dev lift and of the lift's tests).
  • builder/crates/longshot-builder/src/dev/lift_cmd.rs: dev lift is off by default as a build is; --fp-nan-mid turns it on; --no-fp-nan-mid is kept.
  • Tests: stages.rs, lift/src/whole/tests.rs, dev/lift_cmd.rs; doc comments in sem/src/fpfast.rs, dev/words.rs, tests/test_lifter_semantics.py; docs in docs/dev/reference/build.md (the switch row is now LONGSHOT_FP_NAN_MID=1) and builder.md.

A cost on the update: the lifter's key moves (LIFTER_SOURCES hashes the lift crate's sources), so every player's units lift again. Their stores hold the cold units' objects of the same IR, so the new work is compiling the 122 hot units: measured 712 CPU-seconds on a pre-#2684 build (the longest unit 30.8 s), about 1 minute on 16 threads, an estimated 3–4 minutes on 4 cores. No file of the shader stamp changes: the shader caches stay valid.

Testing

Tested: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2.

  • In the game, a player's build with the new default (no switch set): Market child, Fire Temple, Lost Woods child (the runs below). The build log shows no middle-path line; the map's hot tier is 41,979,913 bytes, byte for byte the size of a LONGSHOT_FP_NAN_MID=0 build of #2684. Every run played its scene to the end and was admitted by the harness (game clock, no stall rejections).

  • tests/test_lifter_semantics.py against Unicorn (through a Windows port of its runtime; the suite skips it on Windows), default sizes, the fixed NaN cases each time: ok with the default (off) and with --fp-nan-mid, each on x86-64-v3 and plain x86-64 at -O1, and the default at -O2 -ffp-contract=off (as the hot units ship) on both. The NaN cases' broken variant (--fp-nan-mid-broken) differs in 56 runs each time, as the test requires.

  • Negative control for the code the default now relies on: a broken exact semantics (nan_fix with the operand NaN and the default NaN swapped) fails: 1,537 words differ from Unicorn.

  • Builder, on 8ceba19e (merged with main b4d56f526), Rust 1.99.1: dev.py cargo -- test for build-driver (220 unit tests and its integration tests), lift (56), sem (9), llvm (23) and mir (7): all pass; longshot-builder dev::lift passes; cargo fmt --all --check clean; cargo clippy -p build-driver -p lift -p longshot-builder -p sem --all-targets -- -D warnings clean. mise run test (the whole suite) not run on this head.

  • mise run lint: passes every hook.

  • On this head (d023c8bcb, merged with main d6e819e08: 68 commits, none in the lifter's crates, so the numbers below still hold): cargo fmt --all --check clean, lift's 56 tests pass, mise run lint passes. On this Windows PC four longshot-builder tests (the profile's settings and Streamline choice, dev_runtime) fail at the same lines on main d6e819e08 as here, and clippy flags an unused import in build-core's Windows sandbox code on main as well; neither is in this change.

  • A second-opinion review (gpt-6.2-sol), three rounds; the last found no defect in the change. One follow-up, older than this PR: a longshot-builder dev compile run alone does not check the middle path's setting against the lift's (as check_hot_split does for LONGSHOT_HOT_SPLIT), so a developer compiling kept IR with the other setting gets it unchecked. A build lifts and compiles with one setting, so builds don't reach it.

  • Steam Deck OLED (SteamOS 3.9.5, Mesa 26.2.0-devel RADV, stock 15 W): a player's build of this head (8ceba19e) and of its main (b4d56f52).

    • Market child, uncapped, 3 alternating pairs, in the standard window and at steady state.
    • CPU ms per frame is not higher than main's: −0.3 % at steady state, −0.5 % in the standard window.
    • The head's build compiled 114 hot units again and main's none, so the change is in the build measured.
    • The numbers are in Measurements.

Not tested: a low-core or Intel CPU (no farm run).

Still to test:

  • Linux CI: tests/test_lifter_semantics.py in its default mode, expecting a pass (by hand: CI's Linux job runs it on every push).

Measurements

Verdict: with the middle path off, CPU ms per frame −3.0 % in Market child, −2.3 % in Fire Temple, −1.9 % in Lost Woods child (6 pairs); fps +1.9 %, +2.2 %, +0.9 %. All under 5 % with 3 pairs: diagnostic. The one case that is slower: with the native cloth turned off (HOS_NATIVE_CLOTH=0), Lost Woods child +4.0 % CPU ms (1 pair); LONGSHOT_FP_NAN_MID=1 restores it for anyone who runs that way.

Setup: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2; the standard test (std_test.py): uncapped (HOS_FPS_MAX=240), 16:9, render thread on, the camera turning, 20 s window, 3 alternating pairs, the medians; game clock 0.999–1.002 on every run. Before: main 694ae5820 built as a player's build. After: the same with this change (27776d26d: the branch's commit cherry-picked onto it, the same 9 files), its own builder, no switch set. Lost Woods: #2684's LONGSHOT_FP_NAN_MID=0 on the same base, whose hot tier is identical byte for byte, 6 pairs.

Median of 3 runs a side Before: main @ 694ae5820 After: this PR @ 27776d26d (its change on 694ae5820)
Market child: fps 109.04 111.08 (+1.9 %)
Market child: CPU ms per frame 40.97 39.73 (−3.0 %; pairs −6.0, +0.8, −1.2 %)
Market child: p99 frame ms 17.79 17.36
Market child: worst frame ms (max of 3), frames > 100 ms 25.4, 0 26.3, 0
Fire Temple: fps 127.34 130.13 (+2.2 %)
Fire Temple: CPU ms per frame 37.12 36.28 (−2.3 %; pairs −3.5, −4.4, −2.0 %)
Fire Temple: p99 frame ms 11.31 11.62
Fire Temple: worst frame ms (max of 3), frames > 100 ms 26.0, 0 21.1, 0
Lost Woods child (6 pairs): CPU ms per frame 33.92 33.27 (−1.9 %; lower in 5 of 6)
Hot units' code (map) 58,643,169 B 41,979,913 B (−28.4 %)

Steam Deck: no measurable change in fps or CPU; CPU ms is not higher, as expected.

  • Setup: Steam Deck OLED, SteamOS 3.9.5, Mesa 26.2.0-devel RADV, stock 15 W, AC power. The Deck's standard test (harness/deck_std_test.py): Market child, uncapped (HOS_FPS_MAX=240), no render thread, 45 s window, 3 alternating pairs, the medians; game clock 0.9995-1.001.
  • Arms: before is main b4d56f52 and after is this head, 8ceba19e (b4d56f52 merged in), each built as a player's build.
  • Windows: "steady state" starts the window after 150 s of turning in the scene. "Standard" starts it ~20 s after the arrival, where the load's page faults and swap-ins still run.
Median of 3 runs a side Before: main @ b4d56f52 After: this PR @ 8ceba19e
Steady state: fps 43.27 43.80 (+1.2 %; pairs +2.0, +1.2, −10.7 %)
Steady state: CPU ms per frame 78.71 78.47 (−0.3 %)
Steady state: p99 frame ms 32.58 32.10
Steady state: worst frame ms (max of 3), frames > 100 ms 52.9, 0 61.5, 0
Standard window (2 pairs: the first pair dropped when its first run was refused for swap): fps 39.50 39.43 (−0.2 %)
Standard window: CPU ms per frame 83.73 83.34 (−0.5 %)
  • The third steady-state pair's after run had 55,773 major page faults in its window (the other five had 17-95) but only 2.4 MB swapped in, so file pages (most likely the game's code) were read back from disk. The harness refuses runs for swap, not for this, so it was admitted. The other two pairs average +1.6 %.
  • All results are under 5 % with 3 pairs: diagnostic. The PC's −3.0 % CPU ms in Market does not show on the Deck; neither does a cost.

Risks

  • Correctness: off is the lift before #2684: every NaN-lane float operation takes the exact helper again, which the instruction tests above check under every FZ/DN setting. The middle path was exact too, so nothing a player sees should change.
  • Speed: a scene that still runs the lifted cloth (HOS_NATIVE_CLOTH=0) is about 4 % slower in CPU; LONGSHOT_FP_NAN_MID=1 at build time brings it back. A revert of this PR is also enough.
  • After updating: the game lifts again and the 122 hot units compile again once (about 1 minute on 16 threads, 3–4 on 4 cores). Saves, settings and the shader caches are untouched.

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.
  • 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 **Why:** #2684's middle path for float operations with a NaN lane no longer pays. It was added for the cloth's NaN lane in Lost Woods; since the cloth runs natively (`HOS_NATIVE_CLOTH`), the lifted cloth no longer runs by default, and the middle path is only extra code: it makes the hot units 28 % bigger (58.6 → 42.0 MB with it off). Turned off, the game uses less CPU in every scene measured (Market −3.0 %, Fire Temple −2.3 %, Lost Woods −1.9 % CPU ms per frame; diagnostic, below). **What changes:** `LONGSHOT_FP_NAN_MID` is now **off by default**; `LONGSHOT_FP_NAN_MID=1` (or `on`, `yes`, `true`) turns the middle path back on, exactly as #2684 shipped it. Off, the lift is the lift before #2684: no middle path, nothing added to any key text. The middle path's code, its tests, the skip list and `dev words --fp-nan-mid` all stay. Files, in reading order: - `builder/crates/build-driver/src/stages.rs`: the one place a build reads the switch. `fp_nan_mid_on` is on only for an on word of `build_core::switch`; unset, an off word or any other word is off. `LONGSHOT_FP_NAN_MID_SKIP` is looked up only when the switch is on, and a non-Unicode list is refused only then. - `builder/crates/lift/src/whole/mod.rs`: `LiftOptions::new` starts with `fp_nan_mid: None` (the default of `dev lift` and of the lift's tests). - `builder/crates/longshot-builder/src/dev/lift_cmd.rs`: `dev lift` is off by default as a build is; `--fp-nan-mid` turns it on; `--no-fp-nan-mid` is kept. - Tests: `stages.rs`, `lift/src/whole/tests.rs`, `dev/lift_cmd.rs`; doc comments in `sem/src/fpfast.rs`, `dev/words.rs`, `tests/test_lifter_semantics.py`; docs in `docs/dev/reference/build.md` (the switch row is now `LONGSHOT_FP_NAN_MID=1`) and `builder.md`. **A cost on the update:** the lifter's key moves (`LIFTER_SOURCES` hashes the lift crate's sources), so every player's units lift again. Their stores hold the cold units' objects of the same IR, so the new work is compiling the 122 hot units: measured 712 CPU-seconds on a pre-#2684 build (the longest unit 30.8 s), about 1 minute on 16 threads, an estimated 3–4 minutes on 4 cores. No file of the shader stamp changes: the shader caches stay valid. ## Testing **Tested:** Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2. - In the game, a player's build with the new default (no switch set): Market child, Fire Temple, Lost Woods child (the runs below). The build log shows no middle-path line; the map's hot tier is 41,979,913 bytes, byte for byte the size of a `LONGSHOT_FP_NAN_MID=0` build of #2684. Every run played its scene to the end and was admitted by the harness (game clock, no stall rejections). - `tests/test_lifter_semantics.py` against Unicorn (through a Windows port of its runtime; the suite skips it on Windows), default sizes, the fixed NaN cases each time: **ok** with the default (off) and with `--fp-nan-mid`, each on x86-64-v3 and plain x86-64 at -O1, and the default at -O2 `-ffp-contract=off` (as the hot units ship) on both. The NaN cases' broken variant (`--fp-nan-mid-broken`) differs in 56 runs each time, as the test requires. - Negative control for the code the default now relies on: a broken exact semantics (`nan_fix` with the operand NaN and the default NaN swapped) **fails**: 1,537 words differ from Unicorn. - Builder, on 8ceba19e (merged with main b4d56f526), Rust 1.99.1: `dev.py cargo -- test` for build-driver (220 unit tests and its integration tests), lift (56), sem (9), llvm (23) and mir (7): all pass; `longshot-builder dev::lift` passes; `cargo fmt --all --check` clean; `cargo clippy -p build-driver -p lift -p longshot-builder -p sem --all-targets -- -D warnings` clean. `mise run test` (the whole suite) not run on this head. - `mise run lint`: passes every hook. - On this head (d023c8bcb, merged with main d6e819e08: 68 commits, none in the lifter's crates, so the numbers below still hold): `cargo fmt --all --check` clean, lift's 56 tests pass, `mise run lint` passes. On this Windows PC four `longshot-builder` tests (the profile's settings and Streamline choice, `dev_runtime`) fail at the same lines on main d6e819e08 as here, and clippy flags an unused import in `build-core`'s Windows sandbox code on main as well; neither is in this change. - A second-opinion review (gpt-6.2-sol), three rounds; the last found no defect in the change. One follow-up, older than this PR: a `longshot-builder dev compile` run alone does not check the middle path's setting against the lift's (as `check_hot_split` does for `LONGSHOT_HOT_SPLIT`), so a developer compiling kept IR with the other setting gets it unchecked. A build lifts and compiles with one setting, so builds don't reach it. - **Steam Deck OLED** (SteamOS 3.9.5, Mesa 26.2.0-devel RADV, stock 15 W): a player's build of this head (8ceba19e) and of its main (b4d56f52). - Market child, uncapped, 3 alternating pairs, in the standard window and at steady state. - CPU ms per frame is **not higher than main's**: −0.3 % at steady state, −0.5 % in the standard window. - The head's build compiled 114 hot units again and main's none, so the change is in the build measured. - The numbers are in Measurements. **Not tested:** a low-core or Intel CPU (no farm run). **Still to test:** - Linux CI: `tests/test_lifter_semantics.py` in its default mode, expecting a pass (by hand: CI's Linux job runs it on every push). ## Measurements **Verdict:** with the middle path off, CPU ms per frame −3.0 % in Market child, −2.3 % in Fire Temple, −1.9 % in Lost Woods child (6 pairs); fps +1.9 %, +2.2 %, +0.9 %. All under 5 % with 3 pairs: **diagnostic**. The one case that is slower: with the native cloth turned off (`HOS_NATIVE_CLOTH=0`), Lost Woods child +4.0 % CPU ms (1 pair); `LONGSHOT_FP_NAN_MID=1` restores it for anyone who runs that way. Setup: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2; the standard test (`std_test.py`): uncapped (`HOS_FPS_MAX=240`), 16:9, render thread on, the camera turning, 20 s window, 3 alternating pairs, the medians; game clock 0.999–1.002 on every run. Before: main 694ae5820 built as a player's build. After: the same with this change (27776d26d: the branch's commit cherry-picked onto it, the same 9 files), its own builder, no switch set. Lost Woods: #2684's `LONGSHOT_FP_NAN_MID=0` on the same base, whose hot tier is identical byte for byte, 6 pairs. | Median of 3 runs a side | Before: main @ 694ae5820 | After: this PR @ 27776d26d (its change on 694ae5820) | |---|---|---| | Market child: fps | 109.04 | 111.08 (+1.9 %) | | Market child: CPU ms per frame | 40.97 | 39.73 (−3.0 %; pairs −6.0, +0.8, −1.2 %) | | Market child: p99 frame ms | 17.79 | 17.36 | | Market child: worst frame ms (max of 3), frames > 100 ms | 25.4, 0 | 26.3, 0 | | Fire Temple: fps | 127.34 | 130.13 (+2.2 %) | | Fire Temple: CPU ms per frame | 37.12 | 36.28 (−2.3 %; pairs −3.5, −4.4, −2.0 %) | | Fire Temple: p99 frame ms | 11.31 | 11.62 | | Fire Temple: worst frame ms (max of 3), frames > 100 ms | 26.0, 0 | 21.1, 0 | | Lost Woods child (6 pairs): CPU ms per frame | 33.92 | 33.27 (−1.9 %; lower in 5 of 6) | | Hot units' code (map) | 58,643,169 B | 41,979,913 B (−28.4 %) | **Steam Deck:** no measurable change in fps or CPU; CPU ms is not higher, as expected. - **Setup:** Steam Deck OLED, SteamOS 3.9.5, Mesa 26.2.0-devel RADV, **stock 15 W**, AC power. The Deck's standard test (`harness/deck_std_test.py`): Market child, uncapped (`HOS_FPS_MAX=240`), no render thread, 45 s window, 3 alternating pairs, the medians; game clock 0.9995-1.001. - **Arms:** before is main b4d56f52 and after is this head, 8ceba19e (b4d56f52 merged in), each built as a player's build. - **Windows:** "steady state" starts the window after 150 s of turning in the scene. "Standard" starts it ~20 s after the arrival, where the load's page faults and swap-ins still run. | Median of 3 runs a side | Before: main @ b4d56f52 | After: this PR @ 8ceba19e | |---|---|---| | Steady state: fps | 43.27 | 43.80 (+1.2 %; pairs +2.0, +1.2, −10.7 %) | | Steady state: CPU ms per frame | 78.71 | 78.47 (−0.3 %) | | Steady state: p99 frame ms | 32.58 | 32.10 | | Steady state: worst frame ms (max of 3), frames > 100 ms | 52.9, 0 | 61.5, 0 | | Standard window (2 pairs: the first pair dropped when its first run was refused for swap): fps | 39.50 | 39.43 (−0.2 %) | | Standard window: CPU ms per frame | 83.73 | 83.34 (−0.5 %) | - **The third steady-state pair's after run had 55,773 major page faults in its window** (the other five had 17-95) but only 2.4 MB swapped in, so file pages (most likely the game's code) were read back from disk. The harness refuses runs for swap, not for this, so it was admitted. The other two pairs average +1.6 %. - **All results are under 5 % with 3 pairs: diagnostic.** The PC's −3.0 % CPU ms in Market does not show on the Deck; neither does a cost. ## Risks - **Correctness:** off is the lift before #2684: every NaN-lane float operation takes the exact helper again, which the instruction tests above check under every FZ/DN setting. The middle path was exact too, so nothing a player sees should change. - **Speed:** a scene that still runs the lifted cloth (`HOS_NATIVE_CLOTH=0`) is about 4 % slower in CPU; `LONGSHOT_FP_NAN_MID=1` at build time brings it back. A revert of this PR is also enough. - **After updating:** the game lifts again and the 122 hot units compile again once (about 1 minute on 16 threads, 3–4 on 4 cores). Saves, settings and the shader caches are untouched. ## 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. - [ ] `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] A check under `tests/` that reads changed source is updated, not weakened. - [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)
#2684's middle path (a NaN lane with no subnormal one takes the NaN choice inline instead of the exact helper) paid for
the lifted cloth's NaN lanes. Since #2036 the cloth runs natively, and measured on main 694ae5820 the path no longer
pays where it does: with it off Lost Woods takes 1.9 % less CPU time a frame (6 pairs), the hot units' code is 28 %
smaller (58.6 -> 42.0 MB), and the exact helpers it saves take 0.18 % of the process. Where the cloth runs lifted
(HOS_NATIVE_CLOTH=0) it still saves about 4 %: LONGSHOT_FP_NAN_MID=1 brings it back.

- builder/crates/build-driver/src/stages.rs: fp_nan_mid_on is on only for an on word (1, on, yes, true); unset, an off
  word or any other value is off. The skip list is read only when it is on.
- builder/crates/lift/src/whole/mod.rs: LiftOptions::new starts with it off (dev lift and the lift's tests start there).
- dev lift: off by default as a build is; --fp-nan-mid turns it on (--no-fp-nan-mid kept, now the default).
- The tests that said "on by default" say off, and test both values; docs (build.md, builder.md), the semantics
  check's docstring and the sources' comments say the new default.

The code and the switch stay. Off is the lift as before #2684: the hot units' IR is that of before. The lifter's own key
(LIFTER_SOURCES) moves, as with any change to its crates (lift and sem change here), so every player's units are lifted
again on the update that ships this. The cold units' code is the same, and their objects come from the builder's store;
the hot units are compiled again unless the store still holds objects of their pre-#2684 IR. No file of the shader
translator's stamp changes. The driver reads LONGSHOT_FP_NAN_MID_SKIP only with the switch on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge origin/main into perf/nan-mid-off
Some checks failed
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 12s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 15s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m27s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 15m33s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 13m23s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 13m25s
CI / Website build and checks (pull_request) Failing after 38s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 49m20s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m5s
beanstalk/approval approved by klimovich008 (reviewed)
beanstalk/steamdeck+window 0/1 pass, 0 running, 2 queued
beanstalk/window+cpu-5600x3d 0/1 pass, 0 running, 1 queued
beanstalk/window+cpu-i3-8100 0/1 pass, 0 running, 1 queued
PR description / Title and description (pull_request_target) Successful in 5s
8ceba19e04
Author
Member

Tested in game: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2: this change (27776d26d, on main 694ae5820, the same 9 files) built as a player's build with no switch set, run in Market child and Fire Temple (3 standard-test runs each, all admitted, no stall) and Lost Woods child (6 runs, LONGSHOT_FP_NAN_MID=0 of #2684, the same hot code byte for byte)

Tested in game: Windows 11, Ryzen 7 5700X3D, RX 9070 XT, AMD 26.11.2: this change (27776d26d, on main 694ae5820, the same 9 files) built as a player's build with no switch set, run in Market child and Fire Temple (3 standard-test runs each, all admitted, no stall) and Lost Woods child (6 runs, LONGSHOT_FP_NAN_MID=0 of #2684, the same hot code byte for byte)
Author
Member

@Beanstalk perf, this PR's head against main (a build-time switch: the PR's build is the new default, main's is the old one). Scene: Market child, then Lost Woods child if time allows. Uncapped: frame_rate_cap = 6, vsync = 2, frame_generation = 0, windowed. 2-3 runs a side, interleaved. Machines: steamdeck first, then a low-core (4-6 core) PC and an Intel CPU if any is online. Compare fps_mean, CPU ms per frame and frametime_p99; run_hitch_count and run_frametime_max_ms report-only. Expecting: not slower than main anywhere (on this PC Market was -3.0 % CPU ms). Note: the update relifts the game and recompiles the 122 hot units once, so the first start after the build is not a measurement.

@Beanstalk perf, this PR's head against main (a build-time switch: the PR's build is the new default, main's is the old one). Scene: Market child, then Lost Woods child if time allows. Uncapped: frame_rate_cap = 6, vsync = 2, frame_generation = 0, windowed. 2-3 runs a side, interleaved. Machines: steamdeck first, then a low-core (4-6 core) PC and an Intel CPU if any is online. Compare fps_mean, CPU ms per frame and frametime_p99; run_hitch_count and run_frametime_max_ms report-only. Expecting: not slower than main anywhere (on this PC Market was -3.0 % CPU ms). Note: the update relifts the game and recompiles the 122 hot units once, so the first start after the build is not a measurement.
Member
Beanstalk test farm · an earlier run: commit 8ceba19 (the newer results are in a comment below)

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

⚠️ Note: The farm cannot directly measure CPU milliseconds per frame; process CPU seconds are reported but are not equivalent. Small gains near the claimed 3% may be indistinguishable from run-to-run noise.
⚠️ Note: Windowed scenarios cannot capture comparison pictures, and the build-time switch cannot be varied through a runtime matrix; the timed lift builds do not reproduce the specific one-time update cost.
⚠️ Note: The farm cannot designate an extra unmeasured first game start with this windowed scenario; each measured segment instead has a 20-second warm-up.

Started at 2026-12-03 13:33 UTC.

⚠ No tester has a PC for steamdeck+window (none seen in 14 days): it waits until one signs in.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
steamdeck+window ⏳ queued 0 of 1 — — —
window+cpu-5600x3d (CPU "5600x3d") ⏳ queued 1 1 — — none
window+cpu-i3-8100 (CPU "i3 8100") ⏳ queued 1 1 — — none

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.

  • window+cpu-5600x3d, report 1: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • window+cpu-i3-8100, report 1: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
What was tested

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

The plan compares the PR’s default build with main in child Market and Lost Woods, using three interleaved starts per side and 30-second uncapped measurements in a window. It targets Steam Deck, a six-core PC, and an Intel CPU; the Steam Deck target will wait for a matching window-capable tester. It reports FPS, frame-time tails and hitches, and times the lift builds separately. Crashes, a frame-time regression over 15%, or an FPS regression over 10% fail the plan. No tester online now matches steamdeck+window: that target waits for one.

  • Where: steamdeck+window (1-2 reports), window+cpu-5600x3d (CPU "5600x3d", 1-2 reports), window+cpu-i3-8100 (CPU "i3 8100", 1-2 reports).
  • market-woods: from the repository's save market-entrance (settings vsync=2, fullscreen=0, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0; switches HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0; in a hidden window (the present path runs)), then teleport to Market, measure market for 30 s (after 20 s warm-up), teleport to Lost Woods, measure woods for 30 s (after 20 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 code compared.
  • Measured: crashes, frame times, stutters and hitches, draws and frame rate, memory and CPU time.
  • The PR fails if: it crashes; or frame rate is more than -10% below main; or frame time (p99) is more than 15% above main.
  • Time: about 40 min of game runs per tester (6 game starts), plus the two builds and 4 timed builds (about 80 min).
Measurements on `window+cpu-5600x3d`, for the PR description

Verdict: queued on window+cpu-5600x3d (1 report).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess NVIDIA GeForce RTX 3070, 621.35.0 AMD Ryzen 5 5600X3D 6-Core Processor, 32 GB RAM
Scene: market-woods, from the repository's save market-entrance (vsync=2, fullscreen=0, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=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-woods: 3 game starts a side, market 30 s after 20 s warm-up, woods 30 s after 20 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 1 report
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 @ b4d56f5 After: this PR @ 8ceba19
lift · lifted code 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:** queued on window+cpu-5600x3d (1 report).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 3070, 621.35.0` `AMD Ryzen 5 5600X3D 6-Core Processor, 32 GB RAM`  
Scene: market-woods, from the repository's save market-entrance (vsync=2, fullscreen=0, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=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-woods: 3 game starts a side, market 30 s after 20 s warm-up, woods 30 s after 20 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 1 report  
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 @ b4d56f5 | After: this PR @ 8ceba19 |
|---|---|---|
| lift · lifted code | main's | not compared |

**Flags and settings**

None: the plan varied no setting, switch or build option.
Measurements on `window+cpu-i3-8100`, for the PR description

Verdict: queued on window+cpu-i3-8100 (1 report).

Hardware: 1: windows+intel+intel-proprietary+igpu+window Intel(R) UHD Graphics 630, 0.404.2115 Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM
Scene: market-woods, from the repository's save market-entrance (vsync=2, fullscreen=0, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=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-woods: 3 game starts a side, market 30 s after 20 s warm-up, woods 30 s after 20 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 1 report
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 @ b4d56f5 After: this PR @ 8ceba19
lift · lifted code 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:** queued on window+cpu-i3-8100 (1 report).

Hardware: 1: windows+intel+intel-proprietary+igpu+window `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM`  
Scene: market-woods, from the repository's save market-entrance (vsync=2, fullscreen=0, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=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-woods: 3 game starts a side, market 30 s after 20 s warm-up, woods 30 s after 20 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 1 report  
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 @ b4d56f5 | After: this PR @ 8ceba19 |
|---|---|---|
| lift · lifted code | main's | not compared |

**Flags and settings**

None: the plan varied no setting, switch or build option.
The testers' hardware
Target Report Ran on
window+cpu-5600x3d 1 windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess NVIDIA GeForce RTX 3070, 621.35.0 AMD Ryzen 5 5600X3D 6-Core Processor, 32 GB RAM
window+cpu-i3-8100 1 windows+intel+intel-proprietary+igpu+window Intel(R) UHD Graphics 630, 0.404.2115 Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>8ceba19</code> (the newer results are in a comment below)</summary> Commit `8ceba19` · approved by klimovich008 (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/3081) ⚠️ **Note:** The farm cannot directly measure CPU milliseconds per frame; process CPU seconds are reported but are not equivalent. Small gains near the claimed 3% may be indistinguishable from run-to-run noise. ⚠️ **Note:** Windowed scenarios cannot capture comparison pictures, and the build-time switch cannot be varied through a runtime matrix; the timed lift builds do not reproduce the specific one-time update cost. ⚠️ **Note:** The farm cannot designate an extra unmeasured first game start with this windowed scenario; each measured segment instead has a 20-second warm-up. Started at 2026-12-03 13:33 UTC. ⚠ No tester has a PC for `steamdeck+window` (none seen in 14 days): it waits until one signs in. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `steamdeck+window` | ⏳ queued | 0 of 1 | — | — | — | | `window+cpu-5600x3d` (CPU "5600x3d") | ⏳ queued | 1 [1](https://beanstalk.magicbean.dev/reports/rp_956fde87d463ae22) | — | — | none | | `window+cpu-i3-8100` (CPU "i3 8100") | ⏳ queued | 1 [1](https://beanstalk.magicbean.dev/reports/rp_193ab07c5fff3a2b) | — | — | none | **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. - `window+cpu-5600x3d`, [report 1](https://beanstalk.magicbean.dev/reports/rp_956fde87d463ae22): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `window+cpu-i3-8100`, [report 1](https://beanstalk.magicbean.dev/reports/rp_193ab07c5fff3a2b): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares the PR’s default build with main in child Market and Lost Woods, using three interleaved starts per side and 30-second uncapped measurements in a window. It targets Steam Deck, a six-core PC, and an Intel CPU; the Steam Deck target will wait for a matching window-capable tester. It reports FPS, frame-time tails and hitches, and times the lift builds separately. Crashes, a frame-time regression over 15%, or an FPS regression over 10% fail the plan. No tester online now matches steamdeck+window: that target waits for one. - **Where:** steamdeck+window (1-2 reports), window+cpu-5600x3d (CPU "5600x3d", 1-2 reports), window+cpu-i3-8100 (CPU "i3 8100", 1-2 reports). - **market-woods:** from the repository's save `market-entrance` (settings vsync=2, fullscreen=0, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0; switches `HOS_OUTPUT_RES=1280x720`, `RX_VK_AUTO_TUNE=0`; in a hidden window (the present path runs)), then teleport to Market, measure market for 30 s (after 20 s warm-up), teleport to Lost Woods, measure woods for 30 s (after 20 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 code compared. - **Measured:** crashes, frame times, stutters and hitches, draws and frame rate, memory and CPU time. - **The PR fails if:** it crashes; or frame rate is more than -10% below main; or frame time (p99) is more than 15% above main. - **Time:** about 40 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 `window+cpu-5600x3d`, for the PR description</summary> **Verdict:** queued on window+cpu-5600x3d (1 report). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 3070, 621.35.0` `AMD Ryzen 5 5600X3D 6-Core Processor, 32 GB RAM` Scene: market-woods, from the repository's save market-entrance (vsync=2, fullscreen=0, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=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-woods: 3 game starts a side, market 30 s after 20 s warm-up, woods 30 s after 20 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 1 report 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 @ b4d56f5 | After: this PR @ 8ceba19 | |---|---|---| | lift · lifted code | 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:** queued on window+cpu-5600x3d (1 report). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 3070, 621.35.0` `AMD Ryzen 5 5600X3D 6-Core Processor, 32 GB RAM` Scene: market-woods, from the repository's save market-entrance (vsync=2, fullscreen=0, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=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-woods: 3 game starts a side, market 30 s after 20 s warm-up, woods 30 s after 20 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 1 report 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 @ b4d56f5 | After: this PR @ 8ceba19 | |---|---|---| | lift · lifted code | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `window+cpu-i3-8100`, for the PR description</summary> **Verdict:** queued on window+cpu-i3-8100 (1 report). Hardware: 1: windows+intel+intel-proprietary+igpu+window `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM` Scene: market-woods, from the repository's save market-entrance (vsync=2, fullscreen=0, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=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-woods: 3 game starts a side, market 30 s after 20 s warm-up, woods 30 s after 20 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 1 report 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 @ b4d56f5 | After: this PR @ 8ceba19 | |---|---|---| | lift · lifted code | 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:** queued on window+cpu-i3-8100 (1 report). Hardware: 1: windows+intel+intel-proprietary+igpu+window `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM` Scene: market-woods, from the repository's save market-entrance (vsync=2, fullscreen=0, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=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-woods: 3 game starts a side, market 30 s after 20 s warm-up, woods 30 s after 20 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 1 report 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 @ b4d56f5 | After: this PR @ 8ceba19 | |---|---|---| | lift · lifted code | 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 | | --- | --- | --- | | `window+cpu-5600x3d` | [1](https://beanstalk.magicbean.dev/reports/rp_956fde87d463ae22) | windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 3070, 621.35.0` `AMD Ryzen 5 5600X3D 6-Core Processor, 32 GB RAM` | | `window+cpu-i3-8100` | [1](https://beanstalk.magicbean.dev/reports/rp_193ab07c5fff3a2b) | windows+intel+intel-proprietary+igpu+window `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM` | </details> </details>
Author
Member

Tested on a Steam Deck OLED (stock 15 W). The farm's steamdeck runner errors on main's tools.lock, so I ran this one by hand.

  • Builds: a player's build of this head and of its main b4d56f52.
  • Runs: Market child, uncapped, 3 alternating pairs, in the standard window and at steady state.
  • Result: CPU ms per frame is not higher than main's (−0.3 % and −0.5 %), and fps doesn't change measurably (+1.2 % and −0.2 %; diagnostic).
  • The description's Tested and Measurements now hold the numbers. The Deck item is out of Still to test.

CI: Host C for Windows, Rust and Website fail here exactly as on #2784, a diff that shares no file with this one; details in #2784's comment. They look like main's.

**Tested on a Steam Deck OLED** (stock 15 W). The farm's steamdeck runner errors on main's `tools.lock`, so I ran this one by hand. - **Builds:** a player's build of this head and of its main b4d56f52. - **Runs:** Market child, uncapped, 3 alternating pairs, in the standard window and at steady state. - **Result:** CPU ms per frame is not higher than main's (−0.3 % and −0.5 %), and fps doesn't change measurably (+1.2 % and −0.2 %; diagnostic). - The description's Tested and Measurements now hold the numbers. The Deck item is out of Still to test. **CI:** Host C for Windows, Rust and Website fail here exactly as on #2784, a diff that shares no file with this one; details in [#2784's comment](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2784#issuecomment-100985). They look like main's.
Merge remote-tracking branch 'origin/main' into perf/nan-mid-off
Some checks failed
beanstalk/approval not approved yet
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
PR description / Title and description (pull_request_target) Failing after 7s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m22s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 17m17s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 17s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 10m48s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 13m57s
CI / Website build and checks (pull_request) Failing after 42s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Successful in 46m14s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m5s
d023c8bcba
Member

Beanstalk test farm

Commit d023c8b · 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 `d023c8b` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/3081) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
klimovich008 changed title from WIP: perf(lift): the float slow paths' middle path off by default; LONGSHOT_FP_NAN_MID=1 brings it back to perf(lift): the float slow paths' middle path off by default; LONGSHOT_FP_NAN_MID=1 brings it back 2026-12-04 17:17:33 +00:00
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The hot units are 28.4% smaller, but the reported gameplay timing differences are within the run-to-run spread. The update also requires recompilation, whose effect on total build time has not been compared against main. Recommend approval; not approved on the forge.

The builder disables the float NaN middle path by default while retaining an opt-in switch. This reduces measured hot-unit code from 58.6 MB to 42.0 MB, at the cost of relifting and recompiling hot units on update; its gameplay performance benefit remains unproven.

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

  • L1 builder/crates/build-driver/src/stages.rs:339: The claimed gameplay speedup is smaller than the observed variation, so the new default's performance benefit is unproven. (more on the line) Do: Run additional alternating main-versus-head measurements in the affected scenes, including an Intel or low-core CPU, and report CPU time and frame-time distributions.
  • L2 builder/crates/lift/src/whole/mod.rs:139: The change invalidates the lifter key and recompiles hot units, but the reported compiler CPU seconds do not establish its effect on players' total build time. (more on the line) Do: Measure clean and one-function-change build time and output size on main and this head, including an update from a current build and a low-core machine. (@fix does its part first: Avoid invalidating lifter source keys for changes that do not alter generated IR, if the key can safely distinguish them.)

@fix can do L2.

Checks: Still running: 11 checks.

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

Does it help: Unproven for gameplay performance: the reported Windows CPU-time improvements are 1.9–3.0%, with overlapping or variable runs, and the Deck difference is within noise. The map reports a definite 16.7 MB reduction in hot-unit code, but total clean and incremental build times were not compared.

Other systems: The generated CPU code runs on Windows and Linux regardless of GPU. Windows AMD and Steam Deck gameplay were tested; low-core and Intel CPUs were not. The exact fallback was checked against Unicorn as reported, and the shader cache is unaffected by the changed files.

Switches: LONGSHOT_FP_NAN_MID changes from on to off by default; 1, on, yes or true enables it. LONGSHOT_FP_NAN_MID_SKIP is now read only when the middle path is enabled. The developer lift flags retain explicit on and off choices. The default's gameplay performance advantage is not yet established.

Reviewed: d023c8bcba against d6e819e084: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the diff, commit history, changed option wiring and its cache-key and caller context; inspected the changed tests and documentation. Skimmed the unchanged portions of the larger lift, semantics and test files. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • The default and explicit enablement are wired consistently through the builder and dev lift.
  • The whole-lift and hot-unit keys distinguish enabled and disabled middle paths.
  • The commit records AI assistance, and the diff contains no generated game output or third-party changes.

Testing: Read-only review; no commands from the project or tests were run. The reported Linux semantics run and head CI remain pending.

Overlaps and merge order: Not checked; network access is unavailable.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as klimovich008 took it out of WIP. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The hot units are 28.4% smaller, but the reported gameplay timing differences are within the run-to-run spread. The update also requires recompilation, whose effect on total build time has not been compared against main. Recommend approval; not approved on the forge. The builder disables the float NaN middle path by default while retaining an opt-in switch. This reduces measured hot-unit code from 58.6 MB to 42.0 MB, at the cost of relifting and recompiling hot units on update; its gameplay performance benefit remains unproven. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L1** `builder/crates/build-driver/src/stages.rs:339`: The claimed gameplay speedup is smaller than the observed variation, so the new default's performance benefit is unproven. (more on the line) **Do:** Run additional alternating main-versus-head measurements in the affected scenes, including an Intel or low-core CPU, and report CPU time and frame-time distributions. - **L2** `builder/crates/lift/src/whole/mod.rs:139`: The change invalidates the lifter key and recompiles hot units, but the reported compiler CPU seconds do not establish its effect on players' total build time. (more on the line) **Do:** Measure clean and one-function-change build time and output size on main and this head, including an update from a current build and a low-core machine. *(`@fix` does its part first: Avoid invalidating lifter source keys for changes that do not alter generated IR, if the key can safely distinguish them.)* `@fix` can do L2. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for gameplay performance: the reported Windows CPU-time improvements are 1.9–3.0%, with overlapping or variable runs, and the Deck difference is within noise. The map reports a definite 16.7 MB reduction in hot-unit code, but total clean and incremental build times were not compared. **Other systems:** The generated CPU code runs on Windows and Linux regardless of GPU. Windows AMD and Steam Deck gameplay were tested; low-core and Intel CPUs were not. The exact fallback was checked against Unicorn as reported, and the shader cache is unaffected by the changed files. **Switches:** LONGSHOT_FP_NAN_MID changes from on to off by default; 1, on, yes or true enables it. LONGSHOT_FP_NAN_MID_SKIP is now read only when the middle path is enabled. The developer lift flags retain explicit on and off choices. The default's gameplay performance advantage is not yet established. **Reviewed:** d023c8bcba01 against d6e819e08433: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the diff, commit history, changed option wiring and its cache-key and caller context; inspected the changed tests and documentation. Skimmed the unchanged portions of the larger lift, semantics and test files. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - The default and explicit enablement are wired consistently through the builder and dev lift. - The whole-lift and hot-unit keys distinguish enabled and disabled middle paths. - The commit records AI assistance, and the diff contains no generated game output or third-party changes. **Testing:** Read-only review; no commands from the project or tests were run. The reported Linux semantics run and head CI remain pending. **Overlaps and merge order:** Not checked; network access is unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as klimovich008 took it out of WIP. Nothing was run; a maintainer decides.</sub>
@ -334,1 +336,4 @@
/// Whether `LONGSHOT_FP_NAN_MID`'s value `v` turns the middle path on: only an on word ([`build_core::switch`]: `1`,
/// `on`, `yes`, `true`). Unset, an off word or any other value is off, the default since 2026-11-29: measured then, the
/// middle path no longer paid where the game's cloth runs natively (#2036), and it was 28 % of the hot units' code.
fn fp_nan_mid_on(v: Option<&str>) -> bool {
Member

L1 (should fix): The claimed gameplay speedup is smaller than the observed variation, so the new default's performance benefit is unproven.

When: On Windows, Market pairs range from 6.0% faster to 0.8% slower in CPU time; Deck results likewise show no measurable gain. Players on other CPU architectures may see a different instruction-cache versus helper-call tradeoff.

Do: Run additional alternating main-versus-head measurements in the affected scenes, including an Intel or low-core CPU, and report CPU time and frame-time distributions.

**L1** (should fix): The claimed gameplay speedup is smaller than the observed variation, so the new default's performance benefit is unproven. *When:* On Windows, Market pairs range from 6.0% faster to 0.8% slower in CPU time; Deck results likewise show no measurable gain. Players on other CPU architectures may see a different instruction-cache versus helper-call tradeoff. **Do:** Run additional alternating main-versus-head measurements in the affected scenes, including an Intel or low-core CPU, and report CPU time and frame-time distributions.
@ -137,3 +137,3 @@
mark_each: false,
no_simplify: false,
fp_nan_mid: Some(BTreeSet::new()),
fp_nan_mid: None,
Member

L2 (should fix): The change invalidates the lifter key and recompiles hot units, but the reported compiler CPU seconds do not establish its effect on players' total build time.

When: An existing installation updating to this version relifts and recompiles hot units; a low-core machine can wait several minutes according to the estimate, without a measured main-versus-head wall-time comparison.

Do: Measure clean and one-function-change build time and output size on main and this head, including an update from a current build and a low-core machine.

**L2** (should fix): The change invalidates the lifter key and recompiles hot units, but the reported compiler CPU seconds do not establish its effect on players' total build time. *When:* An existing installation updating to this version relifts and recompiles hot units; a low-core machine can wait several minutes according to the estimate, without a measured main-versus-head wall-time comparison. **Do:** Measure clean and one-function-change build time and output size on main and this head, including an update from a current build and a low-core machine.
HumanBean deleted branch perf/nan-mid-off 2026-12-04 19:15:10 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!3081
No description provided.