Skip to content

pushpull: device dispatch for pull/push/count/grad_backward - #46

Merged
balbasty merged 2 commits into
mainfrom
claude/pushpull-grid-backward
Aug 1, 2026
Merged

pushpull: device dispatch for pull/push/count/grad_backward#46
balbasty merged 2 commits into
mainfrom
claude/pushpull-grid-backward

Conversation

@balbasty

Copy link
Copy Markdown
Collaborator

Part of the stack for fastfields-torch#16 (backpropagate through the pushpull sampling grid).

Stacked PR. Base is claude/cuda-pushpull-dynamic-spline, not main. The cpu/cuda pins point at cpu-lib#49 / cuda-lib#32, both unmerged — re-bump once the parents land.

What

Thin hub wrappers, identical in shape to the forward four: require_same_device across every operand, then forward to FF_CUDA:: or FF_CPU::. Plus the two submodule pin bumps.

Together with the layers below, this is what lets fastfields.torch differentiate pull/push through the sampling grid.

MIGRATION.md: pushpull's row now reads pull/push/count/grad and their four adjoints (only hess remains impl-only), and records the four latent jitfields bugs the new finite-difference oracle turned up, plus the build-cost reasoning behind the separate pushpull_backward module.

Verification

libfastfields.so links and exports all four:

ff::pull_backward(DLTensor&, DLTensor&, DLTensor const&, DLTensor const&, DLTensor const&, ...)
ff::push_backward(...)
ff::count_backward(...)
ff::grad_backward(...)

Downstream, the full Python stack was rebuilt against this and passes: fastfields-dlpack 36 tests, fastfields-torch 104 tests (including 26 new gradchecks that exercise these entry points end-to-end).

Workstream: claude-jitfields-to-fastfields

🤖 Generated with Claude Code


Generated by Claude Code

Thin hub wrappers, identical in shape to the forward four: check that every
operand is on the same device, then forward to FF_CUDA:: or FF_CPU::. Bumps
both submodule pins to the commits that add the ops.
Together with the layers below, this is what lets `fastfields.torch`
differentiate `pull`/`push` through the sampling `grid` (fastfields-torch#16).
MIGRATION.md: pushpull's row now reads pull/push/count/grad *and* their four
adjoints (only `hess` remains impl-only), and records the four latent
jitfields bugs the new finite-difference oracle turned up plus the
build-cost reasoning behind the separate `pushpull_backward` module.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z

@balbastybalbasty left a comment

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to go

Base automatically changed from claude/cuda-pushpull-dynamic-spline to mainJuly 31, 2026 22:22
… conflicts
Both main and this branch independently re-pinned cpu (-> cpu-lib#49's
merge, 6aaa159) and cuda (-> cuda-lib#32's merge, 3be8587) since their
common ancestor. Both merged SHAs are descendants of what main had
(cpu-lib#48's and cuda-lib#31's merges respectively), so they are the
correct resolution.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
@balbasty
balbasty merged commit 87d4fb7 into mainAug 1, 2026
1 check passed
@balbasty
balbasty deleted the claude/pushpull-grid-backward branch August 1, 2026 00:02
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@balbasty@claude