WIP: perf(host): seven of the particle effect library's routines on host code, bit for bit the game's (HOS_NATIVE_VFX) #2001

Draft
snaildev99 wants to merge 8 commits from snaildev99/Longshot:perf/native-vfx-pr into main
Contributor

Summary

Seven routines of the game's particle effect library (NintendoWare vfx3) run as native host code by default (HOS_NATIVE_VFX=0 runs the translated code), giving the game's results bit for bit: every byte written, FPSR, the return value and every register the callers read. A call the host cannot prove exact runs the game's translated routine, with nothing written by the host first.

The goal is less CPU work for the same frame. The particle update runs every frame on the module workers and the main thread, mostly while the frame waits for its last jobs. Against main's own compiled form of each routine the host versions are 1.25 to 8.9 times as fast (Measurements); the seven routines are about 0.7 % of game code in a Market profile and about 1.3 % in a Kakariko and Death Mountain Trail profile. The CPU time this saves in the game is not resolved yet: at a 60 fps cap in the Market the change was inside the runs' spread, and the Test Farm request asks for it.

The routines it answers (guest addresses):

  • f_81281850: the gravity module's per-emitter step: powf of the air resistance, and the gravity step, turned into world coordinates through the emitter's and the emitter set's matrices when the module says so (the game's powf with its own shortcut for y = +-1, FRECPE by Arm's table).
  • f_81260600: an emitter's per-frame buffer update and its 0x1d0-byte draw constant block (the buffer copies, two int triples, the block, then the module calls through four tables, which stay translated).
  • f_8125f0e0: an emitter's per-frame update, whole: its 34 calls as translated code, its matrix block (the rotation-scale rows) by a kernel where that is the game's bits, else by the translator's own statements of that block.
  • f_8128b800: an emitter's time-based emission step, whole: fmodf and five getters absorbed, the random generator's draws and the per-particle loop as translated code, its rotation block by a kernel or by the translator's own statements.
  • f_8127a980: the initial-velocity module's per-particle emit callback, every path: the cone, the Y-axis term and its random fallback, world coordinates; the generator's draws (TinyMT32) on a copy of its state, written back with the other writes.
  • f_812eed00 and f_812ef8c0: the effect resources' placement and entry arrays, set up at area loads and first spawns: the game's two quadratic searches through a hash table and the sort on the host, the same bytes; the allocator's calls stay translated.

How: nx2/oot_patches.py (patch_vfx) puts if (hos_vfx_<addr>(c, f_<addr>)) return; first in each of the seven functions, in the supported build only. For f_8125f0e0 and f_8128b800 it also cuts the translator's own statements of the matrix / rotation block out of the function at build time into a static function placed after it, and hands that to the hook as the fallback; only when the cut is straight-line code (no label, branch, return, guest call, poll, write of x29 / x30 / SP, use of the flags) and reads exactly the registers the host sets before it runs it, else the function is left unpatched. A WARNING names a place not found. host/oot_vfx.c holds the hooks and the gate (the translator's own RECOMP_FPX_OPEN: FPCR at its default but FZ; memory through hos_guest_range; a write that would reach a later read declines), marks every page written, and counts calls per thread. The kernels are in host/vfx_kernels.c, vfx_emitter.c, vfx_emission.c, vfx_velocity.c, vfx_create.c: each routine's instruction sequence statement for statement on SSE, under a class rule (every float the routine loads or computes, the discarded lanes too, is zero or inside the range where x86 and Arm round alike; outside it the call declines). The float parts need FMA; without it they decline and run translated.

Read first: host/oot_vfx.c (its head comment: every hook and what check mode compares), host/vfx_kernels.c, the patch_vfx block of nx2/oot_patches.py, tests/test_oot_vfx_patch.py.

Ported code: host/vfx_powf.c is Arm's optimized-routines v23.01 powf (https://github.com/ARM-software/optimized-routines; Copyright (c) 2017-2022, Arm Limited; MIT OR Apache-2.0 WITH LLVM-exception, taken under MIT), verbatim but for its includes and prefixed names, with the game's own y = +-1 shortcut in front. The console's library links that powf; the game's copy gave the same bits as this source over 8 million inputs. Nothing else here is ported from another project.

Testing

Tested: Windows 11, RTX 3090 (NVIDIA 610.88), Ryzen 9 5900X. In the game, with HOS_NATIVE_VFX=check (every call the host takes also runs translated, for the two whole routines their matrix and rotation blocks, and the two are compared; the translated result is kept), a few minutes each in particle-heavy places, on two builds of this code on main 51f5f9da: 34b50cde (the first four commits here) and 8d9d5575 (plus the per-thread counts). No difference logged in either run. The counts at the last vfx: line of each run:

routine 34b50cde: calls answered by the host translated for its values 8d9d5575: calls answered translated for its values DIFFERENT
gravity f_81281850 1,048,576 1,019,374 (97.2 %) 29,202 196,608 192,165 (97.7 %) 4,443 0
draw constants f_81260600 1,507,328 1,498,714 (99.4 %) 8,614 458,752 455,743 (99.3 %) 3,009 0
emitter update f_8125f0e0 1,048,576 all 0 196,608 all 0 0
its matrix block (compared on its own) 1,048,576 all 0 196,608 all 0 0
emission step f_8128b800 983,040 all 0 196,608 all 0 0

The velocity callback f_8127a980, the two array routines and f_8128b800's rotation block stayed under 65,536 calls in both runs, so they logged no count line; a difference is logged at once, and none was. An earlier form of this code on main 068fb8eb (0dfdbcba) also ran in check mode, about 11 million calls with no difference, and was measured (Measurements). This branch's head (the same five commits cherry-picked onto main f1f2dc5b, plus one commit of declarations) is not built or played; none of the host files differs from 8d9d5575.

Offline, against the game's own code: an AArch64 emulator (Unicorn) runs the game's routine on its image with its own callees, a driver runs the host version on the same case, and everything the routine can change is compared: memory (every region of the case, the routine's frame but the signed x30), FPSR, NZCV where the callers read it, x0, x19-x30, SP and q8-q15; for the two whole routines with calls, every call too (target, argument registers, x29, x30, SP and the frame), through stand-ins that replay the same callee effects on both sides. A declined call must leave everything as the translated routine does.

routine cases answered by the host mismatches deliberately broken copies caught
gravity f_81281850 1,000,000 442,142 0 4 of 4 (an unfused FMLA, a swapped select, a register half not cleared, FRECPE off by one)
draw constants f_81260600 400,000 266,585 0 5 of 5
emitter update f_8125f0e0 (3.4 million calls compared) 100,000 not counted (it declines only for memory out of range) 0 10 of 10
its matrix block 1,000,000 581,248 0 3 of 3
emission step f_8128b800 120,000 112,839 0 22 of 22
initial velocity f_8127a980 200,000 138,280 0 16 of 17 (the 17th, FRINTA's ties to even, gives the same bits in this routine; the unit test catches it)
placement arrays f_812eed00 200,000 not counted 0 none recorded
entry arrays f_812ef8c0 200,000 not counted 0 7 of 7

The cases: realistic emitters and particles, degenerate and zero matrices, edge values wherever a float is read (NaN, infinities, signed zeros, subnormals, the class's bounds), aliasing pointers, changed constants, every FPCR mode the gate allows and others, FPSR states, and for the arrays counts of 0 to 1,000 items, repeated keys, failing allocations and another stride. The game's powf against host/vfx_powf.c: 42,560 special inputs and y = +-1 over 20,000 bases equal (the NaN sign aside, which is never written: out of the class); fmodf against the game's over 200,000 pairs: 0 differences. FRECPE over all 64,512 input patterns of the class: equal to the emulator's. The cuts: both proven again on main's current lift form (#1880's fast-float regions) with the translator's statements as the fallback: f_8125f0e0 20,000 cases, f_8128b800 4,000, 0 mismatches. Velocity's check mode offline: 140,000 cases equal to the translated routine, no false DIFFERENT, five deliberate faults each caught and named.

Run again with this branch's host files at this head, on fresh seeds: gravity 100,000 cases (44,176 answered), draw constants 50,000 (33,158), the matrix block 100,000 (57,919), the emitter update 20,000 (681,568 calls compared) and 10,000 on main's lift form with its cut, the emission step 20,000 (18,812 answered) and 4,000 on main's lift form with its cut (3,753), the initial velocity 40,000 (27,782) and 20,000 through host/oot_vfx.c's check mode (no DIFFERENT line), the two array routines 50,000 each: 0 mismatches in every run, in the x86-64-v3 build and, where the harness has one, the plain x86-64-v2 build (where the float parts decline). The commit on top changes only declarations in the generated code, which these harnesses do not compile: their drivers call the host routines directly, and gravity's and the draw constants' through an offline copy of the hook. The emission step's run on main's lift form used the session's kept main-lift text of the routine with its leaf callees from the old lift (main's full lifted output was no longer on disk).

Game-free tests at this head: tests/test_vfx_kernels.py (FRECPE's model over every class pattern and Arm's pinned values, powf's shortcut, the gravity path against a scalar model, the rows kernel against the block's own rows over 20,000 inputs, 48 declines that write nothing, the same bytes under -ffp-contract=fast-honor-pragmas, every call declined without FMA), tests/test_vfx_create.py (both array routines, 3,000 calls each, against a model written from the instructions), tests/test_vfx_emitter.py, tests/test_vfx_emission.py (the absorbed fmodf against C's over 130,000 finite pairs), tests/test_vfx_velocity.py (FRSQRTE against Arm's pseudo-code over 65,024 inputs, FRINTA over 26,014, TinyMT32 against the reference over 20,000 states, the declines), tests/test_oot_vfx_patch.py (the hooks placed once and only in the supported build, the cuts accepted and refused, a second run changes nothing). Of the 50 tests run (these six, tests/test_switch_table.py, tests/test_patch_hooks_defined.py and every test that reads nx2/oot_patches.py or nx2/entry_hooks.py) 45 pass; the five others fail the same way on main f1f2dc5b on this PC: test_dev_packs, test_high_fps_fixes, test_libc_hooks, test_lift_cache, test_song_note_cue. On 34b50cde the full tests/run_all.py gave 708 passed against main 51f5f9da's 702, with the same 52 failures on both; it was not run at this head. ruff clean.

These tests cover the pieces (FRSQRTE, FRINTA, TinyMT32, fmodf, FRECPE, powf's shortcut, the declines, the call order) and models of the simpler routines; the routines' bodies against the game's own instructions are proven by the emulator harnesses above, which run the game's code and so are not in the repository. In check mode f_81260600 compares its draw constant block and its int triples, not its three buffer copies, and f_8125f0e0 / f_8128b800 compare their matrix and rotation blocks; the rest of those routines is proven offline only.

Still to test:

  • Linux and an AMD GPU, the child Market and Death Mountain Trail (an effect-heavy scene): this PR with HOS_NATIVE_VFX=0 against unset (on) (the same build), and main against this PR with the switch unset, a few minutes each: the game's CPU seconds at a 60 fps cap (on a PC that holds 60 there), standing and turning the camera, per thread if it can be read, and the frame times uncapped, expecting the same frame rate or better with less CPU time with the switch at 1, the particles as without it, and vfx: lines in the log (@Beanstalk linux, amd).
  • Linux, the Market and Death Mountain Trail for a few minutes with HOS_NATIVE_VFX=check, expecting every vfx: line to end DIFFERENT 0 and no DIFFERENT from the lifted code line (@Beanstalk linux).
  • This head built and played on Windows with HOS_NATIVE_VFX=check and then =1, expecting no difference and the effects as on main (by hand).

Measurements

Verdict: faster routines, the saving in the game not resolved yet. Against main's own compiled form of each routine, offline: 1.25x to 8.9x (the table below). In the game, the Market at a 60 fps cap, an earlier form of this code on main 068fb8eb: with the switch on, -1.3 % of the process's CPU standing and +0.0 % turning against main; with it unset, -0.7 % and +0.1 %; all inside the runs' spread (a variant's own runs differ by up to about 1.5 %). That is as expected for routines that are about 0.7 % of game code in the Market: a 2 to 5 times faster 0.7 % is about 0.2 to 0.3 % of the process, below that test's noise. A sampling profile of the same scene, switch off against on, gave no answer either: the seven routines were about 0.02 % of all samples (about 115 of 658,000 standing), and the two "off" runs alone differed by 97 to 133 samples. The Test Farm request asks for the CPU seconds with the switch off and on, in the Market and in an effect-heavy scene.

Baseline: two builds from scratch on the same PC, the default hot list: plain main 068fb8eb (Before), and this code as it stood at 0dfdbcba on main 068fb8eb (After), run with no switch set and with HOS_NATIVE_VFX=1. Main has since moved to f1f2dc5b; the numbers are main 068fb8eb's.
Setup: Windows 11 (build 22631), Ryzen 9 5900X, RTX 3090, 3840x2160; child Link in the Market, hands-free through scripts/longshot_ctl.py; the frame rate capped at 60, which every standing window held (one Before turning window did not: 58.7); each run 30 s standing, then 30 s turning the camera; the three variants interleaved over three rounds. CPU seconds a second of play (cores busy on average) from the processor's cycle counter; the median of three runs.

cores busy, median of three [the runs] Before: main @ 068fb8eb After, no switch set: this PR @ 0dfdbcba After, HOS_NATIVE_VFX=1: this PR @ 0dfdbcba
whole process, standing 5.154 [5.162, 5.154, 5.089] 5.119 [5.114, 5.119, 5.163] (-0.7 %) 5.087 [5.148, 5.064, 5.087] (-1.3 %)
whole process, turning 5.601 [5.601, 5.643, 5.581] 5.606 [5.585, 5.606, 5.614] (+0.1 %) 5.602 [5.635, 5.602, 5.589] (+0.0 %)
module workers, standing 0.828 0.835 0.825
main thread, standing 0.296 0.301 0.293

The process includes the renderer's threads (1.36 cores standing), which this change does not touch.

Offline speed, one call, against main's own compiled form (main's object of each routine from a game build's object cache, at its flags, with its own callees and runtime helpers where they shape the time: powf and the getters for gravity, the buffer copies through main's libc hooks for the draw constants, std::sort and memset for the arrays; stand-ins on both sides for module calls; outputs compared equal first; Ryzen 9 5900X). Main writes a function a patch names with every register in the context rather than in locals, so these factors are against the form main uses without this PR.

routine its share of game code (route profile: Kakariko and Death Mountain Trail) main host factor
gravity f_81281850, world path 0.22 % 615-728 ns 131-137 ns 4.5-5.5x (FPCR 0 / FZ)
gravity f_81281850, local path 1.52-1.65x
draw constants f_81260600 0.31 % 623-756 ns 218-334 ns 2.3-3.1x
emitter update f_8125f0e0 0.45 % 534-968 ns 283-773 ns 1.25-1.9x
emission step f_8128b800, frames that do not emit / emit 0.05-0.07 % 59-65 / 335-381 ns 42-47 / 123-138 ns 1.4x / 2.6-2.9x
initial velocity f_8127a980 (by path) 0.09 % 160-1,225 ns 54-193 ns 2.9-6.9x
placement arrays f_812eed00, 10 to 1,000 items 0.05-0.07 % 0.23-158 us 0.15-17.7 us 1.55-8.9x
entry arrays f_812ef8c0, 10 to 1,000 items 0.18 % 0.29-84.7 us 0.19-14.8 us 1.5-5.7x

f_8125f0e0's matrix block on its own: 2.5-3.7x against the translator's old form (every register in the context), not against main's. The effect resources' arrays run at area loads and first spawns, so their saving is at loads rather than in a running frame. An eighth routine, f_812707c0 (an emitter set's per-frame update, mostly calls), was made exact offline (100,000 cases, 0 mismatches) and is left unwired (0.98 to 1.11 times main's form); its code is not in this PR.

The cost with HOS_NATIVE_VFX=0: each of the seven functions loses main's register locals (a patched function keeps its registers in the context), and the hook's call is a load and a branch. Not measured offline; in the game, the variant with the switch off above was -0.7 % standing and +0.1 % turning against main, inside the spread.

The switch

