# SCM Repository

# Annotation of /branches/cuda/TODO

Parent Directory | Revision Log

Revision **1165** -
(**view**)
(**download**)

Original Path: *trunk/TODO*

1 : | glk | 1162 | NOTE: GLK's approximate ranking of 8 most important tagged with |

2 : | jhr | 1115 | [GLK:1], [GLK:2], ... |

3 : | |||

4 : | glk | 1156 | ======================== |

5 : | SHORT TERM ============= (*needed* for streamlines & tractography) | ||

6 : | ======================== | ||

7 : | jhr | 1115 | |

8 : | glk | 1162 | [GLK:3] Add sequence types (needed for evals & evecs) |

9 : | jhr | 1115 | syntax |

10 : | types: ty '{' INT '}' | ||

11 : | value construction: '{' e1 ',' … ',' en '}' | ||

12 : | indexing: e '{' e '}' | ||

13 : | |||

14 : | glk | 1162 | [GLK:4] evals & evecs for symmetric tensor[2,2] and |

15 : | tensor[3,3] (requires sequences) | ||

16 : | |||

17 : | glk | 1156 | ability to emit/track/record variables into dynamically re-sized |

18 : | runtime buffer | ||

19 : | jhr | 1115 | |

20 : | glk | 1156 | tensor fields: convolution on general tensor images |

21 : | jhr | 1115 | |

22 : | glk | 1156 | ======================== |

23 : | glk | 1162 | SHORT-ISH TERM ========= (to make using Diderot less annoying to |

24 : | ======================== program in, and slow to execute) | ||

25 : | jhr | 1115 | |

26 : | jhr | 1165 | value-numbering optimization [DONE, but needs more testing] |

27 : | jhr | 1115 | |

28 : | glk | 1162 | [GLK:1] Add a clamp function, which takes three arguments; either |

29 : | three scalars: | ||

30 : | clamp(lo, hi, x) = max(lo, min(hi, x)) | ||

31 : | or three vectors of the same size: | ||

32 : | clamp(lo, hi, [x,y]) = [max(lo[0], min(hi[0], x)), | ||

33 : | max(lo[1], min(hi[1], y))] | ||

34 : | This would be useful in many current Diderot programs. | ||

35 : | One question: clamp(x, lo, hi) is the argument order used in OpenCL | ||

36 : | and other places, but clamp(lo, hi, x) is much more consistent with | ||

37 : | lerp(lo, hi, x), hence GLK's preference | ||

38 : | jhr | 1115 | |

39 : | glk | 1162 | [GLK:2] Proper handling of stabilize method |

40 : | |||

41 : | allow "*" to represent "modulate": per-component multiplication of | ||

42 : | vectors, and vectors only (not tensors of order 2 or higher). Once | ||

43 : | sequences are implemented this should be removed: the operation is not | ||

44 : | invariant WRT basis so it is not a legit vector computation. | ||

45 : | |||

46 : | implicit type promotion of integers to reals where reals are | ||

47 : | required (e.g. not exponentiation "^") | ||

48 : | |||

49 : | [GLK:5] Save Diderot output to nrrd, instead of "mip.txt" | ||

50 : | jhr | 1115 | For grid of strands, save to similarly-shaped array |

51 : | For list of strands, save to long 1-D (or 2-D for non-scalar output) list | ||

52 : | For ragged things (like tractography output), will need to save both | ||

53 : | complete list of values, as well as list of start indices and lengths | ||

54 : | to index into complete list | ||

55 : | |||

56 : | glk | 1162 | [GLK:6] Use of Teem's "hest" command-line parser for getting |

57 : | jhr | 1115 | any input variables that are not defined in the source file |

58 : | |||

59 : | glk | 1162 | [GLK:7] ability to declare a field so that probe positions are |

60 : | glk | 1120 | *always* "inside"; with various ways of mapping the known image values |

61 : | to non-existant index locations. One possible syntax emphasizes that | ||

62 : | there is a index mapping function that logically precedes convolution: | ||

63 : | glk | 1162 | F = bspln3 ⊛ (img ◦ clamp) |

64 : | glk | 1120 | F = bspln3 ⊛ (img ◦ repeat) |

65 : | F = bspln3 ⊛ (img ◦ mirror) | ||

66 : | where "◦" or "∘" is used to indicate function composition | ||

67 : | jhr | 1115 | |

68 : | glk | 1162 | Level of differentiability in field type should be statement about how |

