Skip to content

test: every surface construct is held to the program node it lowers to - #215

Merged
FBumann merged 1 commit into
mainfrom
test/lowering-node-claims
Aug 28, 2026
Merged

FBumann merged 1 commit into
mainfrom
test/lowering-node-claims

Conversation

@FBumann

@FBumann FBumann commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Prompt: "Check the latest 4 open issues. CLosable? Otherwise implement them as PRs"

Note

The following content was generated by AI.

Thirteen rows, expression text in and one program node out: sum(by=), at(by=), shift and sum_back are now held to the node they become and every field it arrives with. Closes #212.

Nothing in src/ changes.

What the table adds, and why a whole-node compare

tests/test_program_nodes.py (#201) asks whether each node kind is reached by some file, and Footprint.shapes (#207) reports the same axis. Any mapping of the four constructs onto five node types passes both. Before this, GroupSum, Translate and Window appeared under tests/ only as hand-built entries in the FAN_IN table — constructed by tests, asserted as lowering's output nowhere.

The nodes are frozen dataclasses, so one == per row asserts the kind and over, into, wrap, fill, partition and width together — the fields a partial assertion skips.

The shape claims, each a row of its own:

  • sum_back(within=3) is one Window, not three Translates summed — the number of terms must not be readable from data.
  • by=[lk] and by=lk land on the identical node.
  • by=[lk, lk2] is one GroupSum with paired tuples, not nested groupings.
  • offset=lead carries the parameter name, not a resolved node.
  • by= on shift/sum_back reaches the node as partition.

The fixture is fixtures.SMALL_MODEL plus a second groupable lookup and an int parameter, local to the module. tests/test_dimensions.py::BASE was the other candidate; sharing it would couple the dim rules' fixture to a table that will grow with the operator set, which is a coupling neither side asked for.

Verification

pixi run ci green on the branch (lint, 772 tests, docs-build, compile-tex).

A green suite proves nothing about a table nobody can break, so four mis-lowerings were introduced in src/math_spec/lowering.py one at a time and the table run against each:

mutation result
GroupSum swaps into and coordinate 1 failed, 2 passed
Window drops its partition 1 failed, 12 passed
Translate loses the sign of a literal offset 1 failed, 7 passed
at() lowers to a GroupSum 1 failed, 5 passed

Each mutation reverted; the tree here is unmutated.

Not done

The other eight claims #209 lists, and the vocabulary agreement in its comment — separate PRs on the same base, since #212 is only the shape half.

Closes #212

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@FBumann
FBumann requested a review from brynpickering as a code owner August 28, 2026 13:04
@FBumann
FBumann merged commit e1707e3 into main Aug 28, 2026
5 checks passed
@FBumann
FBumann deleted the test/lowering-node-claims branch September 9, 2026 06:46
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.

which node each construct lowers to is asserted nowhere: GroupSum, Translate and Window are built in no test

1 participant