WIP: perf(lift): the lane-permute idioms are written one line, not five memcpys #1202

Draft
Marcuss2 wants to merge 2 commits from Marcuss2/Longshot:perf/lift-compact-emit into main
Contributor

Type: perf · Risk: low · Tested on: Linux (RADV, RX 9070 XT) · Needs: none

Why

The per-instruction translator writes an EXT by 8 bytes and a DUP (element) as runs of memcpy through two 16-byte stack buffers: five copies for the EXT, two for the DUP, more for the byte splats. Each is a plain permutation of the 16 bytes of one vector register, so each has a one- or two-statement form on the register's two uint64_t halves (a64.h's vreg[32][2]):

{ uint8_t _s[16],_d[16]; memcpy(_s,c->vreg[21],16); memcpy(_d,c->vreg[23],16);
  memcpy(_d+8,_s+0,8); a64_vst16(c->vreg[23],_d); }          ->  { c->vreg[23][1] = c->vreg[21][0]; }

{ uint8_t _s[16]; memcpy(_s,c->vreg[17],16); uint64_t _e=0; memcpy(&_e,_s+8,4);
  uint8_t _d[16]; memset(_d,0,16); for(int _i=0;_i<2;_i++) memcpy(_d+_i*4,&_e,4);
  a64_vst16(c->vreg[17],_d); }
  ->  { uint32_t _e = (uint32_t)(c->vreg[17][1] >> 0);
        c->vreg[17][0] = (uint64_t)_e * 0x100000001ULL; c->vreg[17][1] = 0; }

There are 66,915 EXT and 41,487 DUP sites in the game's lifted C, and where a function is dense in them this is the hardest stretch of it to read: the idiom's five lines name two stack buffers that the register's bytes pass through, and the actual permutation has to be worked out from the offsets. The lifted C is what a person reads to find the next problem, and what an agent pays for by the token; one line instead of five at every one of those sites is the point of this change.

What changed

A pass over the lifted C, right after the lift, rewrites the lane moves the translator writes as runs of memcpy through 16-byte stack buffers — EXT, INS, DUP, UMOV, SMOV and the two FMOV directions — into one or two statements on the register's two halves, through the lift's own whole-register store (a64_vset128/a64_vset64, the opaque 16-byte store widen_vstores exists for — the rewrite keeps it, it never splits the store into two 8-byte halves); a shape it does not recognize is left exactly as written, and the pass is idempotent. It is text only and exact: the same bytes move, which is what the compiled test checks against the build's guest model. A64_NO_COMPACT=1 writes the emitter's text unchanged.

  • nx2/compact_emit.py: the pass, one rule per shape of the family, each written on the register's two uint64_t halves and stored through the lift's opaque whole-register store (a64_vset128/a64_vset64, never two 8-byte halves — the store-forwarding stall widen_vstores exists to avoid). Covered, by the instruction that writes them: EXT by 8 (66,915), DUP (element) (41,487), INS (element) (15,815), INS (general) from XZR (12,399), INS (general) (2,574), DUP (general) (3,241), DUP (scalar) (8,050), UMOV (2,326), SMOV (21), FMOV general → FP (27,732), FMOV FP → general (9,409) — 189,969 sites in 93 files. A shape whose buffers would be read or written out of bounds, whose source lane crosses the source register's two halves, or whose copies are not contiguous elements stays exactly as the emitter wrote it.
  • Left alone on purpose: the 342 AES sbox sites (a loop and a table lookup between the copies, not a permutation) and the 41,646 scalar float select/negate/abs/move sites (a float temporary sits between the copies and must not be read as a bit copy). The pass is idempotent; A64_NO_COMPACT=1 writes the emitter's text unchanged.
  • nx2/make_game.py: the pass runs right after the lift (beside split_hot.py), and LIFT_SCRIPTS names it, so a change to the rewrite invalidates a stored translation instead of stamping old C with a new key.
  • tests/test_compact_emit.py: 886 shape variants — for each, a text check (rewritten, one 16-byte store, the rest untouched, idempotent) and a compiled check that runs the old idiom and the new statement against the build's own guest model from 200 random contexts, comparing every byte of every vector and general register (0 differ; a mutation check that drops the masks gives 1,798 differences, so the comparison bites).
  • tests/test_lift_cleanup_error.py: its run double now recognizes the new lift step; its assertions are unchanged.

Measurements

Verdict: no change to the game. The lifted C is 10 MB smaller (1564.7 → 1554.7 MB, −0.6 %) and the longshot exe 837 KB smaller than main's, and the frame time and CPU time are within this PC's run-to-run spread (fps +0.75 %, p = 0.43; CPU −0.57 %, p = 0.19 over 5 arms each). This is a readability change, and it is a readability change only.

Hardware: AMD Ryzen 9 9950X3D (16 cores, 32 threads), 62 GB, NVMe; RX 9070 XT (RADV) for the game runs.
Scene: none for the build rows; in game, Kokiri Forest from the repo save kokiri-start (the same scene for every arm), 1920x1080, V-Sync off, frame generation off, HOS_FPS_MAX=1000.
Method: from scratch (rm -rf build-linux, LONGSHOT_OBJ_STORE=0 LONGSHOT_LIFT_STORE=0, dev_build.py build), one build at a time through the PC's queue. In game: one warm-up pair per build, then ten arms through the queue in the mirrored order A B B A A B B A A B, 40 s each; fps from the control bridge's frame counter and CPU from /proc/<pid>/stat, medians and an exact permutation test on the medians. The build wall has a spread wider than the difference on this PC (an identical second build measured 3:50 against 3:19), so only the compile phase and the per-chunk times are quoted as timings.
How to reproduce: the build command above, then grep compact_emit in the log for the site counts and python -I nx2/compact_emit.py <gen folder> to run the pass alone; the game arms are build-linux/ab/ab_seq.sh with RTA/RTB set to the two game folders.

