Remove "atom specific" functions from matrix classes - PR 3 - #122
Merged
Merged
Conversation
…(lesson 3, M2b) The three broadcast variants are row gathers with fixed maps over the column-major output index r = i + j*d1: ROW copies child row j, COL copies child row i, SCALAR copies row 0. The atom builds that map in jacobian_init; the broadcast_alloc / broadcast_fill_values slots, their sparse, permuted_dense and stacked_pd kernels, and the now-unused tile_int helper are removed. broadcast_type moves from matrix.h to subexpr.h, its only remaining user. Two new atom-level tests prove a pd child stays pd through ROW and COL broadcasts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Azb8o1AgiFRU4t9aAY7oDr
dance858
force-pushed
the
row-gather-broadcast
branch
from
September 12, 2026 21:25
bdef1e5 to
adf46d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the broadcast variants from the matrix class. Finishes the clean up for a better abstraction.
Claude below:
Summary
Third PR of lesson 3 (M2b), rebased onto
mainafter #121 merged.r = i + j*d1: ROW copies child rowj, COL copies child rowi, SCALAR copies row 0.jacobian_init_implbuilds the map, callsrow_gather_alloc, frees it;eval_jacobian_implcallsrow_gather_fill_values.broadcast_alloc/broadcast_fill_valuesslots,sparse_broadcast_*,broadcast_pd_*(+ decls), the stacked_pd ctx/wrapper/vtable functions, their wiring, andtile_int(its only caller was the sparse broadcast kernel).broadcast_typemoves frommatrix.htosubexpr.h, its only remaining user.Tests
test_broadcast_row_jacobian_pd_preservedandtest_broadcast_col_jacobian_pd_preserved: a pd child Jacobian stays pd through ROW and COL broadcasts, values checked row by row.test_permuted_dense_broadcast_{scalar,row,col},test_spd_vtable_broadcast_row); the M1 gather tests cover the kernels.