fix(eval): resolve cross "topmost" via the order matrix, not array position #25

Closed
opened 2026-07-02 14:03:37 +00:00 by toph · 0 comments
Owner

The spec resolves a cross intersection on stacked layers to "the material point on the topmost layer". The implementation takes the last preimage in face-array iteration order (eval.ml:63) — but fold_state.ml:5 states that array index carries no z-meaning and all stacking lives in order. This only works today because of the deliberately preserved legacy append order plus flip reversing the array.

The moment a fold inserts a face between existing layers (pocket slice), cross silently returns the wrong material point. The covering faces pairwise overlap at the point, so their restriction of order is total and "topmost" is well-defined — consult the order matrix instead.

Must land before the pocket slice.

The spec resolves a `cross` intersection on stacked layers to "the material point on the topmost layer". The implementation takes the *last* preimage in face-array iteration order (`eval.ml:63`) — but `fold_state.ml:5` states that array index carries no z-meaning and all stacking lives in `order`. This only works today because of the deliberately preserved legacy append order plus `flip` reversing the array. The moment a fold inserts a face between existing layers (pocket slice), `cross` silently returns the wrong material point. The covering faces pairwise overlap at the point, so their restriction of `order` is total and "topmost" is well-defined — consult the order matrix instead. Must land before the pocket slice.
toph closed this issue 2026-07-02 22:07:05 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
toph/beloch#25
No description provided.