Skip to content

Remove "atom specific" functions from matrix classes - PR 2 - #121

Merged
dance858 merged 1 commit into
mainfrom
row-gather-promote
Sep 12, 2026
Merged

dance858 merged 1 commit into
mainfrom
row-gather-promote

Conversation

@dance858

Copy link
Copy Markdown
Collaborator

Summary

Second PR of lesson 3, first of the three-way split of M2 (promote; broadcast; diag_vec).

  • promote's Jacobian is a row gather with an all-zero map. jacobian_init_impl builds the map, calls row_gather_alloc, frees it; eval_jacobian_impl calls row_gather_fill_values.
  • Deleted: promote_alloc / promote_fill_values slots in matrix.h, sparse_promote_*, promote_pd_* (+ public decls), the stacked_pd wrapper and vtable functions, and their wiring.
  • No behaviour change: the gather produces the same CSR / pd / spd structure the promote kernels did. The result now carries the bound map (bound_iwork) that promote did not need.

Tests

  • New test_promote_jacobian_pd_preserved: a pd child Jacobian stays pd through promote, with row_perm and tiled values checked.
  • Removed test_permuted_dense_promote and test_spd_vtable_promote (they exercised the deleted slot; the M1 gather tests cover the kernels).
  • Existing promote forward / Jacobian / problem-level tests unchanged.

452 tests Release, 454 with SP_TRACK_MEMORY. UBSan, guard-malloc + leaks, PROFILE_ONLY, clang-format clean. Mutation check: a non-zero map crashes the first promote test.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Azb8o1AgiFRU4t9aAY7oDr

…son 3, M2a)

promote's Jacobian is a row gather with an all-zero map. The atom now builds
that map in jacobian_init and calls row_gather_alloc/fill_values; the
promote_alloc / promote_fill_values slots and their sparse, permuted_dense
and stacked_pd kernels are removed. New atom-level test proves a pd child
Jacobian stays pd through promote.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Azb8o1AgiFRU4t9aAY7oDr
@dance858 dance858 changed the title Migrate promote onto row_gather; delete the promote vtable slots (lesson 3, M2a) Remove "atom specific" functions from matrix classes - PR 2 Sep 12, 2026
@dance858
dance858 merged commit b6c61c9 into main Sep 12, 2026
12 checks passed
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