Home My Page Projects Code Snippets Project Openings diderot

# SCM Repository

[diderot] Diff of /branches/charisee/TODO
 [diderot] / branches / charisee / TODO

# Diff of /branches/charisee/TODO

revision 1140, Fri May 6 14:16:00 2011 UTC revision 1156, Sun May 8 21:20:52 2011 UTC
# Line 1  Line 1
1  NOTE: GLK's approximate ranking of 5 most important tagged with  NOTE: GLK's approximate ranking of 5 most important tagged with
2  [GLK:1], [GLK:2], ...  [GLK:1], [GLK:2], ...
3
4  ==============================  ========================
5  other SHORT TERM =============  (including needed for LIC)  SHORT TERM ============= (*needed* for streamlines & tractography)
6  ==============================  ========================

Add a clamp function, which takes three arguments; either three scalars:
clamp(x, minval, maxval)  = max(minval, min(maxval, x))
or three vectors of the same size:
clamp([x,y], minvec, maxvec)  = [max(minvec[0], min(maxvec[0], x)),
max(minvec[1], min(maxvec[1], y))]
This would be useful in many current Diderot programs.
One question: clamp(x, minval, maxval) is the argument order
used in OpenCL and other places, but clamp(minval, maxval, x)
would be more consistent with lerp(minout, maxout, x).

Level of differentiability in field type should be statement about how
much differentiation the program *needs*, rather than what the kernel
*provides*.  The needed differentiability can be less than or equal to
the provided differentiability.
7
8  [GLK:1] Add sequence types (needed for evals & evecs)  [GLK:1] Add sequence types (needed for evals & evecs)
9      syntax      syntax
10          types: ty '{' INT '}'          types: ty '{' INT '}'
11          value construction: '{' e1 ',' … ',' en '}'          value construction: '{' e1 ',' … ',' en '}'
12          indexing: e '{' e '}'          indexing: e '{' e '}'
13    [GLK:1] evals & evecs for symmetric tensor[3,3] (requires sequences)
14
15  IL support for higher-order tensor values (matrices, etc).  ability to emit/track/record variables into dynamically re-sized
16      tensor construction [DONE]  runtime buffer
tensor indexing [DONE]
tensor slicing
verify that hessians work correctly [DONE]

Use ∇⊗ etc. syntax
syntax [DONE]
typechecking
IL and codegen

test/uninit.diderot:
documents need for better compiler error messages when output variables
are not initialized; the current messages are very cryptic
17
18  determinant ("det") for tensor[3,3]  tensor fields: convolution on general tensor images
19
20  expand trace in mid to low translation  ========================
21    SHORT-ISH TERM ========= (to make using Diderot less annoying/slow)
22    ========================
23
24  value-numbering optimization  value-numbering optimization
25
26  Add type aliases for color types  proper handling of stabilize method
rgb = real{3}
rgba = real{4}

==============================
MEDIUM TERM ================== (including needed for streamlines & tractography)
==============================

[GLK:1] evals & evecs for symmetric tensor[3,3] (requires sequences)
27
28  [GLK:2] Save Diderot output to nrrd, instead of "mip.txt"  [GLK:2] Save Diderot output to nrrd, instead of "mip.txt"
29    For grid of strands, save to similarly-shaped array    For grid of strands, save to similarly-shaped array
# Line 71  Line 39
39  *always* "inside"; with various ways of mapping the known image values  *always* "inside"; with various ways of mapping the known image values
40  to non-existant index locations.  One possible syntax emphasizes that  to non-existant index locations.  One possible syntax emphasizes that
41  there is a index mapping function that logically precedes convolution:  there is a index mapping function that logically precedes convolution:
42    F = bspln3 ⊛ (img ◦ clamp)    F = bspln3 ⊛ (img  clamp)
43    F = bspln3 ⊛ (img ◦ repeat)    F = bspln3 ⊛ (img ◦ repeat)
44    F = bspln3 ⊛ (img ◦ mirror)    F = bspln3 ⊛ (img ◦ mirror)
45  where "◦" or "∘" is used to indicate function composition  where "◦" or "∘" is used to indicate function composition
46
47  extend norm (|exp|) to all tensor types [DONE for vectors and matrices]  Use ∇⊗ etc. syntax
48        syntax [DONE]
49  ability to emit/track/record variables into dynamically re-sized      typechecking
50  runtime buffer      IL and codegen

