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

SCM Repository

[diderot] Annotation of /tests/vis12-bugs/src/bug060.diderot
ViewVC logotype

Annotation of /tests/vis12-bugs/src/bug060.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4640 - (view) (download)

1 : glk 4640 /*
2 :    
3 :     This is at least a bug about how attempts to assign fields happen
4 :     (causing an "uncaught exception Fail" instead of a compiler error
5 :     message). It could also be a feature request to allow fields to be
6 :     assigned to each other, with the same continuity flexibility available
7 :     as when using kernels for fields of lower required continuity.
8 :    
9 :     Bugs 055-060 are variants of the same problem.
10 :    
11 :     */
12 :    
13 :     input image(2)[] img = image("../data/data2D.nrrd");
14 :     input bool foo = true;
15 :    
16 :     /* Only one of the statement(s) enclosed in vvvvvvv, ^^^^^^^^
17 :     should be uncommented at a time */
18 :    
19 :     /* bspln5 and c4hexic are both C4 kernels */
20 :     /*
21 :     uncaught exception Fail [Fail: bogus field binding _t01B3 = RHS(DiffField(G01AB))]
22 :     raised at common/phase-timer.sml:78.50-78.52
23 :     raised at common/phase-timer.sml:78.50-78.52
24 :     raised at high-il/border-control.sml:64.26-66.19 */
25 :     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
26 :     //field#1(2)[] G = (img⊛bspln5 if foo else img⊛c4hexic);
27 :     //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28 :    
29 :     /* (same thing?)
30 :     uncaught exception Fail [Fail: bogus field binding _t01D6 = RHS(DiffField(G01CC))]
31 :     raised at common/phase-timer.sml:78.50-78.52
32 :     raised at common/phase-timer.sml:78.50-78.52
33 :     raised at high-il/border-control.sml:64.26-66.19 */
34 :     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
35 :     //field#1(2)[] Gfoo = img ⊛ bspln5;
36 :     //field#1(2)[] Gbar = img ⊛ c4hexic;
37 :     //field#1(2)[] G = Gfoo if foo else Gbar;
38 :     //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 :    
40 :     /*
41 :     uncaught exception Fail [Fail: bogus kernel binding _t013C = PHI(_t013B,_t0140)]
42 :     raised at common/phase-timer.sml:78.50-78.52
43 :     raised at common/phase-timer.sml:78.50-78.52
44 :     raised at high-il/normalize.sml:66.26-68.19 */
45 :     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
46 :     //field#1(2)[] G = img ⊛ (bspln5 if foo else c4hexic);
47 :     //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 :    
49 :    
50 :     /* ctmr is C1 and bspln3 and C1, but this program only needs one derivative */
51 :    
52 :     /* This causes:
53 :     [bug055.diderot:57.19-54] Error: types do not match in conditional expression
54 :     true branch: field#1(2)[]
55 :     false branch: field#2(2)[]
56 :     [bug055.diderot:11.1-91.0] Error: program does not have any strands
57 :     even though either side can be assigned to field#1(2)[] G */
58 :     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
59 :     //field#1(2)[] G = (img⊛ctmr if foo else img⊛bspln3);
60 :     //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 :    
62 :     /* (same as above?)
63 :     uncaught exception Fail [Fail: bogus field binding _t01D0 = RHS(DiffField(G01C6))]
64 :     raised at common/phase-timer.sml:78.50-78.52
65 :     raised at common/phase-timer.sml:78.50-78.52
66 :     raised at high-il/border-control.sml:64.26-66.19 */
67 :     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
68 :     //field#1(2)[] Gfoo = img ⊛ ctmr;
69 :     //field#1(2)[] Gbar = img ⊛ bspln3;
70 :     //field#1(2)[] G = Gfoo if foo else Gbar;
71 :     //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72 :    
73 :     /* This causes
74 :     [bug055.diderot:71.27-50] Error: types do not match in conditional expression
75 :     true branch: kernel#1
76 :     false branch: kernel#2
77 :     [bug055.diderot:11.1-92.0] Error: program does not have any strands
78 :     even though (as above) we're only asking for field#1 */
79 :     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
80 :     field#1(2)[] G = img ⊛ (ctmr if foo else bspln3);
81 :     //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82 :    
83 :    
84 :     strand sample (int xi, int yi) {
85 :     vec2 pos = [lerp(5, 25, 0, xi, 2), lerp(5, 25, 0, yi, 2)];
86 :     output real out = 0;
87 :    
88 :     update {
89 :     out += |∇G(pos)|;
90 :     stabilize;
91 :     }
92 :     }
93 :    
94 :     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