Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.

fix: give the field regulariser _jrls kernels a real per-channel weight stride - #70

Merged
balbasty merged 1 commit into
mainfrom
claude/65-jrls-per-channel-weight
Aug 2, 2026
Merged

fix: give the field regulariser _jrls kernels a real per-channel weight stride#70
balbasty merged 1 commit into
mainfrom
claude/65-jrls-per-channel-weight

Conversation

@balbasty

Copy link
Copy Markdown
Collaborator

Summary

matvec/diag for absolute/membrane/bending in the JRLS family
(regularisers/field/{1,2,3}d.h) read the weight value once, outside
any per-channel loop (w = *wgt), and applied that single value to
every channel. They had no per-channel stride parameter at all —
unlike their _rls siblings, whose wgt[wsc*c]-style indexing (fixed for
the wc=1 broadcast case by fastfields-kernels#48 / fastfields-cpu-lib#62)
is exactly the per-channel read the _jrls family was missing.

Fix

Give each _jrls kernel a wsc parameter and move the weight load inside
the per-channel loop, mirroring the corresponding _rls kernel's
structure exactly — including the neighbour-guard alt fallback for
membrane/bending at Zero/DST2 boundaries (from #52). relax_*_jrls_ is
unaffected here since it's built on matvec/diag at the driver layer,
so fixing those two propagates automatically.

Spans 6 kernel functions (matvec/diag × absolute/membrane/bending)
× 3 dimensionality files (1d.h/2d.h/3d.h) = 18 functions.

Verification

Header-only — no build of its own. Downstream driver changes (the actual
call sites that pass wsc) land in a fastfields-cpu-impl PR that bumps
this branch as its kernels pin; the ground-truth regression test and the
full make -C fastfields-cpu-lib test CXX=clang++ run (12/12 suites,
44988 checks, 0 failures) live in the fastfields-cpu-lib PR that closes
the tracking issue.

part of fastfields/fastfields-cpu-lib#65

Workstream: claude-jitfields-to-fastfields

🤖 Generated with Claude Code


Generated by Claude Code

…ht stride
matvec/diag for absolute, membrane, and bending in the JRLS family
(regularisers/field/{1,2,3}d.h) read the weight value once, outside any
per-channel loop (`w = *wgt`), and applied that single value to every
channel. They had no per-channel stride parameter at all, unlike their
_rls siblings whose `wgt[wsc*c]`-style indexing (fixed for the wc=1
broadcast case by #62/kernels#48) is exactly the per-channel read the
_jrls family was missing.
Give each _jrls kernel a `wsc` parameter and move the weight load inside
the per-channel loop, mirroring the corresponding _rls kernel's structure
exactly (including the neighbour-guard `alt` fallback for membrane/bending
at Zero/DST2 boundaries). relax_*_jrls_ is unaffected here since it's
built on matvec/diag at the driver layer.
part of fastfields-cpu-lib#65
_Workstream: claude-jitfields-to-fastfields_
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugSomething isn't workingclaude-jitfields-to-fastfields

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@balbasty@claude