Want: allow X *= Y, X /= Y, X += Y, X -= Y to mean what they do in C,
provided that X*Y, X/Y, X+Y, X-Y are already supported.
Nearly every Diderot program would be simplified by this.
51
52  Want: non-trivial field expressions & functions:  Add a clamp function, which takes three arguments; either three scalars:
53    image(2)[2] Vimg = load(...);    clamp(x, minval, maxval)  = max(minval, min(maxval, x))
54    field#0(2)[] Vlen = |Vimg ⊛ bspln3|;  or three vectors of the same size:
55  to get a scalar field of vector length, or    clamp([x,y], minvec, maxvec)  = [max(minvec[0], min(maxvec[0], x)),
56    field#2(2)[] F = Fimg ⊛ bspln3;                                     max(minvec[1], min(maxvec[1], y))]
57    field#0(2)[] Gmag = |∇F|;  This would be useful in many current Diderot programs.
58  to get a scalar field of gradient magnitude, or  One question: clamp(x, minval, maxval) is the argument order
59    field#2(2)[] F = Fimg ⊛ bspln3;  used in OpenCL and other places, but clamp(minval, maxval, x)
60    field#0(2)[] Gmsq = ∇F•∇F;  would be more consistent with lerp(minout, maxout, x).
to get a scalar field of squared gradient magnitude, which is simpler
to differentiate.  However, there is value in having these, even if
the differentiation of them is not supported (hence the indication
of "field#0" for these above)
61
62  Want: ability to apply "normalize" to a field itself, e.g.  Level of differentiability in field type should be statement about how
63    field#0(2)[2] V = normalize(Vimg ⊛ ctmr);  much differentiation the program *needs*, rather than what the kernel
64  so that V(x) = normalize((Vimg ⊛ ctmr)(x)).  *provides*.  The needed differentiability can be less than or equal to
65  Having this would simplify expression of standard LIC method, and  the provided differentiability.
would also help express other vector field expressions that arise
in vector field feature exraction.
66
67  tensor fields: convolution on general tensor images  Add type aliases for color types
68        rgb = real{3}
69        rgba = real{4}
70
71  ==============================  ==============================
72  other MEDIUM TERM ============ (needed for particles)  MEDIUM TERM ================== (*needed* for particles)
73  ==============================  ==============================
74
Put small 1-D and 2-D fields, when reconstructed specifically by tent
and when differentiation is not needed, into faster texture buffers.
test/illust-vr.diderot is good example of program that uses multiple
such 1-D fields basically as lookup-table-based function evaluation

75  run-time birth of strands  run-time birth of strands
76
77  "initially" supports lists  "initially" supports lists
# Line 124  Line 79
79  "initially" supports lists of positions output from  "initially" supports lists of positions output from
80  different initalization Diderot program  different initalization Diderot program
81
82  spatial data structure that permits strands' queries of neighbors  Communication between strands: they have to be able to learn each
83    other's state (at the previous iteration).  Early version of this can
84    have the network of neighbors be completely static (for running one
85    strand/pixel image computations).  Later version with strands moving
86    through the domain will require some spatial data structure to
87    optimize discovery of neighbors.
88
89    ============================
90    MEDIUM-ISH TERM ============ (to make Diderot more useful/effective)
91    ============================
92
93  proper handling of stabilize method  Python/ctypes interface to run-time
94
95  test/vr-kcomp2.diderot: Add support for code like  support for Python interop and GUI
96
97          (F1 if x else F2)@pos  Alow X *= Y, X /= Y, X += Y, X -= Y to mean what they do in C,
98    provided that X*Y, X/Y, X+Y, X-Y are already supported.
99    Nearly every Diderot program would be simplified by this.
100
101  This will require duplication of the continuation of the conditional  Put small 1-D and 2-D fields, when reconstructed specifically by tent
102  (but we should only duplicate over the live-range of the result of the  and when differentiation is not needed, into faster texture buffers.
103  conditional.  test/illust-vr.diderot is good example of program that uses multiple
104    such 1-D fields basically as lookup-table-based function evaluation
105
106    expand trace in mid to low translation
107
108    extend norm (|exp|) to all tensor types [DONE for vectors and matrices]
109
110    determinant ("det") for tensor[3,3]
111
112  add ":" for tensor dot product (contracts out two indices  add ":" for tensor dot product (contracts out two indices
113  instead of one like •), valid for all pairs of tensors with  instead of one like •), valid for all pairs of tensors with
114  at least two indices  at least two indices
115
116  ==============================  test/uninit.diderot:
117  other MEDIUM TERM ============  documents need for better compiler error messages when output variables
118  ==============================  are not initialized; the current messages are very cryptic
119
120  want: warnings when "D" (reserved for differentiation) is declared as  want: warnings when "D" (reserved for differentiation) is declared as
121  a variable name (get confusing error messages now)  a variable name (get confusing error messages now)
122
support for Python interop and GUI

Python/ctypes interface to run-time

==============================
LONG TERM ====================
123  ==============================  ==============================
124    LONG TERM ==================== (make Diderot more interesting/attractive from
125    ==============================  a research standpoint)
126
127    IL support for higher-order tensor values (matrices, etc).
128        tensor construction [DONE]
129        tensor indexing [DONE]
130        tensor slicing
131        verify that hessians work correctly [DONE]
132
133  Better handling of variables that determines the scope of a variable  Better handling of variables that determines the scope of a variable
134  based on its actual use, instead of where the user defined it.  So,  based on its actual use, instead of where the user defined it.  So,
# Line 161  Line 136
136  scope.  Also prune out useless variables, which should include field  scope.  Also prune out useless variables, which should include field
137  variables after the translation to mid-il.  variables after the translation to mid-il.
138
139    test/vr-kcomp2.diderot: Add support for code like
140            (F1 if x else F2)@pos
141    This will require duplication of the continuation of the conditional
142    (but we should only duplicate over the live-range of the result of the
143    conditional.
144
145    [GLK:5] Want: non-trivial field expressions & functions:
147      field#0(2)[] Vlen = |Vimg ⊛ bspln3|;
148    to get a scalar field of vector length, or
149      field#2(2)[] F = Fimg ⊛ bspln3;
150      field#0(2)[] Gmag = |∇F|;
151    to get a scalar field of gradient magnitude, or
152      field#2(2)[] F = Fimg ⊛ bspln3;
153      field#0(2)[] Gmsq = ∇F•∇F;
154    to get a scalar field of squared gradient magnitude, which is simpler
155    to differentiate.  However, there is value in having these, even if
156    the differentiation of them is not supported (hence the indication
157    of "field#0" for these above)
158
159    Want: ability to apply "normalize" to a field itself, e.g.
160      field#0(2)[2] V = normalize(Vimg ⊛ ctmr);
161    so that V(x) = normalize((Vimg ⊛ ctmr)(x)).
162    Having this would simplify expression of standard LIC method, and
163    would also help express other vector field expressions that arise
164    in vector field feature exraction.
165
166    Permit fields composition, especially for warping images by a
167    smooth field of deformation vectors
168      field#2(3)[3] warp = bspln3 ⊛ warpData;
169      field#2(3)[] F = bspln3 ⊛ img;
170      field#2(3)[] Fwarp = F ◦ warp;
171    So Fwarp(x) = F(warp(X)).  Chain rule can be used for differentation
172
173    Allow the convolution to be specified either as a single 1D kernel
174    (as we have it now):
175      field#2(3)[] F = bspln3 ⊛ img;
176    or, as a tensor product of kernels, one for each axis, e.g.
177      field#0(3)[] F = (bspln3 ⊗ bspln3 ⊗ tent) ⊛ img;
178    This is especially important for things like time-varying data, or
179    other multi-dimensional fields where one axis of the domain is very
180    different from the rest.  What is very unclear is how, in such cases,
181    we should notate the gradient, when we only want to differentiate with
182    respect to some of the axes.
183
184  co- vs contra- index distinction  co- vs contra- index distinction
185
186  some indication of tensor symmetry  some indication of tensor symmetry

Legend:
 Removed from v.1140 changed lines Added in v.1156