Skip to content

perf(gust): re-pin gust_mix to synth 0.37.1 — 1.81×→1.69× (stale-pin refresh) - #157

Merged
avrabe merged 1 commit into
mainfrom
perf/synth-0371-repin-sweep
Jul 10, 2026
Merged

avrabe merged 1 commit into
mainfrom
perf/synth-0371-repin-sweep

Conversation

@avrabe

@avrabe avrabe commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What

Re-pin the dissolved gust_mix bench objects (cm3 + cm4) from a stale ~0.15-era synth build to synth 0.37.1 + loom 1.1.18, capturing the accumulated 0.16→0.37 codegen gains.

Measured (gust_codegen_bench, qemu -icount, deterministic)

fn-only ticks/call .text (gust_mix) object ratio vs native LLVM
stale pin (before) 0.725 90 B 440 B 1.81×
0.37.1 re-pin (after) 0.675 82 B 432 B 1.69×

−7% cycles, −9% .text. Directly serves the 0.7× dissolved-vs-native goal.

Correctness gates (all pass)

  • gust_floor_bench soundness assertion mix_proven ≡ mix_native ≡ gust_mix over [524,1524] — sound (the dissolved 0.37.1 object computes identically to native).
  • Proof-carrying floor still 0.45× (unchanged — source-level, not codegen-dependent).
  • silicon_bench links cleanly for thumbv7em-none-eabi with the new cm4 object.
  • cm3 + cm4 rebuilt from the same stripped input, both 432 B.

Beat-LLVM finding → filed synth#686

On the same stripped input, synth 0.30.1→0.37.0 emit 68 B / 0.600 ticks / 1.50×; 0.37.1's #682 mod-32 shift mask adds 14 B / +0.075 ticks because it masks gust_mix's shifts unconditionally — gale's shift amounts are statically <32 and never need the runtime mask. The 12% gap is recoverable by eliding the mask under a static-<32 bound — the same proof-carrying-facts pattern as clamp-elision. Pinned 0.37.1 (single current, correctness-complete toolchain; reproducible) rather than the superseded 0.37.0.

Scope

Only the two gust_mix objects + COMPARE.md + build.rs repro note. dec_diff/control_step/drivers were re-dissolved and checked: dec_diff checksum byte-stable but its checked-in pin is from an older/smaller source (no synth regression — bisected); drivers gain only the correctness-neutral +4 B shift-mask. None re-pinned (no perf benefit).

🤖 Generated with Claude Code

…refresh)

The checked-in gust_mix-cm3/cm4.o pins were STALE (~0.15-era, 90 B / 0.725
fn-only ticks / 1.81× vs native LLVM) and had missed every codegen gain from
synth 0.16→0.37. Re-dissolved gust_kernel.wasm (loom 1.1.18 inline → strip
exports to {memory, gust_mix} → synth 0.37.1 --target cortex-m3/-m4
--all-exports --relocatable) and re-measured on gust_codegen_bench:

  fn-only 0.725 → 0.675 ticks/call (−7%), .text 90 → 82 B (−9%),
  ratio vs native LLVM 1.81× → 1.69×, object 440 → 432 B.

Correctness gated: gust_floor_bench soundness assertion
`mix_proven ≡ mix_native ≡ gust_mix` over [524,1524] still passes; proof-carrying
floor still 0.45×. cm3+cm4 re-pinned identically; silicon_bench links cleanly
for thumbv7em.

Measured beat-LLVM lever (filed synth#686): on the same input, synth
0.30.1→0.37.0 all emit 68 B / 0.600 ticks / 1.50×; 0.37.1's #682 mod-32 shift
mask adds 14 B / +0.075 ticks because it masks gust_mix's shifts
unconditionally, even though gale's shift amounts are statically <32 and never
need the runtime mask. The 12% gap is recoverable by eliding the mask under a
static-<32 bound (constant or range-carried) — the same proof-carrying-facts
pattern as clamp-elision. Pinned 0.37.1 (single current toolchain) not 0.37.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avrabe
avrabe merged commit ec61d27 into main Jul 10, 2026
60 checks passed
@avrabe
avrabe deleted the perf/synth-0371-repin-sweep branch July 10, 2026 12:04
avrabe added a commit that referenced this pull request Jul 10, 2026
…69×→1.50× (#159)

synth 0.38.0 ships the mask-elision lever gale filed (synth#686/#692,
`SYNTH_SHIFT_MASK_ELIDE`, flag-off): it elides #682's mod-32 `AND rm,#31` shift
mask where the amount is provably <32 — exactly gale's gust_mix (Q8 constant
shifts). Re-dissolved cm3+cm4 with the flag:

  fn-only 0.675 → 0.600 ticks/call (−11%), .text 82 → 68 B (−17%),
  ratio vs native LLVM 1.69× → 1.50× — best measured on the shipped path.

Correctness-gated: gust_floor_bench soundness `mix_proven ≡ mix_native ≡
gust_mix` over [524,1524] PASSES; proof-carrying floor still 0.45×; in-range
dissolved 1.55× → 1.40×. silicon_bench links cleanly for thumbv7em.

NOTE: the relocatable .o grew 432 → 496 B despite the smaller .text — that's
0.38.0's new ELF metadata (#656 STB_LOCAL internal symbols + #637
.ARM.attributes), dropped/merged at link time, so flash footprint tracks the
68 B .text. 0.38.0 DEFAULT (flag-off) is perf-neutral (1.69×, .text 82) — the
release adopt is safe; the win needs the flag. build.rs recipe updated.

Ladder: 1.81× (stale) → 1.69× (0.37.1, #157) → 1.50× (0.38.0 elide) → 0.45×
(clamp-elision floor, synth#494 phase-2). Reporting the measured 1.50× to
synth#686 as the arc toward default-on.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant