perf(lift): SSE fast paths for the float forms the translator does lane by lane (A64_VECFP) #1782

Merged
HumanBean merged 8 commits from snaildev99/Longshot:perf/vecfp into main 2026-11-20 08:09:04 +00:00
Contributor

Summary

The game's physics, cloth and animation (Havok, skeletal animation) are full of four-lane multiply-add, multiply by an element, min / max and float / double conversions. The translated code still runs those instructions one lane at a time through the scalar exact-float helper or in software, at 40 to 60 CPU cycles each; docs/cpu-profile.md lists this as candidate 6 (6.3 % of a core). This PR gives 27 of those instruction forms a fast path: one SSE operation, whose result is kept only where it is provably the Switch's bit for bit; otherwise the instruction's own C runs as before.

The goal is fewer host instructions per game instruction for the same results, every result and flag bit for bit as before. Frame rate is the check that nothing got slower, and where the processor sets the frame it rises: Castle Town's Market ran 3.5 % faster standing still and 5.1 % faster turning the camera on main a433db32 (three interleaved runs a side), and +3.9 % / +3.5 % as the mean of eight on/off pairs in a 48-run matrix, a gain in every pair. In a Havok bounding-box routine (f_81746440, lifted and timed in a harness) one call goes from 6,900 to 1,520 TSC ticks. The paths are on by default; A64_VECFP=0 lifts exactly as main.

How: nx2/vecfp.py wraps the translator's text for these forms in if (!a64_vfpx_<form>(c, ...)) { <its own C> }. The helper (appended to a64_fpx.h) does the operation on SSE and returns 1 only when every lane's result is provably Arm's with no FPSR bit to add; else it writes nothing and returns 0. Inside a fast float region (nx2/fastfp.py, FF_VX) the multiply forms become one SSE operation of the region. The forms: FMUL / FMLA / FMLS by element, vector FMLA / FMLS, FMUL 2S, FDIV, FMAX / FMIN and their NM forms, FCVT between single and double. The keep rules, per form: multiplies, multiply-adds and divides by FPX1's (RECOMP_FPX_OPEN, KEEP32 / KEEPDIV32, under FZ no subnormal operand or addend), the fused forms only with FMA3 (else they decline); FMAX / FMIN(NM) when no lane is a NaN (under FZ none subnormal), equal values AND / OR-ed so max(+0, -0) is +0; FCVT S to D every number but NaN (under FZ a subnormal declines); FCVT D to S FPX1's gate and a big result or a zero input. Beside main's own vector paths: vecfp.main_handles asks the lift's own passes whether they already make a word one vector operation (today exactly FMUL 4S by element, #1576) and leaves that word to them. No } at the start of a line, since nx2/split_giants.py and nx2/oot_patches.py end a function's body at the first one; tests/test_function_ends.py checks it.

Read first: nx2/vecfp.py (fast_call, wrap, HEADER, main_handles, install); the FF_VX twins in nx2/fastfp.py; tests/test_vecfp.py.

See #505 (the hot list, which this works beside).

Testing

