Commit 2e9ee1f
committed
Restore §3.3.3 truncation cases in the divisibility check
The strong divisibility check from the previous commit fixes the
wrong-answer composition from #3177, but rejects the paper's §3.3.3
"apparent violation" cases that produce well-defined results, e.g.
A = (4,2,8):(3,12,97), B = 3:3 -> 3:9
After the public composition() coalesces A to (8,8):(3,97), the
strong check sees `8 % 3 != 0` and refuses to compile, even though
A(0)=0, A(3)=9, A(6)=18 is well-defined.
Add a third disjunct that accepts the safe-truncation pattern: when
B's entire image fits inside the current LHS mode, higher modes are
unreachable and cannot perturb the result. This is the §3.3.3
distinction between "apparent" and "real" divisibility violations.
Predicate now accepts iff at least one of:
(a) (rest_stride % curr_shape) == 0 -- skip mode entirely
(b) (curr_shape % rest_stride) == 0 -- partial traversal
(c) (rest_shape - 1) * rest_stride < curr_shape
-- safe truncation: B's image
stays within the current mode
Verification matrix:
Case Pre-coalesce LHS Decision
---------------------------------- --------------------- --------
paper §3.3.3 ok (returns 3:9) (8,8):(3,97) o 3:3 accept
paper §3.3.3 fail-left (8,8):(3,97) o 4:3 reject
paper §3.3.3 fail-right (4,2,8):(3,15,97) o 3:3 reject
wrong-answer bug #3177 (4,6,8):(2,3,5) o 6:3 reject
CuTe test (8,8):(8,1) o 2:3 (8,8):(8,1) o 2:3 accept
CuTe test (8,8):(8,1) o 3:3 (8,8):(8,1) o 3:3 accept
CuTe test (8,8):(8,1) o 4:3 (8,8):(8,1) o 4:3 reject
Reference: arXiv:2603.02298 §3.3.3.1 parent 433fd67 commit 2e9ee1f
2 files changed
Lines changed: 59 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1075 | 1075 | | |
1076 | 1076 | | |
1077 | 1077 | | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1081 | 1094 | | |
1082 | 1095 | | |
1083 | | - | |
| 1096 | + | |
| 1097 | + | |
1084 | 1098 | | |
1085 | 1099 | | |
1086 | 1100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
465 | 485 | | |
466 | 486 | | |
467 | | - | |
| 487 | + | |
468 | 488 | | |
469 | 489 | | |
| 490 | + | |
| 491 | + | |
470 | 492 | | |
471 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
472 | 501 | | |
473 | 502 | | |
474 | 503 | | |
| 504 | + | |
| 505 | + | |
475 | 506 | | |
476 | | - | |
477 | | - | |
| 507 | + | |
| 508 | + | |
478 | 509 | | |
479 | 510 | | |
480 | 511 | | |
| |||
0 commit comments