Before: main @ 71b1edd8 After: this PR @ dabe2efa
lifted C (code_*.c) 1564.7 MB 1554.7 MB (−10.0 MB, −0.6 %)
sites rewritten — 189,969 (11 shapes, 93 files)
build, from scratch 3 min 13 s 3 min 19 s (compile 2:14; the pass itself 6 s)
longshot 543,806,840 B 542,969,736 B (−837,104 B, −0.15 %)
fps, median of 5 89.29 90.04 (+0.75 %, p = 0.43)
CPU ms a frame, median of 5 43.648 43.079 (−0.57 %, p = 0.19)

The store shape is the part that needed care: the emitter's a64_vst16 is not a plain memcpy — it is _mm_loadu_si128 + A64_OPAQUE + _mm_storeu_si128, one 16-byte store the compiler may not narrow, and widen_vstores exists because two 8-byte stores followed by a 16-byte read stall on store forwarding (a quarter of the hottest Castle function's samples). Every form here goes through a64_vset128/a64_vset64 and keeps that, and a text check in the test fails if a rewrite ever emits two halves.

For the record, where the rewrite does move a compile time: the one hot function that carries 15 % of these sites went from 325.6 s to 227.4 s while the function was still compiled whole — but once it is split into pieces (PR #1146) that function compiles in 27.4 s, and the rewrite moves it to 27.3 s. On the densest ordinary chunk it is 49.0 s → 48.7 s, and a 24 MB and a 33 MB chunk compile the same with the old and the new text. The superlinear cost was the giant flow graph, not the copies; this change is for reading, not for building.

Flags and settings

One lift-time switch is added; it is off by default, so a build rewrites the idioms and a reviewer who needs the emitter's own text can ask for it.

Flag Before this PR After this PR Effect Where it helps, doesn't Recommendation
A64_NO_COMPACT no such switch (the emitter's text is what the lift writes) unset by default: the rewrite runs; 1 writes the emitter's text unchanged chooses whether nx2/compact_emit.py runs after the lift; the lift key holds it, so switching it re-lifts helps: reading a translation, and bisecting a rewrite site against the emitter's own text; doesn't: the game, the build time or the frame time unset (rewrite on) for everyone; 1 only for testing

Testing

Tested: python -I -B tests/run_all.py on Linux — 587 passed, 17 failed, 74 skipped, the 17 also failing on main @ 71b1edd8; tests/test_compact_emit.py (text and compiled exactness, 200 random contexts per shape) passes, and tests/test_lift_cleanup_error.py passes with its run double recognizing the new step. In the game: the compact build loaded the repo save and played it twice (2,472 and 2,530 draws a frame, no crash, no assertion; the 10 failed pipelines in that scene are the same on a main build), and a 4-arm A/B against main's build ran both without a fault.

Not tested: a Windows build (the pass is Python and the emitted C is plain C; no Windows build was made), a scene where these sites dominate the frame, and a hot-list build (the pass is independent of A64_HOT_FUNCS; the split branch's build was measured separately).

Must be tested: none.

Risks

What could break: the rewrite writes C, so a wrong shape would change what the game computes — the compiled test covers every shape the pass rewrites against the build's own guest model, byte for byte, and any shape it does not recognize is left as the emitter wrote it. It is a lift step, so a mistake shows up as the generated C, not as a crash: A64_NO_COMPACT=1 writes the emitter's text unchanged, and git revert is the other way back.

Turning it off: A64_NO_COMPACT=1 at lift time (documented).

Compatibility: nothing for players: the C is different, the game is not. A build with an existing translation re-lifts once, because the lift key now holds nx2/compact_emit.py.

Issues

None found in the tracker or the open pull requests that this replaces; it is a readability pass over the lift's output, independent of #1146 (the split) and #1142/#1140 (the flags).

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (none fits).
  • Measurements has a verdict.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main (71b1edd8).
  • python -I -B tests/run_all.py passes (the 17 that fail also fail on main).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead). The rewrite is outside it on purpose: the emitter is vendored and checked.
  • The license is OK: GPL-3.0-or-later.

When it applies

  • AI assistance recorded with an Assisted-by: trailer.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented and shipped at their recommended value (A64_NO_COMPACT defaults off, i.e. the rewrite on).
  • A game-free test added for the change, failing on main (there is no nx2/compact_emit.py there, so the test's import fails on main; the test is the pass's own).
  • A check under tests/ that reads changed source updated in this PR, not weakened (tests/test_lift_cleanup_error.py, whose run double now knows the new step).
  • Docs updated.
**Type:** perf · **Risk:** low · **Tested on:** Linux (RADV, RX 9070 XT) · **Needs:** none ## Why The per-instruction translator writes an `EXT` by 8 bytes and a `DUP` (element) as runs of `memcpy` through two 16-byte stack buffers: five copies for the EXT, two for the DUP, more for the byte splats. Each is a plain permutation of the 16 bytes of one vector register, so each has a one- or two-statement form on the register's two `uint64_t` halves (`a64.h`'s `vreg[32][2]`): ```c { uint8_t _s[16],_d[16]; memcpy(_s,c->vreg[21],16); memcpy(_d,c->vreg[23],16); memcpy(_d+8,_s+0,8); a64_vst16(c->vreg[23],_d); } -> { c->vreg[23][1] = c->vreg[21][0]; } { uint8_t _s[16]; memcpy(_s,c->vreg[17],16); uint64_t _e=0; memcpy(&_e,_s+8,4); uint8_t _d[16]; memset(_d,0,16); for(int _i=0;_i<2;_i++) memcpy(_d+_i*4,&_e,4); a64_vst16(c->vreg[17],_d); } -> { uint32_t _e = (uint32_t)(c->vreg[17][1] >> 0); c->vreg[17][0] = (uint64_t)_e * 0x100000001ULL; c->vreg[17][1] = 0; } ``` There are **66,915 EXT and 41,487 DUP sites** in the game's lifted C, and where a function is dense in them this is the hardest stretch of it to read: the idiom's five lines name two stack buffers that the register's bytes pass through, and the actual permutation has to be worked out from the offsets. The lifted C is what a person reads to find the next problem, and what an agent pays for by the token; one line instead of five at every one of those sites is the point of this change. ## What changed A pass over the lifted C, right after the lift, rewrites the lane moves the translator writes as runs of `memcpy` through 16-byte stack buffers — EXT, INS, DUP, UMOV, SMOV and the two FMOV directions — into one or two statements on the register's two halves, through the lift's own whole-register store (`a64_vset128`/`a64_vset64`, the opaque 16-byte store `widen_vstores` exists for — the rewrite keeps it, it never splits the store into two 8-byte halves); a shape it does not recognize is left exactly as written, and the pass is idempotent. It is text only and exact: the same bytes move, which is what the compiled test checks against the build's guest model. `A64_NO_COMPACT=1` writes the emitter's text unchanged. - `nx2/compact_emit.py`: the pass, one rule per shape of the family, each written on the register's two `uint64_t` halves and stored through the lift's opaque whole-register store (`a64_vset128`/`a64_vset64`, never two 8-byte halves — the store-forwarding stall `widen_vstores` exists to avoid). Covered, by the instruction that writes them: **EXT by 8** (66,915), **DUP (element)** (41,487), **INS (element)** (15,815), **INS (general) from XZR** (12,399), **INS (general)** (2,574), **DUP (general)** (3,241), **DUP (scalar)** (8,050), **UMOV** (2,326), **SMOV** (21), **FMOV general → FP** (27,732), **FMOV FP → general** (9,409) — **189,969 sites** in 93 files. A shape whose buffers would be read or written out of bounds, whose source lane crosses the source register's two halves, or whose copies are not contiguous elements stays exactly as the emitter wrote it. - Left alone on purpose: the **342 AES sbox** sites (a loop and a table lookup between the copies, not a permutation) and the **41,646 scalar float** select/negate/abs/move sites (a float temporary sits between the copies and must not be read as a bit copy). The pass is idempotent; `A64_NO_COMPACT=1` writes the emitter's text unchanged. - `nx2/make_game.py`: the pass runs right after the lift (beside `split_hot.py`), and `LIFT_SCRIPTS` names it, so a change to the rewrite invalidates a stored translation instead of stamping old C with a new key. - `tests/test_compact_emit.py`: 886 shape variants — for each, a text check (rewritten, one 16-byte store, the rest untouched, idempotent) and a compiled check that runs the old idiom and the new statement against the build's own guest model from 200 random contexts, comparing every byte of every vector and general register (0 differ; a mutation check that drops the masks gives 1,798 differences, so the comparison bites). - `tests/test_lift_cleanup_error.py`: its `run` double now recognizes the new lift step; its assertions are unchanged. ## Measurements **Verdict:** no change to the game. The lifted C is 10 MB smaller (1564.7 → 1554.7 MB, −0.6 %) and the `longshot` exe 837 KB smaller than main's, and the frame time and CPU time are within this PC's run-to-run spread (fps +0.75 %, p = 0.43; CPU −0.57 %, p = 0.19 over 5 arms each). This is a readability change, and it is a readability change only. Hardware: AMD Ryzen 9 9950X3D (16 cores, 32 threads), 62 GB, NVMe; RX 9070 XT (RADV) for the game runs. Scene: none for the build rows; in game, Kokiri Forest from the repo save `kokiri-start` (the same scene for every arm), 1920x1080, V-Sync off, frame generation off, `HOS_FPS_MAX=1000`. Method: from scratch (`rm -rf build-linux`, `LONGSHOT_OBJ_STORE=0 LONGSHOT_LIFT_STORE=0`, `dev_build.py build`), one build at a time through the PC's queue. In game: one warm-up pair per build, then ten arms through the queue in the mirrored order `A B B A A B B A A B`, 40 s each; fps from the control bridge's frame counter and CPU from `/proc/<pid>/stat`, medians and an exact permutation test on the medians. The build wall has a spread wider than the difference on this PC (an identical second build measured 3:50 against 3:19), so only the compile phase and the per-chunk times are quoted as timings. How to reproduce: the build command above, then `grep compact_emit` in the log for the site counts and `python -I nx2/compact_emit.py <gen folder>` to run the pass alone; the game arms are `build-linux/ab/ab_seq.sh` with `RTA`/`RTB` set to the two game folders. | | Before: main @ 71b1edd8 | After: this PR @ dabe2efa | |---|---|---| | lifted C (`code_*.c`) | 1564.7 MB | **1554.7 MB (−10.0 MB, −0.6 %)** | | sites rewritten | — | **189,969** (11 shapes, 93 files) | | build, from scratch | 3 min 13 s | 3 min 19 s (compile 2:14; the pass itself 6 s) | | `longshot` | 543,806,840 B | **542,969,736 B (−837,104 B, −0.15 %)** | | fps, median of 5 | 89.29 | 90.04 (+0.75 %, p = 0.43) | | CPU ms a frame, median of 5 | 43.648 | 43.079 (−0.57 %, p = 0.19) | The store shape is the part that needed care: the emitter's `a64_vst16` is not a plain `memcpy` — it is `_mm_loadu_si128` + `A64_OPAQUE` + `_mm_storeu_si128`, one 16-byte store the compiler may not narrow, and `widen_vstores` exists because two 8-byte stores followed by a 16-byte read stall on store forwarding (a quarter of the hottest Castle function's samples). Every form here goes through `a64_vset128`/`a64_vset64` and keeps that, and a text check in the test fails if a rewrite ever emits two halves. For the record, where the rewrite *does* move a compile time: the one hot function that carries 15 % of these sites went from 325.6 s to 227.4 s while the function was still compiled whole — but once it is split into pieces (PR #1146) that function compiles in 27.4 s, and the rewrite moves it to 27.3 s. On the densest ordinary chunk it is 49.0 s → 48.7 s, and a 24 MB and a 33 MB chunk compile the same with the old and the new text. The superlinear cost was the giant flow graph, not the copies; this change is for reading, not for building. ### Flags and settings One lift-time switch is added; it is off by default, so a build rewrites the idioms and a reviewer who needs the emitter's own text can ask for it. | Flag | Before this PR | After this PR | Effect | Where it helps, doesn't | Recommendation | |---|---|---|---|---|---| | `A64_NO_COMPACT` | no such switch (the emitter's text is what the lift writes) | unset by default: the rewrite runs; `1` writes the emitter's text unchanged | chooses whether `nx2/compact_emit.py` runs after the lift; the lift key holds it, so switching it re-lifts | helps: reading a translation, and bisecting a rewrite site against the emitter's own text; doesn't: the game, the build time or the frame time | unset (rewrite on) for everyone; `1` only for testing | ## Testing **Tested:** `python -I -B tests/run_all.py` on Linux — 587 passed, 17 failed, 74 skipped, the 17 also failing on `main @ 71b1edd8`; `tests/test_compact_emit.py` (text and compiled exactness, 200 random contexts per shape) passes, and `tests/test_lift_cleanup_error.py` passes with its `run` double recognizing the new step. In the game: the compact build loaded the repo save and played it twice (2,472 and 2,530 draws a frame, no crash, no assertion; the 10 failed pipelines in that scene are the same on a `main` build), and a 4-arm A/B against `main`'s build ran both without a fault. **Not tested:** a Windows build (the pass is Python and the emitted C is plain C; no Windows build was made), a scene where these sites dominate the frame, and a hot-list build (the pass is independent of `A64_HOT_FUNCS`; the split branch's build was measured separately). **Must be tested:** none. ## Risks **What could break:** the rewrite writes C, so a wrong shape would change what the game computes — the compiled test covers every shape the pass rewrites against the build's own guest model, byte for byte, and any shape it does not recognize is left as the emitter wrote it. It is a lift step, so a mistake shows up as the generated C, not as a crash: `A64_NO_COMPACT=1` writes the emitter's text unchanged, and `git revert` is the other way back. **Turning it off:** `A64_NO_COMPACT=1` at lift time (documented). **Compatibility:** nothing for players: the C is different, the game is not. A build with an existing translation re-lifts once, because the lift key now holds `nx2/compact_emit.py`. ## Issues None found in the tracker or the open pull requests that this replaces; it is a readability pass over the lift's output, independent of #1146 (the split) and #1142/#1140 (the flags). ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (none fits). - [x] Measurements has a verdict. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main` (71b1edd8). - [x] `python -I -B tests/run_all.py` passes (the 17 that fail also fail on `main`). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). The rewrite is outside it on purpose: the emitter is vendored and checked. - [x] The license is OK: GPL-3.0-or-later. ### When it applies - [x] AI assistance recorded with an `Assisted-by:` trailer. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented and shipped at their recommended value (`A64_NO_COMPACT` defaults off, i.e. the rewrite on). - [x] A game-free test added for the change, failing on `main` (there is no `nx2/compact_emit.py` there, so the test's import fails on `main`; the test is the pass's own). - [x] A check under `tests/` that reads changed source updated in this PR, not weakened (`tests/test_lift_cleanup_error.py`, whose `run` double now knows the new step). - [x] Docs updated.
perf(lift): the lane-permute idioms are written one line, not five memcpys
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
26124afed7
The per-instruction translator writes an EXT by 8 and a DUP (element) as memcpy runs through two
16-byte stack buffers: five memcpys for the EXT, two for the DUP, more for the byte splats. Each is a
plain permutation of the 16 bytes of one vector register, so each has a one- or two-statement form on
the register's two uint64_t halves. nx2/compact_emit.py rewrites them after the lift, in the generated
C: 66,915 EXT and 41,487 DUP sites, the lifted C 1564.7 MB -> 1556.3 MB.

Exact by construction: the same bytes are read and written, and the test compiles the old idiom and
the new statement against the build's guest model and runs both from 200 random contexts, comparing
every byte of every vector register.

Assisted-by: DeepSeek Harness
Author
Contributor

Tested in game: Linux (RADV, RX 9070 XT, Ryzen 9 9950X3D), a no-hot-list build with the compact lift: Kokiri Forest from the repo save, two 40 s runs (2,472 and 2,530 draws a frame), no crash, no assertion, the same 10 failed pipelines as a main build in that scene; a 4-arm A/B against main's build ran both without a fault

Tested in game: Linux (RADV, RX 9070 XT, Ryzen 9 9950X3D), a no-hot-list build with the compact lift: Kokiri Forest from the repo save, two 40 s runs (2,472 and 2,530 draws a frame), no crash, no assertion, the same 10 failed pipelines as a main build in that scene; a 4-arm A/B against main's build ran both without a fault
Marcuss2 changed title from WIP: perf(lift): the lane-permute idioms are written one line, not five memcpys to perf(lift): the lane-permute idioms are written one line, not five memcpys 2026-11-16 18:05:42 +00:00
Marcuss2 changed title from perf(lift): the lane-permute idioms are written one line, not five memcpys to WIP: perf(lift): the lane-permute idioms are written one line, not five memcpys 2026-11-16 18:24:50 +00:00
Marcuss2 force-pushed perf/lift-compact-emit from 26124afed7
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 6a0ac1d110
Some checks failed
PR description / Description follows the template (pull_request_target) Has been cancelled
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-16 19:00:13 +00:00
Compare
Marcuss2 changed title from WIP: perf(lift): the lane-permute idioms are written one line, not five memcpys to perf(lift): the lane-permute idioms are written one line, not five memcpys 2026-11-16 19:00:25 +00:00
Author
Contributor

Thanks to a review catch on the store shape, this PR's rewrite changed after its first push: the emitter's is not but + + — one opaque 16-byte store, which exists to guarantee (two 8-byte stores followed by a 16-byte read stall on store forwarding, a quarter of the hottest Castle function's samples). The first form wrote the two halves directly and so dropped that guarantee (byte-identical result, but the wrong store shape); the shipped form goes through /, which are the same opaque store, and now fails if the rewrite ever emits two halves again.\n\nMeasured after the fix (10 arms, 5 each, mirrored, from scratch):\n\n| | main @ 71b1edd8 | this PR @ 6a0ac1d1 |\n|---|---|---|\n| | 543,806,840 B | 542,702,328 B (−1.1 MB, −0.20 %) |\n| lifted C | 1564.7 MB | 1556.9 MB (−0.5 %) |\n| fps, median of 5 | 88.20 | 88.40 (+0.23 %, p = 0.71) |\n| CPU ms a frame, median of 5 | 43.614 | 43.270 (−0.79 %, p = 0.29) |\n\nSo the verdict stands: no game-visible change, a smaller exe and a shorter C. For completeness, the pre-fix form measured +0.12 % fps (p = 1.00) and −0.42 % CPU (p = 0.24) on the same protocol, so the store-shape correction is not a measurable regression either way — it is the correct thing to emit, and it is now checked.

Thanks to a review catch on the store shape, this PR's rewrite changed after its first push: the emitter's is not but + + — **one** opaque 16-byte store, which exists to guarantee (two 8-byte stores followed by a 16-byte read stall on store forwarding, a quarter of the hottest Castle function's samples). The first form wrote the two halves directly and so dropped that guarantee (byte-identical result, but the wrong store shape); the shipped form goes through /, which are the same opaque store, and now fails if the rewrite ever emits two halves again.\n\nMeasured after the fix (10 arms, 5 each, mirrored, from scratch):\n\n| | main @ 71b1edd8 | this PR @ 6a0ac1d1 |\n|---|---|---|\n| | 543,806,840 B | 542,702,328 B (−1.1 MB, −0.20 %) |\n| lifted C | 1564.7 MB | 1556.9 MB (−0.5 %) |\n| fps, median of 5 | 88.20 | 88.40 (+0.23 %, p = 0.71) |\n| CPU ms a frame, median of 5 | 43.614 | 43.270 (−0.79 %, p = 0.29) |\n\nSo the verdict stands: no game-visible change, a smaller exe and a shorter C. For completeness, the pre-fix form measured +0.12 % fps (p = 1.00) and −0.42 % CPU (p = 0.24) on the same protocol, so the store-shape correction is not a measurable regression either way — it is the correct thing to emit, and it is now checked.
perf(lift): the rest of the lane moves, one statement each
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
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 3s
dabe2efa2b
nx2/compact_emit.py rewrote two of the shapes the translator writes for a vector instruction --
EXT by 8 and DUP (element) -- as runs of memcpy through 16-byte stack buffers. The rest of the
family was still there, five or six statements a site. It now writes all of them in one or two
statements on a register's two uint64_t halves, through the lift's own opaque whole-register
store (a64_vset128/a64_vset64, never two 8-byte halves: the store-forwarding stall
widen_vstores exists to avoid):

  INS (element)            15,815   W bytes of one register over W bytes of another (the general EXT)
  INS (general), XZR       12,399   zero bytes over a lane
  INS (general)             2,574   a general register's low W bytes over a lane
  DUP (general)             3,241   a general register's low W bytes repeated over the lanes
  DUP (scalar)              8,050   one lane zero-extended into the low half, the top zeroed
  UMOV                      2,326   one lane out into a general register
  SMOV                         21   the same, sign-extended
  FMOV general -> FP       27,732   the low W bytes of a general register, rest of the register zeroed
  FMOV FP -> general        9,409   the low W bytes of a vector register, zero-extended

With the two shapes already there: 189,969 sites, the lifted C 1564.7 MB -> 1554.7 MB (1556.9
-> 1554.7 on these shapes alone). The exe is 542,969,736 B from a clean build, +267 KB (0.05%)
over the two shapes' 542,702,328 and still 837 KB under main's 543,806,840; the build took 3:19
(compiled in 2:14) against 3:15, within this PC's build-to-build spread (an identical second
build measured 3:50, and one 24 MB chunk compiles in 53 s either way). In game, a 5+5 A/B
against main @ 71b1edd8 was within the spread: 89.3 -> 90.0 fps (exact permutation p = 0.43)
and 43.6 -> 43.1 ms of CPU a frame (p = 0.19). No performance claim.

Left alone, as the emitter wrote it: the 342 AES sbox sites (a loop and a table lookup between
the memcpys, not a permutation) and the 41,646 scalar float select/negate/abs/move sites, whose
float temporary sits between the two memcpys and must not be read as a bit copy. A shape whose
buffers would be read or written out of bounds, or whose source lane crosses the source
register's two halves, stays too. The pass is a text pass and idempotent; A64_NO_COMPACT=1
still writes the emitter's text unchanged.

Exact by construction: the same bytes are read and written, and every half is read as a call
argument before the store, so a site whose source and destination is the same register is right
too. tests/test_compact_emit.py now covers every shape over the sizes, lane counts and byte
offsets the game's C has -- a text check for each (one 16-byte store, the rest untouched,
idempotent) and a compiled check that runs the old idiom and the new statement against the
build's guest model from 200 random contexts, comparing every byte of every vector and general
register. tests/run_all.py: 587 passed, the 17 known failures, 74 skipped.

Assisted-by: DeepSeek Harness
Author
Contributor

Extended the pass to the rest of the family. One commit on top of 6a0ac1d1, no force-push: dabe2efa on perf/lift-compact-emit.

Catalogue

Measured with a script over the kept gen folder (build-linux/dev-work/sa/gen, 93 code_*.c; it is the old pass's
output, so every memcpy shape still in it is one the old pass did not rewrite):

shape, as the emitter writes it instruction sites this commit
{ uint8_t _s[16],_d[16]; memcpy(_s,vreg[S],16); memcpy(_d,vreg[D],16); memcpy(_d+OD,_s+OS,W); a64_vst16(vreg[D],_d); } INS (element) 15,815 rewritten
{ uint8_t _d[16]; memcpy(_d,vreg[D],16); uint64_t _e=(uint64_t)0; memcpy(_d+OD,&_e,W); a64_vst16(vreg[D],_d); } INS (general), XZR 12,399 rewritten
... uint64_t _e=c->x[G]; memcpy(_d+OD,&_e,W); a64_vst16(...) INS (general) 2,574 rewritten
{ uint64_t _e=c->x[G]; ... memset(_d,0,16); for(_i<L) memcpy(_d+_i*ST,&_e,W); a64_vst16(...) DUP (general) 3,241 rewritten (ST == W)
{ uint8_t _s[16]; ... uint64_t _e=0; memcpy(&_e,_s+OS,W); a64_vset64(vreg[D],_e); } DUP (scalar) 8,050 rewritten
{ uint8_t _s[16]; ... memcpy(&_e,_s+OS,W); c->x[G]=_e; } UMOV 2,326 rewritten
... uint64_t _r=(uint64_t)(int64_t)(intN_t)_e; [mask] c->x[G]=_r; SMOV 21 rewritten
{ a64_vset64(vreg[D],0); memcpy(&vreg[D][0],&c->x[G],W); } FMOV general -> FP 27,732 rewritten
{ uint64_t _r=0; memcpy(&_r,&vreg[S][0],W); c->x[G]=_r; } FMOV FP -> general 9,409 rewritten
{ uint8_t _s[16],_k[16],_t[16]; ...recomp_aes_sbox... } AES sbox rounds 342 left alone
{ float _a,_b,_r; memcpy(&_a,&vreg[S][h],N); (void)_b; _r = <float op>; a64_vset64(vreg[D],0); memcpy(&vreg[D][h],&_r,N); } FCSEL / FNEG / FABS / FP->FP move 41,646 left alone

The last two rows are the shapes whose destination buffer is not _d and whose two memcpys have a computation
between them: the AES rounds (xor, a byte permutation and a table lookup in a loop) and the scalar float temporaries.
A bit permutation must not assume a float assignment is a bit copy, so they keep the emitter's text.

There are no a64_vext*, a64_vzip*, a64_vuzp* or a64_vtrn sites in this game's C (grep over the gen: 0), and the
only helper-built vector write in the family is a64_vset_lo, which appears with per-lane arithmetic (BIT, CLZ, ...),
never with a permutation. Two shapes do not use a64_vst16 -- the FMOV pair -- and both are in the table above.

Implemented

For every shape above, in one or two statements on the register's two uint64_t halves, through the lift's own opaque
whole-register store. Examples of the generated text:

/* INS (element): D[4..7] := S[8..11] */
a64_vset128(c->vreg[0], ((c->vreg[0][0] & 0xffffffffULL) | (c->vreg[1][1] << 32)), c->vreg[0][1]);
/* INS (general) from XZR: the low 4 bytes of the top half zeroed */
a64_vset128(c->vreg[2], c->vreg[2][0], (c->vreg[2][1] & 0xffffffffULL));
/* DUP (general): a general register's low 4 bytes over four lanes */
{ uint32_t _e = (uint32_t)c->x[9]; uint64_t _w = (uint64_t)_e * 0x0000000100000001ULL; a64_vset128(c->vreg[4], _w, _w); }
/* FMOV general -> FP */
a64_vset64(c->vreg[0], (uint64_t)(uint32_t)c->x[8]);
/* UMOV: a lane out */
c->x[10] = (uint32_t)(c->vreg[1][0] >> 32);

Hard rules kept: the whole-register store is one opaque 16-byte store (a64_vset128/a64_vset64, never two assignments
to vreg[D][0]/[1]); every source half is read as a call argument or in a local before the store, so S == D sites are
right; a shape that cannot be expressed exactly (buffers read or written out of bounds, a source lane crossing the
source register's two halves, a DUP (general) whose stride is not its element size) is left byte for byte as the emitter
wrote it. Idempotent, and A64_NO_COMPACT=1 still writes the emitter's text unchanged. The A64_NO_COMPACT row in
docs/development.md is updated with the new scope and counts.

Counts and size

compact_emit: 66915 EXT, 41487 DUP, 15815 INS, 12399 INS0, 2574 INSG, 3241 DUPG, 8050 DUPS,
              2326 UMOV, 21 SMOV, 27732 FMOV->FP, 9409 FMOV->GPR = 189969 sites in 93 files,
              C 1564.7 MB -> 1554.7 MB (0.6%)

On the shapes added here alone: C 1556.9 MB -> 1554.7 MB (-2.15 MB, 81,567 sites, 26 B a site on average).

Build and exe, from scratch, one at a time (rm -rf build-linux, the command in the task)

main @ 71b1edd8 branch @ 6a0ac1d1 this commit
lifted C 1564.7 MB 1556.9 MB 1554.7 MB
exe 543,806,840 B 542,702,328 B 542,969,736 B (+267,408 B, +0.05%)
build wall 3:13 3:15 3:19 (lift 52 s, compile 134 s)

The first identical build of this commit measured 3:50 (compile 162 s) and the exe is the same 542,969,736 B, so the
build wall moves between runs on this PC by more than the difference; a 24 MB chunk compiles in 53.2/54.6 s with the
old pass's text and 52.9/52.9 s with this one, and a 33 MB chunk in 33.3/33.5 s vs 33.5/33.5 s. The exe is +267 KB over
the two shapes' build and still 837 KB under main: reported, not claimed as a win.

Tests

  • python -I -B tests/test_compact_emit.py --cc clang -- ok. 886 shape variants: every shape over each size, lane
    count and byte offset the game's C has, plus the edges; for each a text check (rewritten, exactly one 16-byte store,
    other text untouched, idempotent) and a compiled check that runs the old idiom and the new statement against the
    build's guest model from 200 random contexts and compares every byte of every vector register and every general
    register
    -- 0 cases differ. (Mutation check: dropping the element masks makes 1,798 of those contexts differ, so
    the check bites.)
  • python -I -B tests/run_all.py -- 587 passed, 17 failed (the known ones), 74 skipped in 58 s.

In game: 5+5 A/B against main @ 71b1edd8

Harness: ab_pair.sh warm-up then ab_seq.sh (mirrored order A B B A A B B A A B, 40 s samples), baseline
dsh-main-bt/build-linux/base, this build build-linux/perm2. Scene: the repo save kokiri-start (Kokiri Forest,
the save's load point), no teleport, the same options.ini and save on both sides.

A: main @ 71b1edd8 B: this PR @ dabe2efa B - A exact permutation p
fps 89.29, 87.67, 89.75, 92.14, 88.76 -- median 89.29 90.04, 90.00, 92.15, 89.13, 91.47 -- median 90.04 +0.75 0.429
CPU ms a frame 43.88, 43.97, 43.49, 43.18, 43.65 -- median 43.648 43.48, 43.08, 42.91, 43.88, 43.02 -- median 43.079 -0.569 0.190

No change within the spread. This is a readability change; the medians differ by less than one arm of either side
and neither is significant.

What I would put in the description

The lane moves the translator writes as runs of memcpy through 16-byte buffers are now all written the same way:
EXT by 8 and DUP (element) as before, and the INS (element and general), DUP (general and scalar), SMOV/UMOV and both
FMOVs added here -- 189,969 sites, the lifted C 1564.7 MB -> 1554.7 MB. Every site that writes a whole vector register
keeps the one opaque 16-byte store widen_vstores made; sites whose two memcpys have a computation between them (the
AES rounds, the scalar float selects and negates) stay as the emitter wrote them. Exact by construction, checked by
tests/test_compact_emit.py against the build's guest model (every byte of every vector and general register, 200
random contexts a shape). The exe is +267 KB over the two shapes (+0.05%; 837 KB under main) and a 5+5 A/B against
main is within the spread (89.3 vs 90.0 fps, p = 0.43; 43.6 vs 43.1 ms of CPU a frame, p = 0.19): a readability
change, not a performance one.

Extended the pass to the rest of the family. One commit on top of `6a0ac1d1`, no force-push: **`dabe2efa`** on `perf/lift-compact-emit`. ## Catalogue Measured with a script over the kept gen folder (`build-linux/dev-work/sa/gen`, 93 `code_*.c`; it is the old pass's output, so every memcpy shape still in it is one the old pass did not rewrite): | shape, as the emitter writes it | instruction | sites | this commit | |---|---|---:|---| | `{ uint8_t _s[16],_d[16]; memcpy(_s,vreg[S],16); memcpy(_d,vreg[D],16); memcpy(_d+OD,_s+OS,W); a64_vst16(vreg[D],_d); }` | INS (element) | 15,815 | rewritten | | `{ uint8_t _d[16]; memcpy(_d,vreg[D],16); uint64_t _e=(uint64_t)0; memcpy(_d+OD,&_e,W); a64_vst16(vreg[D],_d); }` | INS (general), XZR | 12,399 | rewritten | | `... uint64_t _e=c->x[G]; memcpy(_d+OD,&_e,W); a64_vst16(...)` | INS (general) | 2,574 | rewritten | | `{ uint64_t _e=c->x[G]; ... memset(_d,0,16); for(_i<L) memcpy(_d+_i*ST,&_e,W); a64_vst16(...)` | DUP (general) | 3,241 | rewritten (ST == W) | | `{ uint8_t _s[16]; ... uint64_t _e=0; memcpy(&_e,_s+OS,W); a64_vset64(vreg[D],_e); }` | DUP (scalar) | 8,050 | rewritten | | `{ uint8_t _s[16]; ... memcpy(&_e,_s+OS,W); c->x[G]=_e; }` | UMOV | 2,326 | rewritten | | `... uint64_t _r=(uint64_t)(int64_t)(intN_t)_e; [mask] c->x[G]=_r;` | SMOV | 21 | rewritten | | `{ a64_vset64(vreg[D],0); memcpy(&vreg[D][0],&c->x[G],W); }` | FMOV general -> FP | 27,732 | rewritten | | `{ uint64_t _r=0; memcpy(&_r,&vreg[S][0],W); c->x[G]=_r; }` | FMOV FP -> general | 9,409 | rewritten | | `{ uint8_t _s[16],_k[16],_t[16]; ...recomp_aes_sbox... }` | AES sbox rounds | 342 | left alone | | `{ float _a,_b,_r; memcpy(&_a,&vreg[S][h],N); (void)_b; _r = <float op>; a64_vset64(vreg[D],0); memcpy(&vreg[D][h],&_r,N); }` | FCSEL / FNEG / FABS / FP->FP move | 41,646 | left alone | The last two rows are the shapes whose destination buffer is not `_d` and whose two memcpys have a **computation** between them: the AES rounds (xor, a byte permutation and a table lookup in a loop) and the scalar float temporaries. A bit permutation must not assume a float assignment is a bit copy, so they keep the emitter's text. There are no `a64_vext*`, `a64_vzip*`, `a64_vuzp*` or `a64_vtrn` sites in this game's C (grep over the gen: 0), and the only helper-built vector write in the family is `a64_vset_lo`, which appears with per-lane arithmetic (BIT, CLZ, ...), never with a permutation. Two shapes do not use `a64_vst16` -- the FMOV pair -- and both are in the table above. ## Implemented For every shape above, in one or two statements on the register's two `uint64_t` halves, through the lift's own opaque whole-register store. Examples of the generated text: ```c /* INS (element): D[4..7] := S[8..11] */ a64_vset128(c->vreg[0], ((c->vreg[0][0] & 0xffffffffULL) | (c->vreg[1][1] << 32)), c->vreg[0][1]); /* INS (general) from XZR: the low 4 bytes of the top half zeroed */ a64_vset128(c->vreg[2], c->vreg[2][0], (c->vreg[2][1] & 0xffffffffULL)); /* DUP (general): a general register's low 4 bytes over four lanes */ { uint32_t _e = (uint32_t)c->x[9]; uint64_t _w = (uint64_t)_e * 0x0000000100000001ULL; a64_vset128(c->vreg[4], _w, _w); } /* FMOV general -> FP */ a64_vset64(c->vreg[0], (uint64_t)(uint32_t)c->x[8]); /* UMOV: a lane out */ c->x[10] = (uint32_t)(c->vreg[1][0] >> 32); ``` Hard rules kept: the whole-register store is one opaque 16-byte store (`a64_vset128`/`a64_vset64`, never two assignments to `vreg[D][0]/[1]`); every source half is read as a call argument or in a local before the store, so `S == D` sites are right; a shape that cannot be expressed exactly (buffers read or written out of bounds, a source lane crossing the source register's two halves, a DUP (general) whose stride is not its element size) is left byte for byte as the emitter wrote it. Idempotent, and `A64_NO_COMPACT=1` still writes the emitter's text unchanged. The `A64_NO_COMPACT` row in `docs/development.md` is updated with the new scope and counts. ## Counts and size ``` compact_emit: 66915 EXT, 41487 DUP, 15815 INS, 12399 INS0, 2574 INSG, 3241 DUPG, 8050 DUPS, 2326 UMOV, 21 SMOV, 27732 FMOV->FP, 9409 FMOV->GPR = 189969 sites in 93 files, C 1564.7 MB -> 1554.7 MB (0.6%) ``` On the shapes added here alone: C 1556.9 MB -> 1554.7 MB (**-2.15 MB**, 81,567 sites, 26 B a site on average). ## Build and exe, from scratch, one at a time (`rm -rf build-linux`, the command in the task) | | main @ 71b1edd8 | branch @ 6a0ac1d1 | this commit | |---|---:|---:|---:| | lifted C | 1564.7 MB | 1556.9 MB | **1554.7 MB** | | exe | 543,806,840 B | 542,702,328 B | **542,969,736 B** (+267,408 B, +0.05%) | | build wall | 3:13 | 3:15 | **3:19** (lift 52 s, compile 134 s) | The first identical build of this commit measured 3:50 (compile 162 s) and the exe is the same 542,969,736 B, so the build wall moves between runs on this PC by more than the difference; a 24 MB chunk compiles in 53.2/54.6 s with the old pass's text and 52.9/52.9 s with this one, and a 33 MB chunk in 33.3/33.5 s vs 33.5/33.5 s. The exe is +267 KB over the two shapes' build and still 837 KB under main: reported, not claimed as a win. ## Tests - `python -I -B tests/test_compact_emit.py --cc clang` -- **ok**. 886 shape variants: every shape over each size, lane count and byte offset the game's C has, plus the edges; for each a text check (rewritten, exactly one 16-byte store, other text untouched, idempotent) and a compiled check that runs the old idiom and the new statement against the build's guest model from 200 random contexts and compares **every byte of every vector register and every general register** -- 0 cases differ. (Mutation check: dropping the element masks makes 1,798 of those contexts differ, so the check bites.) - `python -I -B tests/run_all.py` -- 587 passed, 17 failed (the known ones), 74 skipped in 58 s. ## In game: 5+5 A/B against main @ 71b1edd8 Harness: `ab_pair.sh` warm-up then `ab_seq.sh` (mirrored order A B B A A B B A A B, 40 s samples), baseline `dsh-main-bt/build-linux/base`, this build `build-linux/perm2`. Scene: the repo save `kokiri-start` (Kokiri Forest, the save's load point), no teleport, the same `options.ini` and save on both sides. | | A: main @ 71b1edd8 | B: this PR @ dabe2efa | B - A | exact permutation p | |---|---:|---:|---:|---:| | fps | 89.29, 87.67, 89.75, 92.14, 88.76 -- median **89.29** | 90.04, 90.00, 92.15, 89.13, 91.47 -- median **90.04** | +0.75 | **0.429** | | CPU ms a frame | 43.88, 43.97, 43.49, 43.18, 43.65 -- median **43.648** | 43.48, 43.08, 42.91, 43.88, 43.02 -- median **43.079** | -0.569 | **0.190** | **No change within the spread.** This is a readability change; the medians differ by less than one arm of either side and neither is significant. ## What I would put in the description > The lane moves the translator writes as runs of `memcpy` through 16-byte buffers are now all written the same way: > EXT by 8 and DUP (element) as before, and the INS (element and general), DUP (general and scalar), SMOV/UMOV and both > FMOVs added here -- 189,969 sites, the lifted C 1564.7 MB -> 1554.7 MB. Every site that writes a whole vector register > keeps the one opaque 16-byte store widen_vstores made; sites whose two memcpys have a computation between them (the > AES rounds, the scalar float selects and negates) stay as the emitter wrote them. Exact by construction, checked by > `tests/test_compact_emit.py` against the build's guest model (every byte of every vector and general register, 200 > random contexts a shape). The exe is +267 KB over the two shapes (+0.05%; 837 KB under main) and a 5+5 A/B against > main is within the spread (89.3 vs 90.0 fps, p = 0.43; 43.6 vs 43.1 ms of CPU a frame, p = 0.19): a readability > change, not a performance one.
Marcuss2 changed title from perf(lift): the lane-permute idioms are written one line, not five memcpys to WIP: perf(lift): the lane-permute idioms are written one line, not five memcpys 2026-11-16 20:09:31 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 3s
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
View command line instructions

Checkout

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