Skip to content

rules: explicitly prohibit handwritten contraction kernels - #31

Merged
shinaoka merged 1 commit into
mainfrom
docs/no-handwritten-contraction-kernels
Oct 31, 2026
Merged

shinaoka merged 1 commit into
mainfrom
docs/no-handwritten-contraction-kernels

Conversation

@shinaoka

@shinaoka shinaoka commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Add one short paragraph next to the existing owning-backend/linalg rule in rules/rust/performance.md:

  • Explicitly prohibit repository-local scalar-accumulate kernels for contractions, GEMM, decompositions and solves; use einsum_tensors, tcontract, tlinalg, or the owning backend provider.
  • State why: bypassed tuned paths, threading/SIMD policy, and numeric contracts.
  • Require // contraction-kernel-ok: <reason> immediately above a genuinely unavoidable loop and disclose the exception in the PR description.

The identical paragraph is added near the top of tenferro-rs's AGENTS.md, alongside a mechanically enforced CI guard, in tensor4all/tenferro-rs#2347. This PR only adds the paragraph: no restructuring, dependencies or other rule changes.

Background: tensor4all/tensor4all-rs#1064's SimpleTensorTrain::full_tensor shipped a scalar axpy nest despite the existing owning-abstraction rule. The enforcement PR is in tenferro-rs as requested; this shared paragraph documents the same exception convention.

Validation

  • Reproduced the existing validate-rules workflow's Python standard-library relative-link check: all 15 rules/index.md links resolve.
  • Checked that the new paragraph is byte-identical to the paragraph in tenferro-rs AGENTS.md.
  • git diff --check passed; only rules/rust/performance.md changed.
  • Bounded independent GPT review covered this paragraph and the companion guard; no finding against this paragraph.
  • Hosted validate-rules CI passed on head 4d1a34eee87b18f8532dea3d8ba47daeb6d70587.

Do not merge or enable auto-merge.

@shinaoka
shinaoka merged commit 5308b84 into main Oct 31, 2026
1 check passed
@shinaoka
shinaoka deleted the docs/no-handwritten-contraction-kernels branch October 31, 2026 01:33
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