One interface, n implementations, called through an existential whose concrete type is chosen at runtime (defeats static specialization, forcing witness-table dynamic dispatch). Stresses dispatch lowering / specializeModule. Scaling null: n scales implementations and switch cases; generated code is O(n), so ideal cost is O(n).
bucket: dynamic_dispatch · compile mode: target · flags: -target spirv -emit-spirv-directly · default N: 200
Full sub-counter decomposition of compileInner — named leaf timers plus (self) residuals (a parent's time not covered by a named child, e.g. the autodiff transform in linkAndOptimizeIR (self)). Topmost band traces compileInner; hover a band for its phase.
Overall compileInner: 120.8 → 116.6 ms -3.5% (2026-07-30 7c58a326b → 2026-08-29 28c755b09)
Contributors — the mutually-exclusive phase buckets (named leaves + (self) residuals) that tile compileInner; the pp column sums to the overall %. Buckets moving the total by ≥0.2% are listed, the rest fold into the remainder row. Below them, every other reported counter (nested/overlapping, e.g. serialized-module reads — own change only):
| counter | Δ | own % | of total |
|---|---|---|---|
| generateOutput (self) | -1.3 ms | -5.2% | -1.0pp |
| linkAndOptimizeIR (self) | -1.0 ms | -6.6% | -0.8pp |
| legalizeExistentialTypeLayout | -0.7 ms | -24.4% | -0.5pp |
| legalizeResourceTypes | -0.6 ms | -31.0% | -0.5pp |
| compileInner (self) | -0.3 ms | -100.0% | -0.2pp |
| (remaining 10 buckets) | -0.4 ms | – | -0.3pp |
| loadBuiltinModule | -2.7 ms | -2.5% | – |
| readSerializedModuleIR | -2.6 ms | -4.8% | – |
Largest day steps (≥5% of the previous day, both directions; bisect with git log <c0>..<c1> -- source/):
| boundary | % vs prev day | commits | top buckets (own %) |
|---|---|---|---|
| none | |||
Run from the slang repo root. This regenerates the sources below and re-runs this workload's measurement; --gen-dir keeps the generated files (they go to a tempdir and are deleted otherwise).
python3 tools/compile-perf/bench.py --slangc /path/to/slangc --only dynamic_dispatch --label repro --gen-dir repro-dynamic_dispatch
the complete compiled source (N = 200), shown in full
// AUTO-GENERATED by perf-suite/workloads.py - do not edit by hand.
RWStructuredBuffer<float> outBuf;
[anyValueSize(16)]
interface IShape { float eval(float x); }
struct Shape0 : IShape { float eval(float x) { return x * 1.0 + 0.0 + sin(x * 1.0); } }
struct Shape1 : IShape { float eval(float x) { return x * 2.0 + 1.0 + sin(x * 2.0); } }
struct Shape2 : IShape { float eval(float x) { return x * 3.0 + 2.0 + sin(x * 3.0); } }
struct Shape3 : IShape { float eval(float x) { return x * 4.0 + 3.0 + sin(x * 4.0); } }
struct Shape4 : IShape { float eval(float x) { return x * 5.0 + 4.0 + sin(x * 5.0); } }
struct Shape5 : IShape { float eval(float x) { return x * 6.0 + 5.0 + sin(x * 6.0); } }
struct Shape6 : IShape { float eval(float x) { return x * 7.0 + 6.0 + sin(x * 7.0); } }
struct Shape7 : IShape { float eval(float x) { return x * 8.0 + 7.0 + sin(x * 8.0); } }
struct Shape8 : IShape { float eval(float x) { return x * 9.0 + 8.0 + sin(x * 9.0); } }
struct Shape9 : IShape { float eval(float x) { return x * 10.0 + 9.0 + sin(x * 10.0); } }
struct Shape10 : IShape { float eval(float x) { return x * 11.0 + 10.0 + sin(x * 11.0); } }
struct Shape11 : IShape { float eval(float x) { return x * 12.0 + 11.0 + sin(x * 12.0); } }
struct Shape12 : IShape { float eval(float x) { return x * 13.0 + 12.0 + sin(x * 13.0); } }
struct Shape13 : IShape { float eval(float x) { return x * 14.0 + 13.0 + sin(x * 14.0); } }
struct Shape14 : IShape { float eval(float x) { return x * 15.0 + 14.0 + sin(x * 15.0); } }
struct Shape15 : IShape { float eval(float x) { return x * 16.0 + 15.0 + sin(x * 16.0); } }
struct Shape16 : IShape { float eval(float x) { return x * 17.0 + 16.0 + sin(x * 17.0); } }
struct Shape17 : IShape { float eval(float x) { return x * 18.0 + 17.0 + sin(x * 18.0); } }
struct Shape18 : IShape { float eval(float x) { return x * 19.0 + 18.0 + sin(x * 19.0); } }
struct Shape19 : IShape { float eval(float x) { return x * 20.0 + 19.0 + sin(x * 20.0); } }
struct Shape20 : IShape { float eval(float x) { return x * 21.0 + 20.0 + sin(x * 21.0); } }
struct Shape21 : IShape { float eval(float x) { return x * 22.0 + 21.0 + sin(x * 22.0); } }
struct Shape22 : IShape { float eval(float x) { return x * 23.0 + 22.0 + sin(x * 23.0); } }
struct Shape23 : IShape { float eval(float x) { return x * 24.0 + 23.0 + sin(x * 24.0); } }
struct Shape24 : IShape { float eval(float x) { return x * 25.0 + 24.0 + sin(x * 25.0); } }
struct Shape25 : IShape { float eval(float x) { return x * 26.0 + 25.0 + sin(x * 26.0); } }
struct Shape26 : IShape { float eval(float x) { return x * 27.0 + 26.0 + sin(x * 27.0); } }
struct Shape27 : IShape { float eval(float x) { return x * 28.0 + 27.0 + sin(x * 28.0); } }
struct Shape28 : IShape { float eval(float x) { return x * 29.0 + 28.0 + sin(x * 29.0); } }
struct Shape29 : IShape { float eval(float x) { return x * 30.0 + 29.0 + sin(x * 30.0); } }
struct Shape30 : IShape { float eval(float x) { return x * 31.0 + 30.0 + sin(x * 31.0); } }
struct Shape31 : IShape { float eval(float x) { return x * 32.0 + 31.0 + sin(x * 32.0); } }
struct Shape32 : IShape { float eval(float x) { return x * 33.0 + 32.0 + sin(x * 33.0); } }
struct Shape33 : IShape { float eval(float x) { return x * 34.0 + 33.0 + sin(x * 34.0); } }
struct Shape34 : IShape { float eval(float x) { return x * 35.0 + 34.0 + sin(x * 35.0); } }
struct Shape35 : IShape { float eval(float x) { return x * 36.0 + 35.0 + sin(x * 36.0); } }
struct Shape36 : IShape { float eval(float x) { return x * 37.0 + 36.0 + sin(x * 37.0); } }
struct Shape37 : IShape { float eval(float x) { return x * 38.0 + 37.0 + sin(x * 38.0); } }
struct Shape38 : IShape { float eval(float x) { return x * 39.0 + 38.0 + sin(x * 39.0); } }
struct Shape39 : IShape { float eval(float x) { return x * 40.0 + 39.0 + sin(x * 40.0); } }
struct Shape40 : IShape { float eval(float x) { return x * 41.0 + 40.0 + sin(x * 41.0); } }
struct Shape41 : IShape { float eval(float x) { return x * 42.0 + 41.0 + sin(x * 42.0); } }
struct Shape42 : IShape { float eval(float x) { return x * 43.0 + 42.0 + sin(x * 43.0); } }
struct Shape43 : IShape { float eval(float x) { return x * 44.0 + 43.0 + sin(x * 44.0); } }
struct Shape44 : IShape { float eval(float x) { return x * 45.0 + 44.0 + sin(x * 45.0); } }
struct Shape45 : IShape { float eval(float x) { return x * 46.0 + 45.0 + sin(x * 46.0); } }
struct Shape46 : IShape { float eval(float x) { return x * 47.0 + 46.0 + sin(x * 47.0); } }
struct Shape47 : IShape { float eval(float x) { return x * 48.0 + 47.0 + sin(x * 48.0); } }
struct Shape48 : IShape { float eval(float x) { return x * 49.0 + 48.0 + sin(x * 49.0); } }
struct Shape49 : IShape { float eval(float x) { return x * 50.0 + 49.0 + sin(x * 50.0); } }
struct Shape50 : IShape { float eval(float x) { return x * 51.0 + 50.0 + sin(x * 51.0); } }
struct Shape51 : IShape { float eval(float x) { return x * 52.0 + 51.0 + sin(x * 52.0); } }
struct Shape52 : IShape { float eval(float x) { return x * 53.0 + 52.0 + sin(x * 53.0); } }
struct Shape53 : IShape { float eval(float x) { return x * 54.0 + 53.0 + sin(x * 54.0); } }
struct Shape54 : IShape { float eval(float x) { return x * 55.0 + 54.0 + sin(x * 55.0); } }
struct Shape55 : IShape { float eval(float x) { return x * 56.0 + 55.0 + sin(x * 56.0); } }
struct Shape56 : IShape { float eval(float x) { return x * 57.0 + 56.0 + sin(x * 57.0); } }
struct Shape57 : IShape { float eval(float x) { return x * 58.0 + 57.0 + sin(x * 58.0); } }
struct Shape58 : IShape { float eval(float x) { return x * 59.0 + 58.0 + sin(x * 59.0); } }
struct Shape59 : IShape { float eval(float x) { return x * 60.0 + 59.0 + sin(x * 60.0); } }
struct Shape60 : IShape { float eval(float x) { return x * 61.0 + 60.0 + sin(x * 61.0); } }
struct Shape61 : IShape { float eval(float x) { return x * 62.0 + 61.0 + sin(x * 62.0); } }
struct Shape62 : IShape { float eval(float x) { return x * 63.0 + 62.0 + sin(x * 63.0); } }
struct Shape63 : IShape { float eval(float x) { return x * 64.0 + 63.0 + sin(x * 64.0); } }
struct Shape64 : IShape { float eval(float x) { return x * 65.0 + 64.0 + sin(x * 65.0); } }
struct Shape65 : IShape { float eval(float x) { return x * 66.0 + 65.0 + sin(x * 66.0); } }
struct Shape66 : IShape { float eval(float x) { return x * 67.0 + 66.0 + sin(x * 67.0); } }
struct Shape67 : IShape { float eval(float x) { return x * 68.0 + 67.0 + sin(x * 68.0); } }
struct Shape68 : IShape { float eval(float x) { return x * 69.0 + 68.0 + sin(x * 69.0); } }
struct Shape69 : IShape { float eval(float x) { return x * 70.0 + 69.0 + sin(x * 70.0); } }
struct Shape70 : IShape { float eval(float x) { return x * 71.0 + 70.0 + sin(x * 71.0); } }
struct Shape71 : IShape { float eval(float x) { return x * 72.0 + 71.0 + sin(x * 72.0); } }
struct Shape72 : IShape { float eval(float x) { return x * 73.0 + 72.0 + sin(x * 73.0); } }
struct Shape73 : IShape { float eval(float x) { return x * 74.0 + 73.0 + sin(x * 74.0); } }
struct Shape74 : IShape { float eval(float x) { return x * 75.0 + 74.0 + sin(x * 75.0); } }
struct Shape75 : IShape { float eval(float x) { return x * 76.0 + 75.0 + sin(x * 76.0); } }
struct Shape76 : IShape { float eval(float x) { return x * 77.0 + 76.0 + sin(x * 77.0); } }
struct Shape77 : IShape { float eval(float x) { return x * 78.0 + 77.0 + sin(x * 78.0); } }
struct Shape78 : IShape { float eval(float x) { return x * 79.0 + 78.0 + sin(x * 79.0); } }
struct Shape79 : IShape { float eval(float x) { return x * 80.0 + 79.0 + sin(x * 80.0); } }
struct Shape80 : IShape { float eval(float x) { return x * 81.0 + 80.0 + sin(x * 81.0); } }
struct Shape81 : IShape { float eval(float x) { return x * 82.0 + 81.0 + sin(x * 82.0); } }
struct Shape82 : IShape { float eval(float x) { return x * 83.0 + 82.0 + sin(x * 83.0); } }
struct Shape83 : IShape { float eval(float x) { return x * 84.0 + 83.0 + sin(x * 84.0); } }
struct Shape84 : IShape { float eval(float x) { return x * 85.0 + 84.0 + sin(x * 85.0); } }
struct Shape85 : IShape { float eval(float x) { return x * 86.0 + 85.0 + sin(x * 86.0); } }
struct Shape86 : IShape { float eval(float x) { return x * 87.0 + 86.0 + sin(x * 87.0); } }
struct Shape87 : IShape { float eval(float x) { return x * 88.0 + 87.0 + sin(x * 88.0); } }
struct Shape88 : IShape { float eval(float x) { return x * 89.0 + 88.0 + sin(x * 89.0); } }
struct Shape89 : IShape { float eval(float x) { return x * 90.0 + 89.0 + sin(x * 90.0); } }
struct Shape90 : IShape { float eval(float x) { return x * 91.0 + 90.0 + sin(x * 91.0); } }
struct Shape91 : IShape { float eval(float x) { return x * 92.0 + 91.0 + sin(x * 92.0); } }
struct Shape92 : IShape { float eval(float x) { return x * 93.0 + 92.0 + sin(x * 93.0); } }
struct Shape93 : IShape { float eval(float x) { return x * 94.0 + 93.0 + sin(x * 94.0); } }
struct Shape94 : IShape { float eval(float x) { return x * 95.0 + 94.0 + sin(x * 95.0); } }
struct Shape95 : IShape { float eval(float x) { return x * 96.0 + 95.0 + sin(x * 96.0); } }
struct Shape96 : IShape { float eval(float x) { return x * 97.0 + 96.0 + sin(x * 97.0); } }
struct Shape97 : IShape { float eval(float x) { return x * 98.0 + 97.0 + sin(x * 98.0); } }
struct Shape98 : IShape { float eval(float x) { return x * 99.0 + 98.0 + sin(x * 99.0); } }
struct Shape99 : IShape { float eval(float x) { return x * 100.0 + 99.0 + sin(x * 100.0); } }
struct Shape100 : IShape { float eval(float x) { return x * 101.0 + 100.0 + sin(x * 101.0); } }
struct Shape101 : IShape { float eval(float x) { return x * 102.0 + 101.0 + sin(x * 102.0); } }
struct Shape102 : IShape { float eval(float x) { return x * 103.0 + 102.0 + sin(x * 103.0); } }
struct Shape103 : IShape { float eval(float x) { return x * 104.0 + 103.0 + sin(x * 104.0); } }
struct Shape104 : IShape { float eval(float x) { return x * 105.0 + 104.0 + sin(x * 105.0); } }
struct Shape105 : IShape { float eval(float x) { return x * 106.0 + 105.0 + sin(x * 106.0); } }
struct Shape106 : IShape { float eval(float x) { return x * 107.0 + 106.0 + sin(x * 107.0); } }
struct Shape107 : IShape { float eval(float x) { return x * 108.0 + 107.0 + sin(x * 108.0); } }
struct Shape108 : IShape { float eval(float x) { return x * 109.0 + 108.0 + sin(x * 109.0); } }
struct Shape109 : IShape { float eval(float x) { return x * 110.0 + 109.0 + sin(x * 110.0); } }
struct Shape110 : IShape { float eval(float x) { return x * 111.0 + 110.0 + sin(x * 111.0); } }
struct Shape111 : IShape { float eval(float x) { return x * 112.0 + 111.0 + sin(x * 112.0); } }
struct Shape112 : IShape { float eval(float x) { return x * 113.0 + 112.0 + sin(x * 113.0); } }
struct Shape113 : IShape { float eval(float x) { return x * 114.0 + 113.0 + sin(x * 114.0); } }
struct Shape114 : IShape { float eval(float x) { return x * 115.0 + 114.0 + sin(x * 115.0); } }
struct Shape115 : IShape { float eval(float x) { return x * 116.0 + 115.0 + sin(x * 116.0); } }
struct Shape116 : IShape { float eval(float x) { return x * 117.0 + 116.0 + sin(x * 117.0); } }
struct Shape117 : IShape { float eval(float x) { return x * 118.0 + 117.0 + sin(x * 118.0); } }
struct Shape118 : IShape { float eval(float x) { return x * 119.0 + 118.0 + sin(x * 119.0); } }
struct Shape119 : IShape { float eval(float x) { return x * 120.0 + 119.0 + sin(x * 120.0); } }
struct Shape120 : IShape { float eval(float x) { return x * 121.0 + 120.0 + sin(x * 121.0); } }
struct Shape121 : IShape { float eval(float x) { return x * 122.0 + 121.0 + sin(x * 122.0); } }
struct Shape122 : IShape { float eval(float x) { return x * 123.0 + 122.0 + sin(x * 123.0); } }
struct Shape123 : IShape { float eval(float x) { return x * 124.0 + 123.0 + sin(x * 124.0); } }
struct Shape124 : IShape { float eval(float x) { return x * 125.0 + 124.0 + sin(x * 125.0); } }
struct Shape125 : IShape { float eval(float x) { return x * 126.0 + 125.0 + sin(x * 126.0); } }
struct Shape126 : IShape { float eval(float x) { return x * 127.0 + 126.0 + sin(x * 127.0); } }
struct Shape127 : IShape { float eval(float x) { return x * 128.0 + 127.0 + sin(x * 128.0); } }
struct Shape128 : IShape { float eval(float x) { return x * 129.0 + 128.0 + sin(x * 129.0); } }
struct Shape129 : IShape { float eval(float x) { return x * 130.0 + 129.0 + sin(x * 130.0); } }
struct Shape130 : IShape { float eval(float x) { return x * 131.0 + 130.0 + sin(x * 131.0); } }
struct Shape131 : IShape { float eval(float x) { return x * 132.0 + 131.0 + sin(x * 132.0); } }
struct Shape132 : IShape { float eval(float x) { return x * 133.0 + 132.0 + sin(x * 133.0); } }
struct Shape133 : IShape { float eval(float x) { return x * 134.0 + 133.0 + sin(x * 134.0); } }
struct Shape134 : IShape { float eval(float x) { return x * 135.0 + 134.0 + sin(x * 135.0); } }
struct Shape135 : IShape { float eval(float x) { return x * 136.0 + 135.0 + sin(x * 136.0); } }
struct Shape136 : IShape { float eval(float x) { return x * 137.0 + 136.0 + sin(x * 137.0); } }
struct Shape137 : IShape { float eval(float x) { return x * 138.0 + 137.0 + sin(x * 138.0); } }
struct Shape138 : IShape { float eval(float x) { return x * 139.0 + 138.0 + sin(x * 139.0); } }
struct Shape139 : IShape { float eval(float x) { return x * 140.0 + 139.0 + sin(x * 140.0); } }
struct Shape140 : IShape { float eval(float x) { return x * 141.0 + 140.0 + sin(x * 141.0); } }
struct Shape141 : IShape { float eval(float x) { return x * 142.0 + 141.0 + sin(x * 142.0); } }
struct Shape142 : IShape { float eval(float x) { return x * 143.0 + 142.0 + sin(x * 143.0); } }
struct Shape143 : IShape { float eval(float x) { return x * 144.0 + 143.0 + sin(x * 144.0); } }
struct Shape144 : IShape { float eval(float x) { return x * 145.0 + 144.0 + sin(x * 145.0); } }
struct Shape145 : IShape { float eval(float x) { return x * 146.0 + 145.0 + sin(x * 146.0); } }
struct Shape146 : IShape { float eval(float x) { return x * 147.0 + 146.0 + sin(x * 147.0); } }
struct Shape147 : IShape { float eval(float x) { return x * 148.0 + 147.0 + sin(x * 148.0); } }
struct Shape148 : IShape { float eval(float x) { return x * 149.0 + 148.0 + sin(x * 149.0); } }
struct Shape149 : IShape { float eval(float x) { return x * 150.0 + 149.0 + sin(x * 150.0); } }
struct Shape150 : IShape { float eval(float x) { return x * 151.0 + 150.0 + sin(x * 151.0); } }
struct Shape151 : IShape { float eval(float x) { return x * 152.0 + 151.0 + sin(x * 152.0); } }
struct Shape152 : IShape { float eval(float x) { return x * 153.0 + 152.0 + sin(x * 153.0); } }
struct Shape153 : IShape { float eval(float x) { return x * 154.0 + 153.0 + sin(x * 154.0); } }
struct Shape154 : IShape { float eval(float x) { return x * 155.0 + 154.0 + sin(x * 155.0); } }
struct Shape155 : IShape { float eval(float x) { return x * 156.0 + 155.0 + sin(x * 156.0); } }
struct Shape156 : IShape { float eval(float x) { return x * 157.0 + 156.0 + sin(x * 157.0); } }
struct Shape157 : IShape { float eval(float x) { return x * 158.0 + 157.0 + sin(x * 158.0); } }
struct Shape158 : IShape { float eval(float x) { return x * 159.0 + 158.0 + sin(x * 159.0); } }
struct Shape159 : IShape { float eval(float x) { return x * 160.0 + 159.0 + sin(x * 160.0); } }
struct Shape160 : IShape { float eval(float x) { return x * 161.0 + 160.0 + sin(x * 161.0); } }
struct Shape161 : IShape { float eval(float x) { return x * 162.0 + 161.0 + sin(x * 162.0); } }
struct Shape162 : IShape { float eval(float x) { return x * 163.0 + 162.0 + sin(x * 163.0); } }
struct Shape163 : IShape { float eval(float x) { return x * 164.0 + 163.0 + sin(x * 164.0); } }
struct Shape164 : IShape { float eval(float x) { return x * 165.0 + 164.0 + sin(x * 165.0); } }
struct Shape165 : IShape { float eval(float x) { return x * 166.0 + 165.0 + sin(x * 166.0); } }
struct Shape166 : IShape { float eval(float x) { return x * 167.0 + 166.0 + sin(x * 167.0); } }
struct Shape167 : IShape { float eval(float x) { return x * 168.0 + 167.0 + sin(x * 168.0); } }
struct Shape168 : IShape { float eval(float x) { return x * 169.0 + 168.0 + sin(x * 169.0); } }
struct Shape169 : IShape { float eval(float x) { return x * 170.0 + 169.0 + sin(x * 170.0); } }
struct Shape170 : IShape { float eval(float x) { return x * 171.0 + 170.0 + sin(x * 171.0); } }
struct Shape171 : IShape { float eval(float x) { return x * 172.0 + 171.0 + sin(x * 172.0); } }
struct Shape172 : IShape { float eval(float x) { return x * 173.0 + 172.0 + sin(x * 173.0); } }
struct Shape173 : IShape { float eval(float x) { return x * 174.0 + 173.0 + sin(x * 174.0); } }
struct Shape174 : IShape { float eval(float x) { return x * 175.0 + 174.0 + sin(x * 175.0); } }
struct Shape175 : IShape { float eval(float x) { return x * 176.0 + 175.0 + sin(x * 176.0); } }
struct Shape176 : IShape { float eval(float x) { return x * 177.0 + 176.0 + sin(x * 177.0); } }
struct Shape177 : IShape { float eval(float x) { return x * 178.0 + 177.0 + sin(x * 178.0); } }
struct Shape178 : IShape { float eval(float x) { return x * 179.0 + 178.0 + sin(x * 179.0); } }
struct Shape179 : IShape { float eval(float x) { return x * 180.0 + 179.0 + sin(x * 180.0); } }
struct Shape180 : IShape { float eval(float x) { return x * 181.0 + 180.0 + sin(x * 181.0); } }
struct Shape181 : IShape { float eval(float x) { return x * 182.0 + 181.0 + sin(x * 182.0); } }
struct Shape182 : IShape { float eval(float x) { return x * 183.0 + 182.0 + sin(x * 183.0); } }
struct Shape183 : IShape { float eval(float x) { return x * 184.0 + 183.0 + sin(x * 184.0); } }
struct Shape184 : IShape { float eval(float x) { return x * 185.0 + 184.0 + sin(x * 185.0); } }
struct Shape185 : IShape { float eval(float x) { return x * 186.0 + 185.0 + sin(x * 186.0); } }
struct Shape186 : IShape { float eval(float x) { return x * 187.0 + 186.0 + sin(x * 187.0); } }
struct Shape187 : IShape { float eval(float x) { return x * 188.0 + 187.0 + sin(x * 188.0); } }
struct Shape188 : IShape { float eval(float x) { return x * 189.0 + 188.0 + sin(x * 189.0); } }
struct Shape189 : IShape { float eval(float x) { return x * 190.0 + 189.0 + sin(x * 190.0); } }
struct Shape190 : IShape { float eval(float x) { return x * 191.0 + 190.0 + sin(x * 191.0); } }
struct Shape191 : IShape { float eval(float x) { return x * 192.0 + 191.0 + sin(x * 192.0); } }
struct Shape192 : IShape { float eval(float x) { return x * 193.0 + 192.0 + sin(x * 193.0); } }
struct Shape193 : IShape { float eval(float x) { return x * 194.0 + 193.0 + sin(x * 194.0); } }
struct Shape194 : IShape { float eval(float x) { return x * 195.0 + 194.0 + sin(x * 195.0); } }
struct Shape195 : IShape { float eval(float x) { return x * 196.0 + 195.0 + sin(x * 196.0); } }
struct Shape196 : IShape { float eval(float x) { return x * 197.0 + 196.0 + sin(x * 197.0); } }
struct Shape197 : IShape { float eval(float x) { return x * 198.0 + 197.0 + sin(x * 198.0); } }
struct Shape198 : IShape { float eval(float x) { return x * 199.0 + 198.0 + sin(x * 199.0); } }
struct Shape199 : IShape { float eval(float x) { return x * 200.0 + 199.0 + sin(x * 200.0); } }
float dispatch(int id, float x)
{
IShape s;
switch (id)
{
case 0: s = Shape0(); break;
case 1: s = Shape1(); break;
case 2: s = Shape2(); break;
case 3: s = Shape3(); break;
case 4: s = Shape4(); break;
case 5: s = Shape5(); break;
case 6: s = Shape6(); break;
case 7: s = Shape7(); break;
case 8: s = Shape8(); break;
case 9: s = Shape9(); break;
case 10: s = Shape10(); break;
case 11: s = Shape11(); break;
case 12: s = Shape12(); break;
case 13: s = Shape13(); break;
case 14: s = Shape14(); break;
case 15: s = Shape15(); break;
case 16: s = Shape16(); break;
case 17: s = Shape17(); break;
case 18: s = Shape18(); break;
case 19: s = Shape19(); break;
case 20: s = Shape20(); break;
case 21: s = Shape21(); break;
case 22: s = Shape22(); break;
case 23: s = Shape23(); break;
case 24: s = Shape24(); break;
case 25: s = Shape25(); break;
case 26: s = Shape26(); break;
case 27: s = Shape27(); break;
case 28: s = Shape28(); break;
case 29: s = Shape29(); break;
case 30: s = Shape30(); break;
case 31: s = Shape31(); break;
case 32: s = Shape32(); break;
case 33: s = Shape33(); break;
case 34: s = Shape34(); break;
case 35: s = Shape35(); break;
case 36: s = Shape36(); break;
case 37: s = Shape37(); break;
case 38: s = Shape38(); break;
case 39: s = Shape39(); break;
case 40: s = Shape40(); break;
case 41: s = Shape41(); break;
case 42: s = Shape42(); break;
case 43: s = Shape43(); break;
case 44: s = Shape44(); break;
case 45: s = Shape45(); break;
case 46: s = Shape46(); break;
case 47: s = Shape47(); break;
case 48: s = Shape48(); break;
case 49: s = Shape49(); break;
case 50: s = Shape50(); break;
case 51: s = Shape51(); break;
case 52: s = Shape52(); break;
case 53: s = Shape53(); break;
case 54: s = Shape54(); break;
case 55: s = Shape55(); break;
case 56: s = Shape56(); break;
case 57: s = Shape57(); break;
case 58: s = Shape58(); break;
case 59: s = Shape59(); break;
case 60: s = Shape60(); break;
case 61: s = Shape61(); break;
case 62: s = Shape62(); break;
case 63: s = Shape63(); break;
case 64: s = Shape64(); break;
case 65: s = Shape65(); break;
case 66: s = Shape66(); break;
case 67: s = Shape67(); break;
case 68: s = Shape68(); break;
case 69: s = Shape69(); break;
case 70: s = Shape70(); break;
case 71: s = Shape71(); break;
case 72: s = Shape72(); break;
case 73: s = Shape73(); break;
case 74: s = Shape74(); break;
case 75: s = Shape75(); break;
case 76: s = Shape76(); break;
case 77: s = Shape77(); break;
case 78: s = Shape78(); break;
case 79: s = Shape79(); break;
case 80: s = Shape80(); break;
case 81: s = Shape81(); break;
case 82: s = Shape82(); break;
case 83: s = Shape83(); break;
case 84: s = Shape84(); break;
case 85: s = Shape85(); break;
case 86: s = Shape86(); break;
case 87: s = Shape87(); break;
case 88: s = Shape88(); break;
case 89: s = Shape89(); break;
case 90: s = Shape90(); break;
case 91: s = Shape91(); break;
case 92: s = Shape92(); break;
case 93: s = Shape93(); break;
case 94: s = Shape94(); break;
case 95: s = Shape95(); break;
case 96: s = Shape96(); break;
case 97: s = Shape97(); break;
case 98: s = Shape98(); break;
case 99: s = Shape99(); break;
case 100: s = Shape100(); break;
case 101: s = Shape101(); break;
case 102: s = Shape102(); break;
case 103: s = Shape103(); break;
case 104: s = Shape104(); break;
case 105: s = Shape105(); break;
case 106: s = Shape106(); break;
case 107: s = Shape107(); break;
case 108: s = Shape108(); break;
case 109: s = Shape109(); break;
case 110: s = Shape110(); break;
case 111: s = Shape111(); break;
case 112: s = Shape112(); break;
case 113: s = Shape113(); break;
case 114: s = Shape114(); break;
case 115: s = Shape115(); break;
case 116: s = Shape116(); break;
case 117: s = Shape117(); break;
case 118: s = Shape118(); break;
case 119: s = Shape119(); break;
case 120: s = Shape120(); break;
case 121: s = Shape121(); break;
case 122: s = Shape122(); break;
case 123: s = Shape123(); break;
case 124: s = Shape124(); break;
case 125: s = Shape125(); break;
case 126: s = Shape126(); break;
case 127: s = Shape127(); break;
case 128: s = Shape128(); break;
case 129: s = Shape129(); break;
case 130: s = Shape130(); break;
case 131: s = Shape131(); break;
case 132: s = Shape132(); break;
case 133: s = Shape133(); break;
case 134: s = Shape134(); break;
case 135: s = Shape135(); break;
case 136: s = Shape136(); break;
case 137: s = Shape137(); break;
case 138: s = Shape138(); break;
case 139: s = Shape139(); break;
case 140: s = Shape140(); break;
case 141: s = Shape141(); break;
case 142: s = Shape142(); break;
case 143: s = Shape143(); break;
case 144: s = Shape144(); break;
case 145: s = Shape145(); break;
case 146: s = Shape146(); break;
case 147: s = Shape147(); break;
case 148: s = Shape148(); break;
case 149: s = Shape149(); break;
case 150: s = Shape150(); break;
case 151: s = Shape151(); break;
case 152: s = Shape152(); break;
case 153: s = Shape153(); break;
case 154: s = Shape154(); break;
case 155: s = Shape155(); break;
case 156: s = Shape156(); break;
case 157: s = Shape157(); break;
case 158: s = Shape158(); break;
case 159: s = Shape159(); break;
case 160: s = Shape160(); break;
case 161: s = Shape161(); break;
case 162: s = Shape162(); break;
case 163: s = Shape163(); break;
case 164: s = Shape164(); break;
case 165: s = Shape165(); break;
case 166: s = Shape166(); break;
case 167: s = Shape167(); break;
case 168: s = Shape168(); break;
case 169: s = Shape169(); break;
case 170: s = Shape170(); break;
case 171: s = Shape171(); break;
case 172: s = Shape172(); break;
case 173: s = Shape173(); break;
case 174: s = Shape174(); break;
case 175: s = Shape175(); break;
case 176: s = Shape176(); break;
case 177: s = Shape177(); break;
case 178: s = Shape178(); break;
case 179: s = Shape179(); break;
case 180: s = Shape180(); break;
case 181: s = Shape181(); break;
case 182: s = Shape182(); break;
case 183: s = Shape183(); break;
case 184: s = Shape184(); break;
case 185: s = Shape185(); break;
case 186: s = Shape186(); break;
case 187: s = Shape187(); break;
case 188: s = Shape188(); break;
case 189: s = Shape189(); break;
case 190: s = Shape190(); break;
case 191: s = Shape191(); break;
case 192: s = Shape192(); break;
case 193: s = Shape193(); break;
case 194: s = Shape194(); break;
case 195: s = Shape195(); break;
case 196: s = Shape196(); break;
case 197: s = Shape197(); break;
case 198: s = Shape198(); break;
case 199: s = Shape199(); break;
default: s = Shape0(); break;
}
return s.eval(x);
}
float run(IShape s, float x) { return s.eval(x); }
[shader("compute")]
[numthreads(1,1,1)]
void computeMain(uint3 tid : SV_DispatchThreadID)
{
float acc = 0.0;
int base = int(tid.x);
for (int i = 0; i < 200; ++i)
acc += dispatch((base + i) % 200, outBuf[0] + float(i));
outBuf[0] = acc;
}