lgj-abi: lgj_hop conjunction as one ternlog pass; lane read as a lane (5×) - #73
lgj-abi: lgj_hop conjunction as one ternlog pass; lane read as a lane (5×)#73AdaWorldAPI wants to merge 2 commits into
Conversation
selected = class_f AND src AND struct_f was two mask_and_assign passes through a scratch write. AND is the rank-1 spelling of a 3-input mask op; the conjunction is now one mask_ternlog_assign::<AND3> pass (one VPTERNLOGQ per 512 bits) through a new kernels::simd_mask_ternlog_assign wrapper and a kernels::ternlog re-export, so exports names kernels::ternlog::AND3 and never reaches past kernels for SIMD vocabulary (abi.md §8). The lgj_hop doc block still described the PR #39 gather that R1 (0385269) reversed; rewritten to the shipped mask-algebra shape with the arc named and the next rung (dst = src ⊗ A over the V3 EdgeBlock, decode modes 1..=3) stated. columnar_hop_bench, 65 536 rows, 32 facets, equivalence asserted before timing: 6 342 / 6 408 / 7 547 us -> 1 203 / 1 101 / 1 851 us (classid / hop2 / all). Most of that is the ndarray-side finding this exposed: eq_u32_strided_to_mask at stride 4 — every lane of the facet-major store — gathered 16 scalar reads into a temporary before the vector compare. Fixed in the primitive (ndarray, same branch name); no change needed here. No ABI symbol, no minor bump, no Java change. Gates: fmt clean, 138/138 + 3/3 tests incl. the pinned 10 -> 19 -> 29 hop regression on both layouts, clippy --all-targets -D warnings clean. LATEST_STATE entry in this commit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WkNBjHc2e3zuyz9i8qJEv
|
Warning Review limit reachedNext included review available in 57 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 71 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (3)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughThe change adds a ternary SIMD mask wrapper and updates Changeslgj_hop ternary-mask optimization
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This updates lgj_hop to combine its selection masks in one SIMD AND3 pass while retaining the existing scatter behavior. No current merge-blocking risk remains. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_52c2f617-eacb-4131-ad30-4d2f54aa3f31) |
…path-validation-170zcy # Conflicts: # .claude/board/LATEST_STATE.md
What
lgj_hop's selectionselected = class_f ∧ src ∧ struct_fwas spelled as twomask_and_assignpasses through a scratch write. AND is the rank-1 spelling of a 3-input mask op; the conjunction is now onemask_ternlog_assign::<AND3>pass (oneVPTERNLOGQper 512 bits) via a newkernels::simd_mask_ternlog_assignwrapper +kernels::ternlogre-export —exportsnameskernels::ternlog::AND3, neverndarray::simddirectly (abi.md §8).The
lgj_hopdoc block still described the PR #39 gather that R1 (0385269) reversed; rewritten to the shipped mask-algebra shape with the arc named and the next rung (dst = src ⊗ Aover the V3EdgeBlock, decode modes 1..=3) stated.No ABI symbol, no minor bump, no Java change.
LATEST_STATEentry in the same commit.Depends on AdaWorldAPI/ndarray#301 (same branch name) —
mask_ternlog+ the contiguous fast path. Path dep, so this builds once that lands or against that branch checked out at../../../ndarray.Measured
columnar_hop_bench, 65 536 rows × 32 facets, equivalence asserted before timing:The ternlog wire is one of three mask passes and cannot account for 5×. The bulk is what it exposed on the ndarray side:
eq_u32_strided_to_maskatstride_bytes == 4— every lane of the minor-10 facet-major store — gathered 16 bounds-checked scalar reads into a temporary before the vector compare. The store was contiguous; the kernel read it as strided. 2.1 GB/s → ~13 GB/s, fixed in the primitive, solgj_op_eq_classidand every other stride-4 caller gets it with no change here.Gates
lgj-abi:
cargo fmt --checkclean ·cargo test138/138 + 3/3 (incl. the pinned 10 → 19 → 29 hop regression on both layouts, aliasing + reserved-mode falsifiers) ·cargo clippy --all-targets -- -D warningsclean. Java suite not re-run: no Java source or ABI surface changed; rebuild the.sobefore the next Java run.Not here (own PR)
The BBB fence: no byte offset, stride, slot index, or carving width in any public Java signature (
WideFieldMask.ofFacets(int…), the 97LgjLaneDesclanes, the*Ataccessors). The wall passes handles, classids, names, counts, statuses.🤖 Generated with Claude Code
https://claude.ai/code/session_016WkNBjHc2e3zuyz9i8qJEv
Generated by Claude Code
Summary by CodeRabbit
Performance
lgj_hopselection performance by streamlining mask processing and reducing intermediate work.Behavior
Validation