Skip to content

Inline the backward panel kernels into the driver - #46

Merged
ChrisRackauckas merged 1 commit into
JuliaSIMD:mainfrom
ChrisRackauckas-Claude:inline-backward-kernels
Aug 8, 2026
Merged

Inline the backward panel kernels into the driver#46
ChrisRackauckas merged 1 commit into
JuliaSIMD:mainfrom
ChrisRackauckas-Claude:inline-backward-kernels

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown

⚠️ Draft — please ignore until reviewed by @ChrisRackauckas.

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)) on uldiv_solve_W_u! and uldiv_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

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>
@JuliaRegistrator

Copy link
Copy Markdown

Error while trying to register: Register Failed
@ChrisRackauckas-Claude, it looks like you are not a publicly listed member/owner in the parent organization (JuliaSIMD).
If you are a member/owner, you will need to change your membership to public. See GitHub Help

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 8, 2026 09:15
@ChrisRackauckas
ChrisRackauckas merged commit 90d8192 into JuliaSIMD:main Aug 8, 2026
5 checks passed
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.63%. Comparing base (e4d4714) to head (4084545).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants