Commit 7674214
committed
Migration and commit message by Claude Sonnet
Complete elimination of dedicated_access type and migration to proper operation abstractions
This commit completes the big refactoring to eliminate the dedicated_access type and
migrate to cleaner, more type-safe abstractions while maintaining interface compatibility.
## Major Changes
### Eliminated dedicated_access Type
- Removed `dedicated_access` type entirely from `arrayjit/lib/low_level.ml` and `.mli`
- Migrated `Merge_buffer` access to new `Get_merge_buffer` variant in `float_t` type
- Eliminated GPU-incompatible `C_function` and `External_unsafe` variants completely
- Updated all pattern matches across low_level.ml, c_syntax.ml, and shape.ml
### Enhanced Operation System
- Moved `Uint4x32_to_prec_uniform` from fetch_op to proper unary operation in `ops.ml`
- Added corresponding `Uint4x32_to_prec` transpose type in shape system
- Added placeholder implementations in CUDA and Metal backends
- Proper shape inference support for precision conversion operations
### Improved Type Safety and Consistency
- Added `terminal_type` for unified shape inference from init_data and fetch_op
- Updated `tensor.mli` to use `terminal_op` parameter in `op` function signature
- Maintained backward compatibility in `term` function interface (init_data/fetch_op)
- Consistent handling of merge buffer operations across all backends
### Code Quality Improvements
- Added comprehensive FIXME comments for unimplemented functionality
- Updated documentation to reflect new type organization
- Eliminated all compiler warnings about missing pattern cases
- Maintained 1-to-1 correspondence with old functionality where intended
## Files Modified
- `arrayjit/lib/low_level.ml` and `.mli` - Removed dedicated_access, added Get_merge_buffer
- `arrayjit/lib/ops.ml` - Added Uint4x32_to_prec_uniform unary operation
- `arrayjit/lib/assignments.ml` - Removed C_function and External_unsafe variants
- `arrayjit/lib/c_syntax.ml` - Updated pattern matches and added Get_merge_buffer support
- `arrayjit/lib/cuda_backend.ml` - Added Uint4x32_to_prec_uniform placeholder
- `arrayjit/lib/metal_backend.ml` - Added Uint4x32_to_prec_uniform placeholder
- `lib/shape.ml` and `.mli` - Added terminal_type and Uint4x32_to_prec support
- `lib/tensor.ml` and `.mli` - Updated operation signatures with terminal_op support
- `lib/operation.ml` - Migrated all calls to use new interfaces
## Testing Status
✅ All compilation errors resolved
✅ All pattern match warnings eliminated
✅ Backward compatibility maintained for key interfaces
1 parent ad9a53e commit 7674214
File tree
9 files changed
+108
-161
lines changed- arrayjit/lib
- lib
9 files changed
+108
-161
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
172 | 171 | | |
173 | 172 | | |
174 | 173 | | |
175 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| |||
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
269 | | - | |
270 | | - | |
271 | | - | |
| 270 | + | |
272 | 271 | | |
273 | 272 | | |
274 | 273 | | |
| |||
358 | 357 | | |
359 | 358 | | |
360 | 359 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | 360 | | |
368 | 361 | | |
369 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
| 595 | + | |
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | 604 | | |
633 | 605 | | |
634 | 606 | | |
| |||
672 | 644 | | |
673 | 645 | | |
674 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
675 | 654 | | |
676 | 655 | | |
677 | 656 | | |
| |||
692 | 671 | | |
693 | 672 | | |
694 | 673 | | |
695 | | - | |
| 674 | + | |
696 | 675 | | |
697 | 676 | | |
698 | 677 | | |
| |||
708 | 687 | | |
709 | 688 | | |
710 | 689 | | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | 690 | | |
751 | 691 | | |
752 | 692 | | |
| |||
778 | 718 | | |
779 | 719 | | |
780 | 720 | | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
781 | 728 | | |
782 | 729 | | |
783 | 730 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
480 | 483 | | |
481 | 484 | | |
482 | 485 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
| |||
176 | 179 | | |
177 | 180 | | |
178 | 181 | | |
179 | | - | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
183 | 188 | | |
184 | 189 | | |
185 | 190 | | |
| |||
259 | 264 | | |
260 | 265 | | |
261 | 266 | | |
262 | | - | |
| 267 | + | |
263 | 268 | | |
264 | 269 | | |
265 | 270 | | |
| |||
269 | 274 | | |
270 | 275 | | |
271 | 276 | | |
272 | | - | |
273 | 277 | | |
274 | 278 | | |
275 | 279 | | |
| |||
405 | 409 | | |
406 | 410 | | |
407 | 411 | | |
408 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
409 | 425 | | |
410 | 426 | | |
411 | 427 | | |
| |||
530 | 546 | | |
531 | 547 | | |
532 | 548 | | |
533 | | - | |
| 549 | + | |
534 | 550 | | |
535 | 551 | | |
536 | 552 | | |
| |||
607 | 623 | | |
608 | 624 | | |
609 | 625 | | |
610 | | - | |
| 626 | + | |
611 | 627 | | |
612 | 628 | | |
613 | 629 | | |
| |||
689 | 705 | | |
690 | 706 | | |
691 | 707 | | |
692 | | - | |
| 708 | + | |
693 | 709 | | |
694 | 710 | | |
695 | 711 | | |
| |||
717 | 733 | | |
718 | 734 | | |
719 | 735 | | |
720 | | - | |
| 736 | + | |
721 | 737 | | |
722 | 738 | | |
723 | 739 | | |
| |||
779 | 795 | | |
780 | 796 | | |
781 | 797 | | |
782 | | - | |
| 798 | + | |
783 | 799 | | |
784 | 800 | | |
785 | 801 | | |
| |||
886 | 902 | | |
887 | 903 | | |
888 | 904 | | |
889 | | - | |
| 905 | + | |
890 | 906 | | |
891 | 907 | | |
892 | 908 | | |
| |||
984 | 1000 | | |
985 | 1001 | | |
986 | 1002 | | |
987 | | - | |
| 1003 | + | |
988 | 1004 | | |
989 | 1005 | | |
990 | 1006 | | |
| |||
1057 | 1073 | | |
1058 | 1074 | | |
1059 | 1075 | | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
| 1076 | + | |
1068 | 1077 | | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | 1078 | | |
1077 | 1079 | | |
1078 | 1080 | | |
| |||
1139 | 1141 | | |
1140 | 1142 | | |
1141 | 1143 | | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
| 1144 | + | |
1150 | 1145 | | |
1151 | | - | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
1158 | 1146 | | |
1159 | 1147 | | |
1160 | 1148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
558 | 561 | | |
559 | 562 | | |
560 | 563 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
384 | 387 | | |
385 | 388 | | |
386 | 389 | | |
| |||
528 | 531 | | |
529 | 532 | | |
530 | 533 | | |
| 534 | + | |
| 535 | + | |
531 | 536 | | |
532 | 537 | | |
533 | 538 | | |
| |||
573 | 578 | | |
574 | 579 | | |
575 | 580 | | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
576 | 584 | | |
577 | 585 | | |
578 | 586 | | |
| |||
0 commit comments