 trunk/TODO 2011/05/08 14:43:30 1155
+++ trunk/TODO 2011/05/08 21:20:52 1156
@@ 1,61 +1,29 @@
NOTE: GLK's approximate ranking of 5 most important tagged with
[GLK:1], [GLK:2], ...
==============================
other SHORT TERM ============= (including needed for LIC)
==============================

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.
+========================
+SHORT TERM ============= (*needed* for streamlines & tractography)
+========================
[GLK:1] Add sequence types (needed for evals & evecs)
syntax
types: ty '{' INT '}'
value construction: '{' e1 ',' … ',' en '}'
indexing: e '{' e '}'
+[GLK:1] evals & evecs for symmetric tensor[3,3] (requires sequences)
IL support for higherorder tensor values (matrices, etc).
 tensor construction [DONE]
 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
+ability to emit/track/record variables into dynamically resized
+runtime buffer
determinant ("det") for tensor[3,3]
+tensor fields: convolution on general tensor images
expand trace in mid to low translation
+========================
+SHORTISH TERM ========= (to make using Diderot less annoying/slow)
+========================
valuenumbering optimization
Add type aliases for color types
 rgb = real{3}
 rgba = real{4}

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

[GLK:1] evals & evecs for symmetric tensor[3,3] (requires sequences)
+proper handling of stabilize method
[GLK:2] Save Diderot output to nrrd, instead of "mip.txt"
For grid of strands, save to similarlyshaped array
@@ 71,52 +39,39 @@
*always* "inside"; with various ways of mapping the known image values
to nonexistant index locations. One possible syntax emphasizes that
there is a index mapping function that logically precedes convolution:
 F = bspln3 ⊛ (img ◦ clamp)
+ F = bspln3 ⊛ (img clamp)
F = bspln3 ⊛ (img ◦ repeat)
F = bspln3 ⊛ (img ◦ mirror)
where "◦" or "∘" is used to indicate function composition
extend norm (exp) to all tensor types [DONE for vectors and matrices]

ability to emit/track/record variables into dynamically resized
runtime buffer

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, XY are already supported.
Nearly every Diderot program would be simplified by this.
+Use ∇⊗ etc. syntax
+ syntax [DONE]
+ typechecking
+ IL and codegen
[GLK:5] Want: nontrivial field expressions & functions:
 image(2)[2] Vimg = load(...);
 field#0(2)[] Vlen = Vimg ⊛ bspln3;
to get a scalar field of vector length, or
 field#2(2)[] F = Fimg ⊛ bspln3;
 field#0(2)[] Gmag = ∇F;
to get a scalar field of gradient magnitude, or
 field#2(2)[] F = Fimg ⊛ bspln3;
 field#0(2)[] Gmsq = ∇F•∇F;
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)
+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).
Want: ability to apply "normalize" to a field itself, e.g.
 field#0(2)[2] V = normalize(Vimg ⊛ ctmr);
so that V(x) = normalize((Vimg ⊛ ctmr)(x)).
Having this would simplify expression of standard LIC method, and
would also help express other vector field expressions that arise
in vector field feature exraction.
+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.
tensor fields: convolution on general tensor images
+Add type aliases for color types
+ rgb = real{3}
+ rgba = real{4}
==============================
other MEDIUM TERM ============ (needed for particles)
+MEDIUM TERM ================== (*needed* for particles)
==============================
Put small 1D and 2D fields, when reconstructed specifically by tent
and when differentiation is not needed, into faster texture buffers.
test/illustvr.diderot is good example of program that uses multiple
such 1D fields basically as lookuptablebased function evaluation

runtime birth of strands
"initially" supports lists
@@ 124,32 +79,96 @@
"initially" supports lists of positions output from
different initalization Diderot program
spatial data structure that permits strands' queries of neighbors
+Communication between strands: they have to be able to learn each
+other's state (at the previous iteration). Early version of this can
+have the network of neighbors be completely static (for running one
+strand/pixel image computations). Later version with strands moving
+through the domain will require some spatial data structure to
+optimize discovery of neighbors.
+
+============================
+MEDIUMISH TERM ============ (to make Diderot more useful/effective)
+============================
proper handling of stabilize method
+Python/ctypes interface to runtime
test/vrkcomp2.diderot: Add support for code like
+support for Python interop and GUI
 (F1 if x else F2)@pos