69 : | much differentiation the program *needs*, rather than what the kernel | ||

70 : | *provides*. The needed differentiability can be less than or equal to | ||

71 : | the provided differentiability. | ||

72 : | |||

73 : | glk | 1156 | Use ∇⊗ etc. syntax |

74 : | syntax [DONE] | ||

75 : | typechecking | ||

76 : | IL and codegen | ||

77 : | jhr | 1115 | |

78 : | glk | 1156 | Add type aliases for color types |

79 : | rgb = real{3} | ||

80 : | rgba = real{4} | ||

81 : | jhr | 1115 | |

82 : | ============================== | ||

83 : | glk | 1156 | MEDIUM TERM ================== (*needed* for particles) |

84 : | jhr | 1115 | ============================== |

85 : | |||

86 : | run-time birth of strands | ||

87 : | |||

88 : | "initially" supports lists | ||

89 : | |||

90 : | "initially" supports lists of positions output from | ||

91 : | different initalization Diderot program | ||

92 : | |||

93 : | glk | 1156 | Communication between strands: they have to be able to learn each |

94 : | other's state (at the previous iteration). Early version of this can | ||

95 : | have the network of neighbors be completely static (for running one | ||

96 : | strand/pixel image computations). Later version with strands moving | ||

97 : | through the domain will require some spatial data structure to | ||

98 : | optimize discovery of neighbors. | ||

99 : | jhr | 1115 | |

100 : | glk | 1156 | ============================ |

101 : | MEDIUM-ISH TERM ============ (to make Diderot more useful/effective) | ||

102 : | ============================ | ||

103 : | jhr | 1115 | |

104 : | glk | 1156 | Python/ctypes interface to run-time |

105 : | jhr | 1115 | |

106 : | glk | 1156 | support for Python interop and GUI |

107 : | jhr | 1115 | |

108 : | glk | 1162 | Allow integer exponentiation ("^2") to apply to square matrices, |

109 : | to represent repeated matrix multiplication | ||

110 : | |||

111 : | glk | 1156 | Alow X *= Y, X /= Y, X += Y, X -= Y to mean what they do in C, |

112 : | provided that X*Y, X/Y, X+Y, X-Y are already supported. | ||

113 : | Nearly every Diderot program would be simplified by this. | ||

114 : | jhr | 1115 | |

115 : | glk | 1156 | Put small 1-D and 2-D fields, when reconstructed specifically by tent |

116 : | and when differentiation is not needed, into faster texture buffers. | ||

117 : | test/illust-vr.diderot is good example of program that uses multiple | ||

118 : | such 1-D fields basically as lookup-table-based function evaluation | ||

119 : | |||

120 : | expand trace in mid to low translation | ||

121 : | |||

122 : | extend norm (|exp|) to all tensor types [DONE for vectors and matrices] | ||

123 : | |||

124 : | determinant ("det") for tensor[3,3] | ||

125 : | |||

126 : | jhr | 1115 | add ":" for tensor dot product (contracts out two indices |

127 : | instead of one like •), valid for all pairs of tensors with | ||

128 : | at least two indices | ||

129 : | |||

130 : | glk | 1156 | test/uninit.diderot: |

131 : | documents need for better compiler error messages when output variables | ||

132 : | are not initialized; the current messages are very cryptic | ||

133 : | jhr | 1115 | |

134 : | want: warnings when "D" (reserved for differentiation) is declared as | ||

135 : | a variable name (get confusing error messages now) | ||

136 : | |||

137 : | glk | 1156 | ============================== |

138 : | LONG TERM ==================== (make Diderot more interesting/attractive from | ||

139 : | ============================== a research standpoint) | ||

140 : | jhr | 1115 | |

141 : | glk | 1156 | IL support for higher-order tensor values (matrices, etc). |

142 : | tensor construction [DONE] | ||

143 : | tensor indexing [DONE] | ||

144 : | tensor slicing | ||

145 : | verify that hessians work correctly [DONE] | ||

146 : | jhr | 1115 | |

147 : | glk | 1156 | Better handling of variables that determines the scope of a variable |

148 : | based on its actual use, instead of where the user defined it. So, | ||

149 : | for example, we should lift strand-invariant variables to global | ||

150 : | scope. Also prune out useless variables, which should include field | ||

151 : | variables after the translation to mid-il. | ||

152 : | |||

153 : | test/vr-kcomp2.diderot: Add support for code like | ||

154 : | (F1 if x else F2)@pos | ||