HOS_NATIVE_VFX (new, run time, on by default; its row in gpu/vk/switches.def): 0 off (each hook returns at once); unset or 1 on; check runs the host version, keeps what it would write aside, runs the translated routine for real and compares, logging the first difference (slow: for a look in the game). A start line, and a line for each routine every 65,536 calls (the counts are kept per thread and added up every 4,096 calls, so a thread's last few calls may be missing from them). From the check run on 34b50cde:

vfx: the particle routines f_81281850, f_81260600, f_812eed00, f_812ef8c0, f_8127a980, f_8128b800 and f_8125f0e0 on the host, each call checked against the lifted code (HOS_NATIVE_VFX)
vfx: f_81281850 1048576 calls: taken 1019374; lifted for no FMA 0, memory 0, overlap 0, constants 0, values 29202, powf 0, FPCR/FPSR 0, DIFFERENT 0

It ships on: docs/dev/standards.md has a switch ship at its value from the first push, never off because it is new, and the measurement with the rewrite branches together says on. HOS_NATIVE_VFX=0 gives main's lifted code. This PR's own measurement (the farm request) can still turn it off before it leaves WIP.

Risks

What could break: a host version that is not exact would move or draw particles differently from the Switch. Checked as in Testing; the hooks decline what they cannot prove (a float mode outside the translator's gate, values outside the class, memory outside the guest's, a write that would reach a later read, a changed constant of the image, another random generator class, no FMA) and the translated routine runs.

Turning it off: HOS_NATIVE_VFX=0.

After updating: nothing changes for a player: saves, longshot_options.ini and the caches as before. The seven hooked functions are written by the translator with their registers in the context (as every patched function is), which changes their translated code; with the switch at =0 the measured cost was inside the runs' spread.

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. (This code ran in the game in check mode on main 51f5f9da, two builds, no difference; this head is not built or played.)
  • mise run test passes (any failure that also fails on main is named). (50 tests run, the branch's own and every one that reads the patch files: the five failures fail on main too; the full suite not run at this head.)
  • Measured against main, or Measurements says why there is nothing to measure. (Measured against main 068fb8eb in the Market: inside the runs' spread; this PR waits for the Test Farm.)
  • 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. (The row is there; on by default, =0 gives main's lifted code; this PR's own measurement can still turn it off.)
  • A check under tests/ that reads changed source is updated, not weakened. (tests/test_oot_vfx_patch.py and five more are new.)
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: in the game builds above; Linux not built.)
  • 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 Seven routines of the game's particle effect library (NintendoWare vfx3) run as native host code by default (`HOS_NATIVE_VFX=0` runs the translated code), giving the game's results bit for bit: every byte written, FPSR, the return value and every register the callers read. A call the host cannot prove exact runs the game's translated routine, with nothing written by the host first. The goal is less CPU work for the same frame. The particle update runs every frame on the module workers and the main thread, mostly while the frame waits for its last jobs. Against main's own compiled form of each routine the host versions are 1.25 to 8.9 times as fast (Measurements); the seven routines are about 0.7 % of game code in a Market profile and about 1.3 % in a Kakariko and Death Mountain Trail profile. The CPU time this saves in the game is not resolved yet: at a 60 fps cap in the Market the change was inside the runs' spread, and the Test Farm request asks for it. The routines it answers (guest addresses): - `f_81281850`: the gravity module's per-emitter step: powf of the air resistance, and the gravity step, turned into world coordinates through the emitter's and the emitter set's matrices when the module says so (the game's powf with its own shortcut for y = +-1, FRECPE by Arm's table). - `f_81260600`: an emitter's per-frame buffer update and its 0x1d0-byte draw constant block (the buffer copies, two int triples, the block, then the module calls through four tables, which stay translated). - `f_8125f0e0`: an emitter's per-frame update, whole: its 34 calls as translated code, its matrix block (the rotation-scale rows) by a kernel where that is the game's bits, else by the translator's own statements of that block. - `f_8128b800`: an emitter's time-based emission step, whole: fmodf and five getters absorbed, the random generator's draws and the per-particle loop as translated code, its rotation block by a kernel or by the translator's own statements. - `f_8127a980`: the initial-velocity module's per-particle emit callback, every path: the cone, the Y-axis term and its random fallback, world coordinates; the generator's draws (TinyMT32) on a copy of its state, written back with the other writes. - `f_812eed00` and `f_812ef8c0`: the effect resources' placement and entry arrays, set up at area loads and first spawns: the game's two quadratic searches through a hash table and the sort on the host, the same bytes; the allocator's calls stay translated. How: `nx2/oot_patches.py` (`patch_vfx`) puts `if (hos_vfx_<addr>(c, f_<addr>)) return;` first in each of the seven functions, in the supported build only. For `f_8125f0e0` and `f_8128b800` it also cuts the translator's own statements of the matrix / rotation block out of the function at build time into a static function placed after it, and hands that to the hook as the fallback; only when the cut is straight-line code (no label, branch, return, guest call, poll, write of x29 / x30 / SP, use of the flags) and reads exactly the registers the host sets before it runs it, else the function is left unpatched. A WARNING names a place not found. `host/oot_vfx.c` holds the hooks and the gate (the translator's own `RECOMP_FPX_OPEN`: FPCR at its default but FZ; memory through `hos_guest_range`; a write that would reach a later read declines), marks every page written, and counts calls per thread. The kernels are in `host/vfx_kernels.c`, `vfx_emitter.c`, `vfx_emission.c`, `vfx_velocity.c`, `vfx_create.c`: each routine's instruction sequence statement for statement on SSE, under a class rule (every float the routine loads or computes, the discarded lanes too, is zero or inside the range where x86 and Arm round alike; outside it the call declines). The float parts need FMA; without it they decline and run translated. Read first: `host/oot_vfx.c` (its head comment: every hook and what check mode compares), `host/vfx_kernels.c`, the `patch_vfx` block of `nx2/oot_patches.py`, `tests/test_oot_vfx_patch.py`. Ported code: `host/vfx_powf.c` is Arm's optimized-routines v23.01 powf (https://github.com/ARM-software/optimized-routines; Copyright (c) 2017-2022, Arm Limited; MIT OR Apache-2.0 WITH LLVM-exception, taken under MIT), verbatim but for its includes and prefixed names, with the game's own y = +-1 shortcut in front. The console's library links that powf; the game's copy gave the same bits as this source over 8 million inputs. Nothing else here is ported from another project. ## Testing **Tested:** Windows 11, RTX 3090 (NVIDIA 610.88), Ryzen 9 5900X. In the game, with `HOS_NATIVE_VFX=check` (every call the host takes also runs translated, for the two whole routines their matrix and rotation blocks, and the two are compared; the translated result is kept), a few minutes each in particle-heavy places, on two builds of this code on main 51f5f9da: 34b50cde (the first four commits here) and 8d9d5575 (plus the per-thread counts). **No difference logged in either run.** The counts at the last `vfx:` line of each run: | routine | 34b50cde: calls | answered by the host | translated for its values | 8d9d5575: calls | answered | translated for its values | DIFFERENT | |---|---|---|---|---|---|---|---| | gravity `f_81281850` | 1,048,576 | 1,019,374 (97.2 %) | 29,202 | 196,608 | 192,165 (97.7 %) | 4,443 | 0 | | draw constants `f_81260600` | 1,507,328 | 1,498,714 (99.4 %) | 8,614 | 458,752 | 455,743 (99.3 %) | 3,009 | 0 | | emitter update `f_8125f0e0` | 1,048,576 | all | 0 | 196,608 | all | 0 | 0 | | its matrix block (compared on its own) | 1,048,576 | all | 0 | 196,608 | all | 0 | 0 | | emission step `f_8128b800` | 983,040 | all | 0 | 196,608 | all | 0 | 0 | The velocity callback `f_8127a980`, the two array routines and `f_8128b800`'s rotation block stayed under 65,536 calls in both runs, so they logged no count line; a difference is logged at once, and none was. An earlier form of this code on main 068fb8eb (0dfdbcba) also ran in check mode, about 11 million calls with no difference, and was measured (Measurements). This branch's head (the same five commits cherry-picked onto main f1f2dc5b, plus one commit of declarations) is not built or played; none of the host files differs from 8d9d5575. Offline, against the game's own code: an AArch64 emulator (Unicorn) runs the game's routine on its image with its own callees, a driver runs the host version on the same case, and everything the routine can change is compared: memory (every region of the case, the routine's frame but the signed x30), FPSR, NZCV where the callers read it, x0, x19-x30, SP and q8-q15; for the two whole routines with calls, every call too (target, argument registers, x29, x30, SP and the frame), through stand-ins that replay the same callee effects on both sides. A declined call must leave everything as the translated routine does. | routine | cases | answered by the host | mismatches | deliberately broken copies caught | |---|---|---|---|---| | gravity `f_81281850` | 1,000,000 | 442,142 | 0 | 4 of 4 (an unfused FMLA, a swapped select, a register half not cleared, FRECPE off by one) | | draw constants `f_81260600` | 400,000 | 266,585 | 0 | 5 of 5 | | emitter update `f_8125f0e0` (3.4 million calls compared) | 100,000 | not counted (it declines only for memory out of range) | 0 | 10 of 10 | | its matrix block | 1,000,000 | 581,248 | 0 | 3 of 3 | | emission step `f_8128b800` | 120,000 | 112,839 | 0 | 22 of 22 | | initial velocity `f_8127a980` | 200,000 | 138,280 | 0 | 16 of 17 (the 17th, FRINTA's ties to even, gives the same bits in this routine; the unit test catches it) | | placement arrays `f_812eed00` | 200,000 | not counted | 0 | none recorded | | entry arrays `f_812ef8c0` | 200,000 | not counted | 0 | 7 of 7 | The cases: realistic emitters and particles, degenerate and zero matrices, edge values wherever a float is read (NaN, infinities, signed zeros, subnormals, the class's bounds), aliasing pointers, changed constants, every FPCR mode the gate allows and others, FPSR states, and for the arrays counts of 0 to 1,000 items, repeated keys, failing allocations and another stride. The game's powf against `host/vfx_powf.c`: 42,560 special inputs and y = +-1 over 20,000 bases equal (the NaN sign aside, which is never written: out of the class); fmodf against the game's over 200,000 pairs: 0 differences. FRECPE over all 64,512 input patterns of the class: equal to the emulator's. The cuts: both proven again on main's current lift form (#1880's fast-float regions) with the translator's statements as the fallback: `f_8125f0e0` 20,000 cases, `f_8128b800` 4,000, 0 mismatches. Velocity's check mode offline: 140,000 cases equal to the translated routine, no false DIFFERENT, five deliberate faults each caught and named. Run again with this branch's host files at this head, on fresh seeds: gravity 100,000 cases (44,176 answered), draw constants 50,000 (33,158), the matrix block 100,000 (57,919), the emitter update 20,000 (681,568 calls compared) and 10,000 on main's lift form with its cut, the emission step 20,000 (18,812 answered) and 4,000 on main's lift form with its cut (3,753), the initial velocity 40,000 (27,782) and 20,000 through `host/oot_vfx.c`'s check mode (no DIFFERENT line), the two array routines 50,000 each: 0 mismatches in every run, in the x86-64-v3 build and, where the harness has one, the plain x86-64-v2 build (where the float parts decline). The commit on top changes only declarations in the generated code, which these harnesses do not compile: their drivers call the host routines directly, and gravity's and the draw constants' through an offline copy of the hook. The emission step's run on main's lift form used the session's kept main-lift text of the routine with its leaf callees from the old lift (main's full lifted output was no longer on disk). Game-free tests at this head: `tests/test_vfx_kernels.py` (FRECPE's model over every class pattern and Arm's pinned values, powf's shortcut, the gravity path against a scalar model, the rows kernel against the block's own rows over 20,000 inputs, 48 declines that write nothing, the same bytes under `-ffp-contract=fast-honor-pragmas`, every call declined without FMA), `tests/test_vfx_create.py` (both array routines, 3,000 calls each, against a model written from the instructions), `tests/test_vfx_emitter.py`, `tests/test_vfx_emission.py` (the absorbed fmodf against C's over 130,000 finite pairs), `tests/test_vfx_velocity.py` (FRSQRTE against Arm's pseudo-code over 65,024 inputs, FRINTA over 26,014, TinyMT32 against the reference over 20,000 states, the declines), `tests/test_oot_vfx_patch.py` (the hooks placed once and only in the supported build, the cuts accepted and refused, a second run changes nothing). Of the 50 tests run (these six, `tests/test_switch_table.py`, `tests/test_patch_hooks_defined.py` and every test that reads `nx2/oot_patches.py` or `nx2/entry_hooks.py`) 45 pass; the five others fail the same way on main f1f2dc5b on this PC: `test_dev_packs`, `test_high_fps_fixes`, `test_libc_hooks`, `test_lift_cache`, `test_song_note_cue`. On 34b50cde the full `tests/run_all.py` gave 708 passed against main 51f5f9da's 702, with the same 52 failures on both; it was not run at this head. ruff clean. These tests cover the pieces (FRSQRTE, FRINTA, TinyMT32, fmodf, FRECPE, powf's shortcut, the declines, the call order) and models of the simpler routines; the routines' bodies against the game's own instructions are proven by the emulator harnesses above, which run the game's code and so are not in the repository. In check mode `f_81260600` compares its draw constant block and its int triples, not its three buffer copies, and `f_8125f0e0` / `f_8128b800` compare their matrix and rotation blocks; the rest of those routines is proven offline only. **Still to test:** - Linux and an AMD GPU, the child Market and Death Mountain Trail (an effect-heavy scene): this PR with `HOS_NATIVE_VFX=0` against unset (on) (the same build), and main against this PR with the switch unset, a few minutes each: the game's CPU seconds at a 60 fps cap (on a PC that holds 60 there), standing and turning the camera, per thread if it can be read, and the frame times uncapped, expecting the same frame rate or better with less CPU time with the switch at 1, the particles as without it, and `vfx:` lines in the log (@Beanstalk linux, amd). - Linux, the Market and Death Mountain Trail for a few minutes with `HOS_NATIVE_VFX=check`, expecting every `vfx:` line to end `DIFFERENT 0` and no `DIFFERENT from the lifted code` line (@Beanstalk linux). - This head built and played on Windows with `HOS_NATIVE_VFX=check` and then `=1`, expecting no difference and the effects as on main (by hand). ## Measurements **Verdict:** faster routines, the saving in the game not resolved yet. Against main's own compiled form of each routine, offline: 1.25x to 8.9x (the table below). In the game, the Market at a 60 fps cap, an earlier form of this code on main 068fb8eb: with the switch on, -1.3 % of the process's CPU standing and +0.0 % turning against main; with it unset, -0.7 % and +0.1 %; all inside the runs' spread (a variant's own runs differ by up to about 1.5 %). That is as expected for routines that are about 0.7 % of game code in the Market: a 2 to 5 times faster 0.7 % is about 0.2 to 0.3 % of the process, below that test's noise. A sampling profile of the same scene, switch off against on, gave no answer either: the seven routines were about 0.02 % of all samples (about 115 of 658,000 standing), and the two "off" runs alone differed by 97 to 133 samples. The Test Farm request asks for the CPU seconds with the switch off and on, in the Market and in an effect-heavy scene. Baseline: two builds from scratch on the same PC, the default hot list: plain main 068fb8eb (Before), and this code as it stood at 0dfdbcba on main 068fb8eb (After), run with no switch set and with `HOS_NATIVE_VFX=1`. Main has since moved to f1f2dc5b; the numbers are main 068fb8eb's. Setup: Windows 11 (build 22631), Ryzen 9 5900X, RTX 3090, 3840x2160; child Link in the Market, hands-free through `scripts/longshot_ctl.py`; the frame rate capped at 60, which every standing window held (one Before turning window did not: 58.7); each run 30 s standing, then 30 s turning the camera; the three variants interleaved over three rounds. CPU seconds a second of play (cores busy on average) from the processor's cycle counter; the median of three runs. | cores busy, median of three [the runs] | Before: main @ 068fb8eb | After, no switch set: this PR @ 0dfdbcba | After, `HOS_NATIVE_VFX=1`: this PR @ 0dfdbcba | |---|---|---|---| | whole process, standing | 5.154 [5.162, 5.154, 5.089] | 5.119 [5.114, 5.119, 5.163] (-0.7 %) | 5.087 [5.148, 5.064, 5.087] (-1.3 %) | | whole process, turning | 5.601 [5.601, 5.643, 5.581] | 5.606 [5.585, 5.606, 5.614] (+0.1 %) | 5.602 [5.635, 5.602, 5.589] (+0.0 %) | | module workers, standing | 0.828 | 0.835 | 0.825 | | main thread, standing | 0.296 | 0.301 | 0.293 | The process includes the renderer's threads (1.36 cores standing), which this change does not touch. Offline speed, one call, against main's own compiled form (main's object of each routine from a game build's object cache, at its flags, with its own callees and runtime helpers where they shape the time: powf and the getters for gravity, the buffer copies through main's libc hooks for the draw constants, std::sort and memset for the arrays; stand-ins on both sides for module calls; outputs compared equal first; Ryzen 9 5900X). Main writes a function a patch names with every register in the context rather than in locals, so these factors are against the form main uses without this PR. | routine | its share of game code (route profile: Kakariko and Death Mountain Trail) | main | host | factor | |---|---|---|---|---| | gravity `f_81281850`, world path | 0.22 % | 615-728 ns | 131-137 ns | 4.5-5.5x (FPCR 0 / FZ) | | gravity `f_81281850`, local path | | | | 1.52-1.65x | | draw constants `f_81260600` | 0.31 % | 623-756 ns | 218-334 ns | 2.3-3.1x | | emitter update `f_8125f0e0` | 0.45 % | 534-968 ns | 283-773 ns | 1.25-1.9x | | emission step `f_8128b800`, frames that do not emit / emit | 0.05-0.07 % | 59-65 / 335-381 ns | 42-47 / 123-138 ns | 1.4x / 2.6-2.9x | | initial velocity `f_8127a980` (by path) | 0.09 % | 160-1,225 ns | 54-193 ns | 2.9-6.9x | | placement arrays `f_812eed00`, 10 to 1,000 items | 0.05-0.07 % | 0.23-158 us | 0.15-17.7 us | 1.55-8.9x | | entry arrays `f_812ef8c0`, 10 to 1,000 items | 0.18 % | 0.29-84.7 us | 0.19-14.8 us | 1.5-5.7x | `f_8125f0e0`'s matrix block on its own: 2.5-3.7x against the translator's old form (every register in the context), not against main's. The effect resources' arrays run at area loads and first spawns, so their saving is at loads rather than in a running frame. An eighth routine, `f_812707c0` (an emitter set's per-frame update, mostly calls), was made exact offline (100,000 cases, 0 mismatches) and is left unwired (0.98 to 1.11 times main's form); its code is not in this PR. The cost with `HOS_NATIVE_VFX=0`: each of the seven functions loses main's register locals (a patched function keeps its registers in the context), and the hook's call is a load and a branch. Not measured offline; in the game, the variant with the switch off above was -0.7 % standing and +0.1 % turning against main, inside the spread. ### The switch `HOS_NATIVE_VFX` (new, run time, on by default; its row in `gpu/vk/switches.def`): `0` off (each hook returns at once); unset or `1` on; `check` runs the host version, keeps what it would write aside, runs the translated routine for real and compares, logging the first difference (slow: for a look in the game). A start line, and a line for each routine every 65,536 calls (the counts are kept per thread and added up every 4,096 calls, so a thread's last few calls may be missing from them). From the check run on 34b50cde: ``` vfx: the particle routines f_81281850, f_81260600, f_812eed00, f_812ef8c0, f_8127a980, f_8128b800 and f_8125f0e0 on the host, each call checked against the lifted code (HOS_NATIVE_VFX) vfx: f_81281850 1048576 calls: taken 1019374; lifted for no FMA 0, memory 0, overlap 0, constants 0, values 29202, powf 0, FPCR/FPSR 0, DIFFERENT 0 ``` It ships on: docs/dev/standards.md has a switch ship at its value from the first push, never off because it is new, and the measurement with the rewrite branches together says on. `HOS_NATIVE_VFX=0` gives main's lifted code. This PR's own measurement (the farm request) can still turn it off before it leaves WIP. ## Risks **What could break:** a host version that is not exact would move or draw particles differently from the Switch. Checked as in Testing; the hooks decline what they cannot prove (a float mode outside the translator's gate, values outside the class, memory outside the guest's, a write that would reach a later read, a changed constant of the image, another random generator class, no FMA) and the translated routine runs. **Turning it off:** `HOS_NATIVE_VFX=0`. **After updating:** nothing changes for a player: saves, `longshot_options.ini` and the caches as before. The seven hooked functions are written by the translator with their registers in the context (as every patched function is), which changes their translated code; with the switch at `=0` the measured cost was inside the runs' spread. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. (This code ran in the game in check mode on main 51f5f9da, two builds, no difference; this head is not built or played.) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (50 tests run, the branch's own and every one that reads the patch files: the five failures fail on main too; the full suite not run at this head.) - [ ] Measured against `main`, or Measurements says why there is nothing to measure. (Measured against main 068fb8eb in the Market: inside the runs' spread; this PR waits for the Test Farm.) - [x] 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`. (The row is there; on by default, `=0` gives main's lifted code; this PR's own measurement can still turn it off.) - [x] A check under `tests/` that reads changed source is updated, not weakened. (`tests/test_oot_vfx_patch.py` and five more are new.) - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: in the game builds above; Linux not built.) - [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)
host/vfx_kernels.c: the gravity module's per-emitter step (powf of the air
resistance and the gravity step, in world coordinates when the module says
so), an emitter's 0x1d0-byte draw constant block and the emitter's
rotation-scale rows. host/vfx_powf.c: the game's powf, bit for bit. A call
whose inputs fall outside the class the kernels are proven for is declined
before any write, so the lifted code runs it.

tests/test_vfx_kernels.py: FRECPE's model over every class pattern and
Arm's pinned values, powf's shortcut, the gravity path against a scalar
model, the row kernels against the block's own rows, declines that write
nothing, the same bytes under -ffp-contract=fast-honor-pragmas, and every
call declined without FMA.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
host/vfx_create.c: f_812eed00 (the u16 placement arrays) and f_812ef8c0
(the entry arrays), the two routines EmitterSetResource::Initialize runs
when an effect's resources are set up (area loads, first spawns). The
game's searches are quadratic; here they go through a hash table and the
sort runs on the host, with the same bytes as the game's. The allocator's
calls stay lifted. A kept count already set, or another stride, runs the
game's own loop and sort as they are.

tests/test_vfx_create.py: 3,000 calls of each against a model written from
the instructions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- host/vfx_emitter.c, f_8125f0e0 (an emitter's per-frame update): the whole
  routine, its 34 calls as lifted code, its matrix block by the row kernel
  where that is the game's bits, else by the lift's own statements of the
  block, handed in by the caller.
- host/vfx_emission.c, f_8128b800 (an emitter's time-based emission step):
  the whole routine with fmodf and five getters absorbed, the random
  generator's draws and the per-particle loop as lifted code, its rotation
  block by a kernel or by the lift's own statements.
- host/vfx_velocity.c, f_8127a980 (the initial-velocity module's
  per-particle emit callback): every path, the generator's draws on a copy
  of its state, the output store absorbed; declined before any write
  otherwise.

Tests: the call order on each way through by return addresses, FRSQRTE and
FRINTA against Arm's pseudo-code, TinyMT32 against the reference, fmodf
against C's over 130,000 pairs, and the declines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
nx2/oot_patches.py (patch_vfx) splices a hook first in each of f_81281850,
f_81260600, f_812eed00, f_812ef8c0, f_8127a980, f_8128b800 and f_8125f0e0.
For the last two it also cuts the block the host's routine may hand back
out of the lifted function at build time (in the lift's plain and fast-float
forms) and places it after that function as a static function. A cut that
writes registers the routine reads afterwards, or jumps out of itself, stops
the build.

host/oot_vfx.c holds the hooks. HOS_NATIVE_VFX=1 runs each routine on the
host where that gives the game's bits and the lifted code otherwise.
HOS_NATIVE_VFX=check runs both, keeps the lifted result and logs a
difference. It is off by default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A shared atomic add on every call, from six worker threads, took about a tenth of the hooked routines' time in a
profile. Each thread now counts on its own and adds to the shared counts every 4096 calls (at once for a difference);
the mode is one inlined load. The counts are a report only: nothing the routines compute changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(host): HOS_NATIVE_VFX's hooks are declared noescape
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 7s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/any 0/1 pass, 2 running, 0 queued
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
bd26d039d0
The hooks' declarations in the lifted code take the context as `Ctx *A64_NOESC c`, as the lifted functions do: without
it the compiler takes the context for escaped at the call, which costs the hooked function with the switch off. Each
function a hook passes was already declared at file scope (VFX_DECLS), and tests/test_oot_vfx_patch.py already finds a
function by its head line; it now expects the noescape declarations. tests/test_vfx_velocity.py loses an unused import
(ruff F401).

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

Tested in game: This head is not built or played; the same code on main 51f5f9da (builds 34b50cde and 8d9d5575) ran on Windows 11 (RTX 3090, Ryzen 9 5900X) with HOS_NATIVE_VFX=check in particle-heavy places: no difference from the translated routines over about 5.6 million calls the host answered. An earlier form on main 068fb8eb was measured in the Market at a 60 fps cap: -1.3 % CPU standing and +0.0 % turning with the switch on, inside the runs' spread, so the CPU saving is not resolved yet.

Tested in game: This head is not built or played; the same code on main 51f5f9da (builds 34b50cde and 8d9d5575) ran on Windows 11 (RTX 3090, Ryzen 9 5900X) with HOS_NATIVE_VFX=check in particle-heavy places: no difference from the translated routines over about 5.6 million calls the host answered. An earlier form on main 068fb8eb was measured in the Market at a 60 fps cap: -1.3 % CPU standing and +0.0 % turning with the switch on, inside the runs' spread, so the CPU saving is not resolved yet.
Author
Contributor

@Beanstalk linux, and amd: this PR with HOS_NATIVE_VFX unset against HOS_NATIVE_VFX=1 (the same build), and main against this PR with the switch unset, each in the child Market for a few minutes and on Death Mountain Trail (an effect-heavy scene: the crater's smoke and the falling rocks) for a few minutes. Measure the game's CPU seconds with the frame rate capped at 60 (on a PC that holds 60 there), standing and turning the camera, per thread if you can (the particle update runs on the ModuleSystemWorker threads and sead::MainThread), and the frame times uncapped. Expect less CPU time with the switch at 1, the same frame rate or better, no extra CPU time with the switch unset against main, the particles as without the switch, and "vfx:" lines in the log with the switch on; please report those lines (they say how many calls the host answered). Then one run of each scene with HOS_NATIVE_VFX=check: every "vfx:" line should end "DIFFERENT 0", with no "DIFFERENT from the lifted code" line.

@Beanstalk linux, and amd: this PR with HOS_NATIVE_VFX unset against HOS_NATIVE_VFX=1 (the same build), and main against this PR with the switch unset, each in the child Market for a few minutes and on Death Mountain Trail (an effect-heavy scene: the crater's smoke and the falling rocks) for a few minutes. Measure the game's CPU seconds with the frame rate capped at 60 (on a PC that holds 60 there), standing and turning the camera, per thread if you can (the particle update runs on the ModuleSystemWorker threads and sead::MainThread), and the frame times uncapped. Expect less CPU time with the switch at 1, the same frame rate or better, no extra CPU time with the switch unset against main, the particles as without the switch, and "vfx:" lines in the log with the switch on; please report those lines (they say how many calls the host answered). Then one run of each scene with HOS_NATIVE_VFX=check: every "vfx:" line should end "DIFFERENT 0", with no "DIFFERENT from the lifted code" line.
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.
Member

Possibly related, for context:

  • PR #1903 WIP: perf(host): the effect emitter matrix, the sounds' angle fraction and the audio reverb on host code, bit for bit (HOS_NATIVE_FXTRIGGERS, HOS_NATIVE_REVERB, off by default) — Overlapping native host optimization for effect-emitter routines
Possibly related, for context: - PR #1903 WIP: perf(host): the effect emitter matrix, the sounds' angle fraction and the audio reverb on host code, bit for bit (HOS_NATIVE_FXTRIGGERS, HOS_NATIVE_REVERB, off by default) — Overlapping native host optimization for effect-emitter routines
BeanBot requested changes 2026-11-21 04:05:09 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The native paths bypass ExeFS patches and scheduler checkpoints, and check mode can overwrite a pending scheduler interrupt. The offline speedups are promising, but the PR still needs a measurable gain in the game and a safe default.

Seven particle routines gain optional native implementations intended to reduce CPU work during effects and area loads. The patch adds faster array searches and math kernels, alongside several thousand lines that duplicate guest behavior, extra host scratch memory, and a change to the generated code that every player gets.

@fix will do (29)

  1. L1 nx2/oot_patches.py:554: The build-ID gate also accepts ExeFS-modded builds. (more on the line)
  2. L2 host/oot_vfx.c:479: The whole-Ctx snapshots and assignment include poll, which another host thread atomically writes in hos_thread.c. (more on the line)
  3. L3 host/oot_vfx.c:481: The velocity trial writes and marks the live attribute stream and then rolls it back with unmarked memcpy. (more on the line)
  4. L4 host/vfx_emitter.c:121: The native matrix path returns without marking either written span. (more on the line)
  5. L5 host/vfx_emitter.c:355: The whole-routine replacements drop loop back-edge polls. (more on the line)
  6. L6 host/oot_vfx.c:349: The direct draw copies bypass nn_libc.c’s bounded copy path. (more on the line)
  7. L7 host/oot_vfx.c:335: The draw check compares the pre-callback plan with memory after all four module loops have run. (more on the line)
  8. L8 host/oot_vfx.c:350: The draw plan stores the final triples, including the active slot’s reset, before copy 1. (more on the line)
  9. L9 host/oot_vfx.c:246: hos_guest_range checks the reserved window only. (more on the line)
  10. L10 nx2/oot_patches.py:480: The cut validator tracks writes in textual order across alternatives. (more on the line)
  11. L11 host/oot_vfx.c:319: The draw plan is allocated once per host thread and never freed. (more on the line)
  12. L12 host/vfx_create.c:51: The three realloc-backed TLS buffers have no cleanup. (more on the line)
  13. L13 host/vfx_create.c:69: The power-of-two capacity can wrap to zero for a positive count above 2^30 and loop indefinitely. (more on the line)
  14. L14 host/vfx_kernels.c:102: The expected-byte table is presented as bytes taken from the game image. (more on the line)
  15. L15 host/vfx_powf.c:944: The shortcut comment commits an exact expected result sampled from the game. (more on the line)
  16. L16 host/vfx_powf.c:7: The Arm source is taken under MIT, but the vendored copy supplies only the SPDX identifier and copyright. (more on the line)
  17. L17 host/vfx_powf.c:25: The claimed matching powf configuration uses fused polynomial steps, but only Clang gets a contraction override. (more on the line)
  18. L18 tests/test_vfx_emission.py:118: The Linux fixture links calls to fmodf, round and lround without libm. (more on the line)
  19. L19 tests/test_vfx_kernels.py:334: The kernel, emission and velocity fixtures build and execute x86-64-v3 binaries unconditionally. (more on the line)
  20. L20 tests/test_vfx_create.py:366: All five compiler fixtures ignore CC and silently substitute another compiler even when an explicit --cc cannot be found. (more on the line)
  21. L21 (minor) tests/test_vfx_kernels.py:302: The fixture opens a full temporary path through narrow fopen and uses the result unchecked. (more on the line)
  22. L22 tests/test_vfx_emission.py:65: The emission fixture always refuses guest memory, so a broken accepted emission path still passes. (more on the line)
  23. L23 (minor) tests/test_oot_vfx_patch.py:169: The patch test exercises the supported build and an unrelated function, but never submits the same seven matching functions for an unsupported build. (more on the line)
  24. L24 (minor) host/oot_vfx.c:94: Cumulative counters use 32-bit long on Windows. (more on the line)
  25. L25 (minor) nx2/oot_patches.py:2079: The description says a warning names the missing place, but the build reports only a total. (more on the line)
  26. L26 (minor) host/oot_vfx.c:69: The enum accepts any value beginning with c as check and almost any other truthy value as on. (more on the line)
  27. L27 (its part an edit can do): Keep the gated paths independently selectable during measurement so load-only code and whole-frame code can be evaluated separately.
  28. L28 (its part an edit can do) nx2/oot_patches.py:554: Preserve the normal localized fallback and materialize hook inputs only on the enabled branch where possible.
  29. L29 (its part an edit can do) host/vfx_create.c:165: Reuse the lifted sort for the slow path or use the same bounded-complexity sort as the fast path where ties are impossible.

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

  • L27 (minor): Run the current head against the current base on the same settings and hardware, including Windows, Linux/RADV and Steam Deck. Cover the heavy scene, Market and first spawns. Include uncapped frame times, capped CPU and cold/warm loads. The existing runs cannot settle either the benefit or the default.
  • L28 (minor) nx2/oot_patches.py:554: The off build still changes register localization, emits an external hook call and duplicates two blocks in the lift. (more on the line)
  • L29 (minor) host/vfx_create.c:165: The u16 array’s slow path replaces the guest sort with insertion sort. (more on the line)

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

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

Does it help: Unproven. The PR reports 1.25× to 8.9× speedups per routine on a Ryzen 9 5900X. Three interleaved runs on earlier commits showed −1.3% process CPU standing in the Market and +0.0% turning, within about 1.5% run-to-run spread at a 60 FPS cap. The current base and head still need uncapped frame times, average FPS and 1% lows, process and worker CPU, and cold and warm load timings.

Other systems: Virtual-core scheduling, ExeFS mods, GPU-visible guest memory, and the generated lift are affected. The CPU changes can affect frame pacing on NVIDIA, AMD and Steam Deck even though the Vulkan backend is outside the diff. Earlier Windows/NVIDIA runs and offline fixtures provide partial particle coverage. Linux, AMD, Steam Deck, lower CPU baselines and the current Windows build remain unverified. The diff has no direct save, options, audio, input, Launcher or renderer API changes.

Switches: HOS_NATIVE_VFX is the sole new runtime switch and has a sorted row in switches.def. Unset or 0 keeps the lifted behavior with patched code generation, 1 enables the host paths, and check performs comparisons of varying scope. Off is prudent while the issues are open, but the repository requires measurements to settle the shipped default, including the cost of leaving the hooks off. The parser also accepts values beyond the documented enum.

Reviewed: bd26d039d0 against f1f2dc5bd2: Read all 19 changed files and all six commits, AGENTS.md, CONTRIBUTING.md, the Forgejo template and developer standards. Traced the relevant lift, chunking, ExeFS patching, FP helpers, memory, libc, scheduler, switch and test-runner code. No review checklist file was present. Used the PR’s reported runs and CI snapshot as evidence. Generated game C, external emulator harnesses, prior run artifacts and the external Tooling checkout were unavailable.; nothing run (a code review).

Checked and fine:

  • All six commits carry AI co-author trailers. The change stays on one topic and has no checked-in generated files, shader changes, third_party directory changes or renderer ABI change.
  • The runtime switch has a sorted table entry and does not affect the lift cache key through its environment value.
  • Call-site caches and shared VFX counters use atomic access. The reciprocal-square-root table is static const, so it has no first-use initialization race.
  • The array fixture models guest allocation failures and the emitter fixture checks meaningful guest call order and frame state.
  • git diff --check reported no whitespace errors.

Testing: Read-only review. No builds or tests were run. Earlier Windows check-mode runs and offline comparisons were reported in the PR, with limited comparison scope in several hooks. CI was still running in the supplied snapshot. The full suite and in-game runs at bd26d039d0 remain outstanding.

Overlaps and merge order: None found in the checkout or supplied discussion. Remote pull requests were unavailable.


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

**Recommendation: Request changes.** The native paths bypass ExeFS patches and scheduler checkpoints, and check mode can overwrite a pending scheduler interrupt. The offline speedups are promising, but the PR still needs a measurable gain in the game and a safe default. Seven particle routines gain optional native implementations intended to reduce CPU work during effects and area loads. The patch adds faster array searches and math kernels, alongside several thousand lines that duplicate guest behavior, extra host scratch memory, and a change to the generated code that every player gets. **`@fix` will do (29)** 1. **L1** `nx2/oot_patches.py:554`: The build-ID gate also accepts ExeFS-modded builds. (more on the line) 2. **L2** `host/oot_vfx.c:479`: The whole-Ctx snapshots and assignment include poll, which another host thread atomically writes in hos_thread.c. (more on the line) 3. **L3** `host/oot_vfx.c:481`: The velocity trial writes and marks the live attribute stream and then rolls it back with unmarked memcpy. (more on the line) 4. **L4** `host/vfx_emitter.c:121`: The native matrix path returns without marking either written span. (more on the line) 5. **L5** `host/vfx_emitter.c:355`: The whole-routine replacements drop loop back-edge polls. (more on the line) 6. **L6** `host/oot_vfx.c:349`: The direct draw copies bypass nn_libc.c’s bounded copy path. (more on the line) 7. **L7** `host/oot_vfx.c:335`: The draw check compares the pre-callback plan with memory after all four module loops have run. (more on the line) 8. **L8** `host/oot_vfx.c:350`: The draw plan stores the final triples, including the active slot’s reset, before copy 1. (more on the line) 9. **L9** `host/oot_vfx.c:246`: hos_guest_range checks the reserved window only. (more on the line) 10. **L10** `nx2/oot_patches.py:480`: The cut validator tracks writes in textual order across alternatives. (more on the line) 11. **L11** `host/oot_vfx.c:319`: The draw plan is allocated once per host thread and never freed. (more on the line) 12. **L12** `host/vfx_create.c:51`: The three realloc-backed TLS buffers have no cleanup. (more on the line) 13. **L13** `host/vfx_create.c:69`: The power-of-two capacity can wrap to zero for a positive count above 2^30 and loop indefinitely. (more on the line) 14. **L14** `host/vfx_kernels.c:102`: The expected-byte table is presented as bytes taken from the game image. (more on the line) 15. **L15** `host/vfx_powf.c:944`: The shortcut comment commits an exact expected result sampled from the game. (more on the line) 16. **L16** `host/vfx_powf.c:7`: The Arm source is taken under MIT, but the vendored copy supplies only the SPDX identifier and copyright. (more on the line) 17. **L17** `host/vfx_powf.c:25`: The claimed matching powf configuration uses fused polynomial steps, but only Clang gets a contraction override. (more on the line) 18. **L18** `tests/test_vfx_emission.py:118`: The Linux fixture links calls to fmodf, round and lround without libm. (more on the line) 19. **L19** `tests/test_vfx_kernels.py:334`: The kernel, emission and velocity fixtures build and execute x86-64-v3 binaries unconditionally. (more on the line) 20. **L20** `tests/test_vfx_create.py:366`: All five compiler fixtures ignore CC and silently substitute another compiler even when an explicit --cc cannot be found. (more on the line) 21. **L21** (minor) `tests/test_vfx_kernels.py:302`: The fixture opens a full temporary path through narrow fopen and uses the result unchecked. (more on the line) 22. **L22** `tests/test_vfx_emission.py:65`: The emission fixture always refuses guest memory, so a broken accepted emission path still passes. (more on the line) 23. **L23** (minor) `tests/test_oot_vfx_patch.py:169`: The patch test exercises the supported build and an unrelated function, but never submits the same seven matching functions for an unsupported build. (more on the line) 24. **L24** (minor) `host/oot_vfx.c:94`: Cumulative counters use 32-bit long on Windows. (more on the line) 25. **L25** (minor) `nx2/oot_patches.py:2079`: The description says a warning names the missing place, but the build reports only a total. (more on the line) 26. **L26** (minor) `host/oot_vfx.c:69`: The enum accepts any value beginning with c as check and almost any other truthy value as on. (more on the line) 27. **L27** (its part an edit can do): Keep the gated paths independently selectable during measurement so load-only code and whole-frame code can be evaluated separately. 28. **L28** (its part an edit can do) `nx2/oot_patches.py:554`: Preserve the normal localized fallback and materialize hook inputs only on the enabled branch where possible. 29. **L29** (its part an edit can do) `host/vfx_create.c:165`: Reuse the lifted sort for the slow path or use the same bounded-complexity sort as the fast path where ties are impossible. **For the author (3)** (a run, a measurement or a decision) - **L27** (minor): Run the current head against the current base on the same settings and hardware, including Windows, Linux/RADV and Steam Deck. Cover the heavy scene, Market and first spawns. Include uncapped frame times, capped CPU and cold/warm loads. The existing runs cannot settle either the benefit or the default. - **L28** (minor) `nx2/oot_patches.py:554`: The off build still changes register localization, emits an external hook call and duplicates two blocks in the lift. (more on the line) - **L29** (minor) `host/vfx_create.c:165`: The u16 array’s slow path replaces the guest sort with insertion sort. (more on the line) **Checks:** Still running: `CI / Conventional Commit title (pull_request)`, `CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request)`, `CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request)`, `CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request)`, `CI / Workflow lint (actionlint) (pull_request)`, `CI / Website build and checks (pull_request)`, `PR description / Description follows the template (pull_request_target)`, `Guide screenshots / Guide images and local UI source review (pull_request)`, `Third-party parts / As their notes say (pull_request)`, `Third-party parts / The same as upstream (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The PR reports 1.25× to 8.9× speedups per routine on a Ryzen 9 5900X. Three interleaved runs on earlier commits showed −1.3% process CPU standing in the Market and +0.0% turning, within about 1.5% run-to-run spread at a 60 FPS cap. The current base and head still need uncapped frame times, average FPS and 1% lows, process and worker CPU, and cold and warm load timings. **Other systems:** Virtual-core scheduling, ExeFS mods, GPU-visible guest memory, and the generated lift are affected. The CPU changes can affect frame pacing on NVIDIA, AMD and Steam Deck even though the Vulkan backend is outside the diff. Earlier Windows/NVIDIA runs and offline fixtures provide partial particle coverage. Linux, AMD, Steam Deck, lower CPU baselines and the current Windows build remain unverified. The diff has no direct save, options, audio, input, Launcher or renderer API changes. **Switches:** HOS_NATIVE_VFX is the sole new runtime switch and has a sorted row in switches.def. Unset or 0 keeps the lifted behavior with patched code generation, 1 enables the host paths, and check performs comparisons of varying scope. Off is prudent while the issues are open, but the repository requires measurements to settle the shipped default, including the cost of leaving the hooks off. The parser also accepts values beyond the documented enum. **Reviewed:** bd26d039d086 against f1f2dc5bd282: Read all 19 changed files and all six commits, AGENTS.md, CONTRIBUTING.md, the Forgejo template and developer standards. Traced the relevant lift, chunking, ExeFS patching, FP helpers, memory, libc, scheduler, switch and test-runner code. No review checklist file was present. Used the PR’s reported runs and CI snapshot as evidence. Generated game C, external emulator harnesses, prior run artifacts and the external Tooling checkout were unavailable.; nothing run (a code review). **Checked and fine:** - All six commits carry AI co-author trailers. The change stays on one topic and has no checked-in generated files, shader changes, third_party directory changes or renderer ABI change. - The runtime switch has a sorted table entry and does not affect the lift cache key through its environment value. - Call-site caches and shared VFX counters use atomic access. The reciprocal-square-root table is static const, so it has no first-use initialization race. - The array fixture models guest allocation failures and the emitter fixture checks meaningful guest call order and frame state. - git diff --check reported no whitespace errors. **Testing:** Read-only review. No builds or tests were run. Earlier Windows check-mode runs and offline comparisons were reported in the PR, with limited comparison scope in several hooks. CI was still running in the supplied snapshot. The full suite and in-game runs at bd26d039d086 remain outstanding. **Overlaps and merge order:** None found in the checkout or supplied discussion. Remote pull requests were unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.</sub>
host/oot_vfx.c Outdated
@ -0,0 +66,4 @@
static __attribute__((noinline)) int vfx_mode_first(void) {
const char *v = getenv("HOS_NATIVE_VFX");
int unset = -1;
const int m = !env_on("HOS_NATIVE_VFX") ? VFX_MODE_OFF : (v && (v[0] | 0x20) == 'c') ? VFX_MODE_CHECK : VFX_MODE_ON;
Member

L26 (minor): The enum accepts any value beginning with c as check and almost any other truthy value as on. For example, a mistyped check value can silently activate native mode. Match the documented values explicitly, diagnose invalid values and stay off.

**L26** (minor): The enum accepts any value beginning with c as check and almost any other truthy value as on. For example, a mistyped check value can silently activate native mode. Match the documented values explicitly, diagnose invalid values and stay off.
host/oot_vfx.c Outdated
@ -0,0 +91,4 @@
static const char *const vfx_why_name[VFX_NCOUNTS] = {"taken", "no FMA", "memory", "overlap", "constants", "values",
"powf", "FPCR/FPSR", "DIFFERENT"};
enum { VS_GRAV, VS_DRAW, VS_ROWS, VS_EMIT, VS_CREATE, VS_ENTRIES, VS_VEL, VS_EMISSION, VS_EMISSION_BLOCK, VS_N };
typedef struct VfxStats { const char *name; int id; long counts[VFX_NCOUNTS], calls; } VfxStats;
Member

L24 (minor): Cumulative counters use 32-bit long on Windows. After about 2.15 billion calls, the totals go negative and the threshold subtraction can overflow. Independent flushes can already print totals with buckets from different batches. Use 64-bit counters and either snapshot a coherent interval or document the concurrent snapshot as approximate.

**L24** (minor): Cumulative counters use 32-bit long on Windows. After about 2.15 billion calls, the totals go negative and the threshold subtraction can overflow. Independent flushes can already print totals with buckets from different batches. Use 64-bit counters and either snapshot a coherent interval or document the concurrent snapshot as approximate.
host/oot_vfx.c Outdated
@ -0,0 +243,4 @@
for (int i = 0; i < 3; i++) {
if (!p->cp[i].n) continue;
p->cp[i].dp = (uint8_t *)hos_guest_range(p->cp[i].d, p->cp[i].n);
p->cp[i].sp = (const uint8_t *)hos_guest_range(p->cp[i].s, p->cp[i].n);
Member

L9: hos_guest_range checks the reserved window only. A speculative input read during draw planning can touch a reserved hole before the guest reaches that operation, and velocity check mode reads every planned output before the FP gate or store decision. On Windows an in-window read can fault or commit a page. Check live readable and writable spans with their lifetimes secured before speculative host accesses, or keep those accesses on the lifted path.

**L9**: hos_guest_range checks the reserved window only. A speculative input read during draw planning can touch a reserved hole before the guest reaches that operation, and velocity check mode reads every planned output before the FP gate or store decision. On Windows an in-window read can fault or commit a page. Check live readable and writable spans with their lifetimes secured before speculative host accesses, or keep those accesses on the lifted path.
host/oot_vfx.c Outdated
@ -0,0 +316,4 @@
} while (--n);
}
static _Thread_local VfxDrawPlan *vfx_plan; /* (a thread's own, made at its first call: 0x2b0 bytes) */
Member

L11: The draw plan is allocated once per host thread and never freed. It is also shared across calls on that thread while the hook invokes guest code. A nested draw update can overwrite the outer plan and its frame pointer before the outer call resumes. Give each invocation its own stack plan, or use owned scratch with a lifetime and reentry guard.

**L11**: The draw plan is allocated once per host thread and never freed. It is also shared across calls on that thread while the hook invokes guest code. A nested draw update can overwrite the outer plan and its frame pointer before the outer call resumes. Give each invocation its own stack plan, or use owned scratch with a lifetime and reentry guard.
host/oot_vfx.c Outdated
@ -0,0 +332,4 @@
lifted(c);
vfx_inside = 0;
int same = 1;
if (p->doClamp) same &= vfx_same(s, (const uint8_t *)p->tri, p->E + 0x110, 24, "the triples at x0+0x110");
Member

L7: The draw check compares the pre-callback plan with memory after all four module loops have run. A legal callback that updates a triple or the constant block can produce a false difference, while a broken native buffer copy cannot produce any difference because that path never runs. Compare at the boundary before the callbacks and cover the word and copies, or label and test the narrower comparison.

**L7**: The draw check compares the pre-callback plan with memory after all four module loops have run. A legal callback that updates a triple or the constant block can produce a false difference, while a broken native buffer copy cannot produce any difference because that path never runs. Compare at the boundary before the callbacks and cover the word and copies, or label and test the narrower comparison.
host/oot_vfx.c Outdated
@ -0,0 +346,4 @@
HOS_WRITTEN(fr, 0x150);
/* 2. the word, the copies, the triples */
if (p->doP) s32(p->Pp, 0, p->Pv), HOS_WRITTEN(p->Pp, 4);
if (p->cp[0].n) memcpy(p->cp[0].dp, p->cp[0].sp, p->cp[0].n), HOS_WRITTEN(p->cp[0].dp, p->cp[0].n);
Member

L6: The direct draw copies bypass nn_libc.c’s bounded copy path. A multi-megabyte particle buffer now runs as one host memcpy, losing the interrupt polls between 256 KiB pieces and reintroducing the large-copy cache cost the libc path was written to avoid. Keep the lifted copy calls or share the bounded helper and preserve HOS_GUEST_LIBC.

**L6**: The direct draw copies bypass nn_libc.c’s bounded copy path. A multi-megabyte particle buffer now runs as one host memcpy, losing the interrupt polls between 256 KiB pieces and reintroducing the large-copy cache cost the libc path was written to avoid. Keep the lifted copy calls or share the bounded helper and preserve HOS_GUEST_LIBC.
host/oot_vfx.c Outdated
@ -0,0 +347,4 @@
/* 2. the word, the copies, the triples */
if (p->doP) s32(p->Pp, 0, p->Pv), HOS_WRITTEN(p->Pp, 4);
if (p->cp[0].n) memcpy(p->cp[0].dp, p->cp[0].sp, p->cp[0].n), HOS_WRITTEN(p->cp[0].dp, p->cp[0].n);
if (p->doClamp) memcpy(p->E + 0x110, p->tri, 24), HOS_WRITTEN(p->E + 0x110, 24);
Member

L8: The draw plan stores the final triples, including the active slot’s reset, before copy 1. If copy 1 reads that slot, it gets the reset value instead of the clamped value present at the guest copy. The overlap check omits copy sources from its read set for this dependency. Keep clamp, copy and reset in guest order or decline this alias, and test it.

**L8**: The draw plan stores the final triples, including the active slot’s reset, before copy 1. If copy 1 reads that slot, it gets the reset value instead of the clamped value present at the guest copy. The overlap check omits copy sources from its read set for this dependency. Keep clamp, copy and reset in guest order or decline this alias, and test it.
host/oot_vfx.c Outdated
@ -0,0 +476,4 @@
if (n[i] && !(p[i] = (uint8_t *)hos_guest_range(at[i], n[i]))) return 0;
for (int i = 0; i < NR; i++)
if (n[i]) memcpy(before[i], p[i], n[i]);
const Ctx c0 = *c;
Member

L2: The whole-Ctx snapshots and assignment include poll, which another host thread atomically writes in hos_thread.c. A core reassignment requested after the first snapshot can be erased by the restore, and the plain accesses race the atomic writer. Stage velocity outputs without copying Ctx, or snapshot and restore only the guest registers and FPSR changed by the trial.

**L2**: The whole-Ctx snapshots and assignment include poll, which another host thread atomically writes in hos_thread.c. A core reassignment requested after the first snapshot can be erased by the restore, and the plain accesses race the atomic writer. Stage velocity outputs without copying Ctx, or snapshot and restore only the guest registers and FPSR changed by the trial.
host/oot_vfx.c Outdated
@ -0,0 +478,4 @@
if (n[i]) memcpy(before[i], p[i], n[i]);
const Ctx c0 = *c;
int why = VV_OK;
if (!vfx_velocity_8127a980(c, &why, NULL)) { /* (declined: nothing written; the lifted routine, counted) */
Member

L3: The velocity trial writes and marks the live attribute stream and then rolls it back with unmarked memcpy. A concurrent page capture can consume the mark and copy the trial bytes before the rollback, defeating check mode’s promise to keep the lifted result. Compute the predicted writes in private scratch and let the lifted call be the only guest-memory writer.

**L3**: The velocity trial writes and marks the live attribute stream and then rolls it back with unmarked memcpy. A concurrent page capture can consume the mark and copy the trial bytes before the rollback, defeating check mode’s promise to keep the lifted result. Compute the predicted writes in private scratch and let the lifted call be the only guest-memory writer.
@ -0,0 +48,4 @@
/* The kept entries: key, item and the index of the key's first item (the dedupe keeps that first item, and the game's
second search finds that same index: the first item with the key), in first-occurrence order, then sorted. */
typedef struct { uint64_t key, item; uint32_t first; } VcEnt;
static _Thread_local VcEnt *vc_ent, *vc_tmp;
Member

L12: The three realloc-backed TLS buffers have no cleanup. A loader worker that processes a large list and exits leaks its largest allocations, including buffers grown on a partial allocation failure. Use per-call scratch with cleanup or attach it to host thread teardown.

**L12**: The three realloc-backed TLS buffers have no cleanup. A loader worker that processes a large list and exits leaks its largest allocations, including buffers grown on a partial allocation failure. Use per-call scratch with cleanup or attach it to host thread teardown.
@ -0,0 +66,4 @@
*mask = 0;
if (n > VC_LINEAR) {
uint32_t cap = 64;
while (cap < 2 * n) cap <<= 1;
Member

L13: The power-of-two capacity can wrap to zero for a positive count above 2^30 and loop indefinitely. The entry check also allocates for the full list before applying its output cap. Bound the fast path before allocating, check capacity arithmetic, and route oversized lists to an existing continuation.

**L13**: The power-of-two capacity can wrap to zero for a positive count above 2^30 and loop indefinitely. The entry check also allocates for the full list before applying its output cap. Bound the fast path before allocating, check capacity arithmetic, and route oversized lists to an existing continuation.
@ -0,0 +162,4 @@
const uint32_t m = n < u ? n : u; /* (the sorted range: csel w27, w23, lo) */
{ /* std::sort of the first m entries by key, largest first: unique keys, so the result is the only sorted order */
uint8_t *t = (uint8_t *)A64_PTR(T);
for (uint32_t i = 1; i < m; i++) { /* (insertion sort: m is small on this path) */
Member

L29 (minor): The u16 array’s slow path replaces the guest sort with insertion sort. A large alternate-stride list with ascending unique keys causes quadratic entry moves on top of the existing searches. The reported load benchmark should include this case or the path should keep the guest sort.

**L29** (minor): The u16 array’s slow path replaces the guest sort with insertion sort. A large alternate-stride list with ascending unique keys causes quadratic entry moves on top of the existing searches. The reported load benchmark should include this case or the path should keep the guest sort.
@ -0,0 +118,4 @@
}
return;
}
} else if (RECOMP_FPX_OPEN(c) && vfx_emitter_rows_8125f840(x20, x20 + 0xac0, ve_range, &why)) {
Member

L4: The native matrix path returns without marking either written span. The kernel writes both spans directly, and the adjacent marked writes can sit on a different page. Mark both output spans after a successful native write and add a fixture with the spans on separate pages.

**L4**: The native matrix path returns without marking either written span. The kernel writes both spans directly, and the adjacent marked writes can sit on a different page. Mark both output spans after a successful native write and add a fixture with the spans on separate pages.
@ -0,0 +352,4 @@
const uint32_t s0 = e32(E, 0xe8), w8 = e32(E, 0xc8), w10 = e32(E, 0x7c);
if (w9 != w8) {
const uint64_t x11 = e64(E, 0x970);
for (;;) { /* 0x8125f69c */
Member

L5: The whole-routine replacements drop loop back-edge polls. A long particle-ring scan here, a draw module-table walk at oot_vfx.c:308, or resource dedupe and sorting in vfx_create.c can keep a virtual core after a higher-priority thread requests it. Preserve the translated checkpoints or add bounded polling to the replacement loops. Test that a request is serviced before a long scan completes.

**L5**: The whole-routine replacements drop loop back-edge polls. A long particle-ring scan here, a draw module-table walk at oot_vfx.c:308, or resource dedupe and sorting in vfx_create.c can keep a virtual core after a higher-priority thread requests it. Preserve the translated checkpoints or add bounded polling to the replacement loops. Test that a request is serviced before a long scan completes.
@ -0,0 +99,4 @@
/* the routine's constants as the image has them; compared once (read-only data) */
static int g_consts_state; /* 0 not looked at, 1 equal, -1 different or unreachable */
static const uint8_t EXPECT[] = {
Member

L14: The expected-byte table is presented as bytes taken from the game image. The velocity table at vfx_velocity.c:168 has the same provenance issue. The repository forbids committing even small samples from the game. Express independently derived lane selectors and mathematical constants as such with their provenance, and keep image-derived validation on the player’s machine.

**L14**: The expected-byte table is presented as bytes taken from the game image. The velocity table at vfx_velocity.c:168 has the same provenance issue. The repository forbids committing even small samples from the game. Express independently derived lane selectors and mathematical constants as such with their provenance, and keep image-derived validation on the player’s machine.
host/vfx_powf.c Outdated
@ -0,0 +4,4 @@
The files below are optimized-routines v23.01 (https://github.com/ARM-software/optimized-routines), verbatim but for
their includes: math/math_config.h, math/math_errf.c, math/powf_log2_data.c, math/exp2f_data.c, math/powf.c.
Copyright (c) 2017-2022, Arm Limited. SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception (taken here
Member

L16: The Arm source is taken under MIT, but the vendored copy supplies only the SPDX identifier and copyright. Include the upstream MIT permission and warranty notice and retain the provenance alongside the copied source.

**L16**: The Arm source is taken under MIT, but the vendored copy supplies only the SPDX identifier and copyright. Include the upstream MIT permission and warranty notice and retain the provenance alongside the copied source.
host/vfx_powf.c Outdated
@ -0,0 +22,4 @@
#define __math_invalidf vfx_or_math_invalidf
#define __math_check_oflowf vfx_or_math_check_oflowf
#define __math_check_uflowf vfx_or_math_check_uflowf
#if defined(__clang__)
Member

L17: The claimed matching powf configuration uses fused polynomial steps, but only Clang gets a contraction override. A GCC build using the project’s -ffp-contract=off uses separate operations. Express the required FMAs explicitly or decline the host powf on configurations whose rounding has not been established. Check a game-free reference that can detect loss of fusion.

**L17**: The claimed matching powf configuration uses fused polynomial steps, but only Clang gets a contraction override. A GCC build using the project’s -ffp-contract=off uses separate operations. Express the required FMAs explicitly or decline the host powf on configurations whose rounding has not been established. Check a game-free reference that can detect loss of fusion.
host/vfx_powf.c Outdated
@ -0,0 +941,4 @@
/* ==== (longshot) the game's powf: the above with its entry's shortcut ====
The game's f_85751000 (read in the image): |y| == 1.0 returns x as it is (y = +1: no operation, no flag) or 1 / x
(y = -1: a tail call of f_8571f880, "fdiv s0, s0, s1" with s0 = 1.0), before the code above. optimized-routines goes
through log2 / exp2 for those, one ulp off on some inputs (powf(0x3f71cd64, -1): the game 0x3f878402, this source
Member

L15: The shortcut comment commits an exact expected result sampled from the game. Replace it with an independently computed reciprocal example and keep the original comparison output local.

**L15**: The shortcut comment commits an exact expected result sampled from the game. Replace it with an independently computed reciprocal example and keep the original comparison output local.
@ -410,0 +477,4 @@
nw = sum(2 if "&c->vreg" in p.pattern else 1 for p in _WHOLE_V for m in p.findall(st) if m == v) + part.count(v)
if "v" + v not in written and (_MENTION_V.findall(st).count(v) > nw or (v in part and v not in whole)):
read.add("v" + v)
written |= {"x" + x for x in wx} | {"v" + v for v in whole}
Member

L10: The cut validator tracks writes in textual order across alternatives. A register initialized only inside the fast-float arm is treated as initialized when the exact arm reads it. The cut can then pass while the host leaves that register unset. Validate definite writes on every path, including the exact arm after undo, and add a fixture with a fast-arm-only initialization.

**L10**: The cut validator tracks writes in textual order across alternatives. A register initialized only inside the fast-float arm is treated as initialized when the exact arm reads it. The cut can then pass while the host leaves that register unset. Validate definite writes on every path, including the exact arm after undo, and add a fixture with a fast-arm-only initialization.
@ -410,0 +551,4 @@
found = 0
for a in VFX_FUNCS:
head = VFX_HEAD % a
start = source.find(head)
Member

L1: The build-ID gate also accepts ExeFS-modded builds. A mod that changes the gravity routine’s arithmetic keeps the same ID and function header, so native mode returns before the patched instructions run. The same problem affects absorbed callees and the emitter’s second matrix block. Gate the hooks on unchanged code and dependencies, or withhold VFX hooks from builds with ExeFS patches. Add a synthetic patched-input case.

**L1**: The build-ID gate also accepts ExeFS-modded builds. A mod that changes the gravity routine’s arithmetic keeps the same ID and function header, so native mode returns before the patched instructions run. The same problem affects absorbed callees and the emitter’s second matrix block. Gate the hooks on unchanged code and dependencies, or withhold VFX hooks from builds with ExeFS patches. Add a synthetic patched-input case.
Member

L28 (minor): The off build still changes register localization, emits an external hook call and duplicates two blocks in the lift. Compare the current off build to the base for clean build time, output size, frame times and peak RAM. Include native-mode scratch memory in the load measurements.

**L28** (minor): The off build still changes register localization, emits an external hook call and duplicates two blocks in the lift. Compare the current off build to the base for clean build time, output size, frame times and peak RAM. Include native-mode scratch memory in the load measurements.
@ -1891,6 +2076,9 @@ def report(paths, counts, protect_hearts=False):
if protect_hearts and total["sprint press"] != len(SPRINT_HEADS): # (without it Sprint's A rolls and acts as a press)
print("oot_patches: WARNING: the controllers' press was found in %d of %d functions (Sprint's A is a press there)"
% (total["sprint press"], len(SPRINT_HEADS)))
if protect_hearts and total["particle hooks"] != len(VFX_FUNCS) + len(VFX_CUTS): # (HOS_NATIVE_VFX: the others then run as lifted)
Member

L25 (minor): The description says a warning names the missing place, but the build reports only a total. If one split chunk loses its emission cut, the log cannot identify it. Report missing or duplicate hooks by routine and cut, and describe check mode’s actual comparison scope in the startup line and switch row.

**L25** (minor): The description says a warning names the missing place, but the build reports only a total. If one split chunk loses its emission cut, the log cannot identify it. Report missing or duplicate hooks by routine and cut, and describe check mode’s actual comparison scope in the startup line and switch row.
@ -0,0 +166,4 @@
self.assertIsNone(P.patch_vfx(HEADER + fn("80000000", " return;\n")))
def test_patch_file_reports(self):
out, counts, lines = P.patch_file(HEADER + GRAVITY + DRAW + CREATE + ENTRIES + VELOCITY + EMISSION + EMITTER, "code_x.c", True)
Member

L23 (minor): The patch test exercises the supported build and an unrelated function, but never submits the same seven matching functions for an unsupported build. Removing the build gate would pass. Call patch_file with the unsupported flag and assert the text and counts are untouched.

**L23** (minor): The patch test exercises the supported build and an unrelated function, but never submits the same seven matching functions for an unsupported build. Removing the build gate would pass. Call patch_file with the unsupported flag and assert the text and counts are untouched.
@ -0,0 +363,4 @@
def main():
p = argparse.ArgumentParser(description=__doc__)
p.add_argument("--cc", default="clang")
Member

L20: All five compiler fixtures ignore CC and silently substitute another compiler even when an explicit --cc cannot be found. On Windows this can choose a PATH clang targeting MSVC, or report a skip with the configured llvm-mingw installed elsewhere. Resolve the configured toolchain on both platforms and surface a missing explicit compiler through the test runner.

**L20**: All five compiler fixtures ignore CC and silently substitute another compiler even when an explicit --cc cannot be found. On Windows this can choose a PATH clang targeting MSVC, or report a skip with the configured llvm-mingw installed elsewhere. Resolve the configured toolchain on both platforms and surface a missing explicit compiler through the test runner.
@ -0,0 +62,4 @@
#include "vfx_emission.h"
uint8_t t_mem[1 << 16];
void a64_icall(Ctx *c, uint64_t t) { (void)c, (void)t; abort(); }
void *test_range(uint64_t a, uint64_t n) { (void)a, (void)n; return NULL; } /* (nothing in range: the routine declines) */
Member

L22: The emission fixture always refuses guest memory, so a broken accepted emission path still passes. The velocity fixture likewise checks helpers and declines only, and no checked-in fixture exercises the draw hook. Add synthetic accepted calls that assert actual writes, guest call order and state, with a regression case for each hook fix in this review.

**L22**: The emission fixture always refuses guest memory, so a broken accepted emission path still passes. The velocity fixture likewise checks helpers and declines only, and no checked-in fixture exercises the draw hook. Add synthetic accepted calls that assert actual writes, guest call order and state, with a regression case for each hook fix in this review.
@ -0,0 +115,4 @@
r = subprocess.run([cc, "-std=gnu11", "-O2", "-march=x86-64-v3", "-ffp-contract=off", "-Wall", "-Wextra",
"-DVFX_EMISSION_TEST", "-I", str(tmp), "-I", str(ROOT / "host"), str(tmp / "fixture.c"),
str(ROOT / "host" / "vfx_emission.c"), str(ROOT / "host" / "vfx_kernels.c"),
str(ROOT / "host" / "vfx_powf.c"), "-o", str(exe)],
Member

L18: The Linux fixture links calls to fmodf, round and lround without libm. Add -lm after the objects on Linux, as the kernel fixture does.

**L18**: The Linux fixture links calls to fmodf, round and lround without libm. Add -lm after the objects on Linux, as the kernel fixture does.
@ -0,0 +299,4 @@
int main(int argc, char **argv) {
out = fopen(argc > 1 ? argv[1] : "out.bin", "wb");
setup_image();
Member

L21 (minor): The fixture opens a full temporary path through narrow fopen and uses the result unchecked. A Windows temp directory with characters outside the CRT code page can make the open fail and lead to fwrite on a null stream. Set the child cwd and pass an ASCII filename, or use a wide path, and check file errors.

**L21** (minor): The fixture opens a full temporary path through narrow fopen and uses the result unchecked. A Windows temp directory with characters outside the CRT code page can make the open fail and lead to fwrite on a null stream. Set the child cwd and pass an ASCII filename, or use a wide path, and check file errors.
@ -0,0 +331,4 @@
fast = "-ffp-contract=fast-honor-pragmas" if "clang" in os.path.basename(cc) else "-ffp-contract=fast"
for tag, extra in (("as built", ["-ffp-contract=off"]), (fast[1:], [fast])):
exe = tmp / ("fixture_%d%s" % (len(outs), ".exe" if os.name == "nt" else ""))
r = subprocess.run([cc, "-std=gnu11", "-O2", "-march=x86-64-v3", "-DVFX_EXPECT_FMA", "-Wall", "-Wextra",
Member

L19: The kernel, emission and velocity fixtures build and execute x86-64-v3 binaries unconditionally. A supported pre-AVX2 CPU can compile these and then fault when running them, before testing the fallback. Run a baseline fixture first and gate the v3 run on CPU and OS capability, or dispatch from a baseline binary.

**L19**: The kernel, emission and velocity fixtures build and execute x86-64-v3 binaries unconditionally. A supported pre-AVX2 CPU can compile these and then fault when running them, before testing the fallback. Run a baseline fixture first and gate the v3 run on CPU and OS capability, or dispatch from a baseline binary.
Owner
@fix
Owner

@Beanstalk

@Beanstalk
Member
Beanstalk test farm · an earlier run: commit bd26d03 (the newer results are in a comment below)

Commit bd26d03 · approved by HumanBean (reviewed) · dashboard

⚠️ Note: Check mode compares only the portions implemented by its in-game checks; a clean log does not prove every native routine or fallback was exercised.
⚠️ Note: The enabled and check-mode cells measure different workloads, so check-mode frame times include diagnostic overhead. The switch-off PR build is not separately measured.

Started at 07:29 UTC.

Estimate: done in about 2 h, from the queue and the testers online now.

Target Result Reports VRAM peak (MB) Crashes
any 🔄 running 0 of 1 — —

particle-areas · frame time p99 (ms)

Target main HOS_NATIVE_VFX=1 (reference) HOS_NATIVE_VFX=check
any — — —
What was tested

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

The plan compares main with native particle routines enabled and with their check mode in the Market, Kakariko Village, and Death Mountain Trail. It measures frame time, memory, and area-load time, compares pictures, and fails on crashes, substantial performance regressions, or reported VFX mismatches. Lift-stage builds are timed separately; the gameplay runs take about 20 minutes per tester.

  • Where: any (any PC, 1-2 reports).
  • Matrix: 2 cells, each on main and the PR: HOS_NATIVE_VFX 1 or check (PR only).
  • particle-areas: from the repository's save market-entrance, then move the stick, measure market for 30 s (after 5 s warm-up), take the picture market to compare with main, teleport to Kakariko Village, measure kakariko for 30 s (after 5 s warm-up), take the picture kakariko to compare with main, teleport to Death Mountain Trail, measure trail for 30 s (after 5 s warm-up), take the picture trail to compare with main; 1 run on each side for each of 2 cells (2 game starts a run).
  • Build times: main and the PR each built 2 times, alternating, each whole in a fresh folder: the lift again (no kept lift, main's compiled objects kept); every stage timed (shader preparation is not), and the lifted C compared.
  • Measured: crashes, frame times, stutters and hitches, memory and CPU time, load times, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 5%; or peak memory is more than 15% above main; or the lift's time is more than 15% above main; or longest load is more than 30% above main; or frame time (p99) is more than 30% above main; or forbidden log lines is above 0.
  • Time: about 27 min of game runs per tester (4 game starts), plus the two builds and 4 timed builds (about 80 min).
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>bd26d03</code> (the newer results are in a comment below)</summary> Commit `bd26d03` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2001) ⚠️ **Note:** Check mode compares only the portions implemented by its in-game checks; a clean log does not prove every native routine or fallback was exercised. ⚠️ **Note:** The enabled and check-mode cells measure different workloads, so check-mode frame times include diagnostic overhead. The switch-off PR build is not separately measured. Started at 07:29 UTC. **Estimate:** done in about 2 h, from the queue and the testers online now. | Target | Result | Reports | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | | `any` | 🔄 running | 0 of 1 | — | — | **`particle-areas`** · frame time p99 (ms) | Target | main | `HOS_NATIVE_VFX=1` (reference) | `HOS_NATIVE_VFX=check` | | --- | --- | --- | --- | | `any` | — | — | — | <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares main with native particle routines enabled and with their check mode in the Market, Kakariko Village, and Death Mountain Trail. It measures frame time, memory, and area-load time, compares pictures, and fails on crashes, substantial performance regressions, or reported VFX mismatches. Lift-stage builds are timed separately; the gameplay runs take about 20 minutes per tester. - **Where:** any (any PC, 1-2 reports). - **Matrix:** 2 cells, each on main and the PR: HOS_NATIVE_VFX `1` or `check` (PR only). - **particle-areas:** from the repository's save `market-entrance`, then move the stick, measure market for 30 s (after 5 s warm-up), take the picture market to compare with main, teleport to Kakariko Village, measure kakariko for 30 s (after 5 s warm-up), take the picture kakariko to compare with main, teleport to Death Mountain Trail, measure trail for 30 s (after 5 s warm-up), take the picture trail to compare with main; 1 run on each side for each of 2 cells (2 game starts a run). - **Build times:** main and the PR each built 2 times, alternating, each whole in a fresh folder: the lift again (no kept lift, main's compiled objects kept); every stage timed (shader preparation is not), and the lifted C compared. - **Measured:** crashes, frame times, stutters and hitches, memory and CPU time, load times, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 5%; or peak memory is more than 15% above main; or the lift's time is more than 15% above main; or longest load is more than 30% above main; or frame time (p99) is more than 30% above main; or forbidden log lines is above 0. - **Time:** about 27 min of game runs per tester (4 game starts), plus the two builds and 4 timed builds (about 80 min). </details> </details>
Member

I changed this pull request as the review asked: the new head is ada9f122a2. I rebased it onto main (7486869e64).

Changed

  • Matrix page marks: host/vfx_emitter.c:121 marks both native output spans; tests/test_vfx_emitter.py:204 checks spans on separate pages. The test was not run.
  • Fast-float definite writes: nx2/oot_patches.py:468 tracks writes separately across fast and exact arms; tests/test_oot_vfx_patch.py:131 adds the fast-only initialization case. The test was not run.
  • Draw plan lifetime: host/oot_vfx.c:325 gives each invocation its own stack plan.
  • Resource scratch lifetime: host/vfx_create.c:88 uses per-call scratch and frees it on success and allocation or range failure.
  • Bound resource collection scratch: host/vfx_create.c:92 limits input size before allocation and checks the entry comparison’s output capacity before collection.
  • Express derived VFX constants: host/vfx_kernels.c:100 and host/vfx_velocity.c:165 express lane selectors from lane numbers and identify the IEEE-754 vectors; validation remains against the player’s image.
  • Link the Linux emission fixture with libm: tests/test_vfx_emission.py:118 adds -lm after the source inputs on non-Windows hosts. No tests or builds were run.
  • v3 fixture capability gate: tests/vfx_test_support.py:25 checks CPU features and OS AVX state before v3 execution; the three fixtures first exercise a baseline build. No tests were run.
  • Fixture compiler selection: tests/vfx_test_support.py:8 resolves --cc, CC and llvm-mingw without silently replacing a missing configured compiler; all five fixtures use it.
  • Exercise the image patch application and lift gate: tests/test_oot_vfx_patch.py:183 constructs patched and unpatched EdenImage instances and passes their production-assigned state through the lift gate. Tests were not run.
  • Remove the game-sampled shortcut result: host/vfx_powf.c:962 replaces the sampled result with the independently computed reciprocal of 2.0.
  • Include the upstream MIT notice: host/vfx_powf.c:11 includes the permission and warranty notice alongside the Arm provenance.

Not done this time (still open: the next @fix takes it)

  • Avoid copying the concurrently updated poll field: Velocity check mode still needs register-only state handling or a private trial context that excludes poll.
  • Keep velocity trial writes private: Velocity check mode still needs private output staging so only the lifted call writes guest memory.
  • Poll during replacement loops: The ring, module-table and resource loops need bounded polling and a long-scan service test.
  • Preserve bounded guest libc copies: The draw copies need the lifted copy calls or a shared bounded helper that respects HOS_GUEST_LIBC.
  • Compare draw results before callbacks: Draw check mode needs a comparison at the callback boundary covering the word and copies, or an accurately labeled and tested narrower comparison.
  • Handle copy-source alias with the active triple: The draw path needs guest-order writes or an alias decline, plus a regression test.
  • Secure speculative guest accesses: Draw planning and velocity checking need live-span lifetime guarantees or must leave speculative accesses to the lifted path.
  • Make powf fusion portable: The polynomial needs explicit fused operations or a compiler gate, plus a game-free reference that detects lost fusion.
  • Test accepted emission, velocity and draw calls: Synthetic accepted-call fixtures must check writes, guest call order and state, including the hook regressions.

Nothing was built or run: check the change. It will be reviewed again.


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

I changed this pull request as the review asked: the new head is ada9f122a20e. I rebased it onto `main` (7486869e64b1). **Changed** - **Matrix page marks**: host/vfx_emitter.c:121 marks both native output spans; tests/test_vfx_emitter.py:204 checks spans on separate pages. The test was not run. - **Fast-float definite writes**: nx2/oot_patches.py:468 tracks writes separately across fast and exact arms; tests/test_oot_vfx_patch.py:131 adds the fast-only initialization case. The test was not run. - **Draw plan lifetime**: host/oot_vfx.c:325 gives each invocation its own stack plan. - **Resource scratch lifetime**: host/vfx_create.c:88 uses per-call scratch and frees it on success and allocation or range failure. - **Bound resource collection scratch**: host/vfx_create.c:92 limits input size before allocation and checks the entry comparison’s output capacity before collection. - **Express derived VFX constants**: host/vfx_kernels.c:100 and host/vfx_velocity.c:165 express lane selectors from lane numbers and identify the IEEE-754 vectors; validation remains against the player’s image. - **Link the Linux emission fixture with libm**: tests/test_vfx_emission.py:118 adds -lm after the source inputs on non-Windows hosts. No tests or builds were run. - **v3 fixture capability gate**: tests/vfx_test_support.py:25 checks CPU features and OS AVX state before v3 execution; the three fixtures first exercise a baseline build. No tests were run. - **Fixture compiler selection**: tests/vfx_test_support.py:8 resolves --cc, CC and llvm-mingw without silently replacing a missing configured compiler; all five fixtures use it. - **Exercise the image patch application and lift gate**: tests/test_oot_vfx_patch.py:183 constructs patched and unpatched EdenImage instances and passes their production-assigned state through the lift gate. Tests were not run. - **Remove the game-sampled shortcut result**: host/vfx_powf.c:962 replaces the sampled result with the independently computed reciprocal of 2.0. - **Include the upstream MIT notice**: host/vfx_powf.c:11 includes the permission and warranty notice alongside the Arm provenance. **Not done this time (still open: the next `@fix` takes it)** - **Avoid copying the concurrently updated poll field**: Velocity check mode still needs register-only state handling or a private trial context that excludes poll. - **Keep velocity trial writes private**: Velocity check mode still needs private output staging so only the lifted call writes guest memory. - **Poll during replacement loops**: The ring, module-table and resource loops need bounded polling and a long-scan service test. - **Preserve bounded guest libc copies**: The draw copies need the lifted copy calls or a shared bounded helper that respects HOS_GUEST_LIBC. - **Compare draw results before callbacks**: Draw check mode needs a comparison at the callback boundary covering the word and copies, or an accurately labeled and tested narrower comparison. - **Handle copy-source alias with the active triple**: The draw path needs guest-order writes or an alias decline, plus a regression test. - **Secure speculative guest accesses**: Draw planning and velocity checking need live-span lifetime guarantees or must leave speculative accesses to the lifted path. - **Make powf fusion portable**: The polynomial needs explicit fused operations or a compiler gate, plus a game-free reference that detects lost fusion. - **Test accepted emission, velocity and draw calls**: Synthetic accepted-call fixtures must check writes, guest call order and state, including the hook regressions. Nothing was built or run: check the change. It will be reviewed again. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
BeanBot force-pushed perf/native-vfx-pr from bd26d039d0
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 7s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/any 0/1 pass, 2 running, 0 queued
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to ada9f122a2
Some checks failed
beanstalk/approval not approved yet
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 35s
CI / Conventional Commit title (pull_request) Successful in 22s
CI / Workflow lint (actionlint) (pull_request) Successful in 39s
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 27s
Third-party parts / As their notes say (pull_request) Successful in 41s
CI / Website build and checks (pull_request) Has been cancelled
2026-11-21 07:42:46 +00:00
Compare
Member

Beanstalk test farm

Commit a9f473a · 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 `a9f473a` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2001) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
BeanBot left a comment

Recommendation: Request changes. Several correctness and scheduling defects remain in the native and check-mode paths, including live state rollback and omitted interrupt checkpoints. The in-game performance gain also remains unresolved.

The change offers native implementations of seven particle routines behind an off-by-default switch. The fix disables hooks for ExeFS-patched builds, owns temporary allocations, and marks matrix writes, but substantial correctness and testing work remains.

@fix will do (18)

  1. L2 host/oot_vfx.c:479: The whole-Ctx snapshots and assignment include poll, which another host thread atomically writes in hos_thread.c. A core reassignment requested after the first snapshot can be erased by the restore, and the plain accesses race the atomic writer. Stage velocity outputs without copying Ctx, or snapshot and restore only the guest registers and FPSR changed by the trial.
  2. L3 host/oot_vfx.c:481: The velocity trial writes and marks the live attribute stream and then rolls it back with unmarked memcpy. A concurrent page capture can consume the mark and copy the trial bytes before the rollback, defeating check mode’s promise to keep the lifted result. Compute the predicted writes in private scratch and let the lifted call be the only guest-memory writer.
  3. L5 host/vfx_emitter.c:355: The whole-routine replacements drop loop back-edge polls. A long particle-ring scan here, a draw module-table walk at oot_vfx.c:308, or resource dedupe and sorting in vfx_create.c can keep a virtual core after a higher-priority thread requests it. Preserve the translated checkpoints or add bounded polling to the replacement loops. Test that a request is serviced before a long scan completes.
  4. L6 host/oot_vfx.c:349: The direct draw copies bypass nn_libc.c’s bounded copy path. A multi-megabyte particle buffer now runs as one host memcpy, losing the interrupt polls between 256 KiB pieces and reintroducing the large-copy cache cost the libc path was written to avoid. Keep the lifted copy calls or share the bounded helper and preserve HOS_GUEST_LIBC.
  5. L7 host/oot_vfx.c:335: The draw check compares the pre-callback plan with memory after all four module loops have run. A legal callback that updates a triple or the constant block can produce a false difference, while a broken native buffer copy cannot produce any difference because that path never runs. Compare at the boundary before the callbacks and cover the word and copies, or label and test the narrower comparison.
  6. L8 host/oot_vfx.c:350: The draw plan stores the final triples, including the active slot’s reset, before copy 1. If copy 1 reads that slot, it gets the reset value instead of the clamped value present at the guest copy. The overlap check omits copy sources from its read set for this dependency. Keep clamp, copy and reset in guest order or decline this alias, and test it.
  7. L9 host/oot_vfx.c:246: hos_guest_range checks the reserved window only. A speculative input read during draw planning can touch a reserved hole before the guest reaches that operation, and velocity check mode reads every planned output before the FP gate or store decision. On Windows an in-window read can fault or commit a page. Check live readable and writable spans with their lifetimes secured before speculative host accesses, or keep those accesses on the lifted path.
  8. L17 host/vfx_powf.c:25: The claimed matching powf configuration uses fused polynomial steps, but only Clang gets a contraction override. A GCC build using the project’s -ffp-contract=off uses separate operations. Express the required FMAs explicitly or decline the host powf on configurations whose rounding has not been established. Check a game-free reference that can detect loss of fusion.
  9. L20 tests/test_vfx_create.py:366: All five compiler fixtures ignore CC and silently substitute another compiler even when an explicit --cc cannot be found. On Windows this can choose a PATH clang targeting MSVC, or report a skip with the configured llvm-mingw installed elsewhere. Resolve the configured toolchain on both platforms and surface a missing explicit compiler through the test runner.
  10. L21 (minor) tests/test_vfx_kernels.py:302: The fixture opens a full temporary path through narrow fopen and uses the result unchecked. A Windows temp directory with characters outside the CRT code page can make the open fail and lead to fwrite on a null stream. Set the child cwd and pass an ASCII filename, or use a wide path, and check file errors.
  11. L22 tests/test_vfx_emission.py:65: The emission fixture always refuses guest memory, so a broken accepted emission path still passes. The velocity fixture likewise checks helpers and declines only, and no checked-in fixture exercises the draw hook. Add synthetic accepted calls that assert actual writes, guest call order and state, with a regression case for each hook fix in this review.
  12. L23 (minor) tests/test_oot_vfx_patch.py:169: The patch test exercises the supported build and an unrelated function, but never submits the same seven matching functions for an unsupported build. Removing the build gate would pass. Call patch_file with the unsupported flag and assert the text and counts are untouched.
  13. L24 (minor) host/oot_vfx.c:94: Cumulative counters use 32-bit long on Windows. After about 2.15 billion calls, the totals go negative and the threshold subtraction can overflow. Independent flushes can already print totals with buckets from different batches. Use 64-bit counters and either snapshot a coherent interval or document the concurrent snapshot as approximate.
  14. L25 (minor) nx2/oot_patches.py:2079: The description says a warning names the missing place, but the build reports only a total. If one split chunk loses its emission cut, the log cannot identify it. Report missing or duplicate hooks by routine and cut, and describe check mode’s actual comparison scope in the startup line and switch row.
  15. L26 (minor) host/oot_vfx.c:69: The enum accepts any value beginning with c as check and almost any other truthy value as on. For example, a mistyped check value can silently activate native mode. Match the documented values explicitly, diagnose invalid values and stay off.
  16. L27 (its part an edit can do): Keep the gated paths independently selectable during measurement so load-only code and whole-frame code can be evaluated separately.
  17. L28 (its part an edit can do) nx2/oot_patches.py:554: Preserve the normal localized fallback and materialize hook inputs only on the enabled branch where possible.
  18. L29 (its part an edit can do) host/vfx_create.c:165: Reuse the lifted sort for the slow path or use the same bounded-complexity sort as the fast path where ties are impossible.

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

  • L27 (minor): Run the current head against the current base on the same settings and hardware, including Windows, Linux/RADV and Steam Deck. Cover the heavy scene, Market and first spawns. Include uncapped frame times, capped CPU and cold/warm loads. The existing runs cannot settle either the benefit or the default.
  • L28 (minor) nx2/oot_patches.py:554: The off build still changes register localization, emits an external hook call and duplicates two blocks in the lift. Compare the current off build to the base for clean build time, output size, frame times and peak RAM. Include native-mode scratch memory in the load measurements.
  • L29 (minor) host/vfx_create.c:165: The u16 array’s slow path replaces the guest sort with insertion sort. A large alternate-stride list with ascending unique keys causes quadratic entry moves on top of the existing searches. The reported load benchmark should include this case or the path should keep the guest sort.

Since the last review (on bd26d039d0)
Resolved: L1 (The build-ID gate also accepts ExeFS-modded builds. A mod that changes the gravity routine…); L4 (The native matrix path returns without marking either written span. The kernel writes both…); L10 (The cut validator tracks writes in textual order across alternatives. A register initializ…); L11 (The draw plan is allocated once per host thread and never freed. It is also shared across…); L12 (The three realloc-backed TLS buffers have no cleanup. A loader worker that processes a lar…); L13 (The power-of-two capacity can wrap to zero for a positive count above 2^30 and loop indefi…); L14 (The expected-byte table is presented as bytes taken from the game image. The velocity tabl…); L15 (The shortcut comment commits an exact expected result sampled from the game. Replace it wi…); L16 (The Arm source is taken under MIT, but the vendored copy supplies only the SPDX identifier…); L18 (The Linux fixture links calls to fmodf, round and lround without libm. Add -lm after the o…); L19 (The kernel, emission and velocity fixtures build and execute x86-64-v3 binaries unconditio…)
Still open: L2 (The whole-Ctx snapshots and assignment include poll, which another host thread atomically…); L3 (The velocity trial writes and marks the live attribute stream and then rolls it back with…); L5 (The whole-routine replacements drop loop back-edge polls. A long particle-ring scan here,…); L6 (The direct draw copies bypass nn_libc.c’s bounded copy path. A multi-megabyte particle buf…); L7 (The draw check compares the pre-callback plan with memory after all four module loops have…); L8 (The draw plan stores the final triples, including the active slot’s reset, before copy 1.…); L9 (hos_guest_range checks the reserved window only. A speculative input read during draw plan…); L17 (The claimed matching powf configuration uses fused polynomial steps, but only Clang gets a…); L20 (All five compiler fixtures ignore CC and silently substitute another compiler even when an…); L21 (The fixture opens a full temporary path through narrow fopen and uses the result unchecked…); L22 (The emission fixture always refuses guest memory, so a broken accepted emission path still…); L23 (The patch test exercises the supported build and an unrelated function, but never submits…); L24 (Cumulative counters use 32-bit long on Windows. After about 2.15 billion calls, the totals…); L25 (The description says a warning names the missing place, but the build reports only a total…); L26 (The enum accepts any value beginning with c as check and almost any other truthy value as…); L27 (Run the current head against the current base on the same settings and hardware, including…); L28 (The off build still changes register localization, emits an external hook call and duplica…); L29 (The u16 array’s slow path replaces the guest sort with insertion sort. A large alternate-s…)

Checks: Still running: PR description / Description follows the template (pull_request_target).

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

Does it help: Unproven in game. The reported offline routines are 1.25–8.9 times faster, but the earlier Windows Market run measured -1.3% CPU standing and +0.0% turning with the switch on, within approximately 1.5% run-to-run spread. This head has not been built or played.

Other systems: The hooks affect worker scheduling, guest-memory tracking, ExeFS mods, generated builds, and Windows and Linux test fixtures. The ExeFS gate and matrix marks were added; scheduling, speculative access, Windows compiler and path handling, and Linux/RADV and Steam Deck behavior still need the checks identified in the ledger.

Switches: HOS_NATIVE_VFX is new and defaults off; 1 enables native paths and check compares selected results. Its default cannot be settled from the current measurements, and invalid values are still accepted as noted in L26.

Reviewed: ada9f122a2 against 7486869e64: Read the fix commit and its changed sections, AGENTS.md and CONTRIBUTING.md, and relevant callers and fixtures for ledger items. Skimmed the remaining pull request description and recorded results. Did not read every changed file in full, the review checklist, the pull request template, or all referenced developer standards; the network was unavailable.; nothing run (a code review).

Checked and fine:

  • The ExeFS-patched synthetic input exercises the new hook gate.
  • The matrix fixture checks marks for spans on separate pages.
  • The new allocation paths release their owned scratch on the inspected exits.
  • The vendored Arm source now carries its MIT notice.

Testing: Read-only review; no builds, tests or project scripts were run. The supplied CI report has no head-only failures and one description check still running. The author's earlier Windows check-mode runs reported no differences, but this head has not been played.

Overlaps and merge order: Not checked; the network was unavailable.


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

**Recommendation: Request changes.** Several correctness and scheduling defects remain in the native and check-mode paths, including live state rollback and omitted interrupt checkpoints. The in-game performance gain also remains unresolved. The change offers native implementations of seven particle routines behind an off-by-default switch. The fix disables hooks for ExeFS-patched builds, owns temporary allocations, and marks matrix writes, but substantial correctness and testing work remains. **`@fix` will do (18)** 1. **L2** `host/oot_vfx.c:479`: The whole-Ctx snapshots and assignment include poll, which another host thread atomically writes in hos_thread.c. A core reassignment requested after the first snapshot can be erased by the restore, and the plain accesses race the atomic writer. Stage velocity outputs without copying Ctx, or snapshot and restore only the guest registers and FPSR changed by the trial. 2. **L3** `host/oot_vfx.c:481`: The velocity trial writes and marks the live attribute stream and then rolls it back with unmarked memcpy. A concurrent page capture can consume the mark and copy the trial bytes before the rollback, defeating check mode’s promise to keep the lifted result. Compute the predicted writes in private scratch and let the lifted call be the only guest-memory writer. 3. **L5** `host/vfx_emitter.c:355`: The whole-routine replacements drop loop back-edge polls. A long particle-ring scan here, a draw module-table walk at oot_vfx.c:308, or resource dedupe and sorting in vfx_create.c can keep a virtual core after a higher-priority thread requests it. Preserve the translated checkpoints or add bounded polling to the replacement loops. Test that a request is serviced before a long scan completes. 4. **L6** `host/oot_vfx.c:349`: The direct draw copies bypass nn_libc.c’s bounded copy path. A multi-megabyte particle buffer now runs as one host memcpy, losing the interrupt polls between 256 KiB pieces and reintroducing the large-copy cache cost the libc path was written to avoid. Keep the lifted copy calls or share the bounded helper and preserve HOS_GUEST_LIBC. 5. **L7** `host/oot_vfx.c:335`: The draw check compares the pre-callback plan with memory after all four module loops have run. A legal callback that updates a triple or the constant block can produce a false difference, while a broken native buffer copy cannot produce any difference because that path never runs. Compare at the boundary before the callbacks and cover the word and copies, or label and test the narrower comparison. 6. **L8** `host/oot_vfx.c:350`: The draw plan stores the final triples, including the active slot’s reset, before copy 1. If copy 1 reads that slot, it gets the reset value instead of the clamped value present at the guest copy. The overlap check omits copy sources from its read set for this dependency. Keep clamp, copy and reset in guest order or decline this alias, and test it. 7. **L9** `host/oot_vfx.c:246`: hos_guest_range checks the reserved window only. A speculative input read during draw planning can touch a reserved hole before the guest reaches that operation, and velocity check mode reads every planned output before the FP gate or store decision. On Windows an in-window read can fault or commit a page. Check live readable and writable spans with their lifetimes secured before speculative host accesses, or keep those accesses on the lifted path. 8. **L17** `host/vfx_powf.c:25`: The claimed matching powf configuration uses fused polynomial steps, but only Clang gets a contraction override. A GCC build using the project’s -ffp-contract=off uses separate operations. Express the required FMAs explicitly or decline the host powf on configurations whose rounding has not been established. Check a game-free reference that can detect loss of fusion. 9. **L20** `tests/test_vfx_create.py:366`: All five compiler fixtures ignore CC and silently substitute another compiler even when an explicit --cc cannot be found. On Windows this can choose a PATH clang targeting MSVC, or report a skip with the configured llvm-mingw installed elsewhere. Resolve the configured toolchain on both platforms and surface a missing explicit compiler through the test runner. 10. **L21** (minor) `tests/test_vfx_kernels.py:302`: The fixture opens a full temporary path through narrow fopen and uses the result unchecked. A Windows temp directory with characters outside the CRT code page can make the open fail and lead to fwrite on a null stream. Set the child cwd and pass an ASCII filename, or use a wide path, and check file errors. 11. **L22** `tests/test_vfx_emission.py:65`: The emission fixture always refuses guest memory, so a broken accepted emission path still passes. The velocity fixture likewise checks helpers and declines only, and no checked-in fixture exercises the draw hook. Add synthetic accepted calls that assert actual writes, guest call order and state, with a regression case for each hook fix in this review. 12. **L23** (minor) `tests/test_oot_vfx_patch.py:169`: The patch test exercises the supported build and an unrelated function, but never submits the same seven matching functions for an unsupported build. Removing the build gate would pass. Call patch_file with the unsupported flag and assert the text and counts are untouched. 13. **L24** (minor) `host/oot_vfx.c:94`: Cumulative counters use 32-bit long on Windows. After about 2.15 billion calls, the totals go negative and the threshold subtraction can overflow. Independent flushes can already print totals with buckets from different batches. Use 64-bit counters and either snapshot a coherent interval or document the concurrent snapshot as approximate. 14. **L25** (minor) `nx2/oot_patches.py:2079`: The description says a warning names the missing place, but the build reports only a total. If one split chunk loses its emission cut, the log cannot identify it. Report missing or duplicate hooks by routine and cut, and describe check mode’s actual comparison scope in the startup line and switch row. 15. **L26** (minor) `host/oot_vfx.c:69`: The enum accepts any value beginning with c as check and almost any other truthy value as on. For example, a mistyped check value can silently activate native mode. Match the documented values explicitly, diagnose invalid values and stay off. 16. **L27** (its part an edit can do): Keep the gated paths independently selectable during measurement so load-only code and whole-frame code can be evaluated separately. 17. **L28** (its part an edit can do) `nx2/oot_patches.py:554`: Preserve the normal localized fallback and materialize hook inputs only on the enabled branch where possible. 18. **L29** (its part an edit can do) `host/vfx_create.c:165`: Reuse the lifted sort for the slow path or use the same bounded-complexity sort as the fast path where ties are impossible. **For the author (3)** (a run, a measurement or a decision) - **L27** (minor): Run the current head against the current base on the same settings and hardware, including Windows, Linux/RADV and Steam Deck. Cover the heavy scene, Market and first spawns. Include uncapped frame times, capped CPU and cold/warm loads. The existing runs cannot settle either the benefit or the default. - **L28** (minor) `nx2/oot_patches.py:554`: The off build still changes register localization, emits an external hook call and duplicates two blocks in the lift. Compare the current off build to the base for clean build time, output size, frame times and peak RAM. Include native-mode scratch memory in the load measurements. - **L29** (minor) `host/vfx_create.c:165`: The u16 array’s slow path replaces the guest sort with insertion sort. A large alternate-stride list with ascending unique keys causes quadratic entry moves on top of the existing searches. The reported load benchmark should include this case or the path should keep the guest sort. **Since the last review** (on bd26d039d086) Resolved: L1 (The build-ID gate also accepts ExeFS-modded builds. A mod that changes the gravity routine…); L4 (The native matrix path returns without marking either written span. The kernel writes both…); L10 (The cut validator tracks writes in textual order across alternatives. A register initializ…); L11 (The draw plan is allocated once per host thread and never freed. It is also shared across…); L12 (The three realloc-backed TLS buffers have no cleanup. A loader worker that processes a lar…); L13 (The power-of-two capacity can wrap to zero for a positive count above 2^30 and loop indefi…); L14 (The expected-byte table is presented as bytes taken from the game image. The velocity tabl…); L15 (The shortcut comment commits an exact expected result sampled from the game. Replace it wi…); L16 (The Arm source is taken under MIT, but the vendored copy supplies only the SPDX identifier…); L18 (The Linux fixture links calls to fmodf, round and lround without libm. Add -lm after the o…); L19 (The kernel, emission and velocity fixtures build and execute x86-64-v3 binaries unconditio…) Still open: L2 (The whole-Ctx snapshots and assignment include poll, which another host thread atomically…); L3 (The velocity trial writes and marks the live attribute stream and then rolls it back with…); L5 (The whole-routine replacements drop loop back-edge polls. A long particle-ring scan here,…); L6 (The direct draw copies bypass nn_libc.c’s bounded copy path. A multi-megabyte particle buf…); L7 (The draw check compares the pre-callback plan with memory after all four module loops have…); L8 (The draw plan stores the final triples, including the active slot’s reset, before copy 1.…); L9 (hos_guest_range checks the reserved window only. A speculative input read during draw plan…); L17 (The claimed matching powf configuration uses fused polynomial steps, but only Clang gets a…); L20 (All five compiler fixtures ignore CC and silently substitute another compiler even when an…); L21 (The fixture opens a full temporary path through narrow fopen and uses the result unchecked…); L22 (The emission fixture always refuses guest memory, so a broken accepted emission path still…); L23 (The patch test exercises the supported build and an unrelated function, but never submits…); L24 (Cumulative counters use 32-bit long on Windows. After about 2.15 billion calls, the totals…); L25 (The description says a warning names the missing place, but the build reports only a total…); L26 (The enum accepts any value beginning with c as check and almost any other truthy value as…); L27 (Run the current head against the current base on the same settings and hardware, including…); L28 (The off build still changes register localization, emits an external hook call and duplica…); L29 (The u16 array’s slow path replaces the guest sort with insertion sort. A large alternate-s…) **Checks:** Still running: `PR description / Description follows the template (pull_request_target)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in game. The reported offline routines are 1.25–8.9 times faster, but the earlier Windows Market run measured -1.3% CPU standing and +0.0% turning with the switch on, within approximately 1.5% run-to-run spread. This head has not been built or played. **Other systems:** The hooks affect worker scheduling, guest-memory tracking, ExeFS mods, generated builds, and Windows and Linux test fixtures. The ExeFS gate and matrix marks were added; scheduling, speculative access, Windows compiler and path handling, and Linux/RADV and Steam Deck behavior still need the checks identified in the ledger. **Switches:** HOS_NATIVE_VFX is new and defaults off; 1 enables native paths and check compares selected results. Its default cannot be settled from the current measurements, and invalid values are still accepted as noted in L26. **Reviewed:** ada9f122a20e against 7486869e64b1: Read the fix commit and its changed sections, AGENTS.md and CONTRIBUTING.md, and relevant callers and fixtures for ledger items. Skimmed the remaining pull request description and recorded results. Did not read every changed file in full, the review checklist, the pull request template, or all referenced developer standards; the network was unavailable.; nothing run (a code review). **Checked and fine:** - The ExeFS-patched synthetic input exercises the new hook gate. - The matrix fixture checks marks for spans on separate pages. - The new allocation paths release their owned scratch on the inspected exits. - The vendored Arm source now carries its MIT notice. **Testing:** Read-only review; no builds, tests or project scripts were run. The supplied CI report has no head-only failures and one description check still running. The author's earlier Windows check-mode runs reported no differences, but this head has not been played. **Overlaps and merge order:** Not checked; the network was unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
perf(host): HOS_NATIVE_VFX is on by default; =0 runs the particle routines lifted
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
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 12s
a9f473a684
docs/dev/standards.md: a switch ships at its value from the branch's first push, never off because it is new.
The row's kind is kill, unset reads as 1 (env_on_or), and the test runs unset as on and 0 / off as off.

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

HOS_NATIVE_VFX is now on by default (a9f473a6, on top of BeanBot's ada9f122), as docs/dev/standards.md asks: a switch ships at its value from the first push, not off because it is new. HOS_NATIVE_VFX=0 gives main's lifted code. The row's kind is kill, unset reads as on (env_on_or), and the test runs it unset and =1 (on), =0 and =off (off) and check; it fails when the old read is put back. No test ran the switch before, so tests/test_oot_vfx_patch.py now checks the read itself. Title and description updated to match.

`HOS_NATIVE_VFX` is now on by default (a9f473a6, on top of BeanBot's ada9f122), as docs/dev/standards.md asks: a switch ships at its value from the first push, not off because it is new. `HOS_NATIVE_VFX=0` gives main's lifted code. The row's kind is `kill`, unset reads as on (`env_on_or`), and the test runs it unset and `=1` (on), `=0` and `=off` (off) and `check`; it fails when the old read is put back. No test ran the switch before, so `tests/test_oot_vfx_patch.py` now checks the read itself. Title and description updated to match.
HumanBean left a comment

Recommendation: Close. The host kernels are the game's own Arm routines transcribed one instruction at a time, with the disassembly in the comments. CONTRIBUTING.md's Licensing section rules that out, as it did for the sibling #1911. The PR's own in-game measurement also finds no CPU saving past the noise, so a clean rewrite would not be worth it either.

For a player this would mean the same particles for slightly less CPU in seven routines of the effect library. The routines are 0.7-1.3 % of game code, and the in-game difference was not measurable. The cost is about 4,900 lines of instruction-level host code, a second vendored copy of Arm's powf, changed lifted code for the seven functions even with the switch off, and a switch that ships on.

Does it help: No, not past the noise, by the PR's own numbers. In the Market at a 60 fps cap (Windows 11, RTX 3090, Ryzen 9 5900X, three interleaved runs each, on main 068fb8eb, not this head), process CPU was -1.3 % standing and +0.0 % turning with the switch at 1, and -0.7 % / +0.1 % with it unset, against a run-to-run spread of about 1.5 %. The sampling profile put the seven routines at about 0.02 % of samples (115 of 658,000), smaller than the 97-to-133 sample gap between two "off" runs. The offline factors of 1.25x to 8.9x per call are real, but they apply to a slice too small to show up in a frame. No uncapped frame times or 1 % lows. The Test Farm run at bd26d03 has no results posted.
Other systems: this is CPU-only, on Windows and Linux, on every GPU. The scheduler is affected because the replacement loops drop the translated back-edge polls (vfx_emitter.c's ring walk, the module-table walks, vfx_create.c's searches and sort). Page marks and the renderer's capture are affected through guest writes. The build is affected too: every supported build's lift is patched, and with =0 the seven functions keep their registers in the context. Exactness rests on Unicorn harnesses that run the game's code and are not in the repository. In the game, only Windows/NVIDIA in check mode on an older base has run; Linux, AMD and the Steam Deck have not run at all.
Switches: HOS_NATIVE_VFX (new, kill row, on by default; =0 lifted, check compares). The default is not right: on is for a change measured to help, and this one measured inside the spread. Its exactness is proven only by harnesses outside the repository. I did not flip it, because the PR should close rather than ship either way.

Reviewed: a9f473a68 against 7486869e6 (its fork point; main@origin is b62932a96, and the PR conflicts with it). Read: the head comments and the kernels' structure of host/vfx_kernels.c, vfx_velocity.c, vfx_emission.c, vfx_emitter.c and vfx_create.c, with spot reads of their bodies, enough to judge provenance, not every statement; host/oot_vfx.c's gate and velocity check path; host/vfx_powf.c's head and the shortcut; nx2/oot_patches.py patch_vfx and the cut validator; nx2/chunks.py, nx2/image.py, nx2/lift.py; the switches.def row. Only skimmed: the six test files. Nothing run (a code review).
Fixed in this review: nothing. I did not rebase onto main or push: the recommendation is Close, and the blocker is the code itself, not a conflict.
Checked and fine:

  • host/vfx_powf.c is Arm optimized-routines v23.01 under MIT, with the full notice, and the shortcut in front is written from behaviour. Its provenance is fine. It duplicates main's host/libm/or/powf.c, though (below).
  • The build-side change is cheap: patch_vfx is seven str.finds per lifted file. The ExeFS gate (exefs_patch_bytes == 0 from exefs_patches.apply's count) does what the comment says.
  • The hooks are only placed in the supported build, and patching again changes nothing.
  • The cut functions are made from the lift's output on the player's PC, not committed.

Blocking (why this should close)

  1. host/vfx_kernels.c:13: "The code is the game's instruction sequence, statement for statement (addresses in the comments)". The kernels carry the game's registers as variables (v0..v5, w9, x19), each statement is one Arm instruction (k_fmls(&k, v4, v5, v1), v_sel(v0, v2, v3); /* bsl v0, v2, v3 */), and the comments hold the disassembly with guest addresses (:268 /* fmadd s0, s6, s3, s0 */, :472 /* stp q2, q18, [sp] */, /* ---- 81281a14: ... */). The other files are the same: vfx_velocity.c:18 ("every float step of the game's, in its order"), vfx_emission.c:437 /* b.mi */ and :464 /* 8128b8b8: ... (s0 = 0: movi d0) */, vfx_emitter.c:357 for (;;) { /* 0x8125f69c */ with its w9/w8/x11 locals and branch targets, and vfx_create.c:157 /* csel w27, w23, lo */. tests/test_vfx_create.py:2 says its model is "written here from their instructions". This is a translation of decompiled game code, which CONTRIBUTING.md#licensing forbids ("no decompiled game code or anything generated from the dump"), the same finding that closed #1911. The fix is not an edit: the kernels would have to be written again from the behaviour (what the gravity step, the cone emission and the arrays compute) and then shown exact. Given the gain above, that is not worth doing.
  2. Carried from BeanBot's earlier review, and still open at this head (the last commit only flips the default):
    • host/oot_vfx.c:478: velocity check mode copies and restores the whole Ctx, including poll, which another thread writes atomically (L2). It also writes the live output and rolls it back without a mark (L3).
    • The whole-routine replacements have no polls in their loops (L5).
    • The draw copies bypass nn_libc's bounded copy (L6).
    • Draw check mode compares after the module callbacks (L7), and the copy-source alias is not handled (L8).
    • Speculative reads are checked against the reserved window only (L9).
  3. gpu/vk/switches.def:108: the switch ships on without a measured gain past the noise (above). docs/dev/standards.md picks a default from measurements, and these say nothing.

Suggestions

  • host/vfx_powf.c is a second vendored copy of optimized-routines' powf. Main already ships host/libm/or/powf.c with host/libm/PROVENANCE.md and the licence file, and #1904 adds a powf hook there. Any future host powf should call libm_or_powf rather than vendor it again.
  • If particle CPU is worth another try, measure first where it would show: a scene where the update is a real share of a frame, uncapped. Then write the routine from what it computes, not from its instructions.

Testing: Windows 11 / RTX 3090 check-mode runs on main 51f5f9da (two builds, no difference). This head has not been built or played. One capped CPU measurement on 068fb8eb, inside the noise. The Test Farm run at bd26d03 shows no results. Linux, AMD and the Steam Deck have not run.
Overlaps and merge order: #1904 (host powf; duplicates host/vfx_powf.c) and #1903 (effect emitter matrix, the same vfx3 area), and probably the same provenance question there. Rows in gpu/vk/switches.def and hooks in nx2/oot_patches.py shared with #1898, #1899, #1900, #1902, #1905, #1909, #1910 and #2036 (textual only). The siblings built the same way should get the same provenance check.

**Recommendation: Close.** The host kernels are the game's own Arm routines transcribed one instruction at a time, with the disassembly in the comments. CONTRIBUTING.md's Licensing section rules that out, as it did for the sibling https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1911. The PR's own in-game measurement also finds no CPU saving past the noise, so a clean rewrite would not be worth it either. For a player this would mean the same particles for slightly less CPU in seven routines of the effect library. The routines are 0.7-1.3 % of game code, and the in-game difference was not measurable. The cost is about 4,900 lines of instruction-level host code, a second vendored copy of Arm's powf, changed lifted code for the seven functions even with the switch off, and a switch that ships on. **Does it help:** No, not past the noise, by the PR's own numbers. In the Market at a 60 fps cap (Windows 11, RTX 3090, Ryzen 9 5900X, three interleaved runs each, on main 068fb8eb, not this head), process CPU was -1.3 % standing and +0.0 % turning with the switch at 1, and -0.7 % / +0.1 % with it unset, against a run-to-run spread of about 1.5 %. The sampling profile put the seven routines at about 0.02 % of samples (115 of 658,000), smaller than the 97-to-133 sample gap between two "off" runs. The offline factors of 1.25x to 8.9x per call are real, but they apply to a slice too small to show up in a frame. No uncapped frame times or 1 % lows. The Test Farm run at bd26d03 has no results posted. **Other systems:** this is CPU-only, on Windows and Linux, on every GPU. The scheduler is affected because the replacement loops drop the translated back-edge polls (vfx_emitter.c's ring walk, the module-table walks, vfx_create.c's searches and sort). Page marks and the renderer's capture are affected through guest writes. The build is affected too: every supported build's lift is patched, and with `=0` the seven functions keep their registers in the context. Exactness rests on Unicorn harnesses that run the game's code and are not in the repository. In the game, only Windows/NVIDIA in check mode on an older base has run; Linux, AMD and the Steam Deck have not run at all. **Switches:** `HOS_NATIVE_VFX` (new, `kill` row, **on** by default; `=0` lifted, `check` compares). The default is not right: on is for a change measured to help, and this one measured inside the spread. Its exactness is proven only by harnesses outside the repository. I did not flip it, because the PR should close rather than ship either way. **Reviewed:** a9f473a68 against 7486869e6 (its fork point; main@origin is b62932a96, and the PR conflicts with it). Read: the head comments and the kernels' structure of host/vfx_kernels.c, vfx_velocity.c, vfx_emission.c, vfx_emitter.c and vfx_create.c, with spot reads of their bodies, enough to judge provenance, not every statement; host/oot_vfx.c's gate and velocity check path; host/vfx_powf.c's head and the shortcut; nx2/oot_patches.py `patch_vfx` and the cut validator; nx2/chunks.py, nx2/image.py, nx2/lift.py; the switches.def row. Only skimmed: the six test files. Nothing run (a code review). **Fixed in this review:** nothing. I did not rebase onto main or push: the recommendation is Close, and the blocker is the code itself, not a conflict. **Checked and fine:** - `host/vfx_powf.c` is Arm optimized-routines v23.01 under MIT, with the full notice, and the shortcut in front is written from behaviour. Its provenance is fine. It duplicates main's `host/libm/or/powf.c`, though (below). - The build-side change is cheap: `patch_vfx` is seven `str.find`s per lifted file. The ExeFS gate (`exefs_patch_bytes == 0` from `exefs_patches.apply`'s count) does what the comment says. - The hooks are only placed in the supported build, and patching again changes nothing. - The cut functions are made from the lift's output on the player's PC, not committed. **Blocking** (why this should close) 1. `host/vfx_kernels.c:13`: "The code is the game's instruction sequence, statement for statement (addresses in the comments)". The kernels carry the game's registers as variables (`v0`..`v5`, `w9`, `x19`), each statement is one Arm instruction (`k_fmls(&k, v4, v5, v1)`, `v_sel(v0, v2, v3); /* bsl v0, v2, v3 */`), and the comments hold the disassembly with guest addresses (`:268 /* fmadd s0, s6, s3, s0 */`, `:472 /* stp q2, q18, [sp] */`, `/* ---- 81281a14: ... */`). The other files are the same: `vfx_velocity.c:18` ("every float step of the game's, in its order"), `vfx_emission.c:437 /* b.mi */` and `:464 /* 8128b8b8: ... (s0 = 0: movi d0) */`, `vfx_emitter.c:357 for (;;) { /* 0x8125f69c */` with its `w9`/`w8`/`x11` locals and branch targets, and `vfx_create.c:157 /* csel w27, w23, lo */`. `tests/test_vfx_create.py:2` says its model is "written here from their instructions". This is a translation of decompiled game code, which CONTRIBUTING.md#licensing forbids ("no decompiled game code or anything generated from the dump"), the same finding that closed https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1911. The fix is not an edit: the kernels would have to be written again from the behaviour (what the gravity step, the cone emission and the arrays compute) and then shown exact. Given the gain above, that is not worth doing. 2. Carried from BeanBot's earlier review, and still open at this head (the last commit only flips the default): - `host/oot_vfx.c:478`: velocity check mode copies and restores the whole `Ctx`, including `poll`, which another thread writes atomically (L2). It also writes the live output and rolls it back without a mark (L3). - The whole-routine replacements have no polls in their loops (L5). - The draw copies bypass nn_libc's bounded copy (L6). - Draw check mode compares after the module callbacks (L7), and the copy-source alias is not handled (L8). - Speculative reads are checked against the reserved window only (L9). 3. `gpu/vk/switches.def:108`: the switch ships on without a measured gain past the noise (above). docs/dev/standards.md picks a default from measurements, and these say nothing. **Suggestions** - `host/vfx_powf.c` is a second vendored copy of optimized-routines' powf. Main already ships `host/libm/or/powf.c` with `host/libm/PROVENANCE.md` and the licence file, and https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1904 adds a powf hook there. Any future host powf should call `libm_or_powf` rather than vendor it again. - If particle CPU is worth another try, measure first where it would show: a scene where the update is a real share of a frame, uncapped. Then write the routine from what it computes, not from its instructions. **Testing:** Windows 11 / RTX 3090 check-mode runs on main 51f5f9da (two builds, no difference). This head has not been built or played. One capped CPU measurement on 068fb8eb, inside the noise. The Test Farm run at bd26d03 shows no results. Linux, AMD and the Steam Deck have not run. **Overlaps and merge order:** https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1904 (host powf; duplicates `host/vfx_powf.c`) and https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1903 (effect emitter matrix, the same vfx3 area), and probably the same provenance question there. Rows in `gpu/vk/switches.def` and hooks in `nx2/oot_patches.py` shared with https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1898, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1899, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1900, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1902, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1905, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1909, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1910 and https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2036 (textual only). The siblings built the same way should get the same provenance check.
@ -105,6 +105,7 @@ SW(HOS_MOVIE_PACE, kill, bool, "on: a 60 FPS cap is raised for a movie's picture
SW(HOS_MUTEX_TRACE, diag, int, "0: off", "Logs mutex waits longer than <ms>, with the thread that held the mutex.")
SW(HOS_MUTEX_WATCH, diag, string, "off", "Logs every operation on the mutex at that guest address (hex) and its condition variables' signals.")
SW(HOS_MW_WAKE, kill, enum, "only changes to objects linked into a multi-wait wake WaitAny", "=all: every event, semaphore or queue change wakes every WaitAny, as before.")
SW(HOS_NATIVE_VFX, kill, enum, "on: the particle effects' routines that have a host version on host code where it gives the game's bits, the rest lifted", "=0 (or false, off, no): every call runs as lifted, as on main; 1 (or unset) runs the particle effects' routines that have a host version on host code where it gives the game's bits (f_81281850, f_81260600, f_812eed00, f_812ef8c0, f_8127a980, f_8128b800, f_8125f0e0; the float parts need FMA, or run as the lift's own code); check runs the lifted code beside them and compares, for f_8128b800 and f_8125f0e0 their blocks (slow).")
Owner

On by default without a gain past the noise: the PR's own Market runs were -1.3 % / +0.0 % against a ~1.5 % spread, and the profile put the routines at 0.02 % of samples. The measurements do not support on.

On by default without a gain past the noise: the PR's own Market runs were -1.3 % / +0.0 % against a ~1.5 % spread, and the profile put the routines at 0.02 % of samples. The measurements do not support on.
@ -0,0 +475,4 @@
if (n[i] && !(p[i] = (uint8_t *)hos_guest_range(at[i], n[i]))) return 0;
for (int i = 0; i < NR; i++)
if (n[i]) memcpy(before[i], p[i], n[i]);
const Ctx c0 = *c;
Owner

Still open from BeanBot's L2/L3: the whole Ctx is copied and restored with poll in it, which another thread writes atomically, so a core request made in between is lost. The trial's writes also land in live guest memory and are rolled back without a mark.

Still open from BeanBot's L2/L3: the whole `Ctx` is copied and restored with `poll` in it, which another thread writes atomically, so a core request made in between is lost. The trial's writes also land in live guest memory and are rolled back without a mark.
@ -0,0 +154,4 @@
p += 8;
} while (p != end);
if (!u) return;
const uint32_t m = n < u ? n : u; /* (the sorted range: csel w27, w23, lo) */
Owner

Blocking (licensing): csel w27, w23, lo. tests/test_vfx_create.py:2 also calls its model one "written here from their instructions".

**Blocking (licensing):** `csel w27, w23, lo`. tests/test_vfx_create.py:2 also calls its model one "written here from their instructions".
@ -0,0 +461,4 @@
} else {
s9 = LD32(c->x[0] + 0x394);
}
if (ve_cmp(c, g32(M, 0x58), 0) != VC_EQ) { /* 8128b8b8: the generator's slot 0x20 (s0 = 0: movi d0) */
Owner

Blocking (licensing): a guest address and the game's instruction (movi d0) for this statement. The function's control flow follows the game's branches (:437 /* b.mi */).

**Blocking (licensing):** a guest address and the game's instruction (`movi d0`) for this statement. The function's control flow follows the game's branches (`:437 /* b.mi */`).
@ -0,0 +354,4 @@
const uint32_t s0 = e32(E, 0xe8), w8 = e32(E, 0xc8), w10 = e32(E, 0x7c);
if (w9 != w8) {
const uint64_t x11 = e64(E, 0x970);
for (;;) { /* 0x8125f69c */
Owner

Blocking (licensing): the loop is the game's block at 0x8125f69c, with its registers as locals (w8, w9, w10, x11) and its branch targets in the comments. Also BeanBot's L5, still open: this loop has no poll, while the translated loop has back-edge polls.

**Blocking (licensing):** the loop is the game's block at 0x8125f69c, with its registers as locals (w8, w9, w10, x11) and its branch targets in the comments. Also BeanBot's L5, still open: this loop has no poll, while the translated loop has back-edge polls.
@ -0,0 +10,4 @@
accumulators over |x| (zero counted as 2^-63); every other operand is a constant of the routine (all in the class) or
one of those moved or masked by a bitwise step. Anything else is declined before a byte is written.
The code is the game's instruction sequence, statement for statement (addresses in the comments), on SSE vectors:
Owner

Blocking (licensing): this says the code is the game's instruction sequence, statement for statement, with the addresses in the comments, and it is. Variables named after the game's registers (v0..v5), one Arm instruction per statement, the disassembly beside them. CONTRIBUTING.md#licensing forbids decompiled game code; the same finding closed #1911.

**Blocking (licensing):** this says the code is the game's instruction sequence, statement for statement, with the addresses in the comments, and it is. Variables named after the game's registers (v0..v5), one Arm instruction per statement, the disassembly beside them. CONTRIBUTING.md#licensing forbids decompiled game code; the same finding closed https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1911.
@ -0,0 +265,4 @@
const float k0 = k_c1(&k, rdf(es, 0x18)), k1 = k_c1(&k, rdf(es, 0x1c)), k2 = k_c1(&k, rdf(es, 0x20));
const float b0 = k_c1(&k, rdf(prb, 0)), b1 = k_c1(&k, rdf(prb, 4)), b2 = k_c1(&k, rdf(prb, 8));
const float e0 = k_c1(&k, rdf(prr, 0)), e1 = k_c1(&k, rdf(prr, 4)), e2 = k_c1(&k, rdf(prr, 8));
float a0 = k_fma1(&k, b0, k0, e0), a1 = k_fma1(&k, b1, k1, e1), a2 = k_fma1(&k, b2, k2, e2); /* fmadd s0, s6, s3, s0 */
Owner

An example: /* fmadd s0, s6, s3, s0 */, the game's instruction with its registers, transcribed. The same at :472 (stp q2, q18, [sp]).

An example: `/* fmadd s0, s6, s3, s0 */`, the game's instruction with its registers, transcribed. The same at :472 (`stp q2, q18, [sp]`).
@ -0,0 +1,972 @@
/* (longshot) The game's powf for the native particle routines (host/vfx_kernels.c, HOS_NATIVE_VFX): Arm's
Owner

The provenance is fine (optimized-routines v23.01, MIT, full notice), but this is a second vendored copy: main already has host/libm/or/powf.c with host/libm/PROVENANCE.md. Call libm_or_powf instead (see also #1904).

The provenance is fine (optimized-routines v23.01, MIT, full notice), but this is a second vendored copy: main already has `host/libm/or/powf.c` with `host/libm/PROVENANCE.md`. Call `libm_or_powf` instead (see also https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1904).
@ -0,0 +15,4 @@
module's binding at +0x70 (f_8003d280: binding types 3 / 4 / 5 into the particle record, else f_812f0f60 into the
attribute stream, compared first, with the stream's dirty index range); w0 = 1.
Here: every float step of the game's, in its order, on SSE (FMADD / FMLA = fmadd, FMSUB / FMLS = fnmadd, FNMSUB =
Owner

Blocking (licensing): "every float step of the game's, in its order". The same transcription as vfx_kernels.c (e.g. :645 /* fnmsub */, :655 /* fcsel mi */).

**Blocking (licensing):** "every float step of the game's, in its order". The same transcription as vfx_kernels.c (e.g. :645 `/* fnmsub */`, :655 `/* fcsel mi */`).
Owner

Correction to my review above: host/libm/or/powf.c is not on main. It is in #1904, which hasn't merged. So host/vfx_powf.c only duplicates code if 1904 lands first; in that case, whichever merges second should call libm_or_powf and not carry a second copy. The recommendation doesn't change.

Correction to my review above: `host/libm/or/powf.c` is not on `main`. It is in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1904, which hasn't merged. So `host/vfx_powf.c` only duplicates code if 1904 lands first; in that case, whichever merges second should call `libm_or_powf` and not carry a second copy. The recommendation doesn't change.
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
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 12s
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/native-vfx-pr:snaildev99-perf/native-vfx-pr'
git switch 'snaildev99-perf/native-vfx-pr'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2001
No description provided.