test: every surface construct is held to the program node it lowers to - #215
Merged
Merged
Conversation
Closes #212 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Note
The following content was generated by AI.
Thirteen rows, expression text in and one program node out:
sum(by=),at(by=),shiftandsum_backare 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, andFootprint.shapes(#207) reports the same axis. Any mapping of the four constructs onto five node types passes both. Before this,GroupSum,TranslateandWindowappeared undertests/only as hand-built entries in theFAN_INtable — constructed by tests, asserted as lowering's output nowhere.The nodes are frozen dataclasses, so one
==per row asserts the kind andover,into,wrap,fill,partitionandwidthtogether — the fields a partial assertion skips.The shape claims, each a row of its own:
sum_back(within=3)is oneWindow, not threeTranslates summed — the number of terms must not be readable from data.by=[lk]andby=lkland on the identical node.by=[lk, lk2]is oneGroupSumwith paired tuples, not nested groupings.offset=leadcarries the parameter name, not a resolved node.by=onshift/sum_backreaches the node aspartition.The fixture is
fixtures.SMALL_MODELplus a second groupable lookup and an int parameter, local to the module.tests/test_dimensions.py::BASEwas 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 cigreen 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.pyone at a time and the table run against each:GroupSumswapsintoandcoordinateWindowdrops itspartitionTranslateloses the sign of a literal offsetat()lowers to aGroupSumEach 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.