155 : | This will require duplication of the continuation of the conditional | ||

156 : | (but we should only duplicate over the live-range of the result of the | ||

157 : | conditional. | ||

158 : | |||

159 : | glk | 1162 | [GLK:8] Want: non-trivial field expressions & functions. |

160 : | scalar fields from scalar fields F and G: | ||

161 : | field#0(2)[] X = (sin(F) + 1.0)/2; | ||

162 : | field#0(2)[] X = F*G; | ||

163 : | scalar field of vector field magnitude: | ||

164 : | glk | 1156 | image(2)[2] Vimg = load(...); |

165 : | field#0(2)[] Vlen = |Vimg ⊛ bspln3|; | ||

166 : | glk | 1162 | field of normalized vectors (for LIC and vector field feature extraction) |

167 : | field#2(2)[2] F = ... | ||

168 : | field#0(2)[2] V = normalize(F); | ||

169 : | scalar field of gradient magnitude (for edge detection)) | ||

170 : | glk | 1156 | field#2(2)[] F = Fimg ⊛ bspln3; |

171 : | field#0(2)[] Gmag = |∇F|; | ||

172 : | glk | 1162 | scalar field of squared gradient magnitude (simpler to differentiate): |

173 : | glk | 1156 | field#2(2)[] F = Fimg ⊛ bspln3; |

174 : | field#0(2)[] Gmsq = ∇F•∇F; | ||

175 : | glk | 1162 | There is value in having these, even if the differentiation of them is |

176 : | not supported (hence the indication of "field#0" for these above) | ||

177 : | glk | 1156 | |

178 : | glk | 1162 | co- vs contra- index distinction |

179 : | glk | 1156 | |

180 : | glk | 1162 | Permit field composition: |

181 : | glk | 1156 | field#2(3)[3] warp = bspln3 ⊛ warpData; |

182 : | field#2(3)[] F = bspln3 ⊛ img; | ||

183 : | field#2(3)[] Fwarp = F ◦ warp; | ||

184 : | glk | 1162 | So Fwarp(x) = F(warp(X)). Chain rule can be used for differentation. |

185 : | This will be instrumental for expressing non-rigid registration | ||

186 : | methods (but those will require co-vs-contra index distinction) | ||

187 : | glk | 1156 | |

188 : | glk | 1155 | Allow the convolution to be specified either as a single 1D kernel |

189 : | (as we have it now): | ||

190 : | field#2(3)[] F = bspln3 ⊛ img; | ||

191 : | or, as a tensor product of kernels, one for each axis, e.g. | ||

192 : | field#0(3)[] F = (bspln3 ⊗ bspln3 ⊗ tent) ⊛ img; | ||

193 : | This is especially important for things like time-varying data, or | ||

194 : | other multi-dimensional fields where one axis of the domain is very | ||

195 : | glk | 1162 | different from the rest, and hence must be treated separately when |

196 : | it comes to convolution. What is very unclear is how, in such cases, | ||

197 : | glk | 1155 | we should notate the gradient, when we only want to differentiate with |

198 : | glk | 1162 | respect to some subset of the axes. One ambitious idea would be: |

199 : | field#0(3)[] Ft = (bspln3 ⊗ bspln3 ⊗ tent) ⊛ img; // 2D time-varying field | ||

200 : | field#0(2)[] F = lambda([x,y], Ft([x,y,42.0])) // restriction to time=42.0 | ||

201 : | vec2 grad = ∇F([x,y]); // 2D gradient | ||

202 : | glk | 1155 | |

203 : | glk | 1162 | representation of tensor symmetry |

204 : | jhr | 1115 | (have to identify the group of index permutations that are symmetries) |

205 : | |||

206 : | dot works on all tensors | ||

207 : | |||

208 : | outer works on all tensors | ||

209 : | |||

210 : | Einstein summation notation | ||

211 : | |||

212 : | "tensor comprehension" (like list comprehension) | ||

213 : | |||

214 : | ====================== | ||

215 : | BUGS ================= | ||

216 : | ====================== | ||

217 : | |||

218 : | test/zslice2.diderot: | ||

219 : | // HEY (bug) bspln5 leads to problems ... | ||

220 : | // uncaught exception Size [size] | ||

221 : | // raised at c-target/c-target.sml:47.15-47.19 | ||

222 : | //field#4(3)[] F = img ⊛ bspln5; |

root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |

Powered by ViewVC 1.0.0 |