+Alow X *= Y, X /= Y, X += Y, X = Y to mean what they do in C,
+provided that X*Y, X/Y, X+Y, XY are already supported.
+Nearly every Diderot program would be simplified by this.
This will require duplication of the continuation of the conditional
(but we should only duplicate over the liverange of the result of the
conditional.
+Put small 1D and 2D fields, when reconstructed specifically by tent
+and when differentiation is not needed, into faster texture buffers.
+test/illustvr.diderot is good example of program that uses multiple
+such 1D fields basically as lookuptablebased function evaluation
+
+expand trace in mid to low translation
+
+extend norm (exp) to all tensor types [DONE for vectors and matrices]
+
+determinant ("det") for tensor[3,3]
add ":" for tensor dot product (contracts out two indices
instead of one like •), valid for all pairs of tensors with
at least two indices
==============================
other MEDIUM TERM ============
==============================
+test/uninit.diderot:
+documents need for better compiler error messages when output variables
+are not initialized; the current messages are very cryptic
want: warnings when "D" (reserved for differentiation) is declared as
a variable name (get confusing error messages now)
support for Python interop and GUI
+==============================
+LONG TERM ==================== (make Diderot more interesting/attractive from
+============================== a research standpoint)
Python/ctypes interface to runtime
+IL support for higherorder tensor values (matrices, etc).
+ tensor construction [DONE]
+ tensor indexing [DONE]
+ tensor slicing
+ verify that hessians work correctly [DONE]
+
+Better handling of variables that determines the scope of a variable
+based on its actual use, instead of where the user defined it. So,
+for example, we should lift strandinvariant variables to global
+scope. Also prune out useless variables, which should include field
+variables after the translation to midil.
+
+test/vrkcomp2.diderot: Add support for code like
+ (F1 if x else F2)@pos
+This will require duplication of the continuation of the conditional
+(but we should only duplicate over the liverange of the result of the
+conditional.
+
+[GLK:5] Want: nontrivial field expressions & functions:
+ image(2)[2] Vimg = load(...);
+ field#0(2)[] Vlen = Vimg ⊛ bspln3;
+to get a scalar field of vector length, or
+ field#2(2)[] F = Fimg ⊛ bspln3;
+ field#0(2)[] Gmag = ∇F;
+to get a scalar field of gradient magnitude, or
+ field#2(2)[] F = Fimg ⊛ bspln3;
+ field#0(2)[] Gmsq = ∇F•∇F;
+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)
+
+Want: ability to apply "normalize" to a field itself, e.g.
+ field#0(2)[2] V = normalize(Vimg ⊛ ctmr);
+so that V(x) = normalize((Vimg ⊛ ctmr)(x)).
+Having this would simplify expression of standard LIC method, and
+would also help express other vector field expressions that arise
+in vector field feature exraction.
+
+Permit fields composition, especially for warping images by a
+smooth field of deformation vectors
+ field#2(3)[3] warp = bspln3 ⊛ warpData;
+ field#2(3)[] F = bspln3 ⊛ img;
+ field#2(3)[] Fwarp = F ◦ warp;
+So Fwarp(x) = F(warp(X)). Chain rule can be used for differentation
Allow the convolution to be specified either as a single 1D kernel
(as we have it now):
@@ 162,16 +181,6 @@
we should notate the gradient, when we only want to differentiate with
respect to some of the axes.
==============================
LONG TERM ====================
==============================

Better handling of variables that determines the scope of a variable
based on its actual use, instead of where the user defined it. So,
for example, we should lift strandinvariant variables to global
scope. Also prune out useless variables, which should include field
variables after the translation to midil.

co vs contra index distinction
some indication of tensor symmetry