Repository navigation
perf(gust): re-pin gust_mix to synth 0.37.1 — 1.81×→1.69× (stale-pin refresh) - #157
Merged
Merged
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Re-pin the dissolved
gust_mixbench 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)
.text(gust_mix)−7% cycles, −9%
.text. Directly serves the 0.7× dissolved-vs-native goal.Correctness gates (all pass)
gust_floor_benchsoundness assertionmix_proven ≡ mix_native ≡ gust_mixover[524,1524]— sound (the dissolved 0.37.1 object computes identically to native).silicon_benchlinks cleanly forthumbv7em-none-eabiwith the new cm4 object.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<32and never need the runtime mask. The 12% gap is recoverable by eliding the mask under a static-<32bound — 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_mixobjects + 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