liquidev / rkgk

(repository moved) Multiplayer canvas tool with programmable brushes!
1 stars 1 forks source link

Parser seems to produce unbalanced events for brushes that are too long #80

Closed liquidev closed 2 months ago

liquidev commented 2 months ago

A friend stress tested haku with this brush:

s = \c, o, y -> stroke 1 c (vec o y)
 [s #ffffff 0 1
s #ffffff 1 1
s #ffffff 2 1
s #ffffff 3 1
s #ffffff 4 1
s #ffffff 5 1
s #ffffff 6 1
s #ffffff 7 1
s #ffffff 8 1
s #ffffff 9 1
s #ffffff 10 1
s #ffffff 11 1
s #ffffff 12 1
s #ffffff 13 1
s #ffffff 14 1
s #ffffff 15 1
s #ffffff 16 1
s #ffffff 17 1
s #ffffff 18 1
s #ffffff 19 1
s #ffffff 20 1
s #ffffff 21 1
s #ffffff 22 1
s #ffffff 23 1
s #ffffff 24 1
s #ffffff 25 1
s #ffffff 26 1
s #ffffff 27 1
s #ffffff 28 1
s #ffffff 29 1
s #ffffff 30 1
s #ffffff 31 1
s #ffffff 32 1
s #ffffff 33 1
s #ffffff 34 1
s #ffffff 35 1
s #ffffff 36 1
s #ffffff 37 1
s #ffffff 38 1
s #ffffff 39 1
s #ffffff 40 1
s #ffffff 41 1
s #ffffff 42 1
s #ffffff 43 1
s #ffffff 44 1
s #ffffff 45 1
s #ffffff 46 1
s #ffffff 47 1
s #ffffff 48 1
s #ffffff 49 1
s #ffffff 50 1
s #ffffff 51 1
s #ffffff 52 1
s #ffffff 53 1
s #ffffff 54 1
s #ffffff 55 1
s #ffffff 56 1
s #ffffff 57 1
s #ffffff 58 1
s #ffffff 59 1
s #ffffff 60 1
s #ffffff 61 1
s #ffffff 62 1
s #ffffff 63 1
s #ffffff 64 1
s #ffffff 65 1
s #ffffff 66 1
s #ffffff 67 1
s #ffffff 68 1
s #ffffff 69 1
s #ffffff 70 1
s #ffffff 71 1
s #ffffff 72 1
s #ffffff 73 1
s #ffffff 74 1
s #ffffff 75 1
s #ffffff 76 1
s #ffffff 77 1
s #ffffff 78 1
s #ffffff 79 1
s #fefefe 80 1
s #fefefe 81 1
s #fefefe 82 1
s #fefefe 83 1
s #fefefe 84 1
s #fefefe 85 1
s #fefefe 86 1
s #fefefe 87 1
s #fefefe 88 1
s #fefefe 89 1
s #fefefe 90 1
s #fefefe 91 1
s #fefefe 92 1
s #fefefe 93 1
s #fefefe 94 1
s #fefefe 95 1
s #fdfffe 96 1
s #fdfffe 97 1
s #fcfefd 98 1
s #fcfefd 99 1
s #fbfdfc 100 1
s #fafcfb 101 1
s #fafcfb 102 1
s #fafcfb 103 1
s #fafcfb 104 1
s #fafcfb 105 1
s #f9fbfa 106 1
s #f8faf9 107 1
s #f8faf9 108 1
s #f7f9f8 109 1
s #f7f9f8 110 1
s #f6f8f7 111 1
s #f4f8f9 112 1
s #f3f7fa 113 1
s #f3f7fa 114 1
s #f2f6f9 115 1
s #f1f5f8 116 1
s #f0f4f7 117 1
s #eff3f6 118 1
s #eff3f6 119 1
s #eff3f6 120 1
s #eef2f5 121 1
s #eef2f5 122 1
s #edf1f4 123 1
s #ecf0f3 124 1
s #ebeff2 125 1
s #eaeef1 126 1
s #eaeef1 127 1
s #e9eef1 128 1
s #e6eef0 129 1
s #e6eef0 130 1
s #e5edef 131 1
s #e4ecee 132 1
s #e3ebed 133 1
s #e2eaec 134 1
s #e2eaec 135 1
s #e2eaec 136 1
s #e2eaec 137 1
s #e2eaec 138 1
s #e2eaec 139 1
s #e2eaec 140 1
s #e2eaec 141 1
s #e1e9eb 142 1
s #e1e9eb 143 1
s #e1e9ec 144 1
s #dfe9eb 145 1
s #dfe9eb 146 1
s #dfe9eb 147 1
s #dfe9eb 148 1
s #dfe9eb 149 1
s #dfe9eb 150 1
s #dee8ea 151 1
s #dee8ea 152 1
s #dde7e9 153 1
s #dde7e9 154 1
s #dce6e8 155 1
s #dbe5e7 156 1
s #dae4e6 157 1
s #d9e3e5 158 1
s #d9e3e5 159 1
s #d7e1e3 160 1
s #d6e0e2 161 1
s #d8e1e8 162 1
s #c2cbd4 163 1
s #898f9b 164 1
s #727888 165 1
s #888da0 166 1
s #898ea2 167 1
]s #ffffff 0 2
s #ffffff 1 2
s #ffffff 2 2
s #ffffff 3 2
s #ffffff 4 2
s #ffffff 5 2
s #ffffff 6 2
s #ffffff 7 2
s #ffffff 8 2
s #ffffff 9 2
s #ffffff 10 2
s #ffffff 11 2
s #ffffff 12 2
s #ffffff 13 2
s #ffffff 14 2
s #ffffff 15 2
s #ffffff 16 2
s #ffffff 17 2
s #ffffff 18 2
s #ffffff 19 2
s #ffffff 20 2
s #ffffff 21 2
s #ffffff 22 2
s #ffffff 23 2
s #ffffff 24 2
s #ffffff 25 2
s #ffffff 26 2
s #ffffff 27 2
s #ffffff 28 2
s #ffffff 29 2
s #ffffff 30 2
s #ffffff 31 2
s #ffffff 32 2
s #ffffff 33 2
s #ffffff 34 2
s #ffffff 35 2
s #ffffff 36 2
s #ffffff 37 2
s #ffffff 38 2
s #ffffff 39 2
s #ffffff 40 2
s #ffffff 41 2
s #ffffff 42 2
s #ffffff 43 2
s #ffffff 44 2
s #ffffff 45 2
s #ffffff 46 2
s #ffffff 47 2
s #ffffff 48 2
s #ffffff 49 2
s #ffffff 50 2
s #ffffff 51 2
s #ffffff 52 2
s #ffffff 53 2
s #ffffff 54 2
s #ffffff 55 2
s #ffffff 56 2
s #ffffff 57 2
s #ffffff 58 2
s #ffffff 59 2
s #ffffff 60 2
s #ffffff 61 2
s #ffffff 62 2
s #ffffff 63 2
s #ffffff 64 2
s #ffffff 65 2
s #ffffff 66 2
s #ffffff 67 2
s #ffffff 68 2
s #ffffff 69 2
s #ffffff 70 2
s #ffffff 71 2
s #ffffff 72 2
s #ffffff 73 2
s #ffffff 74 2
s #ffffff 75 2
s #ffffff 76 2
s #ffffff 77 2
s #ffffff 78 2
s #ffffff 79 2
s #fefefe 80 2
s #fefefe 81 2
s #fefefe 82 2
s #fefefe 83 2
s #fefefe 84 2
s #fefefe 85 2
s #fefefe 86 2
s #fefefe 87 2
s #fefefe 88 2
s #fefefe 89 2
s #fefefe 90 2
s #fefefe 91 2
s #fefefe 92 2
s #fefefe 93 2
s #fefefe 94 2
s #fefefe 95 2
s #feffff 96 2
s #fdfffe 97 2
s #fdfffe 98 2
s #fdfffe 99 2
s #fdfffe 100 2
s #fcfefd 101 2
]

I think what happened is that this brush is too long, and the parser runs out of space, but that's not communicated anyhow. Events just pile on until they can't anymore.