Skip to content

test(lowering): a where atom reaches the program as the file wrote it - #288

Merged
FabianHofmann merged 1 commit into
feat/where-membershipfrom
test/membership-reaches-the-program
Aug 31, 2026
Merged

FabianHofmann merged 1 commit into
feat/where-membershipfrom
test/membership-reaches-the-program

Conversation

@FBumann

@FBumann FBumann commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Prompt: "Is it missing lowering into the program?" … "Lets do the missing test as a stacked PR!"

Note

The following content was generated by AI.

Stacked on #283. A where atom is the program's predicate — no lowering case rewrites one — which is why #283 needs no lowering.py change. Nothing asserted that, so this does, for all four left-hand kinds in accepts.

The three suites #283 already has each stop short of it: resolution proves the node is built, the walk and golden tests prove it prints. Neither asks whether it survives the pass in between, and a node dropped there fails silently — the mask becomes None, the declaration builds every row, and the model solves the wrong problem.

Verified with pixi run ci on 56593c5 — lint clean, 869 passed (865 + 4), docs --strict, 26 documents compiled. Nothing skipped.

Delete-the-guard

Made resolution drop a membership atom on the way to the program:

folded = _fold(BooleanLiteralNode(True) if isinstance(resolved, _PM) else resolved)
E  +  where None = VariableDeclaration(dims=('g',), where=None, …).where
FAILED test_a_membership_mask_reaches_the_program_unchanged[over-a-parameter]
1 failed, 3 passed

That is the failure this pins: not an error, a silently unmasked declaration.

Why here and not a row in `test_where_lowering`

test_where_lowering reads resolution.where_of directly, so a row there would re-assert what #283's test_validation.py cases already cover. test_lower_program_structure is the one that goes through lower_program and reads .where off the built declaration — this follows that, over SMALL_MODEL, which already carries a parameter, two dimensions, a groupable lookup and a label space.

@FabianHofmann
FabianHofmann merged commit 80239e0 into feat/where-membership Aug 31, 2026
5 checks passed
@FBumann
FBumann deleted the test/membership-reaches-the-program 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.

2 participants