Commit b20fad1
Revert flat_mode to value-level; 68ae496 was a no-op [perf]
Commit 68ae496 made `flat_mode` type-level on the theory that the value-level
form could fail to constant-fold under GPU const-prop and emit a checked getfield
-> InvalidIR. That was the wrong culprit: the real GPU-InvalidIR was
`_col_major_offset`'s tuple tail-recursion, fixed in e4a15ba via unrolled_reduce.
With _col_major_offset fixed, the type-level form makes no difference across any
metric, so restore the simpler value-level `flat_mode` (identical to F1's original
bd53967 form). Verified locally (device-free GPUCompiler CompilerJob + CPU
code_typed/code_llvm, reverted vs HEAD, plus a 3-lens adversarial re-check):
- GPU: bycolumn_kernel! (extruded + column) and eager_copyto_stencil_kernel!
(matrix TridiagonalMatrixRow) all compile clean -- same verdicts as type-level.
- CPU: getindex/setindex! codegen byte-identical across the layout matrix
(0 div/rem, 0 alloc, flat_mode fully folded, no surviving dynamic dispatch);
flat_mode(data) === flat_mode(typeof(data)) for every layout.
- DataLayouts unit_struct / unit_loops / unit_fill_and_copyto: byte-identical
Test Summary lines, 0 Fail/Error.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent e4a15ba commit b20fad1
1 file changed
Lines changed: 12 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 114 | | |
124 | 115 | | |
125 | 116 | | |
| |||
0 commit comments