Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /tests/vis12-bugs/src/bug055.diderot
ViewVC logotype

View of /tests/vis12-bugs/src/bug055.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4640 - (download) (annotate)
Tue Sep 27 20:54:47 2016 UTC (2 years, 10 months ago) by glk
File size: 3413 byte(s)
initial result of svn export --username anonsvn --password=anonsvn https://svn.smlnj-gforge.cs.uchicago.edu/svn/diderot/branches/vis15/src/tests/
/*

This is at least a bug about how attempts to assign fields happen
(causing an "uncaught exception Fail" instead of a compiler error
message).  It could also be a feature request to allow fields to be
assigned to each other, with the same continuity flexibility available
as when using kernels for fields of lower required continuity.

Bugs 055-060 are variants of the same problem.

*/

input image(2)[] img = image("../data/data2D.nrrd");
input bool foo = true;

/* Only one of the statement(s) enclosed in vvvvvvv, ^^^^^^^^
should be uncommented at a time */

/* bspln5 and c4hexic are both C4 kernels */
/*
uncaught exception Fail [Fail: bogus field binding _t01B3 = RHS(DiffField(G01AB))]
  raised at common/phase-timer.sml:78.50-78.52
  raised at common/phase-timer.sml:78.50-78.52
  raised at high-il/border-control.sml:64.26-66.19 */
//vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
field#1(2)[] G = (img⊛bspln5 if foo else img⊛c4hexic);
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/* (same thing?)
uncaught exception Fail [Fail: bogus field binding _t01D6 = RHS(DiffField(G01CC))]
  raised at common/phase-timer.sml:78.50-78.52
  raised at common/phase-timer.sml:78.50-78.52
  raised at high-il/border-control.sml:64.26-66.19 */
//vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//field#1(2)[] Gfoo = img ⊛ bspln5;
//field#1(2)[] Gbar = img ⊛ c4hexic;
//field#1(2)[] G = Gfoo if foo else Gbar;
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/*
uncaught exception Fail [Fail: bogus kernel binding _t013C = PHI(_t013B,_t0140)]
  raised at common/phase-timer.sml:78.50-78.52
  raised at common/phase-timer.sml:78.50-78.52
  raised at high-il/normalize.sml:66.26-68.19 */
//vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//field#1(2)[] G = img ⊛ (bspln5 if foo else c4hexic);
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


/* ctmr is C1 and bspln3 and C1, but this program only needs one derivative */

/* This causes:
[bug055.diderot:57.19-54] Error: types do not match in conditional expression
  true branch:  field#1(2)[]
  false branch: field#2(2)[]
[bug055.diderot:11.1-91.0] Error: program does not have any strands
even though either side can be assigned to field#1(2)[] G */
//vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//field#1(2)[] G = (img⊛ctmr if foo else img⊛bspln3);
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/* (same as above?)
uncaught exception Fail [Fail: bogus field binding _t01D0 = RHS(DiffField(G01C6))]
  raised at common/phase-timer.sml:78.50-78.52
  raised at common/phase-timer.sml:78.50-78.52
  raised at high-il/border-control.sml:64.26-66.19 */
//vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//field#1(2)[] Gfoo = img ⊛ ctmr;
//field#1(2)[] Gbar = img ⊛ bspln3;
//field#1(2)[] G = Gfoo if foo else Gbar;
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/* This causes
[bug055.diderot:71.27-50] Error: types do not match in conditional expression
  true branch:  kernel#1
  false branch: kernel#2
[bug055.diderot:11.1-92.0] Error: program does not have any strands
 even though (as above) we're only asking for field#1 */
//vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//field#1(2)[] G = img ⊛ (ctmr if foo else bspln3);
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


strand sample (int xi, int yi) {
   vec2 pos = [lerp(5, 25, 0, xi, 2), lerp(5, 25, 0, yi, 2)];
   output real out = 0;

   update {
      out += |∇G(pos)|;
      stabilize;
   }
}

initially [ sample(xi, yi) | yi in 0..2, xi in 0..2 ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0