Tested: Windows 11, RTX 3090 (NVIDIA 610.88), Ryzen 9 5900X. In the game: this change at its pre-rebase head in a test tree on main a433db32 (test/perf-prs @ be5623e0 on my fork, built from scratch twice, A64_VECFP=0 and on, 0 failed, both camera edits found by both builds): 15 hands-free Market runs, 6 with the paths on; in a v3.0.0 test tree, 33 Market runs with the paths on; with the first version on main 544229a2, the native maths units of another unmerged branch (themselves checked exact against the game's code in an AArch64 emulator) compared with the lifted code of their functions, which hold six of these forms: about 67 million calls, 0 mismatches. No FATAL and no frame of 50 ms or more in any log. The rebase onto main 068fb8eb (#1802) changed no code: docs/development.md, which #1802 removed, lost the switch's row, which is now in docs/dev/reference/build.md beside A64_FASTFP. Game-free at this head (008b63bf): tests/test_vecfp.py (28 words: both lane counts, by-element indices, an aliased FMLA, S and D forms; the lifted, hot and region copies against the same word with FPX off, 60,000 cases each: normal values and mixes with zeros, subnormals, extremes, infinities, quiet and signalling NaNs, underflow edges, +0 / -0; FZ off and on; FPSR IXC, all, none; x86-64-v3 and v2: 0 mismatches, the fast path taken on the normal cases; FMUL 4S by element runs main's path; with A64_VECFP=0 every word's text is the translator's), tests/test_function_ends.py and tests/test_doc_anchors.py pass; tests/test_lift_cache.py passes every check of this PR (A64_VECFP changes the lift key, nx2/vecfp.py is a lift source) and fails one that fails the same way on main 068fb8eb ("...and the others still by their code"). Earlier, A64_VECFP=0 against main: a made-up image of 4,600 functions holding every form, lifted by main and by this branch with the switch at 0, in one process and in three Windows-style emit processes: every output file identical. tests/run_all.py on Windows at this head: 705 passed, 51 failed, 116 skipped; main 068fb8eb on this PC, run beside it: 704 passed, 50 failed, 116 skipped. The same failures, apart from timing tests that failed in one of those runs only and pass when run alone, on main and here (test_invalidate_vcore, test_compile_stops_on_exception, test_longshot_ctl, test_mesh_args_cleanup); test_vbytes times out at 600 s in both. Main's failures on this PC: test_appimage_player_build, test_auto_handheld, test_bug_report_defaults, test_capture_read_once, test_crash_dialog, test_crt_options, test_damage_debug_menu, test_dev_ab, test_dev_build, test_dev_migrate, test_dev_packs, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_frame_overlap, test_frame_wait_bounds, test_game_menu_mouse_buttons, test_guest_imported, test_high_fps_fixes, test_host_guest_writes, test_hud_layout_row, test_job_queue, test_libc_hooks, test_lift_cache, test_linux_preflight, test_linux_pressure, test_make_game_ngx, test_mise_build, test_missing_nup, test_mods_list, test_ngx_sdk, test_pads_after_menu, test_pending_guest_import, test_pipeline_play_cache, test_portable_builder_home, test_portable_builder_startup, test_prepare_cache_save, test_present_thread, test_profiling_mode, test_psychov35_fsr3_fg, test_readback_timeout_source, test_sdiv_overflow, test_seed_reader, test_slow_frames, test_song_note_cue, test_upscaler_rows, test_vcore_escape, test_walk_key.

Still to test:

  • Linux, any GPU: python -I -B tests/test_vecfp.py, then main against this PR in the Market for a few minutes; the game's CPU seconds with the frame rate capped at 60 on a PC that holds 60 there, and the frame times uncapped, expecting 0 mismatches for every word, the same frame rate or better with less CPU time, and the game looking and playing as on main (@Beanstalk linux).
  • An Intel CPU, any OS: two builds, A64_VECFP=0 and unset, the FPS counter in the Market, expecting the frame rate with the paths no lower than without (by hand: a tester with an Intel CPU; MXCSR costs differ there).
  • Cloth and physics by eye across more areas than the Market (Kakariko, Death Mountain Trail, a boss fight), expecting them as on main (by hand).

Measurements

Verdict: fewer host instructions for the same results: 27 vector float forms take one SSE operation where they took a loop over lanes at 40 to 60 cycles, every result bit for bit the same. Frame rate is the check that nothing got slower, and where the processor sets the frame it rises: the Market +3.5 % standing and +5.1 % turning on main a433db32. Nothing where the renderer sets the frame (Hyrule Field by day). The cost is build time: about 4 % more compiler time on a default build and no longer a compile on this PC; +28 % compile time with every lifted file at -O2.

Baseline: two builds of one tree, test/perf-prs @ be5623e0 on my fork (main a433db32 with this PR and its siblings #1780 and #1781 merged, the default hot list), each from scratch: A64_VECFP=0 (Before: the lifted C and a64_fpx.h are main's to the byte) and unset (After). Both with every run-time switch unset. Main has since moved four commits to 068fb8eb (#1802 docs, tools and the PR template; #1774 and #1807 the Insert menu's rows; #1792 dev packs): outside comments, docs and the dev tools they change the Insert menu's code (#1774, #1807) and the version string and some log texts (#1802): nothing in the lift (its files changed only in comments), and nothing the Market runs each frame but the FPS counter's overlay, which runs alike on both sides. So the numbers hold.
Setup: Windows 11 (build 22631), GeForce RTX 3090 (NVIDIA 610.88), Ryzen 9 5900X (12 cores), 128 GB. Child Link at the Market's save point by day; 3840x2160 full screen, frame rate cap Uncapped, no mods; the GPU wait 0.0 to 0.1 ms in every run (the processor sets the frame). Hands-free through scripts/longshot_ctl.py: the save loads, 10 s to settle, 15 s standing (the FPS counter's value once a second), then 40 s with the right stick held to one side. Three runs a side, interleaved, the median.

Before, A64_VECFP=0: test/perf-prs @ be5623e0 After, the paths on: test/perf-prs @ be5623e0 Δ
Market standing, fps (the three runs) 68.8 (68.9, 68.8, 68.2) 71.2 (70.5, 71.2, 72.3) +3.5 %
Market turning, fps (the three runs) 63.0 (63.0, 63.5, 62.8) 66.2 (65.2, 66.2, 66.3) +5.1 %
the whole build (default hot list, 23 jobs) 9:42 8:51
compile, the lifted files' compiler time summed 7,374 s 7,646 s +3.7 %
the slowest lifted file (sets the compile's length) 458 s 393 s
lifted objects / longshot.exe 679 MB / 511 MB 687 MB / 518 MB +1 %
the lift 92 s 89 s

With its two siblings on as well, the same runs: 76.0 standing (+10.5 %) and 68.1 turning (+8.1 %). No frame of 50 ms or more and no FATAL in any of the 15 logs. Which hot piece is slowest moved, by how the pieces are cut, so the default build paid no wall time here.

The 48-run matrix

The change was measured beside every combination of #1780, #1781 and main's RX_VK_CAPTURE_NT, in one test tree test/perf-matrix @ 2c30c326 on my fork (v3.0.0 09cbdd97 with the three changes, every lifted file at -O2 so that the hot list is not a variable), built twice: A64_VECFP=0 (Before) and unset (After). Sixteen variants, three interleaved runs each, 48 runs in 74 minutes with nobody at the PC.

run-time switches on in both Before, A64_VECFP=0: standing / turning fps After, the paths on Δ standing Δ turning
none 68.5 / 63.5 71.5 / 65.7 +4.4 % +3.5 %
RX_VK_CAPTURE_NT=1 69.7 / 63.7 71.2 / 65.6 +2.2 % +3.0 %
HOS_NVN_REC_HANDOFF=1 71.2 / 64.5 74.2 / 67.1 +4.2 % +4.0 %
those two 72.0 / 65.5 75.0 / 67.7 +4.2 % +3.4 %
HOS_OBJ_CACHE=16384 69.6 / 63.9 72.0 / 66.5 +3.4 % +4.1 %
RX_VK_CAPTURE_NT=1, HOS_OBJ_CACHE=16384 70.0 / 63.8 72.8 / 66.5 +4.0 % +4.2 %
HOS_NVN_REC_HANDOFF=1, HOS_OBJ_CACHE=16384 72.3 / 65.4 75.9 / 66.6 +5.0 % +1.8 %
all three 73.1 / 65.8 76.2 / 68.2 +4.2 % +3.6 %

A gain in every pair (+1.5 to +3.6 fps standing, +1.2 to +2.7 turning). Peak working set 9,944 to 10,030 MB either way. Build cost with every lifted file at -O2: compile 483 s to 616 s (+28 %), the lift 87 s to 86 s. Against the shipped hot list in the v3.0.0 tree (an earlier run with the PC in use, three runs a side): 67.3 / 61.0 fps without the paths, 69.8 / 63.7 with them (+4 %); -O2 on every file does not make the paths redundant (67.1 / 61.2 without them). The run file is docs/tested/2026-11-19-vecfp-snaildev99-matrix-v.md.

Earlier, with the first version on main 544229a2: Hyrule Field by day no change; on a hand-played route, one run each, the game's time a frame -5 % on Death Mountain Trail and -6 % in Kakariko. Offline, whole routines lifted both ways (ticks a call, flush-to-zero off / on): the Havok box routine f_81746440 6,892 / 7,602 to 1,520 / 1,667; the box transform f_80ba6d80 in its region 91 to 76.

The switch

A64_VECFP (new, lift time; its row in docs/dev/reference/build.md): unset = on (elem, vec, minmax, fcvt); 0 off; or a list of the groups; true / yes as on; any other value stops the lift with a message. It ships on, as the measurements chose. It is in the lift's key.

Risks

What could break: a keep rule that is wrong would give a float result the Switch would not, in physics, cloth or animation. Checked as above; a path declines whatever it cannot prove (a NaN, a subnormal under FZ, a closed FPX1 gate, no FMA3 for the fused forms).

Open for review: #1560 (dyst, ready for review) rewrites emit_function and the fast float regions' copy and wrappers into one function with hook points. A trial merge with its head 3f318305 had two conflict blocks, both in nx2/lift.py (an import line and an install line: both sides kept); the two were not run together. Whichever goes in second is fitted to the other; I will do that on this branch if #1560 lands first.

Turning it off: A64_VECFP=0 (lift time: the build translates the game again), or a list of the groups to keep.

After updating: the lift's key changes, so the first build after updating translates the game again and compiles all lifted code (as any translator change). Lifted objects about 1 % larger. Saves, longshot_options.ini and the shader caches: nothing changes.

Checklist

Ready for review

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

When it applies

  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def. (A lift-time switch: on, as measured; its row is in docs/dev/reference/build.md beside A64_FASTFP, as the lift's switches' are.)
  • A check under tests/ that reads changed source is updated, not weakened. (tests/test_lift_cache.py names A64_VECFP and nx2/vecfp.py; tests/test_vecfp.py and tests/test_function_ends.py are new.)
  • 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 The game's physics, cloth and animation (Havok, skeletal animation) are full of four-lane multiply-add, multiply by an element, min / max and float / double conversions. The translated code still runs those instructions one lane at a time through the scalar exact-float helper or in software, at 40 to 60 CPU cycles each; `docs/cpu-profile.md` lists this as candidate 6 (6.3 % of a core). This PR gives 27 of those instruction forms a fast path: one SSE operation, whose result is kept only where it is provably the Switch's bit for bit; otherwise the instruction's own C runs as before. The goal is fewer host instructions per game instruction for the same results, every result and flag bit for bit as before. Frame rate is the check that nothing got slower, and where the processor sets the frame it rises: Castle Town's Market ran 3.5 % faster standing still and 5.1 % faster turning the camera on main a433db32 (three interleaved runs a side), and +3.9 % / +3.5 % as the mean of eight on/off pairs in a 48-run matrix, a gain in every pair. In a Havok bounding-box routine (`f_81746440`, lifted and timed in a harness) one call goes from 6,900 to 1,520 TSC ticks. The paths are on by default; `A64_VECFP=0` lifts exactly as main. How: `nx2/vecfp.py` wraps the translator's text for these forms in `if (!a64_vfpx_<form>(c, ...)) { <its own C> }`. The helper (appended to `a64_fpx.h`) does the operation on SSE and returns 1 only when every lane's result is provably Arm's with no FPSR bit to add; else it writes nothing and returns 0. Inside a fast float region (`nx2/fastfp.py`, `FF_VX`) the multiply forms become one SSE operation of the region. The forms: FMUL / FMLA / FMLS by element, vector FMLA / FMLS, FMUL 2S, FDIV, FMAX / FMIN and their NM forms, FCVT between single and double. The keep rules, per form: multiplies, multiply-adds and divides by FPX1's (`RECOMP_FPX_OPEN`, KEEP32 / KEEPDIV32, under FZ no subnormal operand or addend), the fused forms only with FMA3 (else they decline); FMAX / FMIN(NM) when no lane is a NaN (under FZ none subnormal), equal values AND / OR-ed so max(+0, -0) is +0; FCVT S to D every number but NaN (under FZ a subnormal declines); FCVT D to S FPX1's gate and a big result or a zero input. Beside main's own vector paths: `vecfp.main_handles` asks the lift's own passes whether they already make a word one vector operation (today exactly FMUL 4S by element, #1576) and leaves that word to them. No `}` at the start of a line, since `nx2/split_giants.py` and `nx2/oot_patches.py` end a function's body at the first one; `tests/test_function_ends.py` checks it. Read first: `nx2/vecfp.py` (`fast_call`, `wrap`, `HEADER`, `main_handles`, `install`); the `FF_VX` twins in `nx2/fastfp.py`; `tests/test_vecfp.py`. See #505 (the hot list, which this works beside). ## Testing **Tested:** Windows 11, RTX 3090 (NVIDIA 610.88), Ryzen 9 5900X. In the game: this change at its pre-rebase head in a test tree on main a433db32 (`test/perf-prs` @ be5623e0 on my fork, built from scratch twice, `A64_VECFP=0` and on, 0 failed, both camera edits found by both builds): 15 hands-free Market runs, 6 with the paths on; in a v3.0.0 test tree, 33 Market runs with the paths on; with the first version on main 544229a2, the native maths units of another unmerged branch (themselves checked exact against the game's code in an AArch64 emulator) compared with the lifted code of their functions, which hold six of these forms: about 67 million calls, 0 mismatches. No `FATAL` and no frame of 50 ms or more in any log. The rebase onto main 068fb8eb (#1802) changed no code: `docs/development.md`, which #1802 removed, lost the switch's row, which is now in `docs/dev/reference/build.md` beside `A64_FASTFP`. Game-free at this head (008b63bf): `tests/test_vecfp.py` (28 words: both lane counts, by-element indices, an aliased FMLA, S and D forms; the lifted, hot and region copies against the same word with FPX off, 60,000 cases each: normal values and mixes with zeros, subnormals, extremes, infinities, quiet and signalling NaNs, underflow edges, +0 / -0; FZ off and on; FPSR IXC, all, none; x86-64-v3 and v2: 0 mismatches, the fast path taken on the normal cases; FMUL 4S by element runs main's path; with `A64_VECFP=0` every word's text is the translator's), `tests/test_function_ends.py` and `tests/test_doc_anchors.py` pass; `tests/test_lift_cache.py` passes every check of this PR (`A64_VECFP` changes the lift key, `nx2/vecfp.py` is a lift source) and fails one that fails the same way on main 068fb8eb ("...and the others still by their code"). Earlier, `A64_VECFP=0` against main: a made-up image of 4,600 functions holding every form, lifted by main and by this branch with the switch at 0, in one process and in three Windows-style emit processes: every output file identical. `tests/run_all.py` on Windows at this head: 705 passed, 51 failed, 116 skipped; main 068fb8eb on this PC, run beside it: 704 passed, 50 failed, 116 skipped. The same failures, apart from timing tests that failed in one of those runs only and pass when run alone, on main and here (`test_invalidate_vcore`, `test_compile_stops_on_exception`, `test_longshot_ctl`, `test_mesh_args_cleanup`); `test_vbytes` times out at 600 s in both. Main's failures on this PC: `test_appimage_player_build`, `test_auto_handheld`, `test_bug_report_defaults`, `test_capture_read_once`, `test_crash_dialog`, `test_crt_options`, `test_damage_debug_menu`, `test_dev_ab`, `test_dev_build`, `test_dev_migrate`, `test_dev_packs`, `test_display_startup_failure`, `test_dlss_feature_size`, `test_failed_compile_keeps_objects`, `test_frame_overlap`, `test_frame_wait_bounds`, `test_game_menu_mouse_buttons`, `test_guest_imported`, `test_high_fps_fixes`, `test_host_guest_writes`, `test_hud_layout_row`, `test_job_queue`, `test_libc_hooks`, `test_lift_cache`, `test_linux_preflight`, `test_linux_pressure`, `test_make_game_ngx`, `test_mise_build`, `test_missing_nup`, `test_mods_list`, `test_ngx_sdk`, `test_pads_after_menu`, `test_pending_guest_import`, `test_pipeline_play_cache`, `test_portable_builder_home`, `test_portable_builder_startup`, `test_prepare_cache_save`, `test_present_thread`, `test_profiling_mode`, `test_psychov35_fsr3_fg`, `test_readback_timeout_source`, `test_sdiv_overflow`, `test_seed_reader`, `test_slow_frames`, `test_song_note_cue`, `test_upscaler_rows`, `test_vcore_escape`, `test_walk_key`. **Still to test:** - Linux, any GPU: `python -I -B tests/test_vecfp.py`, then main against this PR in the Market for a few minutes; the game's CPU seconds with the frame rate capped at 60 on a PC that holds 60 there, and the frame times uncapped, expecting 0 mismatches for every word, the same frame rate or better with less CPU time, and the game looking and playing as on main (@Beanstalk linux). - An Intel CPU, any OS: two builds, `A64_VECFP=0` and unset, the FPS counter in the Market, expecting the frame rate with the paths no lower than without (by hand: a tester with an Intel CPU; MXCSR costs differ there). - Cloth and physics by eye across more areas than the Market (Kakariko, Death Mountain Trail, a boss fight), expecting them as on main (by hand). ## Measurements **Verdict:** fewer host instructions for the same results: 27 vector float forms take one SSE operation where they took a loop over lanes at 40 to 60 cycles, every result bit for bit the same. Frame rate is the check that nothing got slower, and where the processor sets the frame it rises: the Market +3.5 % standing and +5.1 % turning on main a433db32. Nothing where the renderer sets the frame (Hyrule Field by day). The cost is build time: about 4 % more compiler time on a default build and no longer a compile on this PC; +28 % compile time with every lifted file at -O2. Baseline: two builds of one tree, `test/perf-prs` @ be5623e0 on my fork (main a433db32 with this PR and its siblings #1780 and #1781 merged, the default hot list), each from scratch: `A64_VECFP=0` (Before: the lifted C and `a64_fpx.h` are main's to the byte) and unset (After). Both with every run-time switch unset. Main has since moved four commits to 068fb8eb (#1802 docs, tools and the PR template; #1774 and #1807 the Insert menu's rows; #1792 dev packs): outside comments, docs and the dev tools they change the Insert menu's code (#1774, #1807) and the version string and some log texts (#1802): nothing in the lift (its files changed only in comments), and nothing the Market runs each frame but the FPS counter's overlay, which runs alike on both sides. So the numbers hold. Setup: Windows 11 (build 22631), GeForce RTX 3090 (NVIDIA 610.88), Ryzen 9 5900X (12 cores), 128 GB. Child Link at the Market's save point by day; 3840x2160 full screen, frame rate cap Uncapped, no mods; the GPU wait 0.0 to 0.1 ms in every run (the processor sets the frame). Hands-free through `scripts/longshot_ctl.py`: the save loads, 10 s to settle, 15 s standing (the FPS counter's value once a second), then 40 s with the right stick held to one side. Three runs a side, interleaved, the median. | | Before, `A64_VECFP=0`: test/perf-prs @ be5623e0 | After, the paths on: test/perf-prs @ be5623e0 | Δ | |---|---|---|---| | Market standing, fps (the three runs) | 68.8 (68.9, 68.8, 68.2) | 71.2 (70.5, 71.2, 72.3) | +3.5 % | | Market turning, fps (the three runs) | 63.0 (63.0, 63.5, 62.8) | 66.2 (65.2, 66.2, 66.3) | +5.1 % | | the whole build (default hot list, 23 jobs) | 9:42 | 8:51 | | | compile, the lifted files' compiler time summed | 7,374 s | 7,646 s | +3.7 % | | the slowest lifted file (sets the compile's length) | 458 s | 393 s | | | lifted objects / `longshot.exe` | 679 MB / 511 MB | 687 MB / 518 MB | +1 % | | the lift | 92 s | 89 s | | With its two siblings on as well, the same runs: 76.0 standing (+10.5 %) and 68.1 turning (+8.1 %). No frame of 50 ms or more and no `FATAL` in any of the 15 logs. Which hot piece is slowest moved, by how the pieces are cut, so the default build paid no wall time here. ### The 48-run matrix The change was measured beside every combination of #1780, #1781 and main's `RX_VK_CAPTURE_NT`, in one test tree `test/perf-matrix` @ 2c30c326 on my fork (v3.0.0 09cbdd97 with the three changes, every lifted file at -O2 so that the hot list is not a variable), built twice: `A64_VECFP=0` (Before) and unset (After). Sixteen variants, three interleaved runs each, 48 runs in 74 minutes with nobody at the PC. | run-time switches on in both | Before, `A64_VECFP=0`: standing / turning fps | After, the paths on | Δ standing | Δ turning | |---|---|---|---|---| | none | 68.5 / 63.5 | 71.5 / 65.7 | +4.4 % | +3.5 % | | `RX_VK_CAPTURE_NT=1` | 69.7 / 63.7 | 71.2 / 65.6 | +2.2 % | +3.0 % | | `HOS_NVN_REC_HANDOFF=1` | 71.2 / 64.5 | 74.2 / 67.1 | +4.2 % | +4.0 % | | those two | 72.0 / 65.5 | 75.0 / 67.7 | +4.2 % | +3.4 % | | `HOS_OBJ_CACHE=16384` | 69.6 / 63.9 | 72.0 / 66.5 | +3.4 % | +4.1 % | | `RX_VK_CAPTURE_NT=1`, `HOS_OBJ_CACHE=16384` | 70.0 / 63.8 | 72.8 / 66.5 | +4.0 % | +4.2 % | | `HOS_NVN_REC_HANDOFF=1`, `HOS_OBJ_CACHE=16384` | 72.3 / 65.4 | 75.9 / 66.6 | +5.0 % | +1.8 % | | all three | 73.1 / 65.8 | 76.2 / 68.2 | +4.2 % | +3.6 % | A gain in every pair (+1.5 to +3.6 fps standing, +1.2 to +2.7 turning). Peak working set 9,944 to 10,030 MB either way. Build cost with every lifted file at -O2: compile 483 s to 616 s (+28 %), the lift 87 s to 86 s. Against the shipped hot list in the v3.0.0 tree (an earlier run with the PC in use, three runs a side): 67.3 / 61.0 fps without the paths, 69.8 / 63.7 with them (+4 %); -O2 on every file does not make the paths redundant (67.1 / 61.2 without them). The run file is `docs/tested/2026-11-19-vecfp-snaildev99-matrix-v.md`. Earlier, with the first version on main 544229a2: Hyrule Field by day no change; on a hand-played route, one run each, the game's time a frame -5 % on Death Mountain Trail and -6 % in Kakariko. Offline, whole routines lifted both ways (ticks a call, flush-to-zero off / on): the Havok box routine `f_81746440` 6,892 / 7,602 to 1,520 / 1,667; the box transform `f_80ba6d80` in its region 91 to 76. ### The switch `A64_VECFP` (new, lift time; its row in `docs/dev/reference/build.md`): unset = on (`elem`, `vec`, `minmax`, `fcvt`); `0` off; or a list of the groups; `true` / `yes` as on; any other value stops the lift with a message. It ships on, as the measurements chose. It is in the lift's key. ## Risks **What could break:** a keep rule that is wrong would give a float result the Switch would not, in physics, cloth or animation. Checked as above; a path declines whatever it cannot prove (a NaN, a subnormal under FZ, a closed FPX1 gate, no FMA3 for the fused forms). **Open for review:** #1560 (dyst, ready for review) rewrites `emit_function` and the fast float regions' copy and wrappers into one function with hook points. A trial merge with its head 3f318305 had two conflict blocks, both in `nx2/lift.py` (an import line and an install line: both sides kept); the two were not run together. Whichever goes in second is fitted to the other; I will do that on this branch if #1560 lands first. **Turning it off:** `A64_VECFP=0` (lift time: the build translates the game again), or a list of the groups to keep. **After updating:** the lift's key changes, so the first build after updating translates the game again and compiles all lifted code (as any translator change). Lifted objects about 1 % larger. Saves, `longshot_options.ini` and the shader caches: nothing changes. ## 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] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. (A lift-time switch: on, as measured; its row is in `docs/dev/reference/build.md` beside `A64_FASTFP`, as the lift's switches' are.) - [x] A check under `tests/` that reads changed source is updated, not weakened. (`tests/test_lift_cache.py` names `A64_VECFP` and `nx2/vecfp.py`; `tests/test_vecfp.py` and `tests/test_function_ends.py` are new.) - [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 fast float region's fast copy turns each a64_vfpx_<form>(c, ...) that nx2/vecfp.py puts in front of a lane-by-lane
FMUL/FMLA/FMLS (by element or vector), FMUL 2S or FDIV into its twin a64_ff_<form>: one SSE op inside the region's
MXCSR window with the regions' lane guard (a NaN lane, or exactly 2^-126 from a product, quotient or multiply-add,
raises the invalid flag), answering 1 so the lanes behind it are dead code in the fast copy. Inputs' top halves are
zeros for 2 lanes and a divisor's ones, so they raise no flag; a subnormal over a zero is sent to the exact copy as
the scalar divide does. Without FMA3 the fused twins answer 0 and the lanes run as before.

The run's count of float ops is unchanged (its lanes' FF_CONV matches). Nothing names these helpers until vecfp is
installed (the next commit), so on its own this changes no lift. Tested there: tests/test_vecfp.py runs each form in a
region of its own against the exact integer C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The translator writes FMUL/FMLA/FMLS by element, vector FMLA/FMLS, FMUL 2S and FDIV as a loop of the scalar FPX
helper per lane, and FMAX/FMIN(NM) and FCVT between S and D with no fast path at all (integer bodies, software
rounding). Outside a fast float region a 4-lane FMUL by element cost about 48 cycles, FMLA by element 52, FMAX 4S 48
and an FCVT 25 to 40 (Ryzen 9 5900X, the instruction lifted and compiled as the build does).

nx2/vecfp.py wraps a64emit.translate: each such word's C becomes `if (!a64_vfpx_<form>(c, ...)) { its C }`. The
helper does the op on SSE and keeps the result only where FPX1's rules prove it Arm's with no FPSR bit to add
(a64_suyu.h: the gate, FPSR.IXC set and FPCR at its default but FZ, and per lane the KEEP32 / KEEPDIV32 tests and,
under FZ, no subnormal operand or addend); FMAX/FMIN when no lane is a NaN (or, under FZ, subnormal), with the AND /
OR of equal values (+0 for max(+0, -0)); FCVT S->D for every number, D->S when the result is big or the input zero.
Else it writes nothing and the instruction's own C runs as before. The helpers' names begin a64_vfpx_, so these
instructions still join fast float regions.

A64_VECFP (lift time, in the lift key as an A64_ variable): on by default; 0 off; or a list of elem, vec, minmax,
fcvt. docs/development.md has the row.

tests/test_vecfp.py: 28 hand-written words (both lane counts, by-element indices, an aliased FMLA, S and D) translated
as the lift does, their hot copy and a region of each, against the same word translated with FPX off, on 60,000 cases
each (normal, and mixed with zeros, subnormals, extremes, infinities, quiet and signalling NaNs, underflow edges,
equal operands), FZ off and on, FPSR with IXC, all flags or none; the fast path must be taken on the normal cases;
x86-64-v3 and v2 (no FMA3: the fused forms decline). Five hand-made faults each fail it. The same words were checked
against Unicorn's AArch64 outside the repository: 0 differences in register or FPSR.

Measured offline (whole game functions lifted and compiled as the build does, synthetic inputs, Ryzen 9 5900X; not a
frame rate): Havok's AABB-of-vertices routine 6,900 -> 1,520 TSC ticks a call, a box-by-matrix transform 91 -> 76 in
its region and 328 -> 105 outside one; outputs byte for byte the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
In the lifted C a "}" at the start of a line closes a function: the lifter writes every instruction's own blocks so, and
the tools that read the lifted C end a function's body at the first one. nx2/split_giants.py's split_text does (each
definition's body runs to the first "}" at the start of a line), and so do nx2/oot_patches.py's edits, which look for
their place before it. nx2/vecfp.py wrote the brace that closes its `if (!a64_vfpx_...) {` there. With A64_VECFP on:

- two edits were not made: the lift said "the free camera was found 0 times" and "the disable camera centering was
  found 0 times". f_804e48c0 (the view, 210 KB of C) has an FCVT Sd, Dn at +39 KB and the free camera's place at
  +96 KB; f_80644c80 (the player camera, 642 KB) an FMAX at +277 KB and the camera centering's place at +321 KB, so
  both places were looked for in the part of the function before the wrapped instruction;
- split_text took every function with one of these forms to end at it, so the function was left whole ("unbalanced
  body", or below MIN_KB by its cut-short size): 221 of the game's 368 giant functions (192 MB of 257 MB of C) were
  compiled whole. A build with the paths on compiled in 13 min where the same lift without them took 5 (2026-11-17,
  Ryzen 9 5900X, 23 jobs; the hot pieces 2.7 times and the chunks with such giants 1.8 times their time, the chunks
  without 1.02 times). One file at a time, as the build compiles it: code_021_6.c 243 s -> 71 s, code_022_5.c
  169 s -> 71 s, a -O2 hot piece 235 s -> 164 s.

The closing brace is indented now. A fast float region's check copy (A64_FASTFP=check) had the same fault in its
else's brace and is indented too. With A64_VECFP=0 and A64_FASTFP not set to check the lift is as before.

Checked with two lifts of the game (vecfp on, before and after): after, every oot_patches edit is found (the same lines
as before plus the two), and split_giants cuts 366 of the 368 giant functions (the other two are
too small to cut). tests/test_function_ends.py (game-free, no compiler): the blocks vecfp.wrap and ff_region (both modes) write put
no "}" at the start of a line; split_text cuts a giant with wrapped instructions; each oot_patches edit that looks for a
place inside one function (free camera, camera centering, heart protection, flight, flight rotation, movement speed,
whole frames) finds it after a wrapped instruction, a region of them, and a region's check copy, and not in the next
function. It fails 30 ways on the wrapping before this change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A value the switch did not know ("true", "yes", a misspelt group) gave an empty set of groups, so every fast path was off
without a word while the lift key still changed. Now 1, on, all, true and yes turn every group on, 0, off, none, false
and no turn them off, a comma list names groups, and anything else stops the lift with a message naming the switch and
the groups it takes. tests/test_vecfp.py checks the new words and three bad values. The module's docstring says where its
cycle counts come from (offline, on lifted game routines) in place of a private folder's name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On today's main the lift has its own vector fast path for one of vecfp's forms (nx2/fastvec.py, #1576: FMUL 4S by
element as a64_vfpx_mul32_elem) and guest registers as C locals (nx2/guest_locals.py). For an A/B that measures only
vecfp's paths:

- vecfp.main_handles(): a word whose translator text the lift's own passes already make a vector op (outline_fpx, then
  vectorize_fpx as installed: the kit's 4-lane FMUL and FADD/FSUB, fastvec's FMUL 4S by element) is not wrapped. So
  FMUL 4S by element stays main's; A64_NO_VFPX_ELEM=1 hands it back to vecfp.
- With A64_VECFP=0 neither vecfp's HEADER nor the region twins are written: the twins moved out of FASTFP_HEADER into
  FF_VX_HEADER, appended by fastfp's write only when vecfp is installed and a group is on. FASTFP_HEADER is main's to the
  byte again.
- Locals: they cover x0-x30, SP and NZCV only; vecfp's helpers read and write c->vreg, c->fpcr and c->fpsr, which stay
  in the context, so a wrapped instruction is the same in a function with locals (said in the module's docstring).

tests/test_vecfp.py installs fastvec as the lift does and checks that FMUL 4S by element is left to main (and wrapped
with A64_NO_VFPX_ELEM=1), that the other 27 words are wrapped, and that A64_VECFP=0 leaves the translator's text as it
is; its C checks write FF_VX_HEADER after FASTFP_HEADER.

Co-Authored-By: Claude Opus <[email protected]>
Main hashes only named variables and prefixes into the lift key (#22). A64_VECFP is covered by the A64_ prefix and
nx2/vecfp.py by lift_sources' import walk from nx2/lift.py; tests/test_lift_cache.py now says both by name, so a change
to either (a renamed switch, vecfp imported another way) shows here instead of reusing a stale lift.

Co-Authored-By: Claude Opus <[email protected]>
docs(tested): the float paths' Market matrix run
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
f4336699ae
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Contributor

Tested in game: Windows 11, RTX 3090 (NVIDIA 610.88), Ryzen 9 5900X: two builds of one test tree (v3.0.0 with these commits, test/perf-matrix @ 2c30c326 on my fork; every lifted file at -O2), A64_VECFP=0 and the paths on; 24 hands-free runs of each in the child Market (15 s standing, then 40 s turning the camera). With the paths on: no FATAL and no frame of 50 ms or more in any log, both camera edits found by the build, +1.5 to +3.6 fps standing and +1.2 to +2.7 turning in all eight on/off pairs. Not built or played at this head on current main yet: that is why this is WIP.

Tested in game: Windows 11, RTX 3090 (NVIDIA 610.88), Ryzen 9 5900X: two builds of one test tree (v3.0.0 with these commits, test/perf-matrix @ 2c30c326 on my fork; every lifted file at -O2), A64_VECFP=0 and the paths on; 24 hands-free runs of each in the child Market (15 s standing, then 40 s turning the camera). With the paths on: no FATAL and no frame of 50 ms or more in any log, both camera edits found by the build, +1.5 to +3.6 fps standing and +1.2 to +2.7 turning in all eight on/off pairs. Not built or played at this head on current main yet: that is why this is WIP.
Member

Possibly related, for context:

  • PR #38 perf(lift): fast float regions, plain SSE checked once by MXCSR with the exact copy as fallback — Existing merged fast-float-region infrastructure; this extends it with vector-form paths.
Possibly related, for context: - PR #38 perf(lift): fast float regions, plain SSE checked once by MXCSR with the exact copy as fallback — Existing merged fast-float-region infrastructure; this extends it with vector-form paths.
Author
Contributor

Built and played at this head. The test tree is test/perf-prs @ be5623e0 on my fork: main a433db32 with #1780, #1781 and #1782 merged, the default hot list, built from scratch twice (A64_VECFP=0, where the lifted code is main's, and the float paths on). Windows 11, RTX 3090 (NVIDIA 610.88), Ryzen 9 5900X, 3840x2160 uncapped, the child Market: 15 s standing, then 40 s turning the camera; five variants, three interleaved runs each, nobody at the PC, medians.

standing fps (the three runs) turning fps (the three runs) standing turning
nothing on 68.8 (68.9, 68.8, 68.2) 63.0 (63.0, 63.5, 62.8)
HOS_NVN_REC_HANDOFF=1 (#1780) 71.8 (71.8, 72.0, 71.2) 65.6 (65.1, 65.9, 65.6) +4.4 % +4.1 %
HOS_OBJ_CACHE=16384 (#1781) 70.2 (69.5, 70.2, 70.2) 64.6 (63.8, 64.7, 64.6) +2.0 % +2.5 %
the float paths (#1782) 71.2 (70.5, 71.2, 72.3) 66.2 (65.2, 66.2, 66.3) +3.5 % +5.1 %
all three 76.0 (75.9, 76.1, 76.0) 68.1 (68.1, 68.4, 68.0) +10.5 % +8.1 %

No frame of 50 ms or more, no FATAL and no not a live recording in any of the 15 logs; the object cache missed 0.69 % of 22 million lookups.

Build cost of the float paths on a default build (both from scratch, 23 jobs): the lifted files' compiler time 7,374 s to 7,646 s (+3.7 %), the compile's wall time 458 s to 422 s (the slowest hot piece sets it, and it is not slower), lifted objects 679 to 687 MB.

The description has these numbers; the full 16-variant matrix on v3.0.0 is still its first table.

Built and played at this head. The test tree is `test/perf-prs` @ be5623e0 on my fork: main a433db32 with #1780, #1781 and #1782 merged, the default hot list, built from scratch twice (`A64_VECFP=0`, where the lifted code is main's, and the float paths on). Windows 11, RTX 3090 (NVIDIA 610.88), Ryzen 9 5900X, 3840x2160 uncapped, the child Market: 15 s standing, then 40 s turning the camera; five variants, three interleaved runs each, nobody at the PC, medians. | | standing fps (the three runs) | turning fps (the three runs) | standing | turning | |---|---|---|---|---| | nothing on | 68.8 (68.9, 68.8, 68.2) | 63.0 (63.0, 63.5, 62.8) | | | | `HOS_NVN_REC_HANDOFF=1` (#1780) | 71.8 (71.8, 72.0, 71.2) | 65.6 (65.1, 65.9, 65.6) | +4.4 % | +4.1 % | | `HOS_OBJ_CACHE=16384` (#1781) | 70.2 (69.5, 70.2, 70.2) | 64.6 (63.8, 64.7, 64.6) | +2.0 % | +2.5 % | | the float paths (#1782) | 71.2 (70.5, 71.2, 72.3) | 66.2 (65.2, 66.2, 66.3) | +3.5 % | +5.1 % | | all three | 76.0 (75.9, 76.1, 76.0) | 68.1 (68.1, 68.4, 68.0) | +10.5 % | +8.1 % | No frame of 50 ms or more, no `FATAL` and no `not a live recording` in any of the 15 logs; the object cache missed 0.69 % of 22 million lookups. Build cost of the float paths on a default build (both from scratch, 23 jobs): the lifted files' compiler time 7,374 s to 7,646 s (+3.7 %), the compile's wall time 458 s to 422 s (the slowest hot piece sets it, and it is not slower), lifted objects 679 to 687 MB. The description has these numbers; the full 16-variant matrix on v3.0.0 is still its first table.
snaildev99 changed title from WIP: perf(lift): SSE fast paths for the float forms the translator does lane by lane (A64_VECFP) to perf(lift): SSE fast paths for the float forms the translator does lane by lane (A64_VECFP) 2026-11-19 23:42:37 +00:00
Author
Contributor

@Beanstalk linux: run python -I -B tests/test_vecfp.py, then build this branch and play a few minutes in the Market, expecting 0 mismatches for every word and the game to look and play as on main.

@Beanstalk linux: run python -I -B tests/test_vecfp.py, then build this branch and play a few minutes in the Market, expecting 0 mismatches for every word and the game to look and play as on main.
Member

@snaildev99 only members of BigBeans can start the farm.

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

@snaildev99 only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `f433669`, and the PR has changed since (`008b63b`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
snaildev99 force-pushed perf/vecfp from f4336699ae
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 008b63bf15
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval changed since the request: ask again
2026-11-20 00:48:12 +00:00
Compare
Author
Contributor

Rebased onto main 068fb8eb (008b63bf). #1802 removed docs/development.md, which held the A64_VECFP row; the row is now in docs/dev/reference/build.md beside A64_FASTFP (one docs commit), and no code changed. The description now uses the new template, and says plainly what this PR is for: fewer host instructions per game instruction for bit-identical results, with frame rate as the check that nothing got slower.

Why the numbers still hold on 068fb8eb: they were measured on main a433db32, and the four commits since (#1802 docs, tools and the PR template; #1774 and #1807 the Insert menu's rows; #1792 dev packs): outside comments, docs and the dev tools they change the Insert menu's code (#1774, #1807) and the version string and some log texts (#1802): nothing in the lift (its files changed only in comments), and nothing the Market runs each frame but the FPS counter's overlay, which runs alike on both sides. So the numbers hold.

The farm request is reworded below, to measure the game's CPU time at a frame cap besides the frame times. A ~4 % change is close to what two runs a side can resolve, and the point of the change is less CPU time for the same frames.

Rebased onto main 068fb8eb (008b63bf). #1802 removed `docs/development.md`, which held the `A64_VECFP` row; the row is now in `docs/dev/reference/build.md` beside `A64_FASTFP` (one docs commit), and no code changed. The description now uses the new template, and says plainly what this PR is for: fewer host instructions per game instruction for bit-identical results, with frame rate as the check that nothing got slower. Why the numbers still hold on 068fb8eb: they were measured on main a433db32, and the four commits since (#1802 docs, tools and the PR template; #1774 and #1807 the Insert menu's rows; #1792 dev packs): outside comments, docs and the dev tools they change the Insert menu's code (#1774, #1807) and the version string and some log texts (#1802): nothing in the lift (its files changed only in comments), and nothing the Market runs each frame but the FPS counter's overlay, which runs alike on both sides. So the numbers hold. The farm request is reworded below, to measure the game's CPU time at a frame cap besides the frame times. A ~4 % change is close to what two runs a side can resolve, and the point of the change is less CPU time for the same frames.
Author
Contributor

@Beanstalk linux: run python -I -B tests/test_vecfp.py, then main against this PR in the Market for a few minutes. Measure the game's CPU seconds with the frame rate capped at 60 (on a PC that holds 60 there), and the frame times uncapped. Expect 0 mismatches for every word, the same frame rate or better with less CPU time, and the game looking and playing as on main.

@Beanstalk linux: run python -I -B tests/test_vecfp.py, then main against this PR in the Market for a few minutes. Measure the game's CPU seconds with the frame rate capped at 60 (on a PC that holds 60 there), and the frame times uncapped. Expect 0 mismatches for every word, the same frame rate or better with less CPU time, and the game looking and playing as on main.
Member

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

@snaildev99 only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
HumanBean deleted branch perf/vecfp 2026-11-20 08:09:04 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval changed since the request: ask again
Some workflows are waiting to be reviewed.
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!1782
No description provided.