Inline the backward panel kernels into the driver - #46
Merged
ChrisRackauckas merged 1 commit intoAug 8, 2026
Merged
Conversation
The last measurable backward-vs-forward difference was a fixed ~5 ns (~20 cycle) cost per kernel call: the compiled bodies contain identical vector work (every FP opcode count matches) but the backward one carries +15 integer bookkeeping instructions and two more callee-saved registers, of which llvm-mca models only about half the observed cost; source-level variants (sinking the pre-offset pointers under the loop guard, absolute-index loops, store-order changes) did not move it. Inlining uldiv_solve_W_u! and uldiv_solve_W! into _ldiv_U! removes the call boundary altogether and lets LLVM hoist stride-invariant setup out of the driver loop. The R-remainder and small kernels keep their calls (they sit behind @nif dispatch). Left-upper vs left-lower ldiv! at equal UNIT (min times, EPYC 7502): n=36 1.09x, n=48 1.06x, n=128 1.02x, n>=256 1.00-1.01x. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
|
Error while trying to register: Register Failed |
ChrisRackauckas
marked this pull request as ready for review
August 8, 2026 09:15
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #46 +/- ##
==========================================
+ Coverage 94.62% 94.63% +0.01%
==========================================
Files 1 1
Lines 837 839 +2
==========================================
+ Hits 792 794 +2
Misses 45 45 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Carries the final commit of the gap hunt, which was pushed to the #45 branch a few minutes after #45 was merged and therefore never landed on main. Cherry-picked onto current main; the resulting tree is bit-identical to the tree that was validated in #45's round-3 report (suite 148,781/148,781, extended sweep, packed-LU, zero-alloc checks), so that verification applies verbatim.
Content:
$(Expr(:meta, :inline))onuldiv_solve_W_u!anduldiv_solve_W!(unique driver call sites), removing the last measured backward-vs-forward difference — a fixed ~5 ns/kernel-call boundary cost that source-level variants could not close (full attribution in #45 (comment)). Final gap at equal UNIT flag: n=36 1.09x, n=48 1.06x, n=64 1.04x, n=128 1.02x, n≥256 1.00-1.01x.No version bump needed: 0.2.3 (from #45) is not yet registered, so this rides in it. After merge, 0.2.3 registration needs an org member's
@JuliaRegistrator register.🤖 Generated with